2008-10-05 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-10-05  Marek Safar  <marek.safar@gmail.com>
2
3         * cs-parser.jay: Allow parsing weird array creation construct.
4
5 2008-10-05  Marek Safar  <marek.safar@gmail.com>
6
7         * cs-parser.jay: Conflicts reduction.
8
9 2008-10-04  Marek Safar  <marek.safar@gmail.com>
10
11         * cs-parser.jay: Conflicts reduction.
12
13 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
14
15         Fix #398325
16         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
17         property.  Add a 'count' hint about the use of the shared vector.
18         Ensure that we don't leak out dirty bits.
19         (UsageVector.MergeChild): Throw away information about variables
20         in child vectors.
21         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
22
23 2008-10-03  Marek Safar  <marek.safar@gmail.com>
24
25         A fix for bug #431746
26         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
27         parameters when iterator is created.
28
29 2008-10-03  Marek Safar  <marek.safar@gmail.com>
30
31         A fix for bug #431827
32         * expression.cs: Fixed right based pointer arithmetic operations
33         emit.
34
35 2008-10-03  Marek Safar  <marek.safar@gmail.com>
36
37         A fix for bug #353779
38         * assign.cs, expression.cs: Fixed compound assignment conversions.
39
40 2008-10-02  Marek Safar  <marek.safar@gmail.com>
41
42         A fix for bug #375262
43         * statement.cs: Refactor ArrayForeach to be usable with string
44         indexer. Optimized single dimentional arrays foreach.
45
46 2008-10-02  Marek Safar  <marek.safar@gmail.com>
47
48         A fix for bug #431255
49         * anonymous.cs, expression.cs: Removed broken optimization.
50
51 2008-10-01  Marek Safar  <marek.safar@gmail.com>
52
53         * anonymous.cs: Use full type parameters of parent generic
54         containers. Removed unnecessary AddParentStoreyReference call.
55
56 2008-10-01  Marek Safar  <marek.safar@gmail.com>
57
58         A fix for bug #324702
59         * class.cs: Use better shorter names for explicit interface member
60         implementations.
61
62         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
63
64 2008-10-01  Marek Safar  <marek.safar@gmail.com>
65         
66         * expression.cs: Use new interface to check fixed expression.
67
68 2008-10-01  Marek Safar  <marek.safar@gmail.com>
69
70         A fix for bug #421101
71         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
72         interface to check for fixed fixed-buffers.
73
74 2008-10-01  Marek Safar  <marek.safar@gmail.com>
75
76         A fix for bug #429264
77         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
78         
79         * delegate.cs: Removed unnecessary casts.
80
81 2008-09-30  Marek Safar  <marek.safar@gmail.com>
82
83         A fix for bug #352151
84         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
85         class.cs: Fixed already defined explicit interface members check.
86
87 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
88
89         cs-tokenizer.cs: Fix typo.
90
91 2008-09-28  Miguel de Icaza  <miguel@novell.com>
92
93         * eval.cs (InteractiveBase): The quit command now just sets a
94         flag, instead of calling Environment.Exit(), it is milder on
95         embedded hosts. 
96
97         CompiledMethod is now in Mono.CSharp, not nested inside
98         the Evaluator, it was inconvenient to use.
99
100 2008-09-27  Miguel de Icaza  <miguel@novell.com>
101
102         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
103         code to be invoked without having to reparse.
104
105 2008-09-27  Miguel de Icaza  <miguel@novell.com>
106
107         * ecore.cs: The recent changes to FieldExpr broke this as well.
108         Fixes LINQ queries in the interactive shell.
109
110         * Multiple files: indentation fixing for the Mono coding
111         guidelines for the switch statement.
112
113         * eval.cs: Make the Evaluator API thread safe.
114
115 2008-09-26  Marek Safar  <marek.safar@gmail.com>
116
117         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
118         constructor parsing.
119
120 2008-09-26  Marek Safar  <marek.safar@gmail.com>
121
122         A fix for bug #325326
123         * statement.cs: Check possible mistaken empty statement using
124         explicit blocks only.
125
126 2008-09-25  Miguel de Icaza  <miguel@novell.com>
127
128         * eval.cs (LoadAssembly, ReferenceAssembly): Call
129         RootNamespace.ComputeNamespaces to update the internal list of
130         namespaces, this is no longer done for us.
131
132         (InteractiveBase): Use the Evaluator APIs instead of calling into
133         Driver directly
134
135 2008-09-25  Marek Safar  <marek.safar@gmail.com>
136
137         A fix for bug #429264
138         * expression.cs: Missing mutator for access to multidimensional
139         arrays.
140
141 2008-09-25  Marek Safar  <marek.safar@gmail.com>
142
143         * class.cs, statement: Emit DebuggerHidden attribute for iterator
144         entry wrapper.
145         
146         * driver.cs: Missing input argument check.
147
148 2008-09-25  Marek Safar  <marek.safar@gmail.com>
149
150         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
151         expression.cs, statement.cs, rootcontext.cs, class.cs, 
152         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
153         DefineMembers.
154
155 2008-09-24  Miguel de Icaza  <miguel@novell.com>
156
157         * ecore.cs (FieldExpr): Only initialize eclass when we return a
158         fully constructed FieldExpr, fixes the regression introduced in
159         the last commit.
160         
161         * ecore.cs, expression.cs: Plug back the eclass initialization as
162         otherwise it regresses `csharp'. 
163
164 2008-09-24  Marek Safar  <marek.safar@gmail.com>
165
166         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
167         ecore.cs, attribute.cs: Moved obsolete method checks from emit
168         phase to resolve phase. It resolves problems with expression trees
169         and fixes bugs #323796, #325156.
170
171 2008-09-23  Marek Safar  <marek.safar@gmail.com>
172
173         * codegen.cs: Report better error when symbol writer is missing.
174
175 2008-09-23  Marek Safar  <marek.safar@gmail.com>
176
177         * codegen.cs: Set .NET symbol writer.
178         
179         * decl.cs: Guard against null generic arguments.
180         
181         * report.cs: Don't report exactly same additional details.
182
183 2008-09-22  Marek Safar  <marek.safar@gmail.com>
184
185         A fix for bug #324917
186         * cs-parser.jay: Add missing multidimensional non-expression type
187         ranks.
188         
189 2008-09-22  Marek Safar  <marek.safar@gmail.com>
190
191         A fix for bug #428191
192         * anonymous.cs: Create an outer generic fields also for non-storey
193         anonymous methods.
194
195 2008-09-22  Marek Safar  <marek.safar@gmail.com>
196
197         A fix for bug #378294
198         * class.cs: Make fixed size buffers gmcs feature only.
199
200 2008-09-22  Marek Safar  <marek.safar@gmail.com>
201
202         A fix for bug #355622, #324993
203         * assign.cs, const.cs, class.cs: Create new EmitContext for each
204         field initializer.
205
206 2008-09-19  Marek Safar  <marek.safar@gmail.com>
207
208         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
209         error reporting.
210
211 2008-09-19  Marek Safar  <marek.safar@gmail.com>
212
213         A fix for bug #416110
214         * generic.cs: Struct constraint results in default ctor and
215         ValueType base type constraint to be set.
216
217 2008-09-19  Marek Safar  <marek.safar@gmail.com>
218
219         A fix for bug #423791
220         * generic.cs: Fixed params output type type-inference.
221
222 2008-09-19  Marek Safar  <marek.safar@gmail.com>
223
224         * cs-parser.jay, expression.cs: Fixed few expression crashes.
225         
226 2008-09-19  Marek Safar  <marek.safar@gmail.com>
227
228         * cs-tokenizer.cs: Don't break on extra partial modifier.
229
230 2008-09-19  Marek Safar  <marek.safar@gmail.com>
231
232         A fix for bug #427592
233         * generic.cs: Use common parameter resolve method.
234
235 2008-09-18  Marek Safar  <marek.safar@gmail.com>
236
237         A fix for bug #414758
238         * expression.cs, ecore.cs: Fixed crash when accessing non-static
239         property.
240
241 2008-09-18  Marek Safar  <marek.safar@gmail.com>
242
243         * driver.cs, namespace.cs: Read types and namespaces after all
244         requested assemblies are loaded, fixes issues with System.Core
245         auto-reference, and #419888.
246
247 2008-09-18  Marek Safar  <marek.safar@gmail.com>
248
249         A fix for bug #417705
250         * cs-parser.jay: Fixed as/is operator expression split.
251
252 2008-09-18  Marek Safar  <marek.safar@gmail.com>
253
254         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
255         Fixed expression tree representation of empty new expression and
256         new initializer expression.
257
258 2008-09-18  Miguel de Icaza  <miguel@novell.com>
259
260         * eval.cs: Remove warning, keep reference to driver around.
261
262         * Hide fields that do not need to be public.
263
264 2008-09-17  Marek Safar  <marek.safar@gmail.com>
265
266         A fix for bug #426385
267         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
268         conversion for array elements.
269
270 2008-09-17  Marek Safar  <marek.safar@gmail.com>
271
272         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
273         void parsing conflicts.
274
275 2008-09-15  Marek Safar  <marek.safar@gmail.com>
276
277         A fix for bug #425601
278         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
279         System.Core only when there is no custom ExtensionAttribute
280         implementation.
281
282 2008-09-15  Miguel de Icaza  <miguel@novell.com>
283
284         * namespace.cs: Do not report CS0246 (name
285
286 2008-09-12  Marek Safar  <marek.safar@gmail.com>
287
288         A fix for bug #425669
289         * generic.cs: Don't cache generic static anonymous method 
290         containers.
291
292 2008-09-12  Marek Safar  <marek.safar@gmail.com>
293
294         * generic.cs, class.cs, delegate.cs: Check recursive inherited
295         conflicting constraints.
296
297 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
298
299         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
300         mcs too.
301
302 2008-09-12  Marek Safar  <marek.safar@gmail.com>
303
304         * literal.cs, convert.cs, expression.cs, statement.cs: More null
305         to null pointer conversion fixes.
306
307 2008-09-11  Marek Safar  <marek.safar@gmail.com>
308
309         * cs-parser.jay, expression.cs: An implicitly typed local variable
310         declarator cannot use an array initializer.
311
312 2008-09-11  Marek Safar  <marek.safar@gmail.com>
313
314         * cs-parser.jay: Reduced number of printed tokens, add sorting.
315
316 2008-09-11  Marek Safar  <marek.safar@gmail.com>
317
318         * generic.cs (InflatedConstraints): Don't crash when constraints
319         are different.
320         
321         * cs-parser.jay: const_declarator is a block.
322
323         * constant.cs: Check for not allowed NaN conversions.
324
325 2008-09-10  Miguel de Icaza  <miguel@novell.com>
326
327         * driver.cs: Drop --shell argument, the compiler is no longer a
328         REPL. 
329
330         * eval.cs: Move most of the code that deals with evaluation into
331         this file and document the public API from repl.cs
332
333         * repl.cs: Remove from here.
334         
335 2008-09-10  Marek Safar  <marek.safar@gmail.com>
336
337         A fix for bug #424684
338         * generic.cs: Generic class constraints must come first.
339
340 2008-09-09  Miguel de Icaza  <miguel@novell.com>
341
342         * cs-parser.jay: Improve error reporting for syntax errors in
343         statements and expressions, we now report the expected tokens
344         instead of reporting the useless "; expected".
345
346         Drop the strings from the token declaration, it turns out that
347         they did not do what I thought they did.  Instead they were adding
348         two sets of tokens to the tables.
349
350 2008-09-09  Marek Safar  <marek.safar@gmail.com>
351
352         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
353         delegate.cs: Share special type check.
354
355 2008-09-09  Marek Safar  <marek.safar@gmail.com>
356
357         A fix for bug #423981
358         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
359
360 2008-09-09  Marek Safar  <marek.safar@gmail.com>
361
362         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
363         ConvertImplicitly.
364
365 2008-09-09  Marek Safar  <marek.safar@gmail.com>
366
367         A fix for bugs: #324750, #335946
368         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
369         lookup rule to determine ?-based tokens.
370
371 2008-09-08  Miguel de Icaza  <miguel@novell.com>
372
373         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
374         expressions (like event adding or removing) end up here, so we
375         need to treat those as statements.
376
377         Add LoadAssembly method.
378
379 2008-09-04  Miguel de Icaza  <miguel@novell.com>
380
381         * repl.cs: Add Time method.
382
383 2008-09-05  Marek Safar  <marek.safar@gmail.com>
384
385         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
386
387 2008-09-05  Miguel de Icaza  <miguel@novell.com>
388
389         * repl.cs: Add workaround for old compilers.
390
391 2008-09-04  Jb Evain  <jbevain@novell.com>
392
393         * repl.cs (PrettyPrint): pretty print everything that
394         implements IDictionary, as well as IEnumerables. Also,
395         add a quit helper property.
396
397 2008-09-04  Marek Safar  <marek.safar@gmail.com>
398
399         * constant.cs: Better error reporting for decimal literals.
400         
401         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
402         field attributes.
403         
404 2008-09-04  Marek Safar  <marek.safar@gmail.com>
405                         Miguel de Icaza  <miguel@novell.com>
406
407         A fix for bug #422951
408         * assign.cs (Assign.DoResolve): Perform the type conversions
409         checks before we attempt to initialize `New' initializers. 
410
411 2008-09-04  Marek Safar  <marek.safar@gmail.com>
412
413         A fix for bug #422853
414         * delegate.cs (DelegateCreation): Add special handling for
415         EmptyExpression.Null instance expression which is just another
416         hack for undecided member instance exression.
417
418 2008-09-04  Marek Safar  <marek.safar@gmail.com>
419
420         * expression.cs, ecore.cs: Emit full expression tree for reduced
421         binary expressions.
422
423 2008-09-04  Marek Safar  <marek.safar@gmail.com>
424
425         * expression.cs (This): Guard against multi-resolving.
426         
427         * ecore.cs, statement.cs (Throw): Simplified.
428         
429         * flowanalysis.cs: Also verify event fields.
430
431 2008-09-04  Miguel de Icaza  <miguel@novell.com>
432
433         * assign.cs (Assign.DoResolve): Perform the type conversions
434         checks before we attempt to initialize `New' initializers. 
435
436         * repl.cs (PrettyPrint): Add Hashtable prettyprint
437
438         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
439         public. 
440
441         * repl.cs: Update help.
442
443 2008-09-03  Miguel de Icaza  <miguel@novell.com>
444
445         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
446         handling of the default config handling, including the special
447         treatment of System.Core assembly. 
448
449         Fixes the REPL processing for LINQ.
450
451 2008-09-03  Marek Safar  <marek.safar@gmail.com>
452
453         A fix for bug #422507
454         * expression.cs (UnboxCast): Add missing child expression mutator.
455
456 2008-09-03  Marek Safar  <marek.safar@gmail.com>
457
458         * driver.cs: Don't self reference System.Core assembly.
459
460 2008-09-03  Marek Safar  <marek.safar@gmail.com>
461
462         A fix for bug #422507
463         * expression.cs (StringConcat): Add missing type mutator.
464
465 2008-09-03  Marek Safar  <marek.safar@gmail.com>
466
467         * generic.cs (TypeInferenceContext): Follow equality rule for
468         constructed type lower bound type inference.
469
470 2008-09-02  Miguel de Icaza  <miguel@novell.com>
471
472         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
473         <dblank@cs.brynmawr.edu> which updates the cursor position on
474         refresh.
475         
476 2008-09-02  Marek Safar  <marek.safar@gmail.com>
477
478         A fix for bug #367145
479         * driver.cs: Fixed import of extension methods when using -noconfig
480         option.
481
482 2008-09-02  Marek Safar  <marek.safar@gmail.com>
483
484         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
485         version from non-generic implementation instead.
486
487 2008-09-01  Marek Safar  <marek.safar@gmail.com>
488
489         A fix for bug #418908
490         * class.cs: Use AddScopeStatement for field initializers.
491
492 2008-09-01  Marek Safar  <marek.safar@gmail.com>
493
494         A fix for bug #415385
495         * ecore.cs, convert.cs: Do method group conversion for equal group types.
496
497 2008-09-01  Marek Safar  <marek.safar@gmail.com>
498
499         A fix for bug #421736
500         * iterators.cs: Don't crash on unreachable iterators.
501
502 2008-09-01  Marek Safar  <marek.safar@gmail.com>
503
504         A fix for bug #421628
505         * parameter.cs, attribute.cs: Clone also parameter attributes.
506
507 2008-08-30  Miguel de Icaza  <miguel@novell.com>
508
509         * namespace.cs (LookupType): In EvalMode, try to replace
510         the TypeBuilder from our cache with a Type as Reflection.Emit does
511         not  like to mix code from older assemblies emitted and new
512         assemblies emitted. 
513
514         This sounds like a serious Mono bug that prevents multiple
515         assemblies to be generated and consumed at the same time.
516
517         * cs-parser.jay (push_current_class): Do not make interactive
518         classes internal or private, make them public as we currently
519         generate each new class in a new assembly.   
520
521 2008-08-29  Miguel de Icaza  <miguel@novell.com>
522
523         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
524         remove types that are entered into the global namespace during
525         parsing so that we can remove them on failure.
526  
527         * cs-parser.jay: Parsing: we now keep track of types that are
528         entered into global variables and queue those in case the parsing
529         or resolution fail.
530  
531         This happens in a few situations: during partial-input, we invoke
532         the parser repeatedly for example with the string "class X", this
533         would cause X to be registed, and we need to remove this
534         registration so that another parse attempt later with say "class X {"
535         would actually work.
536  
537         Additionally, if there is an error in the resolution phase, for
538         example: "class X : NonExistant {}" th
539         
540         * cs-parser.jay: Be more precise with the errors being raised,
541         instead of flagging all exceptions during parsing to be attributed
542         to the parsing process, distinguish those from errors happening in
543         the actions and hint that using -v would produce the actual
544         exception. 
545
546         * repl.cs: Do not load all compiler references on each reset,
547         doing the partial reset takes care of this.
548         
549 2008-08-28  Miguel de Icaza  <miguel@novell.com>
550
551         * repl.cs: Add support for loading all the files from
552         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
553         as shell libraries.
554
555         Introduce a micro-parser that is able to deambiguate on its input
556         whether we are dealing with a compilation unit (namespace, class,
557         interface, struct, delegate) declaration or a statement.   This
558         allows both declarations and statements to be entered. 
559
560         Set history size by default to 300 lines.
561
562         Instead of distinguishing based on the parser.InteractiveResult,
563         have only two cases: statements were parsed, or a compilation unit
564         was.   Always pull the Using statement additions from the
565         compilation unit parse.
566         
567         * cs-tokenizer.cs: Rename tokens to better describe their intent
568         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
569         
570         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
571         EvalMode is used to trigger the lookup of global variables while
572         StatementMode is used turn variable declarations into static
573         fields.
574
575         * getline.cs: Allow history size to be set.
576         
577 2008-08-29  Marek Safar  <marek.safar@gmail.com>
578
579         A fix for bug #360755
580         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
581
582 2008-08-29  Marek Safar  <marek.safar@gmail.com>
583
584         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
585         
586         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
587         member name, it is too confusing
588         
589         * decl.cs, class.cs: Don't report unused fields with attached attribute.
590         
591         * rootcontext.cs: Finally default to warning level 4.
592
593 2008-08-28  Marek Safar  <marek.safar@gmail.com>
594
595         * class.cs (CheckBase): Ignore overloaded operators.
596
597 2008-08-28  Marek Safar  <marek.safar@gmail.com>
598
599         A fix for bug #420830
600         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
601
602 2008-08-28  Marek Safar  <marek.safar@gmail.com>
603
604         A fix for bug #420832
605         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
606
607 2008-08-28  Marek Safar  <marek.safar@gmail.com>
608
609         A fix for bug #420386
610         * nullables.cs: Fixed logic of nullable user comparison operators involving
611         null values.
612
613 2008-08-28  Marek Safar  <marek.safar@gmail.com>
614         
615         * attribute (IsClsCompliant): Use FALSE value for pointer types.
616
617 2008-08-27  Miguel de Icaza  <miguel@novell.com>
618
619         * repl.cs: Add support for aborting the running code with C-c. 
620
621 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
622
623         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
624
625 2008-08-27  Miguel de Icaza  <miguel@novell.com>
626
627         * cs-parser.jay (interactive_statement_list): A new set of rules
628         for hosting statements that uses the "interactive_" prefix.   
629
630         * repl.cs: Add support for parsing `using' as a statement or as a
631         directive.  Deambiguating before passing this to the parser.
632
633         We need to distinguish statement_expressions that occur at the
634         toplevel vs those that occur embedded into expressions.
635
636         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
637         that fixes the cursor key handling, and a history bug.
638         
639 2008-08-26  Miguel de Icaza  <miguel@novell.com>
640
641         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
642         limitations in Console, instead the 2.0 bootstrap libraries now
643         include the Console bits.
644
645         Also, remove the use of Nullables from getline.cs
646
647         ------------
648         
649         Interactive support for the C# compiler.   Use gmcs --shell to
650         enter a read-eval-print loop shell.
651
652         Docs: http://www.mono-project.com/CsharpRepl
653         
654         * sources: include repl.cs here and getline.cs for gmcs.exe,
655         everything else is getline.cs impaired.
656
657         * Makefile: when bootstrapping pass a special flag
658         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
659         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
660         This distinguishes those two cases.
661
662         * repl.cs: Support for a read-eval-print loop.   Will be soon
663         refactored into eval support and then REPL on top of it.
664
665         * ecore.cs: If a simplename lookup fails, before erroring out,
666         if we are in EvalMode to resolve the name to a declaration in the
667         Eval-land.    
668
669         This means that variable declarations that happened in previous
670         classes (as repl puts every statement in a separate class) are
671         made visible in this way.
672
673         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
674         triggered an error due to the end of file being reached.   This is
675         used to do multi-line input, and notify the caller that the user
676         needs to provide more text before a successful parse.
677
678         Add new grammar rules after the INTERACTIVE_PARSER token is seen
679         to drive the evaluation with a custom wrapper. 
680
681         * driver.cs: Add support for --shell, and refactor some code to be
682         reused from repl.cs
683         
684         * namespace.cs: Add support for serializing the contents of the
685         namespaces and reloading them.  
686
687         * getline.cs: A managed implementation of ReadLine under
688         X11/Apache2 license terms.  Easy to embed in other applications as
689         well.
690
691         * namespace.cs: Add some functions to save and restore the
692         namespace state.
693
694         * rootcontext.cs: New public field.
695
696         * cs-tokenizer.cs: Add support for one of the possible characters
697         we introduce into the token stream.  
698
699         This patch does not affect the regular tokenization process, the
700         only performance hit would happen if there is an invalid character
701         on the input string.
702
703         * support.cs: Move isatty helper routine here.
704
705         * codegen.cs: Small cleanup, and add a mechanism to initialize the
706         code generator for in-memory assemblies.
707
708 2008-08-26  Marek Safar  <marek.safar@gmail.com>
709
710         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
711         parameter cannot be always used as a type.
712
713 2008-08-21  Marek Safar  <marek.safar@gmail.com>
714
715         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
716
717 2008-08-21  Marek Safar  <marek.safar@gmail.com>
718
719         * convert.cs: Implement explicit array to IList<T> conversion.
720
721 2008-08-20  Marek Safar  <marek.safar@gmail.com>
722
723         A fix for bug #362740
724         * cs-tokenizer.cs: Handle UTF-16 surrogates.
725
726 2008-08-20  Marek Safar  <marek.safar@gmail.com>
727         
728         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
729         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
730         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
731         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
732         handling to use just one type of infrastructure and deal with generics
733         more effectivelly.
734
735 2008-07-23  Martin Baulig  <martin@ximian.com>
736
737         *** Merged this from trunk revision 108527 ***
738
739         * statement.cs
740         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
741         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
742         scope variable.
743
744 2008-08-15  Marek Safar  <marek.safar@gmail.com>
745         
746         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
747         error checks.
748
749 2008-08-15  Marek Safar  <marek.safar@gmail.com>
750         
751         * delegate.cs: Fixed compiler crash when creating delegate using partial
752         method.
753         
754         * typemanager.cs: MulticastDelegate is not a delegate.
755
756 2008-08-14  Marek Safar  <marek.safar@gmail.com>
757         
758         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
759         checks.
760
761 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
762
763         * cs-parser.jay (type): Allow 'var' in mcs too.
764         (local_variable_type): Likewise.
765
766 2008-08-14  Marek Safar  <marek.safar@gmail.com>
767         
768         * driver.cs: Removed broken -noconfig variants.
769
770 2008-08-14  Marek Safar  <marek.safar@gmail.com>
771         
772         A fix for bug #417078
773         * expression.cs: Emit correctly left side pointer operators.
774
775 2008-08-13  Marek Safar  <marek.safar@gmail.com>
776
777         * generic.cs, lambda.cs: Inflate method generic arguments only.
778
779 2008-08-12  Marek Safar  <marek.safar@gmail.com>
780
781         * class.cs: Fixed struct layout check regression.
782
783 2008-08-12  Marek Safar  <marek.safar@gmail.com>
784
785         * cs-parser.jay, enum.cs: Simplified enum parsing.
786         
787         * decl.cs: Check all type parameters conflicts.
788         
789         * expression.cs, statement.cs, attribute.cs: More expression checks.
790
791 2008-08-11  Marek Safar  <marek.safar@gmail.com>
792
793         * generic.cs: Add type inference types restriction.
794         
795         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
796         anonymous.cs, expression.cs: Allocate less accessor parameters.
797
798 2008-08-08  Marek Safar  <marek.safar@gmail.com>
799
800         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
801         classes.
802
803 2008-08-08  Marek Safar  <marek.safar@gmail.com>
804
805         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
806
807 2008-08-07  Marek Safar  <marek.safar@gmail.com>
808
809         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
810         Also fixes #362146 and #381592.
811
812 2008-08-07  Marek Safar  <marek.safar@gmail.com>
813
814         * ecore.cs: Reduced constant cannot be used as an attribute value.
815         
816         * cs-parser.jay: Base expression has to be a type.
817         
818         * expression.cs (Conditional): Uses ReducedExpression.
819
820 2008-08-06  Marek Safar  <marek.safar@gmail.com>
821
822         A fix for bug #376826
823         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
824         address of hoisted local variable or parameter cannot be taken.
825
826 2008-08-05  Marek Safar  <marek.safar@gmail.com>
827
828         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
829         anonymous method inside checked/unchecked expression.
830
831 2008-08-05  Marek Safar  <marek.safar@gmail.com>
832
833         * typemanager.cs (IsEqual): Guard against null.
834         
835         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
836         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
837         routine. Fixed few misleading conversion errors.
838
839 2008-08-04  Marek Safar  <marek.safar@gmail.com>
840
841         * class.cs: Consider generics when checking cycles in struct layout.
842
843 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
844
845         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
846
847 2008-08-04  Marek Safar  <marek.safar@gmail.com>
848
849         A fix for bug #414165
850         * anonymous.cs: Use same anonymous implementation method for all anonymous
851         method emits.
852
853 2008-08-04  Marek Safar  <marek.safar@gmail.com>
854
855         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
856         constraints.
857
858 2008-08-04  Marek Safar  <marek.safar@gmail.com>
859
860         * cs-parser.jay: Typeof argument has to be a type expression.
861         
862         * namespace.cs: Check alias and namespace definitions collisions.
863         
864         * class.cs, pending.cs: Moved explicit interface accessor implementation
865         check.
866         
867         * delegate.cs, expression.cs: Verify special name invocations.
868         
869 2008-08-01  Marek Safar  <marek.safar@gmail.com>
870
871         * cs-parser.jay: Don't choke on empty generic type arguments.
872         
873         * cs-tokenizer.cs: Handle escaped preprocessor directives.
874         
875         * expression.cs, ecore.cs: Minor expressions bugs.
876
877 2008-08-01  Marek Safar  <marek.safar@gmail.com>
878
879         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
880         and added more error handling.
881         
882         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
883         
884         *  modifiers.cs, enum.cs: Fixed.
885
886 2008-07-31  Jb Evain  <jbevain@novell.com>
887
888         * driver.cs: remove -pkg ability of smcs.
889
890 2008-07-30  Marek Safar  <marek.safar@gmail.com>
891
892         * statement.cs (Switch): Correctly set empty default target for single
893         blocks.
894
895 2008-07-30  Marek Safar  <marek.safar@gmail.com>
896
897         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
898         string switch statement implementation to use string dictionary which
899         significantly (2-8x) improves performance of generated code.
900
901 2008-07-29  Marek Safar  <marek.safar@gmail.com>
902
903         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
904         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
905         
906 2008-07-29  Marek Safar  <marek.safar@gmail.com>
907
908         A fix for bug #412595
909         * typemanager.cs, convert.cs, expression.cs: Some types are never
910         convertible to each other.
911
912 2008-07-29  Marek Safar  <marek.safar@gmail.com>
913
914         * nullable.cs (CreateNullConstant): An error messages update.
915
916 2008-07-29  Marek Safar  <marek.safar@gmail.com>
917
918         A fix for bug #412595
919         * cfold.cs: Don't cast undefined bool constant.
920
921 2008-07-29  Martin Baulig  <martin@ximian.com>
922
923         * symbolwriter.cs
924         (SymbolWriter.Reset): New public static method.
925
926         * driver.cs
927         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
928
929 2008-07-28  Marek Safar  <marek.safar@gmail.com>
930
931         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
932         
933         * expression.cs (ElementAccess): Exact size allocation.
934
935 2008-07-26  Marek Safar  <marek.safar@gmail.com>
936
937         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
938
939 2008-07-25  Marek Safar  <marek.safar@gmail.com>
940
941         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
942         
943         * class.cs: Removed $PRIVATE$ field hack which caused problems during
944         flow analysis.
945
946 2008-07-25  Marek Safar  <marek.safar@gmail.com>
947
948         A fix for bug #412217
949         * assign.cs: Mutate also assignment type.
950
951 2008-07-25  Marek Safar  <marek.safar@gmail.com>
952
953         A fix for bug #323644
954         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
955         indexers.
956
957 2008-07-25  Marek Safar  <marek.safar@gmail.com>
958
959         A fix for bug #412134
960         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
961         non-enumerable operands when overloading equality or bitwise operators.
962
963 2008-07-25  Marek Safar  <marek.safar@gmail.com>
964
965         * anonymous.cs: Cache closed generic anonymous method delegates.
966
967 2008-07-24  Marek Safar  <marek.safar@gmail.com>
968
969         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
970         anonymous.cs, statement.cs: Always emit anonymous method as static method
971         when is instance free. Use nesting for nested anynomous methods blocks.
972         
973 2008-07-23  Marek Safar  <marek.safar@gmail.com>
974
975         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
976         types.
977
978 2008-07-23  Marek Safar  <marek.safar@gmail.com>
979
980         * expression.cs: Removed MakeSimpleCall.
981
982 2008-07-23  Marek Safar  <marek.safar@gmail.com>
983
984         A fix for bug #323012
985         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
986         Base method implementing interface has to be public.
987
988 2008-07-23  Marek Safar  <marek.safar@gmail.com>
989
990         * cs-parser.jay: Don't break on missing argument.
991
992 2008-07-22  Marek Safar  <marek.safar@gmail.com>
993
994         A fix for bug #320993
995         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
996           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
997
998 2008-07-22  Marek Safar  <marek.safar@gmail.com>
999
1000         A fix for bug #320748
1001         * convert.cs: Implicit user operators cannot convert to interfaces
1002
1003 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1004
1005         A fix for bug #312686
1006         * driver.cs: Ignore empty assembly references.
1007
1008 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1009
1010         A fix for bug #387040
1011         * ecore.cs: Skip constrains check for an explicit implementation.
1012
1013 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1014
1015         A fix for bug #409045
1016         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1017           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1018           identifiers are file specific unless passed as input arguments.
1019
1020 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1021
1022          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1023          to emit UnmanagedMarshal data under 2.0 profile.
1024
1025 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1026
1027         A fix for bug #410369
1028         * parameter.cs: Clone correctly ParamsParameter.
1029
1030 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1031
1032         * expression.cs (Argument): Always report type for type based expressions
1033         errors.
1034
1035 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1036
1037         A fix for bug #410666
1038         * anonymous.cs: Correctly initialize generic storey reference.
1039
1040 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1041
1042         * convert.cs: Don't box same type arguments.
1043
1044 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1045
1046         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1047         Finished missing generic type mutators.
1048
1049 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1050
1051         * iterators.cs, statement.cs: Finished statements CloneTo.
1052
1053 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1054
1055         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1056         
1057         * expression.cs: Emit optimized default value expressions in expression tree
1058         array initializer.
1059
1060 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1061
1062         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1063
1064 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1065
1066         A fix for bug #367536
1067         * cs-parser.jay: Check static constructor of generic types for an access
1068         modifier.
1069
1070 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1071
1072         A fix for bug #353800
1073         * lambda.cs: Emit ret for contextual statements.
1074         
1075         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1076         up emitting redundant ret for all anonymous methods with return.
1077
1078 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1079
1080         A fix for bug #365188
1081         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1082         create anonymous method storey in unreachable block.
1083
1084 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1085
1086         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1087         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1088         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1089         statement.cs: Fixed relevant defects found by Gendarme.
1090
1091 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1092
1093         A fix for bug #325291
1094         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1095         statement.cs: Replaced IAnonymousHost with top level block flag.
1096
1097 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1098
1099         * cs-parser.jay: Clean up unused open_parens.
1100
1101 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1102
1103         * ecore.cs: Custom error message for a range variable assignment.
1104
1105 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1106
1107         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1108         load.
1109
1110 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1111
1112         * literal.cs: Null literal is of object type.
1113
1114 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1115
1116         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1117         expression of nullable equality comparison.
1118
1119 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1120
1121         * expression.cs(PointerArithmetic): Removed redundant assignment.
1122
1123 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1124
1125         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1126
1127 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1128
1129         A fix for bug #408361
1130         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1131         they are replaced by GetMethod.
1132
1133 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1134
1135         A fix for bug #408721 by jeremie.laval@gmail.com
1136         * expression.cs (Indirection): Implemented CloneTo.
1137
1138 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1139
1140         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1141         assert check.
1142
1143 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1144
1145         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1146
1147 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1148
1149         * linq.cs: Reset tranparent parameter counter in probing mode.
1150
1151 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1152
1153         * anonymous.cs: Mutate anonymous method type.
1154
1155 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1156
1157         * ecore.cs, anonymous.cs: Mutate field expressions.
1158
1159 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1160
1161         A fix for bug #369670
1162         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1163
1164 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1165
1166         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1167
1168 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1169
1170         Fix bug #314902
1171         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1172         only one '>', and finds a '>>', abort the generic lookahead.
1173
1174 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1175
1176         A fix for bug #319902
1177         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1178
1179 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1180
1181         A fix for bug #406371
1182         * statement.cs: Moved EmitSymbolInfo to Block.
1183
1184 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1185
1186         * ecore.cs: Report better error for extension method overload failures.
1187
1188 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1189
1190         * expression.cs (Is): No need to box reference values.
1191
1192 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1193
1194         * class.cs: Use event resolve context when initializing CreateEmitContext.
1195
1196 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1197
1198         A fix for bug #394436
1199         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1200         method used inside expression trees. Added more LINQ to expression tree
1201         conversions.
1202
1203 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1204
1205         A fix for bug #378189, #370577
1206         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1207         from expression.
1208
1209 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1210
1211         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1212         hierarchically.
1213
1214 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1215
1216         A fix for bug #406702
1217         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1218
1219 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1220
1221         A fix for bug #406648
1222         * cs-parser.jay: Report nullable use in mcs for some cases.
1223
1224 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1225
1226         * ecore.cs: Improved argument mismatch error messages.
1227
1228 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1229
1230         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1231
1232 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1233
1234         * expression.cs (TypeOf): Mutate type argument.
1235
1236 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1237
1238         * class.cs: Report missing partial modifier for correct type.
1239
1240 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1241
1242         * ecore.cs, expression.cs (VariableReference): Variable property is 
1243         protected.
1244
1245 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1246
1247         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1248         
1249 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1250
1251         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1252         method delegates.
1253
1254 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1255
1256         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1257         anonymous method storey to an instance method when only "this" is hoisted.
1258
1259 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1260
1261         A fix for bug #321615
1262         * expression.cs: Pointer comparisons use unsigned operator.
1263
1264 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1265
1266         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1267
1268 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1269
1270         A fix for bug #404905
1271         * class.cs: Always initialize local unsafe variables.
1272
1273 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1274
1275         A fix for bug #396987
1276         * expression.cs (NewInitialize): Clear local temporary variable for next run
1277
1278 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1279
1280         A fix for bug #401020
1281         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1282
1283 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1284
1285         A fix for bug #398319
1286         * cs-parser.jay: Implemented undocumented base access expression inside
1287         anonymous types.
1288
1289 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1290
1291         A fix for bug #404227
1292         * cs-parser.jay: Parse namespace declaration using qualified identifier.
1293
1294 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1295
1296         A fix for bug #404227
1297         * convert.cs: Fixed explicit array to interface cast.
1298
1299 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1300
1301         A fix for bug #403894
1302         * delegate.cs: Mutate DelegateInvocation type.
1303
1304 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1305
1306         A fix for bug #379348
1307         * delegate.cs: Box a load of generic parameters.
1308
1309 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1310
1311         * expression.cs: Add an array creation arguments mutate.
1312
1313 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1314
1315         A fix for bug #386068
1316         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
1317         parameter.
1318
1319 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1320
1321         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
1322         CloneTo.
1323
1324 2008-06-25  Marek Safar  <marek.safar@gmail.com>
1325
1326         A fix for bug #403518
1327         * delegate.cs: Type correctly anonymous method new invocation.
1328
1329 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1330
1331         A fix for bug #394826
1332         * anonymous.cs: Fully qualify members when resolving anonymous type internal
1333         calls.
1334
1335 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1336
1337         A fix for bug #394826
1338         * anonymous.cs, iterators.cs: Construct generic storey only when is really
1339         needed.
1340
1341 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1342
1343         * class.cs: Clone indexer parameters for localized capturing.
1344
1345 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1346
1347         A fix for bug #402379
1348         * expression.cs: Don't crash when an object initializer resolve fails.
1349
1350 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1351
1352         A fix for bug #402888
1353         * expression.cs: Mutate conditional expression.
1354
1355 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1356
1357         A fix for bug #401012
1358         * class.cs: Keep StructLayout in shared container.
1359
1360 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1361
1362         A fix for bug #400438
1363         * decl.cs, class.cs: Only properties can be automatically implemented.
1364
1365 2008-06-24  Marek Safar  <marek.safar@gmail.com>
1366
1367         * statement.cs (ChangeToIterator): Copy also labels.
1368
1369 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1370
1371         * ecore.cs: Pass type argument details to parent extension method.
1372
1373 2008-06-23  Marek Safar  <marek.safar@gmail.com>
1374
1375         A fix for bug #375966
1376         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
1377
1378 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
1379
1380         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
1381
1382 2008-06-22  Marek Safar  <marek.safar@gmail.com>
1383
1384         A fix for bug #394347
1385         * anonymous.cs: Cache compatible delegates as compatibility check produces
1386         a new method every time.
1387
1388 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1389
1390         * anonymous.cs: Propagate storey reference for single references.
1391
1392 2008-06-20  Marek Safar  <marek.safar@gmail.com>
1393
1394         A fix for bug #387615
1395         * assign.cs, expression.cs: Correctly clone compound assignment.
1396
1397 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1398
1399         A fix for bug #359611, #359604
1400         * anonymous.cs: Mutate all types of hoisted parameters.
1401
1402 2008-06-19  Marek Safar  <marek.safar@gmail.com>
1403
1404         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
1405         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
1406         expression.cs, codegen.cs, statement.cs
1407         
1408         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
1409         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
1410         
1411         ** Anonymous methods, lambda expressions rewrite **
1412         
1413         Anonymous expressions are now resolved when an explicit block is resolved 
1414         and they don't require any registration procedure anymore. Further,
1415         anonymous methods are defined when explicit block is emitted which allows
1416         better control of whole process and opens possibilities for more
1417         optimizations as well as alternative to reverse whole process.
1418         
1419         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
1420         process consistent and to correctly emit hoisted generic methods when they
1421         have at least 1 hoisted variable.
1422         
1423 2008-06-17  Martin Baulig  <martin@ximian.com>
1424
1425         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
1426         iterator method.
1427         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
1428         virtual property; check it in Emit().
1429         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
1430         an iterator.
1431         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
1432         an iterator.
1433         (Indexer.Define): Likewise.
1434
1435 2008-06-17  Marek Safar  <marek.safar@gmail.com>
1436
1437         * convert.cs: Don't use IsInterface on type arguments.
1438         
1439         * delegate.cs: DelegateInvocation uses MethodInfo.
1440         
1441         * parameter.cs: Removed IsTypeParameter.
1442         
1443         * generic-mcs.cs: More missing stuff.
1444
1445 2008-06-16  Martin Baulig  <martin@ximian.com>
1446
1447         * modifiers.cs
1448         (Modifiers.DEBUGGER_HIDDEN): New public const.
1449
1450         * typemanager.cs
1451         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
1452
1453         * class.cs
1454         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
1455         (AbstractPropertyEventMethod): Likewise.
1456         (Constructor.Emit): Likewise.
1457         (SourceMethod.SetCompilerGenerated): Removed.
1458
1459         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
1460         on MoveNext().
1461
1462         * anonymous.cs
1463         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
1464         if we're an `IteratorHost'.
1465         (AnonymousMethodMethod..ctor): Don't set
1466         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
1467         not on the method.
1468
1469 2008-06-16  Marek Safar  <marek.safar@gmail.com>
1470
1471         * statement.cs: Clean-up foreach statements.
1472
1473 2008-06-12  Marek Safar  <marek.safar@gmail.com>
1474
1475         * class.cs: Stop using public method which should not exist
1476         (MethodBuilder.SetGenericMethodSignature).
1477
1478 2008-06-11  Martin Baulig  <martin@ximian.com>
1479
1480         * location.cs
1481         (Location.LookupFile): Add `CompilationUnit' argument; when given
1482         a relative file name, make it relative to the directory the .cs
1483         file is located in instead of using the current directory.
1484
1485 2008-06-11  Martin Baulig  <martin@ximian.com>
1486
1487         * class.cs
1488         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
1489         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
1490         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
1491         (SourceMethod.SetCompilerGenerated): Likewise.
1492
1493 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1494
1495         * codegen.cs, driver: Only write symbol file when it's asked for.
1496
1497 2008-06-11  Marek Safar  <marek.safar@gmail.com>
1498
1499         * codegen.cs: Don't use assembly writer error handling for symbol writer.
1500
1501 2008-06-10  Martin Baulig  <martin@ximian.com>
1502
1503         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
1504
1505 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1506
1507         A fix for bug #316290
1508         * expression.cs: Include decimal operators in predefined table.
1509         
1510         * parameters.cs: More readonlyness.
1511
1512 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1513
1514         A fix for bug #397213
1515         * cs-parser.jay: One more missing current_local_parameters reset.
1516
1517 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1518
1519         A fix for bug #396633
1520         * class.cs: Host backing field in partial container.
1521
1522 2008-06-09  Marek Safar  <marek.safar@gmail.com>
1523
1524         A fix for bug #397068
1525         * expression.cs: Check both operand types when predefined operator is used.
1526
1527 2008-06-05  Martin Baulig  <martin@ximian.com>
1528
1529         Merged the `debugger-kahalo' branch.
1530
1531         * class.cs
1532         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
1533         we're an iterator method.
1534         (SourceMethod): Reflect latest symbol writer changes;
1535         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
1536         now `start_row' and `end_row'.
1537         (Constructor.Emit): Fix the logic whether to emit symbol information.
1538
1539         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
1540         generated methods.
1541
1542         * location.cs
1543         (CompilationUnit): New public class; derives from `SourceFile'.
1544         (SourceFileEntry.DefineSymbolInfo): New public method.
1545         (SourceFileEntry.SetChecksum): New public method.
1546         (Location): Encode hidden line numbers by using `column == 255';
1547         the .ctor now accepts `column == -1' to mark a hidden line number.
1548         (Location.Hidden): New public property.
1549         (Location.CheckPoint): Add `CompilationUnit'.
1550         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
1551         (Location.Push): Add `CompilationUnit compile_unit' argument.
1552         (Location.CompilationUnit): New public property.
1553
1554         * statement.cs
1555         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
1556
1557         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
1558
1559         * driver.cs: `SourceFile' -> `CompilationUnit'.
1560
1561         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
1562
1563         * namespace.cs: `SourceFile' -> `CompilationUnit'.
1564
1565         * cs-tokenizer.cs: Add support for `#pragma checksum' and
1566         `#line hidden'.
1567
1568         * symbolwriter.cs
1569         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
1570         new symbol writer API to also pass the file.
1571
1572 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1573
1574         * statement.cs: Emit catch variable assignment using variable expression.
1575         
1576 2008-06-05  Marek Safar  <marek.safar@gmail.com>
1577
1578         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
1579         with other variable types.
1580
1581 2008-06-04  Marek Safar  <marek.safar@gmail.com>
1582
1583         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
1584         GetLength method emit, it breaks resolve rules.
1585         
1586 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
1587             Marek Safar  <marek.safar@gmail.com>
1588                         
1589         A fix for bug #395542
1590         * cs-parser.jay: The trailing comma is allowed in anonymous type member
1591         declaration.
1592         
1593 2008-06-02  Marek Safar  <marek.safar@gmail.com>
1594
1595         A fix for bug #395287
1596         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
1597
1598 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1599
1600         A fix for bug #395845
1601         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
1602         non-nullable parameter type.
1603         
1604 2008-05-31  Marek Safar  <marek.safar@gmail.com>
1605
1606         * class.cs: Handle contructor initializer as a statement in top-level block.
1607
1608 2008-05-30  Marek Safar  <marek.safar@gmail.com>
1609
1610         * attribute.cs: Don't mix old and new corlib types when emitting corlib
1611         security attributes.
1612
1613 2008-05-24  Marek Safar  <marek.safar@gmail.com>
1614
1615         * ecore.cs, expression.cs: Small IVariable refactoring.
1616
1617 2008-05-22  Marek Safar  <marek.safar@gmail.com>
1618
1619         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
1620
1621 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1622
1623         * cs-parser.jay: Removed redundant catch type check.
1624
1625 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1626
1627         A fix for bug #390372
1628         * nullable.cs: Set correct return type.
1629
1630 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1631
1632         A fix for bug #391062
1633         * typemanager.cs: Fixed crash when comparing null types.
1634
1635 2008-05-21  Marek Safar  <marek.safar@gmail.com>
1636
1637         A fix for bug #391871
1638         * cs-parser.jay: Better error handling for invalid catch type.
1639
1640 2008-05-20  Marek Safar  <marek.safar@gmail.com>
1641
1642         A fix for bug #392155
1643         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
1644
1645 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1646
1647         A fix for bug #390666
1648         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
1649         expressions.
1650
1651 2008-05-15  Marek Safar  <marek.safar@gmail.com>
1652
1653         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
1654         in getter.
1655
1656 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1657
1658         A fix for bug #389625
1659         * delegate.cs, generic.cs: Some progress on method group return type
1660         inference.
1661
1662 2008-05-13  Marek Safar  <marek.safar@gmail.com>
1663
1664         A fix for bug #378419
1665         * namespace.cs: Inspect also parent namespaces not only namespace entries.
1666
1667 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1668
1669         * class.cs (Constructor): Added IsCompilerGenerated.
1670
1671 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1672
1673         * expression.cs: Enum binary operators can accept non-enum operand only when
1674         is implicitly convertible to underlying type.
1675
1676 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1677
1678         A fix for bug #389272
1679         * support.cs: Workaround System.InvalidOperationException for enums.
1680
1681 2008-05-12  Marek Safar  <marek.safar@gmail.com>
1682
1683         A fix for bug #389073
1684         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
1685
1686 2008-05-10  Marek Safar  <marek.safar@gmail.com>
1687
1688         * driver.cs: Split Parse.
1689         
1690         * location.cs (LookupFile): Uses string.Empty.
1691
1692 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1693
1694         * expression.cs, parameter.cs: Small ParameterReference clean up.
1695
1696 2008-05-07  Marek Safar  <marek.safar@gmail.com>
1697
1698         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
1699         hack. Fixes #387502.
1700
1701 2008-05-06  Martin Baulig  <martin@ximian.com>
1702
1703         * class.cs (Constructor.Emit): Fix the logic whether to emit
1704         symbol information.
1705
1706 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
1707
1708         Fix #385503
1709         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
1710         InvalidOperationException when the iterator is before the start or
1711         after the end.
1712
1713 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1714
1715         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
1716         when left is nullable type.
1717
1718 2008-05-06  Marek Safar  <marek.safar@gmail.com>
1719
1720         A fix for bug #386628
1721         * expression.cs (LocalVariableReference): Continue in resolving when
1722         variable is not assigned.
1723
1724 2008-05-05  Marek Safar  <marek.safar@gmail.com>
1725
1726         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
1727         nullable operations.
1728
1729 2008-05-04  Marek Safar  <marek.safar@gmail.com>
1730
1731         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
1732         it saves many redundant temporary variables for nullable operations.
1733
1734 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1735
1736         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
1737         
1738         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
1739         method.
1740         
1741         * nullable.cs: Constant coalescing operator optimizations.
1742
1743 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1744
1745         * constant.cs: Use unsigned conversion for values which are unsigned only.
1746
1747 2008-05-03  Marek Safar  <marek.safar@gmail.com>
1748
1749         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
1750         coalescing operator as it should be.
1751
1752 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1753
1754         A fix for bug #371016
1755         * expression.cs: All predefined delegate operators require implicit method
1756         group conversion.
1757         
1758 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1759
1760         * constant.cs: Emit long constant as uint when fits the range.
1761         
1762         * convert.cs, expression.cs: Fixed few unsafe conversions.
1763
1764 2008-05-02  Marek Safar  <marek.safar@gmail.com>
1765
1766         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
1767
1768 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
1769
1770         Fix #385758
1771         * convert.cs (ImplicitNumericConversion): Don't modify the type of
1772         'expr'.
1773         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
1774
1775 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1776
1777         * constant.cs, literal.cs: IsLiteral property for error reporting.
1778         
1779         * ecore.cs, expression.cs: Implemented Property expression.
1780
1781 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1782
1783         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
1784         
1785         * nullable.cs: Implemented nullable coalescing null operator.
1786
1787         * ecore.cs, expression.cs: Expression trees work.
1788
1789 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1790
1791         * ecore.cs: CreateExpressionTree is finally abstract.
1792
1793         * expression.cs, linq.cs: Updated.
1794
1795 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1796
1797         * expression.cs, ecore.cs: Block base access expression inside expression
1798         tree.
1799
1800 2008-05-01  Marek Safar  <marek.safar@gmail.com>
1801
1802         A fix for bug #385058
1803         * expression.cs: User-defined operator implementations always take
1804         precedence over predefined operator implementations.
1805
1806 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1807
1808         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
1809         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
1810         expression tree conversions.
1811         
1812 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1813
1814         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
1815         operators method details to Operator class.
1816
1817 2008-04-30  Marek Safar  <marek.safar@gmail.com>
1818
1819         * anonymous.cs: Pass unsafe flags to anonymous container.
1820         
1821         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
1822         inside expression tree.
1823
1824 2008-04-29  Martin Baulig  <martin@ximian.com>
1825
1826         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
1827         (Tokenizer.PopPosition): Also restore the `line'.
1828
1829 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1830
1831         * delegate.cs: Implemented Invoke expression.
1832
1833 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1834
1835         * expression.cs: Fixed equality reference comparison regression.
1836
1837 2008-04-29  Marek Safar  <marek.safar@gmail.com>
1838
1839         * ecore.cs: Clean up EmptyCast hack.
1840         
1841         * expression.cs, nullable.cs: Implemented enum binary and unary operations
1842         using correct conversion rules. Also fixes #383993.
1843
1844 2008-04-28  Martin Baulig  <martin@ximian.com>
1845
1846         * class.cs (Constructor.Emit): Don't emit debugging information
1847         for generated default .ctor's.
1848
1849 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1850
1851         * convert.cs: Empty-cast ushort to int conversion.
1852
1853 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1854
1855         A fix for bug #384191
1856         * ecore.cs, expression.cs: Fixed expression cloning.
1857
1858 2008-04-28  Marek Safar  <marek.safar@gmail.com>
1859
1860         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
1861
1862 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
1863
1864         Fix #381559, test-638.cs, test-639.cs
1865         * assign.cs (CompoundAssign.Helper): New wrapper.
1866         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
1867         access.
1868         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
1869         Pass unconverted expressions to the params array creation expression.
1870         (FieldExpr.EmitAssign): Don't special-case StringConcat.
1871         (PropertyExpr.EmitAssign): Likewise.
1872         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
1873         element if it is of kind CompoundAssign.Helper.
1874         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
1875         first before anything else.
1876         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
1877         (ArrayAccess.LoadArrayAndArguments): Simplify.
1878
1879 2008-04-27  Marek Safar  <marek.safar@gmail.com>
1880
1881         * expression.cs: Fixed cloning of typeof(void).
1882
1883 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
1884
1885         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
1886         (Assign.Emit): Likewise.  Move it to ...
1887         (CompoundAssign.DoResolve): ... here and ...
1888         (CompoundAssign.Emit): ... here.
1889         (EventAddOrRemove): New helper to handle += and -= on events, and
1890         avoid the use of BinaryDelegates.
1891         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
1892         (EventExpr.EmitAddOrRemove): Improve.
1893         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
1894
1895         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
1896         create VarExprs for 'foo.bar.var'.
1897         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
1898         is a highly inappropriate name for its functionality.
1899
1900 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1901
1902         Simplify handling of multiple assignments
1903         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
1904         inheritable-only.
1905         (SimpleAssign): New.  Class to be used for normal assignments.
1906         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
1907         * expression.cs, parameter.cs, statement.cs: Likewise.
1908
1909 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1910
1911         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
1912         for incompatible underlying types, more to come, uff.
1913
1914 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
1915
1916         Fix gtest-388.cs
1917         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
1918         Handle 'leave_copy'.
1919
1920 2008-04-25  Marek Safar  <marek.safar@gmail.com>
1921
1922         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
1923
1924 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
1925
1926         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
1927         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
1928         * statement.cs (While, Do, For): Allow test to have side effects.
1929         (For.DoEmit): Always emit InitStatement.
1930
1931         Fix test-635.cs
1932         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
1933         Always create SideEffectConstant.
1934         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
1935         of type EnumConstant.
1936
1937         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1938         Handle 'right' being SideEffectConstant of type 'bool'.
1939
1940         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
1941         Use left.EmitBranchable instead of open coding it, so as to
1942         improve optimization opportunities.
1943
1944         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
1945
1946         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
1947         assumptions.
1948         (Expression.EmitSideEffect): Document.
1949
1950 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1951
1952         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
1953
1954 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1955
1956         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
1957
1958 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1959
1960         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
1961         conversion to expression tree.
1962
1963 2008-04-23  Marek Safar  <marek.safar@gmail.com>
1964
1965         * ecore.cs: Removed unused expression.
1966
1967 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1968
1969         * expression.cs: Implemented NegateChecked and New expressions.
1970
1971 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1972
1973         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
1974
1975 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
1976
1977         Fix #351102
1978         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
1979         needing final 'ret' instruction.
1980
1981 2008-04-22  Marek Safar  <marek.safar@gmail.com>
1982
1983         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
1984
1985 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1986
1987         * expression.cs: Emit ldnull and not null expression as an instance argument
1988          of static method expression calls.
1989
1990 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1991
1992         A fix for bug #378200
1993         * expression.cs: Fixed crash when creating parameterless expression tree
1994         method call.
1995
1996 2008-04-21  Marek Safar  <marek.safar@gmail.com>
1997
1998         A fix for bug #375297
1999         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2000         method.
2001
2002 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2003
2004         A fix for bug #377596
2005         * decl.cs, class.cs: Emit delegate type argument attributes.
2006
2007 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2008
2009         A fix for bug #365314
2010         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2011         
2012 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2013
2014         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2015         only.
2016
2017 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2018
2019         * generic.cs (TypeParameter): Removed redundant location.
2020
2021 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2022
2023         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2024         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2025         FullNamedExpression in all declaration type expression, statements will come
2026         later.
2027
2028 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2029
2030         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2031         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2032
2033 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2034
2035         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2036         code.
2037
2038 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2039
2040         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2041         constraints.
2042
2043 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2044
2045         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2046         name expressions.
2047         Also fixes #340463.
2048
2049 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2050
2051         Hook up 'EmitSideEffect'
2052         * constant.cs (Constant.EmitSideEffect): New.
2053         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2054         (SideEffectConstant.EmitSideEffect): New.
2055         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2056         unconditional branch in EmitBranchable.
2057         (FieldExpr.EmitBranchable): New.
2058         * expression.cs (Unary.EmitSideEffect): New.
2059         (Binary.EmitSideEffect): New.
2060         (VariableReference.EmitSideEffect): New.  Do nothing.
2061
2062 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2063
2064         Introduce 'EmitSideEffect'
2065         * ecore.cs (Expression.EmitSideEffect): New.
2066         (TypeCast): Rename from EmptyCast.
2067         (EmptyCast): New.
2068         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2069         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2070         * convert.cs, nullable.cs: Update to changes.
2071
2072 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2073
2074         * class.cs, cs-parser.jay: Early check for base types expression.
2075
2076 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2077
2078         * decl.cs (MemberName): Declare PrettyName as obsolete.
2079
2080 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2081
2082         * namespace.cs: Use MemberName comparison.
2083
2084 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2085
2086         Fix build break
2087         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2088         FullName.
2089         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2090         (MemberName.FullyQualifiedName): New.  Provides the functionality
2091         that users assume FullName would have.
2092         * ecore.cs, namespace.cs: Update to changes.
2093
2094         * statement.cs (Using.assign): Make into ExpressionStatement.
2095         (Using.EmitPreTryBody): Simplify.
2096
2097 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2098
2099         * report.cs: ColorFormat is protected.
2100         
2101         * rootcontext.cs: Unused fields clean-up.
2102         
2103         * namespace.cs: Made UsingEntry name private.
2104
2105 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2106
2107         * cs-tokenizer.cs, location.cs: Removed unused field.
2108
2109 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2110             Raja R Harinath  <harinath@hurrynot.org>
2111
2112         Fix #379822
2113         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2114         (SideEffectConstant.side_effect): Rename from 'right'.
2115         (SideEffectConstant..ctor): Normalize 'side_effect'.
2116         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2117         value of this constant.
2118         * cfold.cs: Update to changes.
2119
2120 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2121
2122         * cs-paser.jay: Removed unused variable.
2123         
2124         * driver.cs: Made Compile instance method.
2125
2126 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2127
2128         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2129
2130 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2131
2132         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2133
2134 2008-04-13  Jb Evain  <jbevain@novell.com>
2135
2136         * namespace.cs: update the System.Core fullname for 2.1
2137         * driver.cs: update the list of required assemblies for 2.1.
2138         Merged from the Moonlight 2 branch.
2139
2140 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2141
2142         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2143         types and user defined operators. User operators arguments has to be checked
2144         for null value before invocation, which also means no operator is called
2145         when any argument is not convertible to unwrapped nullable type.
2146         
2147 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2148
2149         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2150         of Unary expressions to follow operator overloading rules precisely.
2151         Also fixes #321794, #323794
2152         
2153 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2154
2155         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2156         expression.
2157         
2158 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2159
2160         * expression.cs, ecore.cs: Implemented MemberInit expression.
2161         
2162 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2163
2164         Fix mono/tests/exception4.cs
2165         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2166         ec.NeedReturnLabel () rather emitting a 'nop'.
2167
2168         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2169         simple heuristic.
2170         (TryCatch.SomeCodeFollows): Likewise.
2171         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2172         for 'break', 'continue' and 'return' statements inside a try.
2173         We're fairly sure that the generated IL stream will have more
2174         instructions textually following the try.
2175         (FlowBranchingTryCatch): Likewise.
2176
2177         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2178         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2179         overrides.
2180
2181         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2182         wrapper -- forward everything to CollectionForeach.
2183         (CollectionForeach.NonDisposableWrapper): New.
2184         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2185         instead of a pop + branch to end.
2186
2187 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2188
2189         A fix for bug #377485
2190         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2191         Propagate location for extension method groups. Report conversion failure at
2192         right place.
2193
2194 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2195
2196         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2197         ListInit and Field expressions.
2198
2199 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2200
2201         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2202         Since $PC is always -1 inside the body of MoveNext, the fault
2203         handler is a no-op.
2204         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2205         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2206         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2207
2208         The denouement!  Fix #324708
2209         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2210         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2211         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2212         'finally' inside the finally clause.
2213
2214         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2215         inside an iterator.  Don't emit the body of the 'finally' inside
2216         the finally clause yet.
2217
2218         Use the ResumableStatement infrastructure for MoveNext ()
2219         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2220         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2221         'old_resume_points'.  Move dispatcher upfront.
2222         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2223         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2224         in an enumerator.  This encodes the main fix in this patch series
2225         -- we can only jump into the first instruction of a try from the
2226         outside, but we want to emit try/finally regions in iterators and
2227         resume in the middle of them.
2228
2229 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2230
2231         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2232         of NeedReturnLabel here.
2233
2234         Introduce a common point for emitting try/finally to IL
2235         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2236         features of the various subclasses, which are now driven by ...
2237         (ExceptionStatement.EmitPreTryBody): ... this and ...
2238         (ExceptionStatement.EmitTryBody): ... this and the original
2239         EmitFinallyBody.
2240         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2241         Remove DoEmit and update to follow above protocol.
2242
2243         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2244         of the dispatcher are the same, skip emitting the 'switch'.
2245         * iterator.cs (Iterator.EmitDispose): Update to changes.
2246
2247         Clean up handling of 'using' statement
2248         * statement.cs (UsingTemporary): New.  Carved out of ...
2249         (Using): ... this.  Simplify drastically.  Handle exactly
2250         one variable.
2251         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2252         or Using as appropriate.  If there are multiple variable declared,
2253         create nested Using statements.
2254         (resource_acquisition): Kill.
2255
2256         * statement.cs (ExceptionStatement.EmitForDispose): Use
2257         EmitFinallyBody, not EmitFinally.
2258
2259         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2260         * iterator.cs: Update to changes.
2261
2262         Start using the ResumableStatement infrastructure
2263         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2264         (ResumableStatement.EmitForDispose): New.
2265         (ExceptionStatement): Override them.
2266         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2267         EmitForDispose to create the body of the Dispose method.  Don't
2268         use OldResumePoint.
2269
2270         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2271         * statement.cs (Toplevel.AddResumePoint): ... here.
2272         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2273         * flowanalysis.cs (FlowBranchingIterator): New.
2274         * codegen.cs (EmitContext): Update to changes.
2275
2276         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2277         (Iterator.old_resume_points): Rename from 'resume_points'.
2278         (Iterator.MoveNextStatement): Remove unused class.
2279
2280         New infrastructure for try/finally in iterators (still unused)
2281         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2282         (FlowBranchingToplevel.AddResumePoint): Hook into
2283         ToplevelBlock.AddResumePoint.
2284         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2285         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2286         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2287         resume points and assign program-counter values.
2288         (ExceptionBlock.AddResumePoint): Collect resume points for
2289         de-muxer at the top of try block.
2290         * iterators.cs (Yield.CheckContext): Simplify.
2291         (Yield.Resolve): Use FlowBranching.AddResumePoint.
2292
2293 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
2294
2295         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
2296         argument to an ExitStatement.
2297         (FlowBranchingException): Refactor saved origins code.
2298         * statement.cs (ExitStatement): Update to cahges.
2299         * iterator.cs (YieldBreak): Likewise.
2300
2301         * statement.cs (ResumableStatement): New.  Common base class for
2302         YieldReturn and ExceptionStatement.
2303         (ExitStatement): New.  Common base class for Return and YieldBreak.
2304         (Return): Update to changes.
2305         * iterator.cs (YieldBreak): Likewise.
2306         * lambda.cs (ContextualReturn): Likewise.
2307
2308         Fix #377028
2309         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
2310         emit a meaningful error message.
2311
2312         Fix #324765, #319508
2313         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
2314         (VariableInfo.SetAssigned): Set it.
2315         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
2316         determine if CS0219 or CS0168 is appropriate.  Don't use
2317         flow-analysis information.
2318         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
2319         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
2320         (EmitContext.EndFlowBranching): ... this.
2321
2322 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2323
2324         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
2325
2326 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2327
2328         A fix for bug #376508
2329         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
2330         ImplicitConversionExists.
2331
2332 2008-04-03  Marek Safar  <marek.safar@gmail.com>
2333
2334         * expression.cs (Binary): Added remaining binary operators to expression
2335         tree builder.
2336
2337         * nullable.cs: Optimize shift with null argument.
2338
2339 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
2340
2341         Fix minor IL regression
2342         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
2343         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
2344         * cs-parser.jay (try_statement): Update to changes.
2345
2346         * statement.cs (TryFinally.need_exc_block): Delete.
2347         (TryFinally): Update to changes.
2348
2349         Now all ExceptionStatements are unconditional
2350         * statement.cs (CollectionForeach.DisposableWrapper): New.
2351         Extract out the try/finally code into a new wrapper.
2352         (CollectionForeach.Resolve): Use it to simplify the code.
2353
2354 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
2355
2356         Start at simplifying ExceptionStatement semantics a bit
2357         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
2358         * cs-parser.jay (try_statement): Update to changes.
2359         (opt_catch_clauses): Remove.
2360         * flowanalysis.cs: Update to changes.
2361         (FlowBranching.BranchingType.TryCatch): New.
2362         (FlowBranchingTryCatch): New.
2363
2364         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
2365         (FlowBranching.CreateBranching): Update to changes.
2366         (FlowBranchingBlock.AddSibling): Add sanity check.
2367         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
2368         Update to changes.
2369
2370         * iterators.cs (Iterator.MarkFinally): Remove.
2371         * statement.cs (ExceptionStatement): Update to changes.
2372
2373         Add support for skipping over finally blocks at runtime.  First
2374         in a series to fix #324708
2375         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
2376         (Iterator.EmitMoveNext): Initialize it.
2377         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
2378         branch over the body of the 'finally' clause.
2379
2380 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
2381
2382         Avoid lopsided use of Foo/DoFoo names
2383         * statement.cs (ExpressionStatement.EmitFinallyBody):
2384         Rename from EmitFinally.
2385         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
2386         * iterator.cs: Update to changes.
2387
2388 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2389
2390         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
2391         based on UserOperatorCall. More binary nullable operators clean up.
2392
2393 2008-04-02  Martin Baulig  <martin@ximian.com>
2394
2395         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
2396
2397 2008-04-02  Marek Safar  <marek.safar@gmail.com>
2398
2399         * nullable.cs: Merge user and empty conversions when lifting expression
2400         trees.
2401         
2402         * expression.cs (StringConcat): Implemented expression tree representation.
2403
2404 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2405
2406         * nullable.cs: When lifting null literal and a user operator exists, no call 
2407         is made.
2408         
2409 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2410
2411         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
2412         null.
2413
2414 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2415
2416         * nullable.cs, expression.cs: Use namespace instead heavily nested
2417         monster abstract class.
2418
2419 2008-04-01  Marek Safar  <marek.safar@gmail.com>
2420
2421         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
2422         lifting of null literal and user operators. Clean up of some temporary
2423         nullable hacks.
2424
2425 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
2426
2427         Fix #368224, test-629.cs
2428         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
2429         if it crossed an unwind-protect boundary.
2430         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
2431         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
2432         inside an unwind-protected region.
2433         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
2434         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
2435         'leave' instead of a 'br' if unwind-protected.
2436         (Iterator.EmitYieldBreak): Likewise.
2437
2438 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
2439
2440         * driver.cs: Only define versioninfo resources if no win32 resource
2441         file was specified.
2442
2443 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2444
2445         A fix for bug #372375
2446         * convert.cs: Fixed boxing of nullable types.
2447
2448 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2449
2450         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
2451         type.
2452
2453 2008-03-28  Marek Safar  <marek.safar@gmail.com>
2454
2455         A fix for bug #374619
2456         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
2457         
2458 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2459
2460         * lambda.cs: Check return type only for invocation.
2461         
2462 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2463
2464         A fix for bug #374214
2465         * ecore.cs: Correctly report argument type mismatch.
2466
2467 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2468
2469         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
2470         and not rely on broken IsEnum.
2471
2472 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2473
2474         * nullable.cs: New file, extracted from generic.cs.
2475         
2476         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
2477
2478 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2479
2480         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
2481         predefined comparison operators and null literals.
2482         
2483         * report.cs: New warning ID.
2484         
2485 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2486
2487         A fix for bug #370577
2488         * lambda.cs: Check return type too.
2489
2490 2008-03-25  Marek Safar  <marek.safar@gmail.com>
2491
2492         A fix for bug #372846
2493         * class.cs: Automatic properties can be declared as unsafe.
2494
2495 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2496
2497         * location.cs: Use string based concatenation.
2498         
2499         * expression.cs: LiftedBinaryOperator is gmcs only.
2500         
2501 2008-03-20  Marek Safar  <marek.safar@gmail.com>
2502
2503         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
2504         conversions rules and expression trees.
2505
2506 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2507
2508         * delegate.cs: Use extension method source as delegate target.
2509
2510 2008-03-19  Marek Safar  <marek.safar@gmail.com>
2511
2512         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
2513         binary operations to be purely based on binary operations and optimized
2514         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
2515         and other ET refactoring.
2516         
2517         * typemanager.cs: Fixed warning.
2518         
2519 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2520
2521         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
2522         
2523         * symbolwriter.cs: Fixed.
2524
2525 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2526
2527         * anonymous.cs, driver.cs: Reset anonymous types counters.
2528
2529 2008-03-17  Marek Safar  <marek.safar@gmail.com>
2530
2531         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
2532         
2533         * class.cs: Use fullname for all type member definitions.
2534         
2535 2008-02-19  Martin Baulig  <martin@ximian.com>
2536
2537         * class.cs
2538         (IMethodData.EmitExtraSymbolInfo): New interface method.
2539         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
2540         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
2541         interface method here as an empty public virtual method.
2542
2543         * anonymous.cs
2544         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
2545         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
2546         CodeGen.SymbolWriter.SetRealMethodName().       
2547
2548 2008-02-18  Martin Baulig  <martin@ximian.com>
2549
2550         * anonymous.cs
2551         (ScopeInfo.EmitType): Override this and emit debugging
2552         information for captured variables.
2553         (RootScopeInfo.EmitType): Override this and emit symbol
2554         information for a captured `this'.
2555
2556 2008-02-15  Martin Baulig  <martin@ximian.com>
2557
2558         * iterators.cs: Emit debugging info.
2559
2560         * codegen.cs
2561         (EmitContext.Flags): Add `OmitDebuggingInfo'.
2562         (EmitContext.OmitDebuggingInfo): New public property.
2563
2564         * statement.cs
2565         (While): Override Emit() and don't emit symbol info there; do it
2566         inside DoEmit() instead.
2567         (Block.Emit): Omit symbol information while emitting the scope
2568         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
2569         block logic.
2570         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
2571         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
2572         .ctor to make `IsIterator' work.
2573
2574 2008-03-14  Martin Baulig  <martin@ximian.com>
2575
2576         * symbolwriter.cs: Added the new symbol writer function from the
2577         debugger's `terrania' branch; temporarily enclose them inside
2578         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
2579         my vacations.
2580
2581 2008-03-14  Martin Baulig  <martin@ximian.com>
2582
2583         * symbolwriter.cs
2584         (SymbolWriter): Make this a public static class.
2585
2586         * codegen.cs
2587         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
2588         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
2589
2590 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2591
2592         A fix for bug #370577
2593         * statement.cs, lambda.cs: Added extra limitations when dealing with void
2594         return type.
2595         
2596 2008-03-14  Marek Safar  <marek.safar@gmail.com>
2597
2598         * typemanager.cs (CSharpName): Made 250 times faster.
2599
2600 2008-03-13  Marek Safar  <marek.safar@gmail.com>
2601
2602         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
2603         
2604 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2605
2606         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
2607         crash when predefined field does not exist.
2608         
2609 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2610
2611         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
2612         
2613 2008-03-12  Marek Safar  <marek.safar@gmail.com>
2614
2615         * class.cs (FixedField): Don't crash when contructors are missing.
2616
2617 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2618
2619         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
2620         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
2621         check internal types accessibility for internal and external types.
2622         Replaced EnumToUnderlying by GetEnumUnderlyingType.
2623
2624 2008-03-11  Marek Safar  <marek.safar@gmail.com>
2625
2626         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
2627         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
2628         attribute.cs, statement: Use corect instance of predefined types (work
2629         related to #364674).
2630
2631 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2632
2633         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
2634         
2635 2008-03-07  Marek Safar  <marek.safar@gmail.com>
2636
2637         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
2638         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
2639         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
2640         predefined types clean up, delayed predefined types members initialization
2641         (work related to #364674).
2642
2643 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2644
2645         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
2646         
2647 2008-03-05  Marek Safar  <marek.safar@gmail.com>
2648
2649         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
2650         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
2651         predefined types clean up (work related to #364674).
2652
2653 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2654
2655         * ecore.cs: Print an error message instead of throwing exception.
2656         
2657 2008-03-04  Marek Safar  <marek.safar@gmail.com>
2658
2659         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
2660         expression.cs, statement.cs: Unififed null literal representation.
2661
2662 2008-03-03  Marek Safar  <marek.safar@gmail.com>
2663
2664         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
2665         expression.cs: Refactored binary operators resolve phase and improved speed.
2666         The nullable code is still missing and won't work correctly, more fixes
2667         required.
2668
2669         It also fixes #323726, #324312, #324248, and many other unreported issues.
2670
2671 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
2672
2673         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
2674         instead of 'gmcs'.
2675
2676 2008-02-27  Marek Safar  <marek.safar@gmail.com>
2677
2678         * ecore.cs: Clean-up and split BetterConversion.
2679         
2680 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
2681
2682         Fix #363791
2683         * enum.cs (EnumMember.Value): Only access 'value' if
2684         ResolveValue says it's ok.
2685         (EnumMember.DoResolveValue): Don't set prev_member.value.
2686         (Enum.GetDefinition): Reverse arguments of Equals --
2687         EnumMember.Value can return 'null'.
2688
2689         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
2690
2691 2008-02-22  Marek Safar  <marek.safar@gmail.com>
2692
2693         * generic.cs, expression.cs: More ongoing work on expression trees.
2694         
2695 2008-02-21  Marek Safar  <marek.safar@gmail.com>
2696
2697         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
2698         handle missing matches when mutiple operators exist.
2699         
2700 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2701
2702         A fix for bug #363218
2703         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
2704         initializers.
2705         
2706 2008-02-20  Marek Safar  <marek.safar@gmail.com>
2707
2708         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
2709         update. This time to deal correctly with SideEffectConstant expression used
2710         as an argument for another constant folding.
2711
2712 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
2713
2714         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
2715         MethodBuilder.
2716
2717 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2718
2719         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
2720
2721 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2722
2723         A fix for bug #328136
2724         * expression.cs: Do not fold immediately LogicalAnd operators when the left
2725         side is a false constant, because we still need to evaluate the right-hand
2726         side.
2727
2728         * statement.cs (If): Emit two types of boolean constants (simple constant,
2729         side-effect constant).
2730
2731 2008-02-19  Marek Safar  <marek.safar@gmail.com>
2732
2733         * constant.cs (SideEffectConstant): Don't emit boolean constant.
2734
2735         * expression.cs: Fold immediately LogicalAnd operators when both sides are
2736         constants.
2737
2738 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2739
2740         A fix for bug #361457
2741         * ecore.cs (IsApplicable): Params methods have lower priority.
2742
2743         * support.cs: Return correct parameter modifier for params types.
2744
2745 2008-02-18  Marek Safar  <marek.safar@gmail.com>
2746
2747         * generic.cs (TypeParameter): Cache attribute target name.
2748
2749         * support.cs: Removed unused variable.
2750
2751         * typemanager.cs: Removed debugging leftover.
2752
2753         * ecore.cs: Use local type instead of a property;
2754
2755         * class.cs (VerifyMembers): Consider also parent to test whether type member
2756         is local or public.
2757
2758         * expression.cs (FullMethodDesc): Removed.
2759
2760         * attribute.cs (IsValidArgumentType): Made static.
2761
2762 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
2763
2764         Cleanup to be more readable.
2765         * Makefile (GMCS_PROFILE): Remove.
2766         (COMPILER_NAME): New helper.
2767
2768 2008-02-15  Miguel de Icaza  <miguel@novell.com>
2769
2770         * cs-tokenizer.cs: if a conditional expression happens inside a
2771         (...) this also means that we do not need to de-ambiguate between
2772         an parenthesized expression and a cast.
2773
2774         Fixes 346484.
2775
2776         * constant.cs (SideEffectConstant): a constant value that happens
2777         to have a side effect.
2778
2779         Fixes the build regressions introduced by the fix for #359789
2780
2781 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
2782
2783         * expression.cs (Conditional.Emit): when emitting the ternary
2784         operator, use local variables to generate code verifiable code.
2785
2786         The verifier cannot infer that the type on stack before the
2787         stloc.0 is executed is of type ParentB. This happens because the
2788         stack merge algorithm uses only parent types when deciding which
2789         is the common type.  This is described in Part III 1.8.1.3 of ECMA
2790         335.
2791
2792         This code compiled with mcs is not verifiable under MS. The MS
2793         verifier picks the first common interface of Foo and Bar, which is
2794         wrong, but doesn't use a full join type of the 2 interfaces.
2795
2796         CSC uses a clever hack to compile such code in a verifiable
2797         way. It stores the intermediate values in a local variable with
2798         the expected type.
2799
2800         Fixes: #358102
2801
2802 2008-02-14  Miguel de Icaza  <miguel@novell.com>
2803
2804         * expression.cs: Do not fold BitwiseAnd operators when the left
2805         side is a false constant, because we still need to evaluate the
2806         right-hand side.
2807
2808         Fixes #359789
2809
2810         * support.cs: Instead of throwing an InternalErrorException when
2811         the position of the stream is outside the boundary of our buffer,
2812         reset the state of the reader, and restart the reading from the
2813         beginning of the file.
2814
2815 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2816
2817         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
2818
2819 2008-02-14  Marek Safar  <marek.safar@gmail.com>
2820
2821         A fix for bug #361686
2822         * decl.cs: A protected types used inside a private class which parents
2823         derives from the protected class are accessible.
2824
2825 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2826
2827         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
2828         the parameterless constructor.
2829
2830 2008-02-13  Marek Safar  <marek.safar@gmail.com>
2831
2832         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
2833         lookup methods to use standard member cache when doing member lookup.
2834
2835 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2836
2837         * driver.cs: Don't report full path for referenced module as assembly error.
2838
2839 2008-02-12  Marek Safar  <marek.safar@gmail.com>
2840
2841         * Makefile: Fixed `qh' target to work on all machines.
2842
2843         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
2844         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
2845         and HasElementType with TypeManager implementation.
2846
2847 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2848
2849         A fix for bugs #325134, #359749
2850         * expression.cs, ecore.cs: Try to resolve an extension method even if the
2851         first binds point to non-method member expression.
2852
2853 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2854
2855         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
2856
2857 2008-02-08  Marek Safar  <marek.safar@gmail.com>
2858
2859         A fix for bugs #321394, #323028
2860         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
2861         Reworked naive IsAccessibleAs implementation to handle nested types.
2862
2863 2008-02-05  Jb Evain  <jbevain@novell.com>
2864
2865         * class.cs: use generic type comparison for parameters
2866         as well.
2867
2868 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2869
2870         A fix for bug #325372
2871         * class.cs: Use generic type comparison when testing method signatures.
2872
2873 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2874
2875         A fix for bug #357047
2876         * ecore.cs: Applied C# 3.0 changes to better conversion.
2877
2878 2008-02-05  Marek Safar  <marek.safar@gmail.com>
2879
2880         A fix for bug #358374
2881         * cs-parser.jay: Correctly set modifiers for all constructor types.
2882
2883 2008-02-04  Marek Safar  <marek.safar@gmail.com>
2884
2885         A fix for bug #355251
2886         * generic.cs: Added base class constraint based type inference.
2887
2888 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2889
2890         A fix for bug #357255
2891         * decl.cs: One more missing visibility check.
2892
2893 2008-02-01  Marek Safar  <marek.safar@gmail.com>
2894
2895         * support.cs: Fixed broken return.
2896
2897 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2898
2899         * report.cs: Correctly reset warnings count after probing.
2900
2901 2008-01-25  Martin Baulig  <martin@ximian.com>
2902
2903         * namespace.cs
2904         (NamespaceEntry.SymbolFileID): Make this work again after
2905         MemberName.ToString() is gone.
2906
2907 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2908
2909         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
2910         expressions.
2911
2912 2008-01-25  Marek Safar  <marek.safar@gmail.com>
2913
2914         * generic.cs: Use full implicit conversion for type inference fixing.
2915
2916 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2917
2918         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
2919         Fixed user operator conversions.
2920
2921 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2922
2923         * generic.cs: Do nullable type to null comparison optimization during
2924         resolve phase.
2925
2926 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2927
2928         A fix for bug #355163
2929         * generic.cs: Enabled l-value resolve on nullable expressions.
2930
2931 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2932
2933         A fix for bug #353986
2934         * class.cs: Ingore static ctors with parameters for any further checks.
2935
2936 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2937
2938         A fix for bug #354310
2939         * namespace.cs: Removed redundant check.
2940
2941 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2942
2943         A fix for bug #354928
2944         * expression.cs: ElementInitializers can be resolved only once.
2945
2946 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2947
2948         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
2949         Condition expressions.
2950
2951 2008-01-23  Marek Safar  <marek.safar@gmail.com>
2952
2953         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
2954
2955 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2956
2957         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
2958         not allowed.
2959
2960         * generic.cs: Implemented coalesce expression.
2961
2962 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2963
2964         A fix for bug #355145
2965         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
2966         expression tree type inference.
2967
2968 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
2969
2970         Fix #354663
2971         * expression.cs (Binary.IsUnsignedType): Fix typo.
2972
2973 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2974
2975         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
2976
2977 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2978
2979         A fix for bug #355161
2980         * ecore.cs, expression.cs: Wider range of extension method supported
2981         expressions.
2982
2983 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
2984
2985         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
2986         AssemblyBuilder to operate in compiler context. Fixes mcs part of
2987         bug #354970.
2988
2989 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2990
2991         A fix for bug #355148
2992         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
2993
2994 2008-01-22  Miguel de Icaza  <miguel@novell.com>
2995
2996         * expression.cs (CreateExpressionTree): Add support for or and
2997         logical or, and indent following the coding conventions.
2998
2999         * typemanager.cs (LinqExpression): renamed from
3000         ExpressionTreeManager, for a shorter name.
3001
3002         Use TypeManager.CoreLookupType to lookup types from our core
3003         assemblies and turn those into "Type" variables.
3004
3005         Consumers that previously used "Namespace" and "Type" from this
3006         class should instead use the TypeExpression which is a type that
3007         is fully resolved (without involving the regular C# resolution
3008         rules). 
3009
3010         This typically looks like this:
3011
3012         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3013         new MemberAccess (texpr, name, type_arguments, loc)
3014
3015         This avoids the problem in: #355178
3016
3017 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3018
3019         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3020         feature in parser only as we do in other cases.
3021         
3022 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3023
3024         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3025         typemanager.cs: A refactoring of params arguments to reuse existing
3026         expressions (params -> array initializer) to emit params argument instead
3027         of specialized handling.
3028         It was required by expression tree implementation and it has other benefits
3029         as well, we now apply same optimization for params arguments as we do for
3030         array initializers.
3031         
3032 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3033
3034         A fix for bug #353526
3035         * generic.cs: A type inference of params arguments may not required any
3036         temporary array creation.
3037         
3038 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3039
3040         A fix for bug #353534
3041         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3042         supported for delegates only.
3043         
3044 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3045
3046         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3047         type for more than 1 candidates.
3048         
3049 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3050
3051         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3052         expressions.
3053         
3054 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3055
3056         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3057         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3058         operator) expressions. 
3059                 
3060 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3061
3062         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3063         not accessed from the generated IL.
3064
3065 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3066
3067         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3068         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3069         statement.cs: The first expression tree implementation drop, mostly
3070         infrastructure work.
3071
3072 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3073
3074         * ecore.cs (IsNestedChild): Refactored.
3075
3076 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3077
3078         * lambda.cs: Don't use a cast on unknown expression statement.
3079
3080 2008-01-10  Geoff Norton  <gnorton@novell.com>
3081
3082         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3083         arguments
3084
3085 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3086
3087         * doc.cs: Report better /doc crash details.
3088         
3089 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3090
3091         A fix for bug #352536
3092         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3093
3094 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3095
3096         A fix for bug #352287
3097         * ecore.cs, expression.cs: Do `this' access checking in all member access
3098         expressions.
3099         
3100 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3101
3102         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3103         
3104         * report.cs: Reset message stacks.
3105         
3106 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3107
3108         * generic.cs (InferInPhases): Correctly calculate params position.
3109         
3110 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3111
3112         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3113         arguments.
3114
3115 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3116
3117         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3118         
3119         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3120         
3121         * driver.cs: Updated --help option.
3122         
3123 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3124
3125         * generic.cs (InferParamsTypeArguments): Removed.
3126         (InferInPhases): Add params type inference.
3127         (LowerBoundInference): Fixed scoring mechanism.
3128         
3129         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3130         
3131 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3132
3133         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3134         byte array for unsigned "baked" assemblies.
3135
3136 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3137
3138         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3139         array for assemblies that are not strongnamed.
3140
3141 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3142
3143         A fix for bug #351481
3144         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3145         declaring type for nested generic types.
3146         
3147 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3148
3149         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3150         instead of ToString.
3151         
3152 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3153
3154         A fix for bug #351047
3155         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3156         null and structs only when equality and inequality operators are defined
3157         either as an user-operators or predefined operators.
3158         
3159 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3160
3161         A fix for bug #351047
3162         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3163         
3164 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3165
3166         A fix for bug #351257
3167         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3168         
3169 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3170
3171         A fix for bug #351157
3172         * class.cs (Using): Fixed yet another broken cloning.
3173         
3174         (Block): Put back more sensible default value for statements.
3175         
3176 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3177
3178         * codegen.cs: Allow AssemblyVersion with only major version component.
3179         Fixes bug #351055.
3180
3181 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3182
3183         A fix for bug #324654
3184         * class.cs: Use FullName property as member name.
3185
3186 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3187
3188         A fix for bug #342117
3189         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3190         constructor constraint.
3191
3192 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3193
3194         A fix for bug #338273
3195         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3196         only.
3197
3198 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3199
3200         A fix for bug #350839
3201         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3202
3203 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3204
3205         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3206         GHOP:
3207         
3208         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3209
3210         * statement.cs: Changed some Hashtables to use HybridDictionaries
3211         instead. It was observed that some HashTables only contained a few
3212         items in the vast majority of cases. Since HybridDictionary is
3213         more efficient on small sets (<10 elements), "known_variables"
3214         from class ExplicitBlock as well as "labels" and "constants " from
3215         class Block were changed to HybridDictionaries. 
3216
3217         Atsai results: (56216kb->54987kb)
3218
3219         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3220
3221
3222 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3223
3224         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3225         GHOP:
3226         
3227         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3228         
3229         * expression.cs: foreach loop to for loop, saved on allocation of
3230         enumerator (59333kb->59141kb)
3231
3232         * statement.cs. Changed foreach loops to for loops, saved on
3233         allocation of enumerator (59141kb->59006kb)
3234
3235         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3236         when constructed with no specified capacity. This was causing a
3237         few ArrayLists to allocate more memory than they would potentially
3238         need in the Block class and MemberCache class. Setting the
3239         ArrayLists to construct with a capacity of 1 saves some
3240         memory. (56216kb->55585kb)
3241
3242 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3243
3244         A fix for bug #347189 (2nd issue)
3245         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3246         type.
3247
3248 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3249         
3250         * report.cs: Do not use colors if stdout and stderr are not a
3251         terminal.
3252
3253 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3254
3255         A fix for bug #346998
3256         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3257         overloads.
3258
3259 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3260
3261         A fix for bug #343465
3262         * class.cs: Explicit method name for nested types uses dots only.
3263
3264 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3265
3266         A fix for bug #343707
3267         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3268
3269 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3270
3271         * ecore.cs: Report type inference errors only when arguments count matches
3272         parameter count.
3273         
3274         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3275         
3276         * expression.cs, report.cs: New warning.
3277         
3278         * typemanager.cs: Catch anonymous method type too.
3279
3280 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3281
3282         A fix for bug #346379
3283         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3284
3285 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3286
3287         A fix for bug #347359
3288         * expression.cs (Invocation): Don't resolve already resolved expression.
3289
3290 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3291
3292         A fix for bug #347189
3293         * class.cs (FixedField): Use non-dependent code only in the define phase.
3294
3295 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3296
3297         A fix for bug #348076
3298         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
3299
3300 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3301
3302         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
3303         discovered extension methods.
3304
3305 2007-12-22  Marek Safar  <marek.safar@gmail.com>
3306
3307         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
3308         method.
3309
3310 2007-12-21  Miguel de Icaza  <miguel@novell.com>
3311
3312         * report.cs (ErrorMessage): Add support for using colors on
3313         terminals that support it. 
3314
3315 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3316
3317         * ecore.cs: Use information about expanded params for error reporting.
3318
3319 2007-12-21  Marek Safar  <marek.safar@gmail.com>
3320
3321         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
3322         and logic for params overloads.
3323         
3324 2007-12-15  Miguel de Icaza  <miguel@novell.com>
3325
3326         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
3327         as this is also created from the parser.  Fixes #349034
3328
3329 2007-12-12  Miguel de Icaza  <miguel@novell.com>
3330
3331         * statement.cs (Throw.CloneTo): it is valid to have empty
3332         expressions for throw. 
3333
3334 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3335
3336         * cs-parser.jay: Set delegate constraint parsing region correctly.
3337
3338 2007-12-03  Marek Safar  <marek.safar@gmail.com>
3339
3340         A fix for bug #345467
3341         * typemanager.cs (IsEqual): Compare generic parameters position only.
3342         
3343 2007-11-28  Marek Safar  <marek.safar@gmail.com>
3344
3345         * expression.cs (BaseAccess): Type arguments can be null.
3346
3347 2007-11-27  Raja R Harinath  <harinath@gmail.com>
3348
3349         * statement.cs (Block.Resolve): Ensure flow-branching tree is
3350         consistent even when an error has occured.
3351         (Switch.Resolve): Likewise.
3352
3353 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3354
3355         A fix for bug #334505
3356         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
3357         overrides.
3358         
3359 2007-11-22  Marek Safar  <marek.safar@gmail.com>
3360
3361         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
3362         refactorings required to resolve extension methods correctly when mixing
3363         generics and non-generics members.
3364         
3365 2007-11-20  Marek Safar  <marek.safar@gmail.com>
3366
3367         A fix for bug #342584
3368         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
3369         conversion.
3370         
3371 2007-11-19  Marek Safar  <marek.safar@gmail.com>
3372
3373         A fix for bug #342512
3374         * delegate.cs: Use delegate argument expression when is available. Don't
3375         emit virtual call when class is sealed.
3376         
3377 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3378
3379         A fix for bug #325423
3380         * assign.cs (FieldInitializer): Use resolved expression for emit.
3381         
3382         * class.cs: Print less confusing error message.
3383         
3384 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3385
3386         * cs-tokenizer.cs: Removed GMCS ifdefs.
3387         
3388         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
3389         mcs.
3390         
3391         * cs-parser.jay: Disabled nullable check.
3392         
3393         * generic-mcs: Copied more generic stuff.
3394                 
3395 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3396
3397         * gcs-parser.jay: Merged to cs-parser.jay.
3398         
3399         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
3400         * *.csproj, *.sources: Updated to use only jay parser file.
3401
3402 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3403
3404         * gcs-parser.jay: Added nullable and default expression feature checks.
3405         
3406 2007-11-16  Marek Safar  <marek.safar@gmail.com>
3407
3408         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
3409         it fixes many TODOs and hidden bugs.
3410         
3411         * expression: Removed duplicate error check.
3412
3413 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3414
3415         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
3416         implicitly type local variable only when it is used in a declaration.
3417
3418 2007-11-15  Marek Safar  <marek.safar@gmail.com>
3419
3420         * attribute.cs: Use CS0612 for empty strings.
3421
3422 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3423
3424         * lambda.cs, statement.cs: Contextual return may act as a statement.
3425
3426 2007-11-14  Marek Safar  <marek.safar@gmail.com>
3427
3428         A fix for a regression cause by #324222
3429         * class.cs: Don't report unused even when it implements an interface.
3430         
3431 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3432
3433         A fix for bug #341205
3434         * ecore.cs, expression.cs: Method group expression cannot do static
3435         method access with an instance reference check before overloading takes
3436         a place.
3437         
3438 2007-11-13  Marek Safar  <marek.safar@gmail.com>
3439
3440         A fix for bug #325359
3441         * class.cs: Use predictable name for automatically generated property.
3442         
3443 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3444
3445         A fix for bug #324996
3446         * expression.cs (Is): Handle case where D is nullable and T is not
3447         correctly.
3448         
3449         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
3450         
3451 2007-11-12  Marek Safar  <marek.safar@gmail.com>
3452
3453         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
3454         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
3455         Flush small error reporting changes.
3456         
3457 2007-11-09  Marek Safar  <marek.safar@gmail.com>
3458
3459         A fix for bug #324996
3460         * expression.cs: Rewrote Is expression implementation to work with
3461         generics, nullable types, anonymous method. A const result expression 
3462         uses existing infrastructure instead of custom not fully-featured one.
3463         
3464 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3465
3466         A fix for bug #340202
3467         * class.cs: Consider generics for volatile field.
3468
3469 2007-11-08  Marek Safar  <marek.safar@gmail.com>
3470
3471         A fix for bug #335594
3472         * expression.cs: Use conversion rules when handling string addition.
3473         
3474 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3475
3476         A fix for bug #336651
3477         * expression.cs: Fixed a crash when probing is on.
3478         
3479 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3480
3481         A fix for bug #324242
3482         * covert.cs: Added a conversion from any nullable-type with an 
3483         underlying enum-type to the type System.Enum.
3484         
3485 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3486
3487         A fix for bug #324222
3488         * class.cs: Report all non-used event fields.
3489         
3490 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3491
3492         A fix for bug #325161
3493         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
3494         qualifier for generic types.
3495         
3496 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3497
3498         A fix for bug #322971
3499         * expression.cs, ecore.cs: Added intermediate result value check for
3500         indexers. 
3501         
3502 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3503
3504         A fix for bug #324754
3505         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
3506         when it was requested.
3507
3508 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3509
3510         A fix for bug #325101
3511         * expression.cs: Do type not value comparison for `is' expression.
3512
3513 2007-11-07  Marek Safar  <marek.safar@gmail.com>
3514
3515         A fix for bug #320236
3516         * convert.cs: Don't apply user conversion on underlying target type.
3517
3518 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3519
3520         * expression.cs: Don't use unresolved expression for error reporting.
3521  
3522 2007-11-06  Marek Safar  <marek.safar@gmail.com>
3523
3524         A fix for bugs #337712, #324490
3525         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
3526         overloading resolution too.
3527         
3528         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
3529         the process consistent and more robust.
3530         
3531         * expression.cs, linq.cs, report.cs: Update.
3532
3533 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3534
3535         A fix for bug #332909
3536         * attribute.cs: Resolve attributes in correct context using error
3537         handling procedure.
3538         
3539         * rootcontext.cs: Define Obsolete attribute members as core members.
3540         
3541 2007-11-02  Marek Safar  <marek.safar@gmail.com>
3542
3543         * statement.cs: Removed unused methods.
3544         
3545 2007-10-31  Wade Berrier  <wberrier@novell.com>
3546
3547         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
3548         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
3549         during 'make dist')
3550
3551 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3552
3553         A fix for bug #338102
3554         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
3555         methods registered as non-generics.
3556         
3557 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3558
3559         A fix for bugs #337712, #324490
3560         * delegate.cs: Delegate covariance and contravariance is not allowed for
3561         value types.
3562         
3563 2007-10-31  Marek Safar  <marek.safar@gmail.com>
3564
3565         A fix for bug #337719 
3566         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
3567         `from' keyword.
3568         
3569 2007-10-30  Marek Safar  <marek.safar@gmail.com>
3570  
3571         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
3572
3573 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3574  
3575         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
3576         query expressions.
3577
3578 2007-10-29  Raja R Harinath  <rharinath@novell.com>
3579
3580         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
3581
3582 2007-10-29  Marek Safar  <marek.safar@gmail.com>
3583  
3584         A fix for bug #334652
3585         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
3586         extension methods when we have not found the best candidate in normal
3587         container.
3588
3589 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3590
3591         * AssemblyInfo.cs: Keep up-to-date.
3592
3593 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3594
3595         * Makefile: Fixed generics compiler name.
3596         
3597 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3598
3599         * lambda.test: removed, lambda parsing is done differently.
3600         
3601         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
3602
3603 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
3604
3605         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
3606
3607 2007-10-27  Marek Safar  <marek.safar@gmail.com>
3608
3609         * Makefile, *.sources : All C# compilers are in mcs folder.
3610         
3611         * *.cs: Use existing 2_1 define for smcs.
3612
3613 2007-10-26  Marek Safar  <marek.safar@gmail.com>
3614
3615         A fix for bug #335847
3616         * assign.cs, expression.cs: Couple of changes to avoid creating a
3617         temporary variable for each object initializer assignment statement. It
3618         simplifies struct initialization too, otherwise two temporary variables
3619         would be required.
3620         Implemented optimization of redundant default element initializers.
3621         
3622 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3623
3624         A fix for bug #336766
3625         * expression.cs (Class.CheckBase): Use generic name when method is
3626         generic.
3627         
3628 2007-10-25  Marek Safar  <marek.safar@gmail.com>
3629
3630         A fix for bug #334737
3631         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
3632         variable and not variable argument for prepared copies.
3633
3634 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3635
3636         A fix for bug #325110
3637         * class.cs, expression.cs, attribute.cs: Use open generic method when
3638         checking conditional attribute.
3639         
3640 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3641
3642         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
3643         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
3644         FeatureIsNotAvailable.
3645
3646 2007-10-24  Marek Safar  <marek.safar@gmail.com>
3647
3648         ** C# 3.0 Partial methods
3649         
3650         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
3651         methods support. Because of member cache issue with generics only
3652         non-generics partial methods are fully supported.
3653         
3654 2007-10-23  Marek Safar  <marek.safar@gmail.com>
3655         
3656         * class.cs, decl.cs: Rewrote member overloads check to cope with 
3657         generics and to use member cache for member checking. It also improves
3658         performance and fixes remaining overloads issues.
3659         
3660 2007-10-20  Marek Safar  <marek.safar@gmail.com>
3661         
3662         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
3663         roottypes.cs, typemanager.cs:
3664                 
3665         A member cache creation logic changed to add members immediately and
3666         not rely on fallback. The member cache is now only prefered way
3667         how to access and find type declaration members. It saves 5 MB of memory
3668         during MWF compilation and makes code ready for more optimizations and
3669         clean-ups, it's also a pre-requirement for partial methods.
3670         
3671 2007-10-18  Raja R Harinath  <harinath@gmail.com>
3672
3673         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
3674         handling for generic parameters.
3675
3676 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3677         
3678         * class.cs (FixedField): Removed redundant volatile check.
3679         
3680 2007-10-15  Marek Safar  <marek.safar@gmail.com>
3681         
3682         * class.cs, decl.cs: Fixed overload members verification to do only one
3683         check per possible collision.
3684         
3685 2007-10-13  Marek Safar  <marek.safar@gmail.com>
3686         
3687         A fix for bug #325478
3688         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
3689         and create only one disposable flags container.
3690         
3691 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3692         
3693         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
3694         * statement.cs (Fixed): Fixed variables cloning.
3695         
3696 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3697         
3698         A fix for bug #333342
3699         * class.cs (EventField): Don't mark value type event as synchronized. 
3700         
3701 2007-10-12  Marek Safar  <marek.safar@gmail.com>
3702         
3703         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
3704         inference to identify best candidate method correctly.
3705         (ProperyExpr): A range variable is read only and cannot be modified.
3706         
3707 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3708         
3709         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
3710         logic to identify best candidate method correctly.
3711         
3712 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3713         
3714         * location.cs (Equals, GetHashCode): Removed.
3715         
3716 2007-10-11  Marek Safar  <marek.safar@gmail.com>
3717         
3718         * report.cs: Implemented message recorder. It is used mainly for lambda
3719         expressions to capture otherwise swallowed error messages.
3720         
3721         * anonymous.cs, lambda.cs.cs: Do full parameters check.
3722
3723         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
3724         and not at the top.
3725         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
3726                 
3727         * expression.cs (MemberAccess): Always report lookup failure.
3728         
3729         * location.cs: Implemented Equals, GetHashCode.
3730         
3731         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
3732         
3733 2007-10-10  Jb Evain  <jbevain@novell.com>
3734
3735         * codegen.cs: re-enable assembly version check.
3736
3737 2007-10-09  Marek Safar  <marek.safar@gmail.com>
3738         
3739         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
3740         checks.
3741         
3742         * namespace.cs (UsingAlias): Do correct version check.
3743         
3744 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3745         
3746         * expresison.cs, ecore.cs: Issue extension method error message when
3747         appropriate.
3748         
3749         * rootcontext.cs: Added ISO_2 compiler mode option.
3750
3751 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3752         
3753         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
3754          message.
3755         
3756 2007-10-08  Marek Safar  <marek.safar@gmail.com>
3757         
3758         * attribute.cs (GetString, GetBoolean): Work with both literal and
3759         constant.
3760         
3761         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
3762         Moved method overload specific methods to MethodGroupExpr.
3763         
3764         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
3765         it should be less memory consuming.
3766         
3767 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
3768
3769         * codegen.cs: remove the assembly version check until the buildbot is
3770         fixed.
3771
3772 2007-10-07  Jb Evain  <jbevain@novell.com>
3773
3774         * attribute.cs (Attribute.GetString): if the value
3775         expression is a StringConstant, return its string value.
3776
3777 2007-10-07  Jb Evain  <jbevain@novell.com>
3778
3779         * typemanager.cs: add `assembly_version_attribute_type`.
3780         * codegen.cs: on attribute emission, check that the
3781         AssemblyVersionAttribute doesn't overflow.
3782
3783 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3784         
3785         A fix for bug #324677
3786         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
3787         parent container of a scope container with currently resolved one. 
3788         
3789 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3790         
3791         A fix for bug #325534
3792         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
3793         only.
3794         
3795 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3796         
3797         A fix for bug #327504
3798         * class.cs (Operator.Define): Refactored implicit and explicit user
3799         operator conversion rules.
3800         
3801 2007-10-05  Marek Safar  <marek.safar@gmail.com>
3802         
3803         A fix for bug #327520
3804         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
3805         
3806 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3807         
3808         A fix for bug #328022
3809         * class.cs (MethodData.Define): Use correct method to check whether
3810         a method implementents an accessor.
3811         
3812 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3813         
3814         A fix for bug #330069
3815         * statement.cs (Fixed.Resolve): Read the first array element only when
3816         an array is instantiated. 
3817         
3818 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3819         
3820         * expression.cs, assign.cs, generics.cs: Print correct operator when
3821         compound assignment is used.
3822         
3823 2007-10-04  Marek Safar  <marek.safar@gmail.com>
3824         
3825         A fix for bug #325841
3826         * expression.cs (ArrayAccess): Use full argument cloning only for
3827         string compound concatenation.
3828         
3829 2007-10-03  Marek Safar  <marek.safar@gmail.com>
3830         
3831         A fix for bug #328774
3832         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
3833         assignment.
3834         (PropertyExpr.EmitAssign): Fixed string concatenation compound
3835         assignment.
3836
3837 2007-10-03  Raja R Harinath  <rharinath@novell.com>
3838
3839         Fix #328490
3840         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
3841         Event accessibility checks here.  Remove some bogus code that
3842         accidently made GenericMethods work.
3843         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
3844
3845 2007-09-25  Marek Safar  <marek.safar@gmail.com>
3846         
3847         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
3848         
3849         * statement.cs (Block): Refactored AddVariable to allow error handling
3850         customization.
3851         
3852         * generic.cs: New stub.
3853         
3854 2007-09-23  Marek Safar  <marek.safar@gmail.com>
3855         
3856         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
3857         flag.
3858         
3859 2007-09-17  Marek Safar  <marek.safar@gmail.com>
3860
3861         * class.cs: Use partial container to record whether any partial part
3862         contains static field initializer and therefore default contructor has
3863         to be defined.
3864         
3865 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3866
3867         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
3868         mono-list when only one of two partial parts has defined accessibility
3869         modifier.
3870         
3871 2007-09-14  Marek Safar  <marek.safar@gmail.com>
3872
3873         A fix for bug #82845
3874         
3875         * class.cs (TypeContainer): Set correct resolve context for all field
3876         initializers.
3877         
3878 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3879
3880         * assign.cs: Fixed a crash when field is resolved twice with an error.
3881         
3882         * codegen.cs: Changed InFieldInitializer to be flag.
3883         
3884         * anonymous.cs, ecore.cs, expression.cs: Update after
3885         IsInFieldInitializer rename.
3886         
3887         * const.cs: Removed unused parameter.
3888         
3889         * class.cs: Changed the way how we resolve and emit field initializers.
3890         The field initilizers have to have access to contructor block to emit
3891         compiler generated code.
3892
3893 2007-09-13  Marek Safar  <marek.safar@gmail.com>
3894
3895         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
3896         generics use TypeContainer instead.
3897         
3898 2007-09-12  Marek Safar  <marek.safar@gmail.com>
3899         
3900         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
3901
3902         * lambda.cs (ResolveParameters): Use more powerful
3903         InflateGenericArgument.
3904         
3905         * parameters.cs: Better exception message.
3906                 
3907 2007-09-10  Marek Safar  <marek.safar@gmail.com>
3908
3909         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
3910         correct expression block type. 
3911         
3912         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
3913         
3914         * expression.cs (Invocation): Extracted method group resolve to
3915         DoResolveOverload.
3916         
3917 2007-09-07  Marek Safar  <marek.safar@gmail.com>
3918
3919         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
3920         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
3921         
3922         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
3923         generic extension methods.
3924
3925 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3926
3927         A fix for bug #82676 (Do I get it right now?)
3928         * convert.cs (Binary.ResolveOperator): An interface is converted to the
3929         object before a standard conversion is applied.
3930         
3931 2007-09-06  Marek Safar  <marek.safar@gmail.com>
3932
3933         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
3934         #82676.
3935         
3936 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3937
3938         A fix for bug #82676
3939         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
3940         non-generic interface types.
3941         
3942 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3943
3944         A fix for bug #82690
3945         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
3946         
3947 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3948
3949         A fix for bug #82571
3950         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
3951         modifier for container based methods.
3952         
3953 2007-09-05  Marek Safar  <marek.safar@gmail.com>
3954
3955         A fix for bug #82676
3956         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
3957         any interface-type T means to any of interface type T.
3958
3959 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3960
3961         * namespace.cs: We have 2 versions of System.Core assembly.
3962
3963 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3964
3965         A fix for bug #82652
3966         * class.cs (Class.GetClassBases): Compare types and not expressions.
3967
3968 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3969
3970         A fix for bug #82620
3971         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
3972         actually never worked before.
3973         (IndexerAccess): Emit prepared arguments before they are modified.
3974         
3975 2007-09-04  Marek Safar  <marek.safar@gmail.com>
3976
3977         A fix for bug #82563
3978         * assign.cs: Revert wrong fix.
3979         
3980         * expression.cs (VariableReference.EmitAssign): Handle ref reference
3981         correctly.
3982         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
3983         Instead of ldelema/stdind we have to use temporary variables to handle
3984         cases like String.Concat (params string[]).
3985         
3986 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3987
3988         * class.cs: EmitAttributes to Emit rename.
3989         
3990         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
3991         null.
3992         (MemberCore.HasClsCompliantAttribute): Don't depend on 
3993         GetClsCompliantAttributeValue execution.
3994         
3995 2007-08-31  Marek Safar  <marek.safar@gmail.com>
3996
3997         * anonymous.cs: Use shorter type prefix.
3998         
3999         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4000         when exist.
4001         
4002         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4003         variables when probing is on.
4004         
4005         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4006         unresolved variables.
4007         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4008         handle transparent identifiers.
4009         
4010 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4011
4012         * attribute.cs (IsClsCompliant): Add nullable types test.
4013         
4014 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4015
4016         * doc.cs : catch other types of exception than XmlException to
4017           report CS1570. Fixed bug #82565.
4018
4019 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4020
4021         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4022         The number of delegate parameters has to match.
4023         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4024         arrays.
4025
4026 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4027
4028         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4029         to fix problem with private arguments.
4030
4031 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4032
4033         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4034         
4035         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4036         
4037         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4038         empty. Add cloning suport.
4039         
4040         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4041
4042 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4043
4044         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4045         to create EmptyCast. It handles EmptyConstantCast specialization for
4046         constants.
4047         
4048 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4049
4050         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4051         (EmitArrayArgument): One routine for array arguments.
4052         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4053         
4054 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4055
4056         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4057
4058 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4059
4060         * anonymous.cs: MemberLookupFinal update.
4061
4062         * class.cs (ConstructorInitializer): Is expression based.
4063         
4064         * delegate.cs: MethodGroupExpr update.
4065         
4066         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4067         messages.
4068         (Error_MemberLookupFailed): Customizable error override.
4069         (MethodGroupExpr): Keep queried type for later usage.
4070         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4071         resolve.
4072         
4073         * expression.cs: Error_MemberLookupFailed refactoring.
4074         (New.DoResolve): Resolve as much as possible.
4075         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4076         customization for invalid member types.
4077
4078         * statement.cs: MethodGroupExpr update.
4079         
4080 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4081
4082         * modifier.cs (Check): Check all modifiers and not only accessibility
4083         ones.
4084
4085 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4086
4087         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4088         type and not an expression.
4089
4090 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4091
4092         * statement.cs (Catch.Clone): Type and variable can be null.
4093
4094 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4095
4096         A fix for bug #81979
4097         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4098         I am really not sure whether this is the best fix.
4099         
4100         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4101         only once.
4102         
4103 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4104
4105         ** C# 3.0 Object and collection initializers (major re-write)
4106         
4107         * assign.cs (DoResolve): Initializers are not assign related.
4108         
4109         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4110         used during collection or object initialization.
4111         
4112         * expression.cs (Error_InvalidArguments): Add initializers specific
4113         messages. More will come later because it requires some general
4114         refactoring.
4115         (New.DoResolve): Better error handling for unsafe types.
4116         (EmptyExpressionStatement): New class.
4117         (ElementInitializer): An object initializer expression.
4118         (CollectionElementInitializer): A collection initializer expression.
4119         (CollectionOrObjectInitializers): A block of object or collection
4120         initializers.
4121         (NewInitialize): New expression with element/object initializers.
4122         
4123         * statement.cs: Reverted object/collection initializer hacks.
4124         
4125         * typemanager.cs (CSharpName): Filter __arglist type.
4126         
4127 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4128
4129         ** C# 3.0 Anonymous Types (update to the latest standard)
4130         
4131         * expression.cs (Binary.ResolveOperator): Threat all null based types
4132         same.
4133         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4134         (AnonymousTypeParameter): Updated.
4135         
4136         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4137         (AnonymousTypeClass): New anonymous type container.
4138         
4139         * class.cs (AddField): Return operation result.
4140         
4141         * generic.cs: Another empty TypeArguments overload.
4142         
4143         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4144         are stored at top of normal hierarchy.
4145         
4146         * typemanager.cs (CSharpName): Filter anonymous types.
4147         
4148 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4149
4150         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4151         as single Concat call. How could we miss that :-(
4152         
4153 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4154
4155         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4156         
4157 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4158
4159         * expression.cs: Fix the previous commit, the creation of the
4160         arguments array list needs also to be conditional on the arguments
4161         not being null.
4162
4163         * class.cs: Add a little bit of help to help narrow down problems.
4164
4165         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4166         not try to copy in that case. 
4167
4168         * driver.cs: When building SMCS, include a new different set of
4169         default assemblies here.   Do this here so we can control whether
4170         to include the default assemblies with /noconfig.
4171
4172 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4173
4174         A fix for bug #81979
4175         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4176         only.
4177
4178 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4179
4180         A fix for bug #82300
4181
4182         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4183         we are in probing scope.
4184
4185 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4186
4187         A fix for bug #82301
4188
4189         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4190         (Statement.CloneTo): Clone and not map children blocks.
4191
4192 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4193
4194         A fix for bug #82299
4195
4196         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4197         variable too.
4198         
4199         * statement.cs (Statement.CloneTo): Clone variables before statements
4200         to allow remaping of local variables.
4201
4202 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4203
4204         A fix for bug #82296
4205
4206         * anonymous.cs,
4207         * report.cs: Log crash details for future clone problems.
4208         
4209         * statement.cs (Return.Clone): Don't clone non-existent expression.
4210
4211 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4212
4213         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4214         (Class.AddBasesForPart): Move CS0537 check here from ...
4215         * cs-parser.jay (class_declaration): ... here.  Move calling of
4216         'AddBasesForPart' to ...
4217         (class_bases): ... here.
4218         (struct_declaration, interface_declaration): Update to changes.
4219
4220 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4221
4222         A fix for bug #81923
4223
4224         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4225         conversion is allowed.
4226
4227 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4228
4229         A fix for bug #81564
4230
4231         * ecore.cs (EventExpr): Add IsBase handling.
4232
4233         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4234         too.    
4235         
4236 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4237
4238         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4239         * cs-parser.jay: Some whitespace cleanups.
4240         (current_delegate): New.
4241         (type_name): New.
4242         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4243         a dummy code block, and use 'type_name' instead of 'member_name'.
4244         (interface_declaration, class_declaration): Likewise.
4245         (delegate_declaration): Likewise.  Rearrange slightly and use
4246         'current_delegate'.
4247         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4248         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4249
4250 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4251
4252         A fix for bug #82039
4253
4254         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4255         available.
4256
4257         * typemanager.cs (CSharpName): Split to string overload.
4258
4259 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4260
4261         * expression.cs,
4262         * report.cs: Updated warning CS0472.
4263
4264 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4265
4266         A fix for bug #82181
4267         * cs-parser.jay,
4268         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4269
4270 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4271
4272         A fix for bug #82277
4273         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4274
4275 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4276
4277         ** C# 3.0 Type Inference (major bits are working)
4278         
4279         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4280         (.ImplicitStandardConversionExists): Uses compatible.
4281         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4282         (.InferReturnType): New method.
4283         (.Compatible): Refactored.
4284         (.ResolveParameters): Uses factory to create resolved parameters.
4285         (.CompatibleMethod): Add probing mode support.
4286         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4287         clearly distinguish between 2 different operations.
4288         (LambdaMethod): Moved to lambda.cs.
4289         (AnonymousMethod): Removed unused fields and methods.
4290         (AnonymousDelegate): Simplified.
4291         
4292         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
4293         
4294         * convert. cs (ImplicitConversionStandard): Compatible works differently.
4295         
4296         * delegate.cs (Delegate): New mehods to reduce code duplication.
4297         (.GetConstructor): New method.
4298         (.GetInvokeMethod): New method.
4299         (DelegateCreation): Updated.
4300         
4301         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
4302         does not exist.
4303         (OverloadResolve): Made probing little bit faster.
4304         
4305         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
4306         when probing is on.
4307         
4308         * generic.cs (TypeInferenceContext): Dummy implementation.
4309         
4310         * iterators.cs: Updated after Resolve/Define rename.
4311         
4312         * lambda.cs (LambdaExpression)
4313         (.ResolveParameters): Handles both type of arguments and type inference too.
4314         
4315         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
4316         (InflateTypes): Updated.
4317         
4318         * support.cs (InflateTypes): Changed signature and updated.
4319         
4320         * typemanager.cs (LookupMemberCache): Better dynamic type check.
4321         (MemberLookup_FindMembers): More MS tricks.
4322         (GetParameterData): Ditto.
4323         (GetDelegateParameters): Uses quick path for dynamic types.
4324         
4325 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4326
4327         * class.cs (MethodData.Define): EmitContext is required for generic stuff
4328         only.
4329
4330 2007-07-31  Marek Safar  <marek.safar@gmail.com>
4331
4332         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
4333         syntax.
4334         
4335 2007-07-26  Jb Evain  <jbevain@novell.com>
4336
4337         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
4338         which takes a boolean 'report_errors', similar to the GetMethod.
4339         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
4340         in .net 2.1, do not report errors here.
4341
4342         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
4343         System.Runtime.CompilerServices.RequiredAttributeAttribute and
4344         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
4345         in .net 2.1.
4346
4347         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
4348         of the type InternalsVisibleToAttribute before the first call
4349         to CoreLookupType which is allowed to fail (third boolean parameter
4350         to true). Because, during the resolution for a type that is not
4351         immediately found, we try to check if the type is not defined in
4352         a friend assembly, and to do so, we need the
4353         InternalVisibleToAttribute.
4354
4355 2007-07-23  Miguel de Icaza  <miguel@novell.com>
4356
4357         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
4358         feature that allows structs to be compared against null and inline
4359         the result as true or false.
4360
4361         Notice that the same code is not permitted inside a generic block
4362         of code that would do:
4363
4364         class Foo<T> where T : struct {
4365             bool Eval (T x)
4366             {
4367                  return x == null;
4368             }
4369         }
4370
4371         It is only allowed if the type of T is not bound (no where
4372         clause).   In my opinion, this CSC 2 behavior is broken but people
4373         seem to be using it (IronRuby does, a few bug reports on bugzilla
4374         have it and some people have complained about it).
4375
4376         All of the users that depend on this behavior have code that is
4377         very likely broken. 
4378         
4379         * report.cs (Warning, Error): make these take object arguments,
4380         not strings, as that allows us to take advantage of Format.
4381
4382 2007-07-20  William Holmes  <billholmes54@gmail.com>
4383
4384         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
4385           Left member variable for the Count.
4386         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
4387           MemberName.CountTypeArguments to avoid a NRE. 
4388
4389         This code is contributed under the MIT X11 license
4390
4391 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4392
4393         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4394
4395 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4396
4397         * doc.cs : generic method arguments are written as ``x while generic
4398           type arguments are `x. Combined with the previous change, fixed bug
4399           #79706.
4400
4401 2007-07-18  Raja R Harinath  <rharinath@novell.com>
4402
4403         Fix #82120
4404         * expression.cs (Binary.ResolveOperator): When converting
4405         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
4406
4407 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
4408
4409         * doc.cs : when T: or whatever x: is specified, it does not really
4410           check the doc comment's syntax correctness. Fixed bug #82006.
4411
4412 2007-07-18  Marek Safar  <marek.safar@gmail.com>
4413
4414         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
4415         LambdaExpression better.
4416         
4417         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
4418         
4419         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
4420         
4421         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
4422         as it can be generated.
4423         
4424         * expression.cs (Invocation.Error_InvalidArguments): Show correct
4425         modifiers.
4426         
4427         * lambda.cs (LambdaExpression): Refactored to share same code with
4428         AnonymousMethodExpression.
4429         
4430 2007-07-17  Marek Safar  <marek.safar@gmail.com>
4431
4432         * anonymous.cs (MakeName): Include host name for easier debugging.
4433         (LambdaMethod): New class for lambda spcecific stuff.
4434         
4435         * attribute.cs: Set EmitContext return type.
4436
4437         * class.cs: Set EmitContext return type.
4438         
4439         * codegen.cs (EmitContext): Return type cannot be null to stop messing
4440         with null/void meaning.
4441         
4442         * iterators.cs (ContainerType): Implemented.
4443         
4444         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
4445         
4446         * statement.cs (Return): Updated to lambda expressions.
4447         (Block.CloneTo): Parent can be null.
4448                 
4449 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4450
4451         A fix for bug #81917
4452         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
4453         
4454         * class.cs (FixedField): Check whether field is in unsafe scope.
4455
4456         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
4457         (FieldExpr.Emit): Fixed buffers cannot be volatile.
4458
4459         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
4460         FieldExpr.
4461         
4462         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
4463                 
4464 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4465
4466         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
4467         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
4468         from Report class.
4469
4470 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4471
4472         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
4473         
4474 2007-07-13  Marek Safar  <marek.safar@gmail.com>
4475
4476         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
4477         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
4478         
4479         * codegen.cs(EmitContext): Add ProbingMode flag.
4480         
4481         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
4482         
4483         * driver.cs: For now set both warning values.
4484         
4485         * ecore.cs (SimpleName): Name is readonly.
4486         (MethodGroup.OverloadResolve): One quick path for probing.
4487         
4488         * expression.cs (Unary): Set Oper r/o.
4489         (Binary): Set Oper r/o.
4490         (ParameterReference): Set few instance variables as r/o.
4491         (ParameterReference.DoResolveBase): Don't capture aruments when 
4492         the probing is on.
4493         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
4494         (Arglist): arguments are private.
4495         (SizeOf): type is private and r/o.
4496         (MemberAccess): arguments are private.
4497
4498         * report.cs: Enhanced reporting on/off capabilities.
4499         
4500         * lambda.cs: Uses ec.IsInProbingMode.
4501         (ContextualReturn): Derives from return.
4502         
4503         * rootcontext.cs: For now set both warning values.
4504         
4505         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
4506         copy if one exists.
4507         (Return.Resolve): Don't die immediately.
4508         (Block.Resolve): Speed-up probing.
4509         (Block.CloneTo): Clone only child blocks.
4510
4511 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
4512
4513         * iterators.cs: reverted Miguel's latest change (r81925) as it
4514         breaks the build in System.
4515
4516 2007-07-13  Miguel de Icaza  <miguel@novell.com>
4517
4518         * iterators.cs (Yield.CheckContext): Check for the iterator type
4519         also here as we can call into Yield even in codepaths that are not
4520         directly checked by
4521         (MethodOrOperator is the only path that was checked).
4522
4523         In addition to the standard check, use a more specific check for
4524         constructors to report a more verbose error. 
4525
4526 2007-07-12  Miguel de Icaza  <miguel@novell.com>
4527
4528         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
4529         report the warning and continue 
4530
4531         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
4532         values on the stack on the call to Emit.   Use EmitStatement if
4533         possible, or using Emit + Pop if not possible.   Fixes #82064
4534
4535 2007-07-12  Raja R Harinath  <rharinath@novell.com>
4536
4537         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
4538         avoid try...finally in some cases.
4539
4540 2007-07-10  Marek Safar  <marek.safar@gmail.com>
4541
4542         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
4543         
4544         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
4545         instead of method. Re-use standard error handling.
4546         (ConstructorInitializer.Emit): Simplified.
4547         
4548         * delegate.cs: Updated after Invocation.EmitCall change.
4549         
4550         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
4551         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
4552         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
4553         method and don't permanently changing input arguments.
4554         (MethodGroupExpr): Introduced resolved best_candidate, when method group
4555         is resolved it has one of the candidates is the best one which is later
4556         used to emit. Removed a few unused method.
4557         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
4558
4559         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
4560         (Binary.ResolveOperator): Ditto.
4561         (ConditionalLogicalOperator.DoResolve): Ditto.
4562         (Invocation): Uses method group.
4563         (Invocation.DoResolve): Simplified.
4564         (Invocation.EmitCall): Removed useless is_static.
4565         (Invocation.Emit): Delegate to method group.
4566         (Invocation.EmitStatement): Simplified.
4567         (New): Uses method group.
4568         (MemberAccess.DoResolve): Don't destroy original expression.
4569         
4570         * statement.cs (ForEach.Resolve): Use null for no method arguments.
4571         
4572 2007-07-04  Marek Safar  <marek.safar@gmail.com>
4573
4574         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
4575         
4576         * anonymous.cs,
4577         * lambda.cs: Add custom error message type.
4578
4579 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4580
4581         * lambda.cs: Simplified little bit.
4582         
4583         * parameter.cs: Introduced ImplicitLambdaParameter.
4584         (Parameters.CreateFullyResolved): New factory instead of ctor.
4585         
4586         * anonymous.cs,
4587         * class.cs,
4588         * delegate.cs: Updated parameter creation.
4589         
4590 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4591
4592         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
4593         arguments.
4594         
4595         * generic.cs: Synchronized with gmcs.
4596         
4597 2007-07-03  Marek Safar  <marek.safar@gmail.com>
4598
4599         * class.cs (Indexer): Check return type as soon as possible.
4600         
4601         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
4602         members too.
4603         
4604         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
4605         
4606         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
4607         
4608         * parameter.cs (Parameter): Use expression type when it is available.
4609         
4610         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
4611         method modifier for the first parameter only.
4612
4613 2007-06-24  Marek Safar  <marek.safar@gmail.com>
4614
4615         A fix for bug #81938
4616         * typemanager.cs (ChangeType): Fixed couple of char conversions.
4617         
4618         * constant.cs: Tide up an exception message.
4619
4620 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4621
4622         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
4623         an uninitialized variable is used.
4624         
4625         * expression.cs (LocalVariableReference.DoResolve): Ditto.
4626
4627 2007-06-22  Marek Safar  <marek.safar@gmail.com>
4628
4629         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
4630         not found error handling.
4631
4632         * expression.cs (ArrayCreation): Removed redundant fields and little bit
4633         simplified.
4634         (ArrayCreation.ResolveArrayElement): To be ready to customization.
4635         (ArrayCreation.DoResolve): Simplified.
4636         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
4637         its own resolve process.
4638         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
4639
4640 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4641
4642         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
4643         more error details.
4644         
4645 2007-06-20  Marek Safar  <marek.safar@gmail.com>
4646
4647         * cs-tokenizer.cs: Removed var related stuff.
4648         
4649         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
4650         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
4651         a type and a keyword at same time.
4652         
4653         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
4654         matches to "var".
4655         
4656         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
4657         implicitly typed arrays, more changes will follow.
4658         
4659         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
4660         
4661 2007-06-19  Marek Safar  <marek.safar@gmail.com>
4662
4663         * ecore.cs (VarExpr): Removed Handled field.
4664         
4665         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
4666         build-in assign functionality.
4667         (ForEach.Resolve): Removed all implicitly typed local variable code and
4668         simplified.
4669         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
4670         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
4671
4672 2007-06-18  Marek Safar  <marek.safar@gmail.com>
4673
4674         * assign.cs: Removed implicitly typed local variable check.
4675         
4676         * expression.cs (LocalVariableReference.DoResolve): Add check for self
4677         referencing implicitly typed local variable.
4678         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
4679         variable here.
4680         
4681         * statement.cs (Fixed): Removed unsupported implicitly typed local
4682         variable code.
4683
4684 2007-06-15  Marek Safar  <marek.safar@gmail.com>
4685
4686         * decl.cs (MemberName): Moved all Unbound stuff to parser.
4687
4688 2007-06-14  Marek Safar  <marek.safar@gmail.com>
4689
4690         A fix for bugs #81855 and #76274
4691         * attribute.cs (AttachTo): Always set owner for global attributes to
4692         prefined owner.
4693         
4694         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
4695         usefull too.
4696         
4697         * cs-parser.jay: Assembly and module attributes must precede all other
4698         elements except using clauses and extern alias declarations.
4699
4700 2007-06-13  Marek Safar  <marek.safar@gmail.com>
4701
4702         A fix for bug #81748
4703         * cs-tokenizer.cs,
4704         * expression.cs: More checks for non ISO-1 features.
4705
4706 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4707
4708         A fix for bug #81807
4709         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
4710         present inside switch statement and it is required by nullable check.
4711
4712 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4713
4714         A fix for bug #81840
4715         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
4716         when type matching fails.
4717         
4718         * namespace.cs: Tiny error message change.
4719
4720 2007-06-12  Marek Safar  <marek.safar@gmail.com>
4721
4722         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
4723         reporting. Added automatic property check.
4724         
4725         * class.cs: Updated after CheckAbstractAndExtern relocation.
4726         (AEventPropertyAccessor.GetSignatureForError): Customized.
4727         
4728 2007-06-11  Marek Safar  <marek.safar@gmail.com>
4729
4730         * class.cs (DefineBaseTypes): Base type can be undefined.
4731         
4732         * ecore.cs (TypeLookup): Minor refactoring.
4733         (DoResolveAsTypeStep): Removed redundant check.
4734
4735         * namespace.cs (Lookup): Removed redundant check.
4736                 
4737         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
4738         ResolveAsTypeTerminal step.
4739         (BootstrapCorlib_*): Simplified.
4740         (PopulateCoreType): Core types can be now external.
4741
4742 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4743
4744         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
4745          verification only.
4746          (InferTypeArguments): Infers anonymous expression type arguments.
4747          (Compatible): Split to Compatible and InferTypeArguments. 
4748         
4749         * lambda.cs: Updated.
4750
4751 2007-06-08  Marek Safar  <marek.safar@gmail.com>
4752
4753         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
4754
4755 2007-06-07  Raja R Harinath  <harinath@gmail.com>
4756
4757         Fix #80477, cs0135-2.cs, cs0135-3.cs
4758         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
4759         names to the "known" variables list.
4760         (Block.CheckInvariantMeaningInBlock): Handle the fact the
4761         parameter names are also "known".
4762         (Block.CheckError136): Remove.
4763         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
4764         null.
4765
4766 2007-06-07  Marek Safar  <marek.safar@gmail.com>
4767
4768         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
4769
4770 2007-06-06  Marek Safar  <marek.safar@gmail.com>
4771
4772         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
4773         internal error not an user error.
4774          
4775         * expression.cs (IsApplicable): Refactored to make debugging easier.
4776
4777         * support.cs: More tricks for non-mono runtimes.
4778         
4779         * typemanager.cs (CoreLookupType): Made public.
4780         (InitSystemCore): All linq specific stuff moved to linq.cs
4781
4782 2007-06-05  Marek Safar  <marek.safar@gmail.com>
4783
4784         * typemanager.cs (CSharpSignature): One more missing build-in types
4785         replacement.
4786         More tricks for non-mono runtime.
4787
4788 2007-06-05  Raja R Harinath  <harinath@gmail.com>
4789
4790         * statement.cs (Block.CheckError136_InParents): Remove.
4791         (Block.AddVariable): Use GetParameterInfo instead.
4792         (ToplevelBlock.ProcessArguments): Likewise.
4793
4794 2007-06-04  Raja R Harinath  <rharinath@novell.com>
4795
4796         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
4797         information too.
4798         (ToplevelBlock.GetParameterInfo): Split out of ...
4799         (ToplevelBlock.GetParameterRefernce): ... this.
4800         (ToplevelBlock.ParameterMap): Remove.
4801         * expression.cs (ParameterReference): Update to use
4802         ToplevelParameterInfo.
4803
4804         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
4805         regression.
4806
4807         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
4808         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
4809
4810         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
4811         (ToplevelBlock.ProcessParameters) ... here.
4812         (ToplevelBlock..ctor): Invoke it.
4813
4814         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
4815         new parameters.
4816
4817         * statement.cs (IKnownVariable): New interface.
4818         (LocalInfo): Implement it.
4819         (ToplevelParameterInfo): New class.
4820         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
4821         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
4822         GetKnownVariableInfo.
4823
4824 2007-06-03  Raja R Harinath  <harinath@gmail.com>
4825
4826         Partly speed up CS0136 error checks.
4827         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
4828         'recurse' parameter.
4829         (Block.DoCheckError136): Only check errors in parameters.  Move
4830         local variable checks ...
4831         (Block.AddVariable): ... here, and ...
4832         (ToplevelBlock.ResolveMeta): ... here.
4833
4834 2007-06-02  Raja R Harinath  <harinath@gmail.com>
4835
4836         * statement.cs (Block.IsChildOf): Remove.
4837
4838         * statement.cs (Statement.Clone): Move special case code ...
4839         (Block.CloneTo): ... here.
4840
4841 2007-05-29  Raja R Harinath  <rharinath@novell.com>
4842
4843         * statement.cs (ToplevelBlock.container): Remove field.  It's
4844         redundant with 'Parent'.
4845         (ToplevelBlock.ContainerBlock): Remove accessor.
4846         (ToplevelBlock..ctor): Update to changes.  Register anonymous
4847         child with parent here, ...
4848         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
4849         current_block.
4850         (start_anonymous): Don't save current_block.
4851         (top_current_block): Remove.
4852
4853         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
4854         (Block.Resolve): Update to changes.
4855         (Block..ctor): Move setting of "correct" 'Toplevel'
4856         and 'Explicit' fields to ...
4857         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
4858
4859 2007-05-27  Raja R Harinath  <harinath@gmail.com>
4860
4861         Kill Block.Implicit
4862         * statement.cs (Block.Implicit): Remove.
4863         (Block): Update to changes.
4864         * flowanalysis.cs: Likewise.
4865
4866         Mildly speed up CheckInvariantMeaningInBlock
4867         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
4868         Recursively call AddKnownVariable to all enclosing blocks.
4869         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
4870         Remove recursive calls.
4871         (Block): Update to changes.
4872
4873         New ExplicitBlock invariants
4874         * statement.cs (Block.Explicit): New field.  It points to the
4875         immediately enclosing non-implicit block.
4876         (Block..ctor): Maintain the invariant.
4877         * cs-parser.jay: Take advantage of invariant.
4878
4879         Introduce ExplicitBlock
4880         * statement.cs (ExplicitBlock): New.
4881         (ToplevelBlock): Derive from it.
4882         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
4883         sense of flag.
4884         (Block.Implicit): Update to changes.
4885         * cs-parser.jay: Update to changes.
4886
4887         Remove unused field
4888         * codegen.cs (EmitContext.IsLastStatement): Remove.
4889         * statement.cs (Block.DoEmit): Update to changes.
4890
4891 2007-05-25  Raja R Harinath  <rharinath@novell.com>
4892
4893         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
4894         modifying current_block directly.
4895
4896 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
4897         
4898         * class.cs: Implemented automatic properties (C# 3.0)
4899           Thanks to Marek for the help.
4900
4901 2007-05-23  Raja R Harinath  <rharinath@novell.com>
4902
4903         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
4904         variable as assigned, note also that all its components are
4905         assigned too.
4906         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
4907
4908 2007-05-19  Marek Safar  <marek.safar@gmail.com>
4909
4910         * anonymous.cs, class.cs: Emit Compiler generated attribute when
4911         member is marked as compiler generated.
4912         
4913         * decl.cs (MemberCore): Refactored ModFlags into property.
4914
4915         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
4916         (Check): Check only accessibility modifiers.
4917
4918 2007-05-18  Raja R Harinath  <rharinath@novell.com>
4919
4920         Track all assignable slots in one bit array
4921         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
4922         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
4923         logic from VariableMap constructor here.  Use the same 'offset'
4924         variable that's later used for computing offsets of local
4925         variables.
4926         * flowanalysis.cs (UsageVector.parameters): Remove.
4927         (UsageVector): Update to changes.
4928         (VariableMap): Remove.
4929
4930         Avoid creating ParameterMap in every block
4931         * statement.cs (Block.ParameterMap): Move ...
4932         (ToplevelBlock.ParameterMap): ... here.
4933         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
4934         only once.
4935         * flowanalysis.cs (FlowBranching.param_map): Remove.
4936         (FlowBranching.UsageVector): Update to changes.
4937         (FlowBranchingToplevel.CheckOutParameters): Likewise.
4938
4939         * statement.cs (Block.CloneTo): Clone Toplevel field too.
4940
4941         * expression.cs (ParameterReference): Distinguish between block
4942         where parameter was referenced and declared.
4943
4944 2007-05-18  Marek Safar  <marek.safar@gmail.com>
4945
4946         * flowanalysis.cs, statement.cs: Put back improved error handling.
4947
4948 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
4949         
4950         * assign.cs:
4951         * expression.cs:
4952           Imporved object and collection initialization (C# 3.0).
4953
4954 2007-05-15  Marek Safar  <marek.safar@gmail.com>
4955
4956         A fix for bug #81380
4957         * expression.cs (Is.DoResolve): Only value types have constant `is'
4958         behaviour.
4959
4960 2007-05-15  Raja R Harinath  <rharinath@novell.com>
4961
4962         * statement.cs (ToplevelBlock.child): Remove.
4963
4964 2007-05-15  Raja R Harinath  <harinath@gmail.com>
4965
4966         Rationalize ResolveMeta: refactoring
4967         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
4968         out constant handling code into ...
4969         (Block.DoResolveConstants): ... this.
4970
4971         Rationalize ResolveMeta: kill local_map
4972         * statement.cs (Block.local_map, Block.LocalMap): Remove.
4973         (Block.AssignableSlots): New.
4974         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
4975         for locals -- move code from VariableMap here.  Avoid unnecessary
4976         allocations.
4977         * flowanalysis.cs (FlowBranching.local_map): Remove.
4978         (FlowBranching..ctor): Use Block.AssignableSlots.
4979         (VariableMap): Remove unused constructors.
4980
4981 2007-05-11  Raja R Harinath  <rharinath@novell.com>
4982
4983         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
4984
4985 2007-05-11  Marek Safar  <marek.safar@gmail.com>
4986
4987         * typemanager.cs (IsFriendAssembly): Should not be called for building
4988         assembly.
4989
4990 2007-05-09  Marek Safar  <marek.safar@gmail.com>
4991
4992         * literal.cs (NullConstant): Print null in all cases.
4993         
4994         * expression.cs (Binary.ResolveOperator): Implemented delegate
4995          comparison based on C# 2.0 changes.
4996
4997 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
4998
4999         This code is contributed under the MIT X11 license
5000         
5001         The following enables support for several C# 3.0 language features:
5002         
5003         * cs-tokenizer.cs: Added support for the "var" keyword.
5004         
5005         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5006           Added VarExpr class to facilitate type inferencing.
5007         
5008         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5009           to support anonymous types.
5010         
5011         * assign.cs: Added support for type inferencing and initialization.
5012         
5013         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5014         
5015         * expression.cs: Added implicit array support to ArrayCreation.
5016           Added 5 types and 1 interface:
5017           
5018           IInitializable                Implementing classes can inject initializing
5019                                         statements after object instantiation.
5020           
5021           Initializer                   Stores data for object initialization.
5022           
5023           AnonymousType                 An expression for anonymous types.
5024           
5025           AnonymousTypeParameter        Stores data about an anonymous type's field.
5026           
5027           NewInitialize                 An expression for object initialization.
5028           
5029           CollectionInitialize          An expression for collection initialization.
5030         
5031         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5032           statements.
5033
5034 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5035
5036         A fix for bug #81500
5037         * cs-tokenizer.cs: Add special handling for coalescing operator.
5038
5039 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5040
5041         A fix for bug #81529
5042         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5043         its value from base class until it is redefined.
5044
5045 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5046
5047         Fix regression in cs0631-3.cs
5048         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5049         fallback.  Make error fallback catch more cases.
5050
5051 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5052
5053         * cs-parser.jay: Allow parameters in operator declarations to have
5054         attributes. 
5055
5056 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5057
5058         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5059         exists. 
5060
5061         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5062         inside the ContextualReturn, it does not have to be an
5063         ExpressionStatement. 
5064
5065 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5066
5067         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5068         set, set it.
5069
5070 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5071
5072         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5073         method in two methods: ResolveNoDefine and Resolve.
5074
5075         ResolveNoDefine will stop just after ResolveTopBlock has been
5076         called.   
5077
5078         Resolve will then continue by creating a method and issuing the
5079         call to method.Define ().
5080
5081         (AnonymousMethod): Split and implement the new Resolve and
5082         ResolveNoDefine as well.
5083
5084         * lambda.cs (LambdaExpression): Split the anonymous method
5085         resolution code into a separate routine (CoreCompatibilityTest)
5086         from DoCompatibleTest.
5087
5088         (LambdaExpression.TryBuild): New method, this method tries to
5089         build the LambdaExpression with the given set of types to be used
5090         as the types for the various parameters of the lambda expression. 
5091
5092         If the compilation succeed with the given types, the infered type
5093         of the Anonymous method is returned, otherwise null is returned.
5094
5095 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5096
5097         A fix for bug #81414
5098         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5099
5100 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5101
5102         * cs-tokenizer.cs: Change various identifiers here from the
5103         camelCasing to the recommended Linux-like style for instance
5104         variables from the Coding Guidelines. 
5105
5106 2007-04-19  Martin Baulig  <martin@ximian.com>
5107
5108         * convert.cs
5109         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5110         System.Enum to System.ValueType.
5111
5112 2007-04-13  Martin Baulig  <martin@ximian.com>
5113
5114         Rewrote implicit reference conversions.  We need to distinguish
5115         between implicit reference conversions (13.1.4) and implicit
5116         boxing conversions (13.1.5).
5117
5118         According to the spec, there's an an implicit conversion
5119         "From a one-dimensional array-type S[] to IList<T> and base
5120         interfaces of this interface, provided there is an implicit
5121         reference conversion from S to T."  Note that this does not
5122         include boxing conversions.
5123
5124         * convert.cs
5125         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5126         (Convert.ImplicitReferenceConversion): Split into
5127         ImplicitReferenceConversionCore() and
5128         ImplicitBoxingConversionExist().
5129         (Convert.ImplicitReferenceConversionExists): Use the new
5130         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5131
5132 2007-04-12  Martin Baulig  <martin@ximian.com>
5133
5134         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5135         `TypeManager.null_type' checks up to the top of the method.
5136
5137 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5138
5139         A fix for bug #81350
5140         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5141         extension methods.
5142
5143 2007-04-11  Martin Baulig  <martin@ximian.com>
5144
5145         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5146         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5147         to make this work for generic classes; fixes #79561.
5148
5149 2007-04-11  Martin Baulig  <martin@ximian.com>
5150
5151         * expression.cs (As): Add support for nullable types; fixes #79371.
5152
5153 2007-04-11  Martin Baulig  <martin@ximian.com>
5154
5155         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5156         `type.FullName' is null; fixes #80243.
5157
5158 2007-04-11  Martin Baulig  <martin@ximian.com>
5159
5160         * expression.cs (Invocation.IsApplicable): Don't modify the method
5161         if type inference succeeded, but the method was not applicable.
5162         Fixes #81250.
5163
5164 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5165
5166         A fix for bug #81324
5167         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5168         internal and external namespaces containers.
5169
5170 2007-04-10  Martin Baulig  <martin@ximian.com>
5171
5172         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5173         TypeManager.DropGenericMethodArguments() so we also call
5174         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5175
5176 2007-04-10  Martin Baulig  <martin@ximian.com>
5177
5178         * iterators.cs (Iterator.CreateIterator): Don't crash if
5179         `method.ReturnType' is null.  This happens if something went wrong
5180         while resolving that typ (we already reported an error in this case).
5181
5182 2007-04-10  Martin Baulig  <martin@ximian.com>
5183
5184         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5185         generic interfaces; report the CS0144 directly.
5186
5187 2007-04-10  Martin Baulig  <martin@ximian.com>
5188
5189         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5190         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5191
5192 2007-04-10  Martin Baulig  <martin@ximian.com>
5193
5194         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5195
5196 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5197
5198         A better fix
5199         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5200         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5201
5202         Fix #81338
5203         * statement.cs (For.Resolve): If resolution fails, use
5204         KillFlowBranching.
5205
5206 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5207
5208         * anonymous.cs (MakeName): Make faster and zero-based.
5209         (VerifyExplicitParameterCompatibility): Back to mode where generic
5210         parameter is ignored.
5211         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5212
5213         * class.cs (EmitType): Method can emit another new method.
5214
5215         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5216
5217         * driver.cs: Updated.
5218
5219         * lambda.cs: Reuse predefined empty parameters.
5220
5221         * parameter.cs: Updated
5222
5223         * support.cs: Implemented InflateTypes.
5224
5225         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5226         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5227
5228 2007-04-03  Martin Baulig  <martin@ximian.com>
5229
5230         Fix #80632.
5231
5232         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5233         version of TypeManager.IsOverride() which also works with generic
5234         types.  
5235
5236 2007-04-03  Martin Baulig  <martin@ximian.com>
5237
5238         Fix #81044.
5239
5240         * convert.cs
5241         (Convert.ExplicitReferenceConversion): We need to cast when
5242         converting from IList<T> to S[].
5243
5244 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5245
5246         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5247         at this level.
5248         
5249         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5250
5251 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5252
5253         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5254         argument and return type inferring.
5255
5256         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5257         (ReturnType): Turned to property.
5258
5259         * statement.cs (Return): Implemented return type inferring.
5260
5261         * support.cs (ReflectionParameters): Use local types if possible.
5262
5263 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5264
5265         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5266         (FlowBranching.UsageVector): Update to changes.
5267
5268         Prepare to kill 'Reachability'
5269         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5270         argument of constructor.
5271
5272 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5273
5274         Prepare to kill 'Reachability'
5275         * flowanalysis.cs (UsageVector.is_unreachable): New.
5276         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5277         'reachability', and verify they're consistent.
5278
5279         Fix #81121
5280         * expression.cs (New.EmitStatement): Handle type parameters here too.
5281
5282 2007-03-29  Martin Baulig  <martin@ximian.com>
5283
5284         Fix #79148.
5285
5286         * anonymous.cs
5287         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5288         CompilerGeneratedClass.
5289         (ScopeInfo.EmitScopeInstance): Make this protected.
5290         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5291         `ec.CurrentAnonymousMethod.Scope == Scope'.
5292
5293         * statement.cs (Block.ScopeInfo): Make this a property.
5294
5295 2007-03-27  Raja R Harinath  <harinath@gmail.com>
5296
5297         Prepare to kill 'Reachability'
5298         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
5299         (FlowBranching.UsageVector.Reachability): Remove property.
5300         (FlowBranching.UsageVector.IsUnreachable): New property.
5301         (FlowBranching.UsageVector.ResetBarrier): New.
5302         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
5303         * codegen.cs, statement.cs: Update to changes.
5304
5305 2007-03-27  Martin Baulig  <martin@ximian.com>
5306
5307         Fix #81209.
5308
5309         * decl.cs
5310         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
5311         generic types.
5312
5313 2007-03-26  Raja R Harinath  <rharinath@novell.com>
5314
5315         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
5316         instead of TriState.  Remove all mention of TriState.
5317
5318         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
5319         replaced by a boolean.  Add boolean 'is_unreachable' field, check
5320         and maintain invariants.
5321
5322 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5323
5324         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
5325
5326 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5327
5328         * expression.cs: Stop using obsolete 2.0 opcodes.
5329
5330 2007-03-25  Marek Safar  <marek.safar@gmail.com>
5331
5332         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
5333         one of the latests Martin's fixes.
5334
5335 2007-03-23  Miguel de Icaza  <miguel@novell.com>
5336
5337         * expression.cs: On BigEndian systems, swap the bytes, temporary
5338         solution until we get a new bitconverter class.
5339
5340 2007-03-23  Martin Baulig  <martin@ximian.com>
5341
5342         Fix #81158.
5343
5344         * decl.cs (MemberCache.AddMembers): Add generic methods both as
5345         "Method" and "Method`1".  Normally, a cache lookup is done on the
5346         "Method" form (ie. without the generic arity), but this one makes
5347         lookups on the full form work as well.
5348
5349 2007-03-22  Raja R Harinath  <rharinath@novell.com>
5350
5351         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
5352         unused properties.
5353
5354 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
5355         * class.cs: 
5356         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
5357         ordered_member_list, to TypeBuilder to store members to be defined
5358         in the order they were parsed in.
5359         - ordered_explicit_member_list contains all properties indexers
5360           and methods that are defined as explicit implementation of an
5361           interface or base class.
5362         - ordered_member_list contains all properties indexers and methods
5363           that are not defined as explicit implementation of an interface
5364           or base class.
5365
5366         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
5367         functionality in these removed classes has been replaced with 
5368         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
5369         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
5370
5371         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
5372         to CheckForDuplications inside GetMethod and SetMethod Define Method
5373         to handle method property and indexer name conflicts.
5374
5375         Fixes #79434
5376
5377         All code is contributed under the MIT/X11 license.
5378
5379 2007-03-20  Martin Baulig  <martin@ximian.com>
5380
5381         * class.cs (TypeContainer.Interfaces): Removed; they're now
5382         included in `TypeContainer.Types'.
5383
5384 2007-03-20  Martin Baulig  <martin@ximian.com>
5385
5386         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
5387
5388         * class.cs (TypeContainer.CreateType): New public method.  This is
5389         now called before DefineType() to create the TypeBuilders.
5390         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
5391         has already been created by CreateType().
5392         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
5393         don't resolve our base classes here; this has been moved into
5394         DefineBaseTypes().  We're now called from CreateType().
5395         (TypeContainer.DefineBaseTypes): New private method; resolve our
5396         base classes here.  We're now called from DefineType().
5397
5398         * rootcontext.cs
5399         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
5400         our types first to create all the TypeBuilders.  After that, call
5401         TypeContainer.DefineType() on all the types which'll resolve their
5402         base classes and setup the resolve order.
5403
5404 2007-03-20  Martin Baulig  <martin@ximian.com>
5405
5406         * class.cs (TypeContainer.Enums): Removed; they're now included in
5407         `TypeContainer.Types'.  
5408
5409 2007-03-20  Martin Baulig  <martin@ximian.com>
5410
5411         * class.cs
5412         (TypeContainer.DefineType): Don't call ResolveMembers() here.
5413         (TypeContainer.DoResolveMembers): Call DefineType() on our
5414         `compiler_generated' classes; moved here from DefineNestedTypes().
5415
5416         * rootcontext.cs
5417         (RootContext.ResolveTree): Call ResolveMembers() on all
5418         TypeContainer's in the `type_container_resolve_order'.
5419
5420 2007-03-19  Marek Safar  <marek.safar@gmail.com>
5421
5422         * class.cs: Use corlib to handle InternalMethodImplAttribute.
5423
5424 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5425
5426         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
5427         implementation flags.
5428
5429 2007-03-17  Marek Safar  <marek.safar@gmail.com>
5430
5431         * class.cs: More optimizations for type parameters.
5432
5433 2007-03-15  Marek Safar  <marek.safar@gmail.com>
5434
5435         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
5436
5437         * ecore.cs, parameter.cs: More common code for both corlibs.
5438
5439         * typemanager.cs (IsGenericMethod): Simplified.
5440
5441 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5442
5443         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5444         'returns'.
5445         * statement.cs, iterators.cs, lambda.cs: Update to changes.
5446
5447         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
5448         unconditionally.  Simplify explanation.
5449         (Try.Resolve, Using.Resolve): Likewise.
5450
5451 2007-03-15  Martin Baulig  <martin@ximian.com>
5452
5453         Fix #80731.
5454
5455         * decl.cs (DeclSpace): If we're a partial class, use our
5456         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
5457
5458 2007-03-15  Raja R Harinath  <rharinath@novell.com>
5459
5460         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5461         'throws'.
5462         (FlowBranching.UsageVector): Update to changes.
5463         (FlowBranching.MergeSiblings): Likewise.
5464         * statement.cs: Likewise.
5465
5466 2007-03-15  Martin Baulig  <martin@ximian.com>
5467
5468         Fix #79302.
5469
5470         * decl.cs
5471         (MemberCache): Added a special .ctor for type parameters.
5472
5473         * typemanager.cs
5474         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
5475         `MemberCache'.  
5476
5477 2007-03-09  Martin Baulig  <martin@ximian.com>
5478
5479         * enum.cs (Enum): Make this a TypeContainer.
5480         (EnumMember): Derive from `Const'.
5481
5482         * const.cs
5483         (Const.DoResolveValue): New protected virtual method; move most of
5484         the functionality of ResolveValue() here so we can override it in
5485         `EnumMember'.
5486         (Const.CreateConstantReference): Make this virtual.
5487
5488         * class.cs (Kind): Add `Kind.Enum'.
5489         (TypeContainer.Emit): Don't emit the enums here; they're already
5490         in the `RootContext.typecontainer_resolve_order'.
5491
5492         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
5493         here; they're already in the `typecontainer_resolve_order'.
5494
5495         * ecore.cs (EnumConstant.ConvertImplicitly): Add
5496         TypeManager.DropGenericTypeArguments().
5497
5498         * typemanager.cs
5499         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
5500         (TypeManager.IsEnumType): Likewise.
5501         (TypeManager.EnumToUnderlying): Likewise.
5502         (TypeManager.IsEqual): Add support for enums.
5503
5504 2007-03-12  Raja R Harinath  <rharinath@novell.com>
5505
5506         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
5507         DefaultParameterValueAttribute to be undefined, say if System.dll
5508         is not referenced.
5509
5510 2007-03-11  Marek Safar  <marek.safar@gmail.com>
5511
5512         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
5513         any mscorlib.
5514
5515 2007-03-10  Marek Safar  <marek.safar@gmail.com>
5516
5517         * class.cs, parameter.cs: Unified parameters verification.
5518
5519 2007-03-08  Martin Baulig  <martin@ximian.com>
5520
5521         * cs-parser.jay (constructor_header): Pass the location to the
5522         newly created TopLevelBlock.
5523
5524 2007-03-07  Martin Baulig  <martin@ximian.com>
5525
5526         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
5527
5528 2007-03-06  Miguel de Icaza  <miguel@novell.com>
5529
5530         * convert.cs (ExplicitReferenceConversionExists): Sync this method
5531         with the changes from David, fixes the build.
5532
5533 2007-03-05  David Mitchell  <dmitchell@logos.com>
5534
5535         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
5536         and its base interfaces to a one-dimensional array type S[],
5537         provided there is an implicit or explicit reference conversion
5538         from S to T.
5539
5540 2007-03-03  Marek Safar  <marek.safar@gmail.com>
5541
5542         * cs-tokenizer.cs: Implemented basic linq grammar.
5543
5544         * driver.cs: Set linq lang version on demand.
5545
5546 2007-02-26  Marek Safar  <marek.safar@gmail.com>
5547
5548         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
5549
5550 2007-02-25  Marek Safar  <marek.safar@gmail.com>
5551
5552         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
5553         (Fixes #80455)
5554
5555         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
5556         here.
5557         Check property and event extern attributes.
5558
5559         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
5560         charset.
5561
5562 2007-02-24  Marek Safar  <marek.safar@gmail.com>
5563
5564         A fix for bug #80407
5565         * ecore.cs: Don't report ambiguity error when methods have same parent.
5566
5567 2007-02-23  Marek Safar  <marek.safar@gmail.com>
5568
5569         A fix for bug #80878
5570         * class.cs, cs-parser.jay: Event property can host anonymous methods.
5571
5572 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5573
5574         * attribute.cs: Enable ExtensionAttribute presence test.
5575
5576 2007-02-22  Marek Safar  <marek.safar@gmail.com>
5577
5578         * class.cs: Warn about missing GetHashCode only when Equals is override.
5579
5580         * decl.cs: Check accessibility of type arguments.
5581
5582         * typemanager.cs: Correctly report nullable array.
5583
5584 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5585
5586         * class.cs, report.cs: Capture more details when things go wrong.
5587
5588 2007-02-20  Marek Safar  <marek.safar@gmail.com>
5589
5590         A fix for bug #80650
5591         * cs-parser.jay: Anonymous container starts at constructor declaration
5592         and not at block beginning because it has to be usable in constructor
5593         initializer.
5594
5595         * statement.cs: Use context location and not block one for error reporting.
5596
5597 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5598
5599         A fix for bug #78712
5600         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
5601         too.
5602
5603 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5604
5605         A fix for bug #80493 by Atsushi Enomoto
5606         * cs-parser.jay: Ignore invalid attribute target.
5607
5608 2007-02-18  Marek Safar  <marek.safar@gmail.com>
5609  
5610         * cs-tokenizer.cs: Ignore '\0' as white space character.
5611
5612 2007-02-17  Miguel de Icaza  <miguel@novell.com>
5613
5614         * cs-parser.jay: Add support for lambda expressions to the mcs
5615         compiler as well.
5616
5617         * lambda.cs: Only clone when we are probing, not on the final call
5618         (Compatible is the final call). 
5619
5620         * statement.cs (CloneContext): Introduce class to provide block
5621         remapping during clone.
5622
5623         All statements Clone themselves now.
5624
5625         (Clone): special handling for blocks, when we clone a block, we
5626         register the block inside this routine, as children of the block
5627         might trigger a lookup. 
5628         
5629         * expression.cs: Add support for CloneContext in all expressions. 
5630         
5631 2007-02-17  Marek Safar  <marek.safar@gmail.com>
5632  
5633         A fix for bug #80493
5634         * statement.cs: Report ambiguous warning when interfaces are not related.
5635
5636 2007-02-15  Marek Safar  <marek.safar@gmail.com>
5637
5638         C# 3.0 extension methods.
5639
5640         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
5641         cannot be used directly.
5642
5643         * class.cs (Class.Emit): Emit extension attribute if any class method
5644         is extension method.
5645         (Method.Define): Add basic extension method validation conditions.
5646         (Method.Emit): Emit extension attribute for method.
5647
5648         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
5649         extension method exists. Currently we follow same approach as Microsoft
5650         does, emit even if a method or a class are private but this can change
5651         later.
5652
5653         * cs-parser.jay: Add handling of `this' keyword in method parameters
5654         context.
5655
5656         * decl.cs (DeclSpace.IsStaticClass): New property.
5657         (MemberCache.FindExtensionMethods): Looks for extension methods with
5658         defined name and extension type.
5659
5660         * doc.cs: Updated after OverloadResolve changes.
5661
5662         * driver.cs: Add new soft reference to System.Core.dll.
5663
5664         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
5665         (ExtensionMethodGroupExpr): Represents group of extension methods.
5666
5667         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
5668         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
5669         to MethodGroupExpr and made non-static for easier customization.
5670         (Invocation.DoResolve): Add extension method lookup when no standard
5671         method was found.
5672         (MemberAccess.DoResolve): Try extension methods if no member exists.
5673
5674         * modifiers.cs: Add METHOD_EXTENSION modifier.
5675
5676         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
5677         as well as candidate extension type.
5678         (ComputeNamespaces): When assembly constains extension methods registers
5679         them.
5680         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
5681         extension method lookup.
5682         (Namespace.LookupExtensionMethod): Looks for extension method in this
5683         namespace.
5684         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
5685         find a method which matches name and extensionType.
5686
5687         * parameter.cs (Parameter): Add This modifer.
5688         (HasExtensionMethodModifier): New property.
5689         (Resolve): Add extension parameter check.
5690         (ModFlags): turned to property to exclude this modifier as it is not real
5691         parameter modifier.
5692         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
5693
5694         * support.cs (ParameterData): Add ExtensionMethodType.
5695         (ReflectionParameters): Implemented ExtensionMethodType interface property.
5696
5697         * typemanager.cs: Add type and ctor extension attribute type.
5698
5699 2007-02-15  Miguel de Icaza  <miguel@novell.com>
5700
5701         * report.cs (DisableErrors, EnableErrors): used to prevent error
5702         output when we are "trying" to compile various methods with
5703         different types. 
5704
5705         * ecore.cs (Expression): Add Clone method that calls the virtual
5706         CloneTo method.  The current CloneTo method in Expression throws
5707         an exception so we can track down all the places where this must
5708         be implemented (not using abstract, because that would be a lot of
5709         up-front-work before we can start testing the implementation
5710         idea). 
5711
5712         Important: we only need Clone capabilities for expressions created
5713         by the parser, as the expressions we will be cloning are
5714         expressions in the pre-resolved state.   This vastly simplifies
5715         the work required. 
5716         
5717         (SimpleName): Add CloneTo that does nothing.
5718         (EmptyCast): Add CloneTo.
5719         
5720         * expression.cs (Binary): Implement CloneTo.
5721         (Invocation.IsApplicable): Store the current ec in
5722         EmitContext.TempEc and restore it on return.  This is used so we
5723         do not have to sprinkle hundres of methods with an extra
5724         EmitContext, we know that the only user is the lambda expression
5725         ImplicitConversionExists code. 
5726         
5727         (Argument): Add Cloning capabilities.
5728         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
5729         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
5730         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
5731         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
5732         IndexerAccess): Add Clone capability.
5733
5734         (LocalVariableReference, This): TODO: needs cloned Block mapping.
5735
5736         (Argument): Add cloning capability.
5737
5738         * assign.cs (Assign): Implement CloneTo.
5739
5740         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
5741         
5742         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
5743         version by calling Convert with the EmitContext (that we are
5744         currently storing in ec, this is not great, but will do for now,
5745         to avoid passing EmitContext parameters to hundreds of functions
5746         that do not need them now).
5747
5748         (SetExpression): Remove, it is not needed.
5749         
5750         (ContextualReturn): Implement CloneTo.
5751
5752         * statement.cs (Statement): Implement cloning infrastructure,
5753         similar to expressions.
5754
5755         (Block): Partial implementation of Clone for statements.
5756
5757         (Return): Implement clone.
5758         
5759         * constant.cs (Constant.CloneTo): New method, does nothing.
5760
5761         * codegen.cs (TempEc): Add a static EmitContext as a temporary
5762         solution, until we decide how to exactly do this.  
5763         
5764 2007-02-14  Marek Safar  <marek.safar@gmail.com>
5765  
5766         A fix for bug #80493
5767         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
5768         a property is override we need to use second accessor.
5769
5770 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5771  
5772         A fix for bug #80418
5773         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
5774         methods.
5775
5776 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5777
5778         Another fix for bug #80749
5779         * pending.cs: Abstract class has priority over interfaces.
5780
5781 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5782
5783         Another fix for bug #80749
5784         * pending.cs: Abstract class has priority over interfaces.
5785
5786 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5787
5788         Another fix for bug #80749
5789         * pending.cs: Abstract class has priority over interfaces.
5790
5791 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5792
5793         Another fix for bug #80749
5794         * pending.cs: Abstract class has priority over interfaces.
5795
5796 2007-02-13  Marek Safar  <marek.safar@gmail.com>
5797
5798         * class.cs Better error message.
5799
5800         * driver.cs: Add shorter versions of -optimize option.
5801
5802 2007-02-13  Martin Baulig  <martin@ximian.com>
5803
5804         * class.cs (Constructor.Emit): Check the return value of
5805         ec.ResolveTopBlock() and return on error.
5806
5807 2007-02-13  Raja R Harinath  <rharinath@novell.com>
5808
5809         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
5810         message to fix error message regression.
5811
5812 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5813
5814         * delegate.cs: Delegate creation expression cannot be of Nullable type.
5815
5816 2007-02-12  Marek Safar  <marek.safar@gmail.com>
5817
5818         A fix for bug #80749
5819         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
5820         its parent container.
5821
5822         * class.cs (DefineFieldInitializers): Each initializer can has different
5823         resolve context.
5824
5825         * const.cs: Updated.
5826
5827 2007-02-11  Miguel de Icaza  <miguel@novell.com>
5828
5829         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
5830         now all the heavy lifting to check that embedded statements or
5831         expressions have the right form is done in the ContextualReturn.
5832
5833         (ContextualReturn): New class.  
5834
5835         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
5836         method that can be invoked to report 201, so we do not replicate
5837         this everywhere.
5838
5839         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
5840         
5841         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
5842         treating tabs as spaces. 
5843
5844 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5845
5846         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
5847         * assign.cs: Use full implicit conversion for right side check.
5848
5849 2007-02-09  Marek Safar  <marek.safar@gmail.com>
5850
5851         * statement.cs (Switch): Switch over boolean type is not standardized.
5852
5853 2007-02-08  Marek Safar  <marek.safar@gmail.com>
5854
5855         A fix for bug #80755
5856         * decl.cs (FindBaseEvent): Don't use method cache for events.
5857
5858 2007-02-07  Marek Safar  <marek.safar@gmail.com>
5859
5860         * cs-parser.jay: Better syntax error handling.
5861
5862         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
5863         instead of underlying type value.
5864
5865 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5866
5867         * driver.cs: Check define identifier before is registered.
5868
5869         * namespace.cs: Use existing error message.
5870
5871         * report.cs: New warning.
5872
5873 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5874
5875         A fix for bug #80742
5876         * expression.cs: Delegate Invoke method can be called directly.
5877
5878 2007-02-06  Marek Safar  <marek.safar@gmail.com>
5879
5880         A fix for bug #80676
5881         * class.cs (IsEntryPoint): The Main method can have params modifier.
5882
5883 2007-02-04  Miguel de Icaza  <miguel@novell.com>
5884
5885         * parameter.cs (Parameter, Parameters): Add Clone method.
5886
5887         * anonymous.cs (Compatible): Turn method into virtual method, so
5888         LambdaExpression can implement a different behavior.
5889
5890         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
5891         out the basic checking here, so it can be used by
5892         LambdaExpressions.
5893         
5894         * lambda.cs: Introduce "Compatible" function that will do the
5895         heavy lifting.
5896
5897 2007-02-02  Marek Safar  <marek.safar@gmail.com>
5898
5899         * attribute.cs: Unified one error message.
5900
5901         * class.cs (Class): Use type attributes and not properties to test static
5902         class.
5903         (IsEntryPoint): Don's pass local variable.
5904
5905         * convert.cs: Removed duplicate check.
5906
5907         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
5908
5909         * driver.cs: Don't crash when soft reference does not exist.
5910
5911         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
5912         (UsingEntry): Removed redundant allocation.
5913
5914         * parameter.cs: Add fast path for type parameters.
5915
5916         * support.cs: Don't allocate attribute when it's not used.
5917
5918 2007-01-30  Miguel de Icaza  <miguel@novell.com>
5919
5920         * anonymous.cs
5921         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
5922         this into a virtual method, so we can override it in LambdaExpression.
5923
5924         * driver.cs: Improve diagnostics in case of failure. 
5925
5926         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
5927         write a function that is slightly more complex and that parses:
5928
5929         type identifier [, type identifier]* )
5930
5931         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
5932         this expression:
5933
5934                 (canEmpty ? i >= 0 : i > 0)
5935
5936 2007-01-30  Raja R Harinath  <rharinath@novell.com>
5937
5938         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
5939         exception on possibly valid code.
5940
5941 2007-01-29  Raja R Harinath  <rharinath@novell.com>
5942
5943         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
5944         Push/PopPosition.
5945         (parse_opt_type_arguments): Remove.  It's almost the same as
5946         parse_less_than.
5947         (parse_namespace_or_typename): Use parse_less_than.
5948
5949 2007-01-28  Miguel de Icaza  <miguel@novell.com>
5950
5951         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
5952         this bug took a few hours to find, because the state saved and
5953         restored by PushPosition and PopPosition was ignoring the state of
5954         parse_generic_less_than.
5955
5956         I can also now remove the handling of OP_LT and OP_GT, this solves
5957         the big mistery.
5958         
5959         * cs-tokenizer.cs: store the location for the ARROW token, we use
5960         that in the parser.
5961
5962         (PushPosition, PopPosition): save/restore also `current_token',
5963         restore `parse_generic_less_than' (was missing).
5964
5965         (parse_opt_type_arguments): use parse_type, not
5966         parse_namespace_or_typename to parse types.
5967
5968         * lambda.cs: Empty new file, will eventually have the lambda
5969         expression implementation.
5970
5971         * lambda.test: used to test the internal tokenizer. 
5972
5973         * report.cs (FeatureIsNotISO1): Rename from
5974         FeatureIsNotStandardized, because it was about the language level
5975         (1 vs 2) it was not about standarization.
5976
5977         (FeatureRequiresLINQ): New.
5978
5979         * support.cs (SeekableStreamReader): Only require that the reader
5980         is a TextReader, not a StreamReader, so we can plug StringReader. 
5981
5982         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
5983         given position in the input stream the following tokens can be
5984         parsed as a type followed by an identifier.
5985
5986         (is_punct): after a '(' if parse_type_and_parameter returns true,
5987         then return a special token OPEN_PARENS_LAMBDA which is used to
5988         avoid reduce/reduce errors in the grammar for the
5989         lambda_expression rules.
5990
5991         (parse_type): implement a type parser inside the
5992         tokenizer, the parser only returns true or false depending on
5993         whether the input at a given position can be parsed as a type.
5994
5995         (peek_token): new method used during type parsing.
5996
5997 2007-01-28  Raja R Harinath  <rharinath@novell.com>
5998
5999         Fix #80531
6000         * anonymous.cs (ScopeInfo.InflateParameters): New.
6001         (AnonymousContainer.Resolve): Use it to redirect types of
6002         delegate parameters.
6003
6004 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6005
6006         Fix #80530
6007         * expression.cs (Error_InvalidArguments): Don't use two different
6008         messages for CS1503.  Use ExtraInformation and
6009         SymbolRelatedToPreviousError instead.
6010
6011         Fix #80358
6012         * decl.cs (DeclSpace.initialize_type_params): Don't access
6013         'type_params' of a partial class directly.
6014
6015 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6016
6017         * constant.cs: Removed a handful of out-of-range checks that were
6018         not necessary. 
6019
6020 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6021
6022         * expression.cs (CheckUselessComparison): Add additional check for char
6023         constants.
6024
6025         * namespace.cs: Fixed typo.
6026
6027 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6028
6029         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6030         gone, instead we inline the test, preventing the needless casts to
6031         longs, ulongs and doubles for the parameters, avoiding calls to
6032         methods that overchecked stuff, and instead inlined things
6033         nicely. 
6034
6035 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6036
6037         * cs-parser.jay: Better parameter error handling.
6038
6039 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6040
6041         A fix for bug #80368, #80522
6042         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6043         whether array initializer contains constants only.
6044         (ArrayCreation.Emit): Use better formula to decide when
6045         are array initializers for static initialization.
6046         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6047         have to emit even constants otherwise they are pre-initialized.
6048
6049 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6050             Raja R Harinath  <rharinath@novell.com>
6051
6052         Fix emit order of 'get' vs. 'set'.
6053         * support.cs (Accessors): New.
6054         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6055         Note the order in which accessors are declared in the source.
6056         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6057         Refactored from Property.Define and Indexer.Define.
6058         (PropertyBase.DefineAccessors): New helper that calls the above in
6059         appropriate order as noted by the parser.
6060         (Property.Define, Indexer.Define): Update to changes.
6061         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6062
6063 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6064
6065         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6066         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6067         there's an implicit conversion from the current type to the target
6068         type before converting the underlying constant.
6069
6070 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6071
6072         * const.cs (ResolveValue): Updated after constant conversion was made more
6073         generic.
6074
6075         * constant.cs (GetAttributableValue): constant to object conversion is
6076         used for attributes only.
6077         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6078         constant conversions.
6079         (LongConstant.ConvertImplicitly): Ditto.
6080
6081         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6082         (ImplicitConversionStandard): Handle constant conversion as extra step.
6083         It solves the issue when constant conversion was called indirectly like
6084         inside array initializer and constant folding was skipped.
6085
6086         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6087         this change.
6088
6089         * statement.cs(ImplicitConversionStandard): Updated after constant
6090         conversion was made more generic.
6091
6092 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6093
6094         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6095         Constraints, solves the problem where the compiler incorrectly
6096         reported that a type parameter was not constrained to a class (Bug
6097         80518)
6098
6099 2007-01-14  Marek Habersack  <grendello@gmail.com>
6100
6101         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6102
6103 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6104
6105         A fix for bug #80368
6106         * assign.cs (FieldInitializer): New class implements field
6107         initializer statement.
6108
6109         * attribute.cs: Update after FieldMember rename.
6110
6111         * class.cs (PropertyBasedMember): New common class for property based
6112         types.
6113         (InterfaceMemberBase): New base class for all members which can be used as
6114         an interface members.
6115         (MethodCore): Moved really common code to InterfaceMemberBase.
6116         (Method.Define): Equal and GetHasCode detection is relevant for methods
6117         only.
6118         (MethodData.Define): Don't assume that public event implements an
6119         interface automatically.
6120         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6121         modifier is used.
6122         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6123         (FieldMember): Merged with FieldBase.
6124         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6125         event extern modifier can be used.
6126         (EventField.EventFieldAccessor): Moved event field specific code here.
6127         (Event.AllowedModifiers): Even event can be extern.
6128         (Event.FindOutBaseMethod): New override specific to events.
6129         (Indexer.parameters): Reintroduce parameters because base class holds
6130         only properties common data.
6131         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6132         need do extra parameters check.
6133
6134         * const.cs: Update after FieldMember rename.
6135
6136         * decl.cs (MemberCache.FindBaseEvent): New method.
6137
6138         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6139         to reflect that indexer is now derived from PropertyBased.
6140
6141         * ecore.cs (GetMemberType): Made public.
6142         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6143         obsolete event.
6144
6145         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6146         
6147         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6148         (RegisterEvent): Removed.
6149         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6150         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6151
6152 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6153
6154         Fix #80249
6155         * statement.cs (CollectionForeach.TryType): Prefer generic
6156         GetEnumerator over non-generic variant.  Fix code to follow comments.
6157
6158 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6159
6160         Fix #80446
6161         * support.cs (ReflectionParameter): Don't use an invalid index on
6162         the generic parameter data.
6163
6164 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6165
6166         * driver.cs: Just add a tiny bit of infrastructure.
6167
6168 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6169
6170         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6171         where field type is struct from current assembly.
6172         
6173         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6174         it is possible.
6175
6176 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6177
6178         A fix for bug #80381
6179         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6180         the core types.
6181
6182         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6183         messages.
6184         (Namespace.LookupType): Always use core types from corlib when speficied.
6185
6186         * report.cs: A new warning.
6187
6188         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6189         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6190         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6191
6192         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6193         (InitCoreTypes): Set expression type of object_type and value_type
6194         immediately after lookup.
6195
6196 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6197
6198         * cs-tokenizer.cs: Accept Pc class characters (Connector
6199         Punctuation) as valid identifiers.  Fixes #78259
6200
6201         * expression.cs (Invocation.DoResolve): Moved the check for the
6202         use of `this' for doing method calls to the Invocation resolution
6203         step, after overload resolution has taken place instead of doing
6204         the check at the low-level `This.DoResolve' level.
6205
6206         The `This.DoResolve'(appens before overload resolution, so it has
6207         no way of knowing if the method that will be called will be
6208         instace or static, triggering an erroneous report for cs0188 (Bug
6209         78113).
6210
6211         We now do the check for instance method invocations after we know
6212         what method will be called.
6213
6214         (This.CheckThisUsage): Move the actual use of this structure
6215         checking into its own method and expose it. 
6216
6217         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6218         EmitContext.
6219
6220         Exceptions: Null.ConvertImplicitly,
6221         Constant.ImplicitConversionRequired as there are too many call
6222         sites for passing the ec. 
6223
6224         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6225         EmitContext, if the value is null, then we do not try to provide
6226         the extra information from the error (If a userdefined conversion
6227         exists, as UserDefinedConversion requires a non null-EmitContext).
6228
6229         Fixes: #80347
6230
6231 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6232
6233         * flowanalysis.cs (MyBitVector): Document some invariants.
6234         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6235         introduced below, and add a couple of others, 
6236
6237 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6238
6239         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6240         GetPropertyFromAccessor and GetEventFromAccessor.
6241         
6242         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6243         overrides non-obsolete one.
6244         (Indexer.Define): Error message has been moved to the parser.
6245
6246         * cs-parser.jay: Better syntax errors handling.
6247
6248         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6249         when an invocation has no arguments.
6250
6251         * ecore.cs: Removed not used caching.
6252
6253         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6254         implementation.
6255
6256         * report.cs: Add a new warning.
6257
6258         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6259
6260         * typemanager.cs (enumeration_type): Removed.
6261         (CSharpSignature): Reuses IsSpecialMethod.
6262         (IsEqual): Hack for MS BCL.
6263         (GetPropertyFromAccessor): New method.
6264         (GetEventFromAccessor): New method.
6265         (IsSpecialMethod): Fixed to handle more cases.
6266
6267 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6268
6269         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6270         Made white spaces array static.
6271
6272         * ecore.cs (RemoveGenericArity): Optimized.
6273
6274         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6275         10 times faster).
6276         (MyBitVector.initialize_vector): Simplified.
6277
6278 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6279
6280         * ecore.cs: Am not entirely happy with this hack, but it seems to
6281         address the issue in 80257 (a small test case for
6282         CreativeDocs.NET). 
6283
6284         I set the MethodGroupExpr.Type to an internal compiler type
6285         (itself in this case) to force the resolution to take place.   Why
6286         it does not take place with a null is beyond me.
6287
6288 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6289
6290         A fix for bug #80288
6291         * expression.cs (ResolveOperator): Consider user defined conversion for
6292         logical and operator too.
6293         (EmitBranchable): Optimization for logical and when full constant folding
6294         could not be applied but one operand is constant.
6295
6296 2006-12-19  Marek Safar  <marek.safar@gmail.com>
6297
6298         * class.cs (GetClassBases): Write 5 times every day, will never use
6299         FullName for error reporting.
6300
6301         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
6302
6303 2006-12-19  Martin Baulig  <martin@ximian.com>
6304
6305         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
6306         the symbol file info here.
6307
6308 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6309
6310         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
6311         of `elseif' is taking then following sections are not taking.
6312         Fixes an issue reported on mono mailing list.
6313
6314 2006-12-18  Marek Safar  <marek.safar@gmail.com>
6315
6316         A fix for bug #80300
6317         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
6318         a caller is not taking.
6319
6320 2006-12-18  Raja R Harinath  <rharinath@novell.com>
6321
6322         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
6323         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
6324         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
6325         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
6326         * class.cs: Update to changes.
6327
6328 2006-12-17  Marek Safar  <marek.safar@gmail.com>
6329
6330         A fix for bug #79934
6331         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
6332         partial container.
6333
6334         * class.cs (ResolveMembers): Register an iterator in current container and
6335         not in shared one.
6336
6337 2006-12-16  Raja R Harinath  <rharinath@novell.com>
6338
6339         Fix test-543.cs
6340         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
6341         satisfy a params annotated parameter.
6342
6343 2006-12-16  Marek Safar  <marek.safar@gmail.com>
6344
6345         A fix for bug #77014
6346         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
6347         paramters correctly and not rely on hacks in Parameters class.
6348         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
6349         at any possition.
6350         (Invocation.VerifyArgumentsCompat): Ditto.
6351         (Invocation.EmitArguments): Changed to correctly emit params arguments at
6352         any possition.
6353
6354         * parameter.cs (HasParams): Don't assume that params is the last one.
6355
6356         * support.cs (ReflectionParameters.ctor): Look for params attribute
6357         correctly.
6358         (ReflectionParameters.ParameterType): Removed hack when we returned last
6359         parameter for out of range parameters.
6360         (ParameterName, ParameterModifier): Ditto.
6361
6362 2006-12-14  Marek Safar  <marek.safar@gmail.com>
6363
6364         A fix for bug #79987
6365         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
6366         when assembly is not CLS compliant but type is. I have no idea why is this
6367         allowed.
6368
6369         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
6370
6371 2006-12-13  Miguel de Icaza  <miguel@novell.com>
6372
6373         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
6374         in struct constructors, they are basically no-ops.
6375
6376 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6377
6378         * cs-tokenizer.cs (Position): Save preprocessor status too.
6379
6380 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6381
6382         A fix for bug #77794
6383         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
6384
6385 2006-12-12  Marek Safar  <marek.safar@gmail.com>
6386
6387         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
6388         Fixes #69299.
6389         (pp_expr): Report error for an invalid expression.
6390         (handle_preprocessing_directive): Simplified; add more error checking.
6391
6392 2006-12-11  Marek Safar  <marek.safar@gmail.com>
6393
6394         A fix for bug #74939
6395         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
6396         directives handling.
6397
6398 2006-12-10  Marek Safar  <marek.safar@gmail.com>
6399
6400         A fix for bugs #80093, and #75984
6401         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
6402         logic, it seems to me as it worked before "by coincidence".
6403         (xtoken): Simplified to use reworked handle_preprocessing_directive.
6404         (cleanup): Enabled endif check.
6405
6406 2006-12-09  Marek Safar  <marek.safar@gmail.com>
6407
6408         A fix for bug #80162
6409         * statement.cs (CollectionForeach.TryType): Generics and non-generics
6410         enumerators are never ambiguous.
6411
6412 2006-12-08  Raja R Harinath  <rharinath@novell.com>
6413
6414         Fix #80060
6415         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
6416
6417 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6418
6419         A fix for bug #80144
6420         * class.cs (EventProperty.Define): Explicit implementation means
6421         that an even is used.
6422
6423 2006-12-06  Marek Safar  <marek.safar@gmail.com>
6424
6425         Fixes the operators implementation (part II)
6426
6427         * cfold.cs (DoConstantNumericPromotions): Renamed to
6428         DoBinaryNumericPromotions and simplified.
6429         (BinaryFold): Couple of conversion fixes; simplified.
6430
6431         * constant.cs, ecore.cs, literal.cs
6432         (ToType): Renamed to ConvertImplicitly.
6433         (Reduce): Renamed to ConvertExplicitly.
6434
6435         * class.cs, convert.cs: Updated.
6436
6437         * expression.cs: TryReduce doesn't throw an exception.
6438
6439 2006-12-01  Marek Safar  <marek.safar@gmail.com>
6440
6441         A fix for bug #80108
6442         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
6443         compatible.
6444
6445 2006-11-30  Marek Safar  <marek.safar@gmail.com>
6446
6447         Fixes unary operators implementation (part I)
6448         Also fixes #80026
6449
6450         * cfold.cs (Error_CompileTimeOverflow): Made internal
6451
6452         * const.cs (IConstant): Changed to use reference to constant and
6453         not constant itself.
6454         Updated IConstant implementations.
6455
6456         * constant.cs (CreateConstant): New factory method.
6457         Updated IConstant implementation.
6458
6459         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
6460
6461         * ecore.cs: Updated to use CreateConstantReference.
6462
6463         * enum.cs: Reflects IConstant changes.
6464
6465         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
6466
6467         * literal.cs (NullConstant): Change to be independently usable.
6468
6469 2006-11-29  Martin Baulig  <martin@ximian.com>
6470
6471         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
6472         we need to emit the scope initializer before calling the base .ctor.
6473
6474         * anonymous.cs: Merged back from the new anonymous methods branch.
6475         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
6476
6477         * expression.cs (ParameterReference.DoResolveBase): Create a
6478         "normal" ScopeInfo when capturing parameters rather than using the
6479         root scope; this makes things work with anonymous methods having
6480         parameters.
6481
6482         * statement.cs
6483         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
6484
6485 2006-11-22  Marek Safar  <marek.safar@gmail.com>
6486
6487         A fix for bug #79987
6488         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6489         check to a base class.
6490         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
6491         only when assembly has missing attribute.
6492         * report.cs: Update.
6493
6494 2006-11-21  Marek Safar  <marek.safar@gmail.com>
6495
6496         * cs-tokenizer.cs: Merged with gmcs version.
6497
6498 2006-11-20  Marek Safar  <marek.safar@gmail.com>
6499
6500         * cs-tokenizer.cs,
6501         * cs-parser.jay: Better error message when partial keyword is misplaced.
6502
6503 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
6504
6505         A fix for bug #79810
6506         report.cs: CS1058 only applies to 2.0 profile (gmcs).
6507         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
6508         a RuntimeWrappedException by default.
6509
6510 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6511
6512         A fix for bug #79843
6513         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
6514         implementation.
6515         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
6516
6517 2006-11-18  Marek Safar  <marek.safar@gmail.com>
6518
6519         * driver.cs, namespace.cs: Uses faster IndexOf version.
6520
6521 2006-11-17  Marek Safar  <marek.safar@gmail.com>
6522
6523         A fix for bug #79941
6524         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
6525         operators.
6526         (Operator.Define): Implicit/Explicit operator of same type is duplicate
6527         even if internal name is different.
6528         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
6529         (UserDefinedConversion): Simplified as the operators cannot be internal.
6530         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
6531         conversions.
6532         (MethodLookup): Replaced EmitContext with parentType.
6533         * expression.cs: Updated.
6534
6535 2006-11-09  Raja R Harinath  <rharinath@novell.com>
6536
6537         * driver.cs (BadAssembly): Handle all the ugliness of
6538         DefineDynamicAssembly.
6539
6540 2006-11-08  Raja R Harinath  <rharinath@novell.com>
6541
6542         Address parts of #58244 -- most of what's left is in the runtime
6543         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
6544         CS1509 error checks, and handle them for all assembly loads, not
6545         just the first invocation.
6546         (LoadModule): Likewise.  Move handling of 'adder_method' ...
6547         * codegen.cs (AssemblyClass.AddModule): ... here.
6548
6549 2006-11-02  Marek Safar  <marek.safar@gmail.com>
6550
6551         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
6552         IEnumerable<T> is ambiguous.
6553
6554 2006-10-31  Marek Safar  <marek.safar@gmail.com>
6555
6556         A fix for bug #67689
6557         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
6558         GetEnumerator is ambiguous.
6559
6560         * report.cs: Add new warning.
6561
6562 2006-10-29  Marek Safar  <marek.safar@gmail.com>
6563
6564         A fix for bug #78602
6565         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6566         to protected member can be nested type.
6567
6568 2006-10-28  Marek Safar  <marek.safar@gmail.com>
6569
6570         A fix for bug #78965
6571         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
6572         to protected member must derive from current type.
6573
6574 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6575
6576         assign.cs: Reuses error method.
6577
6578         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
6579         instead of type for constants.
6580         (Expression.Error_ValueAssignment): Common error method.
6581
6582         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
6583         for any assignment.
6584
6585 2006-10-27  Marek Safar  <marek.safar@gmail.com>
6586
6587         A fix for bug #79081
6588         * expression.cs (MemberAccess.DoResolve): Check nested type
6589         accessibility.
6590
6591 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
6592
6593         * doc.cs : nested delegates were not handled. Fixed bug #79754.
6594
6595 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6596
6597         A fix for bug #76591
6598         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
6599
6600 2006-10-26  Marek Safar  <marek.safar@gmail.com>
6601
6602         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
6603         type forwarder of the same type multiple times.
6604
6605 2006-10-26  Raja R Harinath  <rharinath@novell.com>
6606
6607         Fix #78820
6608         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
6609         instance as an rvalue, even when we later resolve as an lvalue.
6610
6611 2006-10-25  Martin Baulig  <martin@ximian.com>
6612
6613         * anonymous.cs: Fix #79673.
6614
6615 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
6616
6617         A fix for bug #79666
6618         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
6619         ignored when is optimized (= default value) as its value is already set.
6620
6621 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6622
6623         A fix for bug #79724
6624         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
6625         TypeContainer for type lookup.
6626
6627 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
6628
6629         A fix for bug #79231
6630         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
6631         * expression.cs (OverloadResolve): Always convert type name for
6632         an error message.
6633         (ResolveNamespaceOrType): Don't confuse a nested type with any 
6634         other member.
6635
6636 2006-10-18  Martin Baulig <martin@ximian.com>
6637
6638         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
6639
6640 2006-10-17  Miguel de Icaza  <miguel@novell.com>
6641
6642         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
6643         an int32, but requesting an int64 from the conversion
6644
6645 2006-10-12  Martin Baulig  <martin@ximian.com>
6646
6647         * anonymous.cs
6648         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
6649         
6650 2006-10-12  Martin Baulig  <martin@ximian.com>
6651
6652         * statement.cs
6653         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
6654
6655 2006-10-11  Miguel de Icaza  <miguel@novell.com>
6656
6657         * convert.cs: Remove broken code: I was doing the "Existance"
6658         tests for Implicit conversions.
6659
6660 2006-10-10  Miguel de Icaza  <miguel@novell.com>
6661
6662         * convert.cs: Added one missing case in
6663         ImplicitStandardConversionExists uint64 to intptr.
6664
6665         Fixes #59800
6666         
6667         * typemanager.cs (uintptr_type): another core known type.   
6668
6669         * ecore.cs (OperatorCast): routine used to do cast operations that
6670         depend on op_Explicit.  We could change some of the Decimal
6671         conversions to use this.
6672
6673         This one has a probe mechanism that checks both types for an op_
6674         which it coudl be used to eliminate two classes: CastToDecimal
6675         and CastFromDecimal.
6676
6677         * convert.cs: Implement the conversions documented in #59800
6678         
6679 2006-10-10  Martin Baulig  <martin@ximian.com>
6680
6681         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
6682         before RootScope.ResolveMembers().
6683
6684         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
6685         `CurrentType' if appropriate.
6686
6687 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
6688
6689         A fix for bug #78568
6690         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
6691         when contains binary operators.
6692         * cs-parser.jay: Updated.
6693
6694 2006-10-09  Martin Baulig  <martin@ximian.com>
6695
6696         * delegate.cs
6697         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
6698         moved that into Define() and also do the other type parameter
6699         checks there.  Fixes #79094.  Added gtest-292.cs.
6700
6701         * expression.cs
6702         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
6703         since that doesn't include type parameters; don't use `Ldelema'
6704         for type parameters.  Fixes #78980.  Added gtest-293.cs.
6705
6706 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
6707
6708         A fix for #77796
6709         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
6710         conversion is allowed.
6711
6712 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
6715         error reporting when no error occurs.
6716
6717 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
6718
6719         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
6720         does not exist.
6721
6722 2006-10-06  Raja R Harinath  <rharinath@novell.com>
6723
6724         Fix #79584
6725         * class.cs (DefineTypeBuilder): Check circular dependencies before
6726         setting the parent of the TypeBuilder.
6727         (CheckRecursiveDefinition): Don't use 'BaseType', since
6728         it may not be valid until after DefineTypeBuilder.  Use
6729         'base_type' instead.
6730
6731 2006-10-04  Martin Baulig  <martin@ximian.com>
6732
6733         Merged the Anonymous Methods patch.
6734
6735         * anonymous.cs, iterators.cs: The new anonymous methods code.
6736
6737         * statement.cs (Variable): New public abstract class.
6738         (LocalInfo.Variable): New public property.
6739         (LocalInfo.ResolveVariable): New public method.
6740         (Block.Flags): Add `IsIterator'.
6741         (Block.AddVariable): Improved the CS0136 check.
6742         (Block.AnonymousChildren): New public property.
6743         (Block.AddAnonymousChild): New public method.
6744         (ToplevelBlock): Update to use the new anonymous method framework.
6745         (ToplevelBlock.ctor): `container' is now a `Block' and not a
6746         `ToplevelBlock'; this is required to correctly implement the
6747         CS0136 check.
6748         (Fixed, Using): Use `TemporaryVariable' instead of directly
6749         creating the `LocalBuilder'.
6750
6751         * parameter.cs (Parameter.ResolveVariable): New public method.
6752         (Parameters.ResolveVariable): Likewise.
6753
6754         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
6755
6756         * class.cs (TypeContainer): Replaced the `iterators' list and
6757         corresponding methods with a list of `CompilerGeneratedClass'es.
6758         (TypeContainer.ResolveMembers): New public method.
6759         (Method): `IIteratorContainer' has been replaced by
6760         `IAnonymousHost'.
6761
6762         * expression.cs (VariableReference): New public abstract base
6763         class for `LocalVariableReference', `ParameterReference' and
6764         `This'.
6765
6766         * codegen.cs (EmitContext): Removed `capture_context',
6767         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
6768         (EmitContext.EmitThis): Removed.
6769
6770         * cs-parser.jay: Replace `iterator_container' with
6771         `anonymous_host'.       
6772
6773 2006-10-04  Martin Baulig  <martin@ximian.com>
6774
6775         * generic.cs (GenericMethod): Don't make this abstract.
6776         (Constraints.Clone): Added dummy implementation.
6777
6778 2006-10-04  Raja R Harinath  <harinath@gmail.com>
6779
6780         Fix #79577
6781         * namespace.cs (LookForAnyGenericType): Avoid nullref on
6782         'declspaces'.  Avoid allocating arrays willy-nilly.
6783
6784         Fix #79553
6785         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
6786         cases out of the switch.
6787
6788 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6789
6790         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
6791         message when non-generic type is used with the type arguments.
6792         * expression.cs: Updated.
6793
6794 2006-09-28  Raja R Harinath  <rharinath@novell.com>
6795
6796         Fix #79013
6797         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
6798         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6799         Change semantics slightly.  Don't insist on having only one
6800         temporary EmptyExpression -- just throttle the creation of new ones.
6801
6802         Fix #79451
6803         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
6804         non-interfaces too.  If no methods are found, don't try to create
6805         a MethodGroupExpr.
6806
6807 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
6808
6809         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
6810         generic type.
6811
6812         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
6813         us produce better error message.
6814
6815 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
6816
6817         * expression.cs (Binary.ResolveOperator): Warn about a side effect
6818         of the `|' operator.
6819
6820         * report.cs: A new warning added.
6821
6822 2006-09-27  Martin Baulig  <martin@ximian.com>
6823
6824         * generic.cs (GenericMethod): Don't make this abstract.
6825
6826 2006-09-27  Martin Baulig  <martin@ximian.com>
6827
6828         * report.cs
6829         (InternalErrorException): Added overloaded ctor taking a params array.
6830
6831 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
6832
6833         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
6834         Fixed the cases when same error was reported twice.
6835
6836         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
6837         now report symbol information.
6838
6839 2006-09-25  Martin Baulig  <martin@ximian.com>
6840
6841         * class.cs: Completely unified with the gmcs version.
6842
6843 2006-09-25  Martin Baulig  <martin@ximian.com>
6844
6845         * typemanager.cs (TypeManager.IsNullableType): New public function.
6846         (TypeManager.IsNullableTypeOf): Likewise.
6847         (TypeManager.IsNullableValueType): Likewise.
6848
6849         * class.cs (MethodCore): Added the `GenericMethod' argument from
6850         gmcs and also unified all classes derived from `MethodCore' with gmcs.
6851
6852 2006-09-24  Raja R Harinath  <harinath@gmail.com>
6853
6854         * convert.cs: Unify with gmcs version.
6855
6856 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6857
6858         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
6859         verify them as well.
6860
6861         * report.cs: New warning.
6862
6863 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6864
6865         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
6866         for anonymous block with out argument.
6867
6868 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
6869
6870         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
6871         not used private events only.
6872
6873 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
6874
6875         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
6876
6877         * const.cs (Const.Define): Check for constant type.
6878         (Const.IsConstantTypeValid): Looks for valid constant types.
6879
6880         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
6881
6882         * ecore.cs (EmptyConstantCast): New common class for all constant based
6883         EmptyCast(s).
6884
6885         * expression.cs (Is.DoResolve): Handle null constant especially.
6886         (New.DoResolve): Check for new void().
6887         (MemberAccess.DoResolve): Cope with all kind of nulls.
6888
6889         * literal.cs (NullConstant): Uses EmptyConstantCast.
6890         (NullDefault): Based on EmptyConstantCast.
6891         (NullLiteral): Uses EmptyConstantCast.
6892
6893         * statement.cs (Block.ResolveMeta): Check for constant type.
6894
6895 2006-09-22  Martin Baulig  <martin@ximian.com>
6896
6897         * delegate.cs, attribute.cs: Merged with the gmcs versions.
6898
6899 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6900
6901         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
6902         not the null type.
6903
6904         Fix part of #79451
6905         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
6906         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
6907         code slightly.
6908
6909 2006-09-22  Martin Baulig  <martin@ximian.com>
6910
6911         * ecore.cs: Merged with the gmcs version.
6912
6913         * generic.cs (ConstructedType): New dummy class.
6914         (TypeArguments): Don't make this abstract.
6915
6916         * typemanager.cs
6917         (TypeManager.IsGenericTypeDefinition): New method.
6918         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
6919
6920 2006-09-22  Raja R Harinath  <rharinath@novell.com>
6921
6922         * expression.cs (ComposedCast): Check for arrays of TypedReference
6923         before creating the type, not after.
6924
6925 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
6926
6927         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
6928         after ToType change.
6929
6930         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
6931         when constant must be implicitly convertible.
6932
6933         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
6934
6935         * ecore.cs (NullCast): Derives from NullConstant.
6936
6937         * expression.cs (Is.DoResolve): Removed useless variables.
6938         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
6939         (New.Constantify): Add enum support.
6940         (MemberAccess.DoResolve): Add warning when accessing null constant or
6941         variable.
6942
6943         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
6944         property.
6945
6946         * literal.cs (NullConstant): New abstract class with common
6947         functionality for all null specializations.
6948         (NullDefault): Represents default(X) when result can be
6949         reduced to null.
6950         (NullLiteral): Updated.
6951
6952         * report.cs: Add new warning.
6953
6954 2006-09-21  Martin Baulig  <martin@ximian.com>
6955
6956         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
6957
6958 2006-09-21  Martin Baulig  <martin@ximian.com>
6959
6960         * generic.cs (GenericConstraints): New dummy class.
6961         (Constraints): Likewise.
6962         (TypeParameter): Likewise.
6963         (TypeParameterName): Likewise.
6964         (GenericMethod): Likewise.
6965
6966         * typemanager.cs (TypeManager.GetGenericArguments): New method.
6967
6968         * decl.cs: Merged with the gmcs version.
6969
6970 2006-09-21  Raja R Harinath  <rharinath@novell.com>
6971
6972         * generic.cs (TypeParameter): Implement IMemberContainer.
6973         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
6974
6975         * rootcontext.cs: Unify with gmcs version.
6976
6977         * report.cs: Unify with gmcs version.
6978         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
6979         from gmcs/generics.cs.
6980         * generics.cs (TypeParameter): New dummy class.
6981
6982         * support.cs: Unify with gmcs version.
6983
6984 2006-09-20  Raja R Harinath  <rharinath@novell.com>
6985
6986         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
6987         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
6988
6989         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
6990         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
6991         * mcs.exe.sources: Add generic.cs.
6992
6993         * codegen.cs: Unify with gmcs version.
6994
6995         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
6996         (EmitContext): Add GenericDeclContainer implementation.
6997         * decl.cs (MemberCore, DeclSpace): Likewise.
6998         * namespace.cs: Remove #ifdef GMCS_SOURCE.
6999
7000         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7001         MCS TypeManager has a corresponding dummy method.
7002
7003 2006-09-19  Martin Baulig  <martin@ximian.com>
7004
7005         * expression.cs: Completely merged with the gmcs version.
7006
7007 2006-09-19  Martin Baulig  <martin@ximian.com>
7008
7009         * expression.cs (Invocation): Merged with the gmcs version.
7010         (ArrayAccess.GetStoreOpcode): Likewise.
7011
7012 2006-09-19  Martin Baulig  <martin@ximian.com>
7013
7014         * typemanager.cs
7015         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7016         (TypeManager.IsGenericMethodDefinition): Likewise.
7017
7018 2006-09-19  Martin Baulig  <martin@ximian.com>
7019
7020         * typemanager.cs
7021         (TypeManager.IsEqual): Moved the gmcs implementation here.
7022         (TypeManager.DropGenericTypeArguments): Likewise.
7023         (TypeManager.DropGenericMethodArguments): Likewise.
7024         (TypeManager.GetTypeArguments): Moved here from gmcs.
7025         (TypeManager.HasGenericArguments): Likewise.
7026
7027 2006-09-19  Martin Baulig  <martin@ximian.com>
7028
7029         * expression.cs (Binary): Merged with the gmcs version.
7030
7031 2006-09-19  Martin Baulig  <martin@ximian.com>
7032
7033         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7034
7035 2006-09-19  Martin Baulig  <martin@ximian.com>
7036
7037         * typemanager.cs: Merged with the gmcs version.
7038
7039 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7040
7041         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7042         * driver.cs: Likewise.
7043
7044 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7045
7046         A fix for #79401
7047         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7048         only if parent type is class.
7049         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7050         update.
7051
7052 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7053
7054         * cs-parser.jay,
7055         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7056         keywords are used.
7057         * typemanager.cs(CSharpName): Converts NullType to null.
7058
7059 2006-09-15  Martin Baulig  <martin@ximian.com>
7060
7061         * typemanager.cs
7062         (TypeManager.GetMethodName): Added mcs implementation.
7063         (TypeManager.IsEqual): Likewise.
7064
7065         * ecore.cs
7066         (SimpleName.RemoveGenericArity): Added dummy implementation.
7067
7068         * pending.cs: Merged with the gmcs version.     
7069
7070 2006-09-15  Martin Baulig  <martin@ximian.com>
7071
7072         * statement.cs: Merge with the gmcs version.
7073
7074 2006-09-15  Martin Baulig  <martin@ximian.com>
7075
7076         * statement.cs (Switch): Merge with the gmcs implementation
7077         (without nullables), which is newer.
7078
7079 2006-09-15  Martin Baulig  <martin@ximian.com>
7080
7081         * statement.cs (Block.Variables): Make this public.
7082         (ToplevelBlock.Parameters): Make this a property.
7083         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7084
7085 2006-09-15  Martin Baulig  <martin@ximian.com>
7086
7087         * namespace.cs: Merge with the gmcs version.
7088
7089 2006-09-15  Martin Baulig  <martin@ximian.com>
7090
7091         * decl.cs (MemberName): Minor code cleanups.
7092
7093 2006-09-15  Martin Baulig  <martin@ximian.com>
7094
7095         * parameter.cs: Merge with the gmcs version.
7096
7097 2006-09-15  Martin Baulig  <martin@ximian.com>
7098
7099         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7100         and an error in mcs.
7101
7102 2006-09-15  Martin Baulig  <martin@ximian.com>
7103
7104         * flowanalysis.cs: Merged from GMCS; added the generics code into
7105         a `GMCS_SOURCE' conditional so we can share this file.
7106
7107 2006-09-08  Martin Baulig  <martin@ximian.com>
7108
7109         * typemanager.cs (TypeManager.interlocked_type): New public field.
7110         (TypeManager.int_interlocked_compare-exchange): New public field.
7111         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7112         enumerator types here and call InitGenericCoreTypes().
7113         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7114         after calling InitEnumUnderlyingTypes().
7115
7116         * rootcontext.cs
7117         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7118         `classes_second_stage'. 
7119
7120 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7121
7122         * assign.cs, ecore.cs, expression.cs: Share error message text.
7123         * class.cs (FieldMember.Define): Check for varible of static type.
7124         * driver.cs (LoadAssembly): Uses error output for errors.
7125         * statement.cs: Updated.
7126
7127 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7128
7129         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7130         type instance.
7131
7132 2006-09-07  Martin Baulig  <martin@ximian.com>
7133
7134         * driver.cs
7135         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7136
7137 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7138
7139         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7140         
7141 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7142
7143         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7144         #52019 and #79064, the use of the \uXXXX sequence in source code
7145         to represent unicode characters.
7146
7147 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7148
7149         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7150         support.
7151         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7152
7153 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7154
7155         * assign.cs: Catch attempts to assign to a method groups in += and
7156         report as 1656
7157
7158 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7159
7160         A fix for #79056
7161         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7162
7163 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7164
7165         * class.cs (Method.Define): Issue a warning when generic method looks like
7166         an entry point.
7167         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7168         as well.
7169
7170 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7171  
7172         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7173         looking for ctor.
7174         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7175         search all base interfaces as a member can be ambiguous.
7176         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7177         Constructor member type filter. 
7178         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7179         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7180         reporting for returned memberinfos.
7181         * report.cs: Updated.
7182         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7183         version to work on all runtimes.
7184         (TypeManager.RealMemberLookup): Removed members filtering.
7185
7186 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7187
7188         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7189         (PropertyExpr.EmitAssign): Likewise.
7190         * expression.cs (Indirection.EmitAssign): Likewise.
7191         (LocalVariableReference.EmitAssign): Likewise.
7192         (ParameterReference.EmitAssign): Likewise.
7193         (Invocation.EmitArguments): Likewise.
7194         (ArrayAccess.EmitAssign): Likewise.
7195         (IndexerAccess.EmitAssign): Likewise.
7196         (This.EmitAssign): Likewise.
7197         (ConditionalLogicalOperator.Emit): Likewise.
7198
7199         Fix #79026
7200         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7201         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7202         leave it in after returning it.
7203         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7204
7205 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7206
7207         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7208         message.
7209
7210 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7211
7212         Fix cs0146-3.cs and cs0146-4.cs.
7213         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7214         enclosing types don't depend on the current type.
7215
7216 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7217
7218         Fix #77963
7219         * class.cs (TypeContainer.DoDefineMembers): Use
7220         FindBaseMemberWithSameName on Parent, since we're interested in
7221         whether we hide inherited members or not.
7222         (FindBaseMemberWithSameName): Make slightly more robust.
7223
7224         Fix the non-generic testcase from #77396
7225         * decl.cs (DeclSpace.DeclContainer): Remove override.
7226
7227         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7228         declspaces for doppelgangers too.
7229         (UsingEntry): Implement IResolveContext.
7230         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7231         'this' as the resolve context.
7232         (LocalAliasEntry): Likewise.
7233
7234         Implement parts of #77403
7235         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7236         toplevel declaration space.  Each namespace declaration introduces
7237         a "partial" root declaretion space.
7238         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7239         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7240         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7241         from 'current_namespace.SlaveDeclSpace'.
7242         (namespace_declaration): Likewise.
7243         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7244         check.  It can't happen now.
7245         * decl.cs (DeclSpace.LookupType): Likewise.
7246         * driver.cs (MainDriver): Sanity check.
7247
7248 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7249
7250         * decl.cs (DeclSpace.FindNestedType): Remove.
7251         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7252         LookupTypeContainer to get the container of the nested type.
7253         * class.cs (TypeContainer.FindNestedType): Make non-override.
7254
7255 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7256
7257         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7258         * class.cs (TypeContainer.PartialContainer): ... here.
7259         (TypeContainer.AddBasesForPart): New helper.
7260         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7261         instead.
7262         * cs-parser.jay (current_class): Convert to DeclSpace.
7263         (struct_declaration, interface_declaration, class_declaration):
7264         Use AddBasesForPart instead of .Bases directly.
7265         * const.cs, iterators.cs: Update to changes.
7266
7267 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7268
7269         * class.cs (TypeContainer.AddMemberType): Rename from
7270         AddToTypeContainer.
7271         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7272         (AddTypeContainer): New.  Combine AddClassOrStruct and
7273         AddInterface.
7274         (AddPartial): Update.  Add 'is_partial' argument.
7275         * roottypes.cs: Update to changes.
7276         * cs-parser.jay (push_current_class): New helper for handling
7277         current_container and current_class.
7278         (struct_declaration, interface_declaration, class_declaration):
7279         Use it.
7280
7281 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7282
7283         * roottypes.cs: Rename from tree.cs.
7284
7285         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7286         * tree.cs (Tree, ITreeDump): Remove types.
7287         * rootcontext.cs (tree, Tree): Remove fields.
7288         (root, ToplevelTypes): New.
7289         * *.cs: Update to rename.
7290
7291         * tree.cs (Tree.RecordDecl): Remove.
7292         (RootTypes.AddToTypeContainer): Record the toplevel type in its
7293         namespace here.
7294         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
7295
7296 2006-07-23  Raja R Harinath  <harinath@gmail.com>
7297
7298         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
7299         DoFlowAnalysis and OmitStructFlowAnalysis here.
7300         (ec.With): Rename from WithUnsafe and generalize.
7301         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
7302         (ec.WithFlowAnalyis): New.
7303         * ecore.cs, expression.cs, statement.cs: Update.
7304
7305 2006-07-22  Raja R Harinath  <harinath@gmail.com>
7306
7307         * statement.cs (Block.ResolveMeta): Simplify slightly.
7308
7309         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
7310         multiple boolean fields.  Convert InUnsafe, constant_check_state,
7311         check_state to flags.
7312         (CheckState, ConstantCheckState): Update.
7313         (InUnsafe): New read-only property.
7314         (FlagsHandle): Rename from CheckStateHandle and convert to handle
7315         arbitrary flags.
7316         (WithUnsafe): New helper similar to WithCheckState.
7317         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
7318         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
7319
7320 2006-07-21  Raja R Harinath  <rharinath@novell.com>
7321
7322         Make comparisons use the same IL irrespective of whether they're
7323         in a 'checked' or 'unchecked' context: one of the issues in #78899
7324         * codegen.cs (EmitContext.CheckState): Make read-only property.
7325         (EmitContext.ConstantCheckState): Likewise.
7326         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
7327         helper that implement a save/restore stack for CheckState
7328         values.  This is the only way to change check-state.
7329         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
7330         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
7331         (CheckedExpr.EmitBranchable): New forwarding method.
7332         (UnCheckedExpr): Likewise.
7333         * statement.cs (Block.ResolveMeta): Use WithCheckState.
7334         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
7335         (Checked.Resolve, checked.DoEmit): Likewise.
7336
7337 2006-07-20  Miguel de Icaza  <miguel@novell.com>
7338
7339         * anonymous.cs: Cache the resolved anonymous delegate, and return
7340         this so that the ResolveTopBlock is only triggered once, not
7341         twice.
7342
7343         Currently we trigger ResolvetopBlock twice due to a first pass of
7344         argument check compatibility, and a second pass that does the
7345         actual resolution.   
7346         
7347 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7348
7349         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
7350         modifiers.
7351         * rootcontext.cs (Reset): Add helper_classes.
7352
7353 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
7354
7355         A fix for #78860
7356         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
7357         correctly.
7358
7359 2006-07-13  Miguel de Icaza  <miguel@novell.com>
7360
7361         * statement.cs (Lock): Handle expressions of type
7362         TypeManager.null_type specially.  Fixes #78770
7363
7364 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7365
7366         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
7367         to an event.
7368
7369 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
7370
7371         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
7372         for accessors as well.
7373         * ecore.cs (EventExpr): Add AccessorTable.
7374
7375 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
7376
7377         A fix for #78738
7378         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
7379         for CS0122 where appropriate.
7380         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
7381         level attributes.
7382         (Filter): Assembly can be null in the case of top level attributes.
7383
7384 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
7385
7386         A fix for #78690
7387
7388         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
7389         is done at global level.
7390
7391 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7392
7393         A fix for #77002, Implemented TypeForwarder support.
7394
7395         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
7396         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
7397         * typemanager.cs (): Add type_forwarder_attr_type.
7398
7399 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
7400
7401         * report.cs: Add CS0469 warning.
7402
7403 2006-06-21  Martin Baulig  <martin@ximian.com>
7404
7405         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
7406         the `try'-block, so we also report CS0016 etc. there.
7407
7408 2006-06-21  Martin Baulig  <martin@ximian.com>
7409
7410         * delegate.cs
7411         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
7412
7413 2006-06-21  Martin Baulig  <martin@ximian.com>
7414
7415         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
7416         also report CS1686 for parameters.
7417
7418 2006-06-21  Martin Baulig  <martin@ximian.com>
7419
7420         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
7421         instead of an error if the value is not implicitly convertible to
7422         the switch types; fixes #77964.
7423
7424 2006-06-21  Raja R Harinath  <rharinath@novell.com>
7425
7426         Fix #78673
7427         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
7428         FieldBuilder is null.
7429
7430         Fix #78662
7431         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
7432         'left' and 'right' before error-checking.
7433
7434 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
7435
7436         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
7437         Fixed bug #78601.
7438         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
7439         (FieldExpr.DoResolve): likewise.
7440         (PropertyExpr.InstanceResolve): likewise.
7441         (EventExpr.InstanceResolve): likewise. 
7442
7443 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7444
7445         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
7446         attribute applicable tests for attribute argument.
7447
7448 2006-06-02  Raja R Harinath  <rharinath@novell.com>
7449
7450         Fix #78079
7451         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
7452         (Binary.OverloadResolve_PredefinedIntegral): New.
7453         (Binary.OverloadResolve_PredefinedFloating): New.
7454         (Binary.OverloadResolve_PredefinedString): New.
7455         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
7456         Follow the standard more closely, and treat numeric promotions in
7457         terms of overload resolution.
7458         (Binary.CheckShiftArguments): Simplify.
7459
7460 2006-06-01  Raja R Harinath  <rharinath@novell.com>
7461
7462         * flowanalysis.cs (MyBitVector): Simplify representation.
7463         (MyBitVector.Clone): Avoid allocating BitArray.
7464         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
7465         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
7466         (*): Update.  Change all references to MyBitVector.And and
7467         MyBitVector.Or to &= and |=.
7468
7469 2006-05-29  Raja R Harinath  <rharinath@novell.com>
7470
7471         Fix cs0231-[34].cs.
7472         * cs-parser.jay (formal_parameter_list): Extend the pattern below
7473         to param arguments too.
7474
7475 2006-05-26  Miguel de Icaza  <miguel@novell.com>
7476
7477         * cs-parser.jay: Catch another parsing form for arglist being
7478         followed by other arguments.  Fixes #78313.
7479
7480 2006-05-24  Raja R Harinath  <rharinath@novell.com>
7481
7482         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
7483         checking of out parameters to ...
7484         (FlowBranchingToplevel.Merge): ... here.
7485         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
7486         set, propagate the origin upward, and only complain if there was
7487         no other error.
7488         (FlowBranchingException.AddContinueOrigin): Likewise.
7489         (FlowBranchingException.AddReturnOrigin): Likewise.
7490         (FlowBranchingException.AddGotoOrigin): Likewise.       
7491
7492 2006-05-23  Raja R Harinath  <rharinath@novell.com>
7493
7494         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
7495         unreachable, skip it.
7496         (FlowBranchingException.Merge): Always propagate jumps, even if
7497         the finally block renders subsequent code unreachable.
7498
7499 2006-05-18  Raja R Harinath  <rharinath@novell.com>
7500
7501         Fix #77601
7502         * statement.cs (Goto.Resolve): Move responsibility for resolving
7503         'goto' to FlowBranching.AddGotoOrigin.
7504         (Goto.SetResolvedTarget): New.  Callback to set the
7505         LabeledStatement that's the target of the goto.
7506         (Goto.DoEmit): Use Leave instead of Br when crossing an
7507         unwind-protect boundary.
7508         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
7509         LookupLabel and adjust to new semantics.
7510         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
7511         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
7512         Goto.SetResolvedTarget to update target.
7513         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
7514         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
7515         AddBreakOrigin & co.  Delay propagation until ...
7516         (FlowBranchingException.Merge): ... this.
7517
7518         * statement.cs (Block.Resolve): Always depend on flow-branching to
7519         determine unreachability.  Kill workaround that originally emitted
7520         only one statement after an "unreachable" label (see infloop in
7521         test-515.cs).
7522
7523         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
7524         This is still "wrong", but anything better would probably need a
7525         multi-pass algorithm.
7526         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
7527         usage vector.  Force current usage vector to be reachable, to
7528         optimistically signify backward jumps.
7529         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
7530         detected.
7531         (FlowBranchingLabeled.Merge): New.  If no backward jump was
7532         detected, return the original salted-away usage vector instead,
7533         updated with appropriate changes.  Print unreachable warning if
7534         necessary.
7535         * statement.cs (Block.Resolve): Don't print unreachable warning on
7536         a labeled statement.
7537
7538 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
7539
7540         * driver.cs: Pass filename without path to AssemblyBuilder's 
7541         AddResourceFile. Fixes bug #78407.
7542
7543 2006-05-17  Raja R Harinath  <rharinath@novell.com>
7544
7545         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
7546         * flowanalysis.cs (FlowBranchingLabeled): ... here.
7547         (FlowBranching.MergeChild): Overwrite
7548         reachability information from Labeled branchings too.
7549
7550 2006-05-16  Raja R Harinath  <rharinath@novell.com>
7551
7552         * statement.cs (Goto.Resolve): Merge jump origins here ...
7553         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
7554
7555         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7556         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
7557         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
7558         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
7559         here, ...
7560         * statement.cs (Goto.Resolve): ... not here.
7561         (Goto.Emit): Remove CS1632 check.
7562
7563 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
7564
7565         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
7566         error message.
7567
7568 2006-05-11  Raja R Harinath  <rharinath@novell.com>
7569
7570         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
7571         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
7572         (FlowBranchingException.Label): Likewise.
7573
7574         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
7575         given value.
7576         (MyBitVector.Or): Use it to avoid losing information (Count).
7577         (FlowBranching.MergeOrigins): Likewise.
7578
7579         * flowanalysis.cs (UsageVector.IsDirty): Remove.
7580         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
7581         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
7582         (UsageVector.ToString): Simplify.
7583         (UsageVector.MergeSiblings): Move here from ...
7584         (FlowBranching.Merge): ... here.
7585         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
7586         not a MyBitVector.
7587
7588 2006-05-10  Raja R Harinath  <rharinath@novell.com>
7589
7590         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
7591         null bitvector is treated as all-true.
7592
7593         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
7594         (MyBitVector): Rationalize invariants.  'vector != null' implies
7595         that we have our own copy of the bitvector.  Otherwise,
7596         'InheritsFrom == null' implies all inherited bits are true.
7597
7598 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
7599
7600         * statement.cs (LocalInfo): Add IsConstant.
7601         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
7602         local variable for constants.
7603
7604 2006-05-09  Raja R Harinath  <rharinath@novell.com>
7605
7606         * flowanalysis.cs (MyBitVector.Empty): New.
7607         (MyBitVector): Don't allow InheritedFrom to be null.
7608         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
7609         (UsageVector, FlowBranching): Update to changes.
7610
7611         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
7612         recursion.  The 'Parent == null' condition isn't sufficient for
7613         anonymous methods.
7614         (FlowBranching.AddBreakOrigin): Likewise.
7615         (FlowBranching.AddContinueOrigin): Likewise.
7616         (FlowBranching.AddReturnOrigin): Likewise.
7617         (FlowBranching.StealFinallyClauses): Likewise.
7618         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
7619         (FlowBranching.CheckOutParameters): Likewise.
7620         (FlowBranchingToplevel): Terminate all the above recursions here.
7621         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
7622         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
7623
7624         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
7625         toplevel block.
7626         (FlowBranchingToplevel): New.  Empty for now.
7627         (FlowBranching.MergeTopBlock): Update.
7628         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
7629         branching for the anonymous delegate.
7630         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
7631
7632         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
7633         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
7634         information at the start of the merge.  Reorganize.
7635
7636 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7637
7638         * class.cs (MethodData.Define): Method cannot implement interface accessor.
7639
7640 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7641
7642         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
7643         to newly introduced ctor.
7644
7645         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
7646         message to one place.
7647         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
7648         global namespace.
7649
7650 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
7651
7652         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
7653
7654         * ecore.cs (Expression.ResolveAsConstant): Updated.
7655
7656         * statement.cs (ResolveMeta): Updated.
7657
7658 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7659
7660         * cs-parser.jay: __arglist cannot be used in initializer.
7661
7662 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
7663
7664         A fix for #77879
7665         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
7666         private types.
7667
7668 2006-05-05  Raja R Harinath  <rharinath@novell.com>
7669
7670         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
7671         (LabeledStatement): Add 'name' parameter.
7672         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
7673         (Block.AddLabel): Update to changes.
7674         * cs-parser.jay (labeled_statement): Likewise.
7675
7676         * flowanalysis.cs (BranchingType.Labeled): New.
7677         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
7678         (FlowBranchingLabeled): New.  Does nothing for now, but will
7679         eventually handle 'goto' flows.
7680         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
7681         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
7682         that's terminated ...
7683         (Block.Resolve): ... here.
7684
7685         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
7686         (UsageVector.MergeFinallyOrigins): Likewise.
7687         (FlowBranching.InTryOrCatch): Likewise.
7688         (FlowBranching.AddFinallyVector): Likewise.
7689         (FlowBranchingException): Update to changes.
7690
7691         Fix #78290
7692         * statement.cs (Return.Resolve): Move error checking to ...
7693         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
7694         (FlowBranchingException): Handle return origins like break and
7695         continue origins.
7696         (FlowBranching.UsageVector.CheckOutParameters): Remove.
7697
7698 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7699
7700         A fix for #76122
7701         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
7702         filter.
7703
7704 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
7705
7706         A fix for #77543
7707         * class.cs (MethodData.Define): Do public accessor check only when method
7708         implements an interface.
7709
7710 2006-05-04  Raja R Harinath  <rharinath@novell.com>
7711
7712         Remove special handling of 'break'
7713         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
7714         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
7715         (UsageVector.Break): Remove.
7716         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
7717         reachability.
7718         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
7719
7720         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
7721         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
7722
7723 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7724
7725         A fix for #75726
7726         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
7727         be the interface member.
7728
7729 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
7730
7731         A fix for #60069
7732         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
7733         for emitting small (int) values.
7734
7735 2006-05-03  Raja R Harinath  <rharinath@novell.com>
7736
7737         Fix #59427
7738         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
7739         control-flow passes through the 'finally' after merging-in all the
7740         control-flows from 'try' and the 'catch' clauses.
7741
7742         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
7743         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
7744         always true at the only non-recursive entry point.
7745         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7746         FlowBranchingBreakable.
7747         (FlowBranchingLoop): Remove.
7748         * statement.cs (Return.DoResolve): Update to changes.
7749
7750         Fix #76471, #76665
7751         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
7752         (FlowBranching.CreateBranching): Handle it: create a
7753         FlowBranchingContinuable.
7754         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
7755         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
7756         except that it handles the 'continue' command.
7757         (FlowBranching.UsageVector.MergeOrigins): Rename from
7758         MergeBreakOrigins.
7759         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
7760         except that it overrides AddContinueOrigin.
7761         (FlowBranchingException): Override AddContinueOrigin, similar to
7762         AddBreakOrigin.
7763         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
7764         Create a new branching around the embedded statement.
7765         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
7766         control flow after the embedded statement.
7767         (Continue.Resolve): Move all error checking to AddContinueOrigin.
7768
7769         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
7770         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
7771         FlowBranchingBreakable.
7772         (FlowBranchingSwitch): Remove.
7773
7774         Fix test-503.cs
7775         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
7776         error reporting to ...
7777         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
7778         Rename from 'AddBreakVector'.  Add new location argument.  Return
7779         a bool indicating whether the 'break' crosses an unwind-protect.
7780         (FlowBranchingException.AddBreakOrigin): Add.
7781         (FlowBranchingException.Merge): Propagate 'break's to surrounding
7782         flowbranching after updating with the effects of the 'finally'
7783         clause.
7784         (FlowBranchingBreakable): New common base class for
7785         FlowBranchingLoop and FlowBranchingSwitch.
7786
7787         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
7788         embedded statement.
7789         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
7790
7791 2006-05-02  Raja R Harinath  <rharinath@novell.com>
7792
7793         * statement.cs (Do.Resolve): If the loop is infinite, set the
7794         barrier.
7795         (While.Resolve, For.Resolve): Set a barrier after the embedded
7796         statement.  There's no direct control flow that goes from the end
7797         of the embedded statement to the end of the loop.
7798         * flowanalysis.cs (FlowBranching.Infinite): Remove.
7799         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
7800         above ensure that the reachability is correctly computed.
7801
7802         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
7803         (UsageVector.MergeBreakOrigins): If the current path is
7804         unreachable, treat it as if all parameters/locals are initialized.
7805         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
7806         infinite loops before merging-in break origins.
7807
7808         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
7809         (Reachability.Reachable): Split part into ...
7810         (Reachability.Unreachable): ... this.  Simplify.
7811         (Reachability.IsUnreachable): Use 'Unreachable' instead.
7812
7813         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
7814         (Reachability.SetThrowsSometimes): Likewise.
7815         (FlowBranchingBlock.MergeTopBlock): Don't compare against
7816         TriState.Always, use corresponding property.
7817         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
7818         (Block.Resolve): Likewise.  Remove some redundant checks.
7819
7820 2006-05-02  Raja R Harinath  <harinath@gmail.com>
7821
7822         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
7823         (Reachability.Meet): Don't bother checking AlwaysThrows --
7824         barrier is always set.
7825         (FlowBranchingBlock.Merge): Likewise.
7826
7827 2006-05-01  Raja R Harinath  <harinath@gmail.com>
7828
7829         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
7830         checks for unreachable.
7831
7832 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
7833
7834         A fix for #77980
7835         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
7836
7837         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
7838         whether field is really assigned.
7839
7840 2006-04-30  Raja R Harinath  <harinath@gmail.com>
7841
7842         * flowanalysis.cs (Reachability): Make 4-argument constructor
7843         private.
7844         (Reachability.Meet): Rename from 'And'.  Remove static variant.
7845         (Reachability.Always): Rename from the highly misleading
7846         'Reachability.Never'.
7847         (FlowBranching.Merge): Update to changes.  Mark an impossible
7848         situation with a 'throw'.
7849         (*): Update to changes.
7850
7851 2006-04-29  Raja R Harinath  <harinath@gmail.com>
7852
7853         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
7854         Remove 'Undefined'.
7855         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
7856         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
7857         (*): Update to changes.
7858         * statement.cs: Update to changes.
7859
7860 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
7861
7862         A fix for #78049
7863         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
7864
7865 2006-04-28  Raja R Harinath  <harinath@gmail.com>
7866
7867         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
7868         dummy UsageVector.
7869
7870         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7871         argument to two arguments: an usage-vector and a bool.  Move call
7872         to FlowBranching.Merge () ...
7873         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
7874
7875         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
7876         handling of loop and switch reachability to ...
7877         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
7878
7879 2006-04-27  Raja R Harinath  <harinath@gmail.com>
7880
7881         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
7882         handling to FlowBranchingLoop.InLoop.
7883         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
7884
7885 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
7886
7887         A fix for #78115
7888         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
7889         anonymous method is allowed from AnonymousContainer here.
7890
7891         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
7892
7893 2006-04-24  Raja R Harinath  <rharinath@novell.com>
7894
7895         Fix #78156
7896         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
7897
7898 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
7899
7900         A fix for #49011.
7901         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
7902         (DoubleConstant.Reduce): Ditto.
7903
7904 2006-04-23  Raja R Harinath  <rharinath@novell.com>
7905
7906         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
7907         Remove 'lvalue_right_side' argument.  Move parts to ...
7908         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
7909         (LocalVariable.DoResolveLValue): ... these.
7910
7911 2006-04-21  Raja R Harinath  <rharinath@novell.com>
7912
7913         Fix cs1655.cs
7914         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
7915         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
7916         (LocalVariableReference.DoResolveBase): Use it to implement new
7917         CS1655 check.
7918         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
7919         (Argument.Resolve): Simplify.  Move CS1510 check ...
7920         * ecore.cs (Expression.ResolveLValue): ... here.
7921         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
7922         (PropertyExpr.DoResolveLValue): Likewise.
7923         (FieldExpr.Report_AssignToReadonly): Likewise.
7924         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
7925         LValueMemberAccess or LValueMemberOutAccess on instance depending
7926         on it.
7927         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
7928         DoResolve as appropriate.
7929
7930 2006-04-20  Raja R Harinath  <rharinath@novell.com>
7931
7932         Fix #75800
7933         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
7934         implicit conversions on 'out' and 'ref' arguments.
7935
7936         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
7937         improve clarity.  Remove dead code.
7938
7939         Fix #66031
7940         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
7941         (Catch.Resolve): Resolve VarBlock if it exists.
7942
7943 2006-04-19  Miguel de Icaza  <miguel@novell.com>
7944
7945         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
7946         twice, this was some residual code, the enumerator was emitted
7947         properly in the two branche of if later.
7948
7949 2006-04-19  Raja R Harinath  <rharinath@novell.com>
7950
7951         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
7952         cast is never an lvalue.
7953         (Cast.DoResolve, Cast.ResolveRest): Combine.
7954         (Argument.Emit): Simplify slightly.  Move 'Expr is
7955         IMemoryLocation' check ...
7956         (Argument.Resolve): ... here.
7957         (Argument.Error_LValueRequired): Remove.  Inline into only user.
7958
7959         Simplifications.  Fix cs0191-2.cs
7960         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
7961         CS1649 and CS1651 to ...
7962         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
7963         the actual selection of the error code and message to a lookup
7964         table.  Add a dummy return value to simplify callsites.
7965         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
7966         readonly fields of other instances of the same type.  Move CS0197
7967         warning from ...
7968         * expression.cs (Argument.Resolve): ... here.  Simplify code.
7969         Ensure that ec.InRefOutArgumentResolving is only set during LValue
7970         resolution of an out or ref argument.  The code simplification
7971         above uses this invariant.
7972
7973 2006-04-18  Raja R Harinath  <rharinath@novell.com>
7974
7975         Possibly fix #77752.  Fix cs1690-[4-7].cs.
7976         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
7977         CheckMarshallByRefAccess.  Drop parameter.
7978         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
7979         warning.
7980         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
7981         InstanceExpression.
7982         * report.cs (AllWarnings): Add CS1690.
7983         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
7984         for ref access too.
7985         (LocalVariableReference.DoResolveBase): Update.
7986
7987 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
7988
7989         * class.cs (MethodOrOperator): Moved common parts from method class.
7990         detect obsolete attributes.
7991         (Method.Define): Simplified as it reuses code from base.
7992         (Constructor.ValidAttributeTargets): Fixed issue found during
7993         refactoring.
7994         (Destructor.ValidAttributeTargets): Fixed issue found during
7995         refactoring.
7996         (Operator): Finished refactoring set off by #78020. Operator class is now
7997         ordinary method class.
7998
7999         * anonymous.cs: Updated.
8000
8001         * decl.cs (DeclSpace): Add IsGeneric
8002
8003 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8004
8005         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8006
8007 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8008
8009         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8010         detect obsolete attributes.
8011         (Method.CreateEmitContext): Moved to MethodOrOperator.
8012
8013 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8014
8015         A fix for #78048.
8016         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8017         customized exception to make crash detection easier.
8018         (MethodOrOperator): Started to work on new base class for methods and
8019         operators.
8020         (Method): Derives from MethodOrOperator.
8021         (Constructor.Emit): Emits its own attributes.
8022         (AbstractPropertyEventMethod.Emit): Ditto.
8023         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8024         patch.
8025         (Operator.Emit): It's temporary more tricky than should be.
8026         
8027         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8028
8029         * report.cs (InternalErrorException): Add ctor with inner exception.
8030
8031 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8032
8033         A fix for #76744.
8034         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8035         only not visible.
8036
8037 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8038
8039         A fix for #77916.
8040         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8041         array.
8042
8043 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8044
8045         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8046         attribute is present and Guid not.
8047         (Interface.ApplyAttributeBuilder): Ditto.
8048
8049         * attribute.cs: Add error message.
8050
8051 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8052
8053         A fix for #78020.
8054
8055         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8056         sources (it's composite) so hold them in extra array as they are used in
8057         Emit phase only. It worked in the previous versions by mistake.
8058         (Attribute.Emit): Emit attribute for more owners when exist.
8059
8060         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8061         it has now different behaviour.
8062
8063 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8064
8065         * constant.cs (Constant.IsDefaultInitializer): New method.
8066
8067         * class.cs: Updated.
8068
8069         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8070         re-initialize default values. It saves KBs almost for every assembly.
8071         Thanks Zoltan for the idea.
8072         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8073         (ArrayCreation.DoResolve): Resolve only once.
8074         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8075         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8076
8077 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8078
8079         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8080         From #77961.
8081
8082 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8083
8084         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8085         in an embedded statement too.
8086
8087 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8088
8089         Fix #77958
8090         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8091
8092 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8093
8094         A fix for #77966.
8095
8096         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8097         was not specified.
8098
8099         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8100
8101 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8102
8103         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8104         phase.
8105
8106         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8107         LocalTemporary change.
8108
8109         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8110         TypeContainer.
8111         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8112         initializers optimization.
8113         (ClassOrStruct.TypeAttr): Moved from modifiers.
8114         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8115         (FieldBase.ResolveInitializer): Resolves initializer.
8116         (FieldBase.HasDefaultInitializer): New property.
8117
8118         * cs-parser.jay: Removed message.
8119
8120         * expression.cs (CompilerGeneratedThis): New specialization.
8121
8122         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8123
8124 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8125
8126         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8127
8128 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8129
8130         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8131         be now EnumConstants only.
8132
8133 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8134
8135         * attribute.cs, driver.cs: Reset more caches.
8136
8137 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8138
8139         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8140
8141 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8142
8143         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8144         for easier reuse. Updated all overrides.
8145         (IntegralConstant): New base class for all integral constants.
8146         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8147         of the constant range, report custom error.
8148         (UIntConstant.Reduce): Fixed uint conversion.
8149
8150         * ecore.cs, literal.cs: Reduce updates.
8151
8152 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8153
8154         A fix for #75813.
8155
8156         * class.cs (Constructor.Define): Removed extra if for default ctors.
8157         A patch from Atsushi Enomoto.
8158
8159 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8160
8161         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8162         GetAttributableValue.
8163
8164         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8165         when required.
8166
8167         * convert.cs (ImplicitConversionRequired): Error message moved to
8168         DoubleLiteral.
8169
8170         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8171         automatic implicit conversion of an output value.
8172         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8173
8174         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8175         conversion.
8176         (TypeOf.GetAttributableValue): Add extra handling for object type.
8177
8178         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8179         special error message.
8180
8181 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8182
8183         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8184         InternalCall.
8185         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8186         compatible with MS runtime.
8187
8188 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8189
8190         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8191         attribute arguments here.
8192
8193         * class.cs (Indexer.Define): The check was moved to attribute class.
8194
8195 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8196
8197         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8198         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8199         easier.
8200
8201 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8202
8203         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8204         mcs to keep code differences small.
8205         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8206         * typemanager.cs (parameter_default_value_attribute_type): New.
8207         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8208         CS1908 check.
8209
8210 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8211
8212         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8213
8214 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8215
8216         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8217
8218         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8219         the blocks too.
8220
8221 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8222
8223         * doc-bootstrap.cs : fix build.
8224
8225 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8226
8227         * expression.cs (StringConcat.Append): Issue a warning when empty string
8228         is going to append.
8229
8230 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8231
8232         * assign.cs (CompoundAssign.ResolveSource): Removed.
8233
8234         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8235         clean up.
8236
8237         * class.cs (TypeContainer.FindMethods): Removed.
8238         (TypeContainer.CheckMemberUsage): Made static.
8239
8240         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8241
8242         * constant.cs (CheckRange): Removed unused type argument.
8243         (CheckUnsigned): Removed unused type argument.
8244
8245         * cs-parser.jay: Updated after MemberAccess clean up.
8246         Uses Length for empty string test.
8247
8248         * cs-tokenizer.cs: Uses Length for empty string test.
8249         (IsCastToken): Made static.
8250         (is_hex): Made static.
8251         (real_type_suffix): Made static.
8252
8253         * decl.cs (SetupCache): Made static.
8254         (OnGenerateDocComment): Removed unused ds argument.
8255
8256         * delegate.cs (VerifyDelegate): Removed unused argument.
8257
8258         * doc.cs: Uses Length for empty string test.
8259
8260         * driver.cs: Uses Length for empty string test.
8261
8262         * enum.cs (IsValidEnumType): Made static
8263
8264         * expression.cs (EnumLiftUp): Removed unused argument.
8265         (ResolveMethodGroup): Ditto.
8266         (BetterConversion): Ditto.
8267         (GetVarargsTypes): Ditto.
8268         (UpdateIndices): Ditto.
8269         (ValidateInitializers): Ditto.
8270         (MemberAccess.ctor): Ditto.
8271         (GetIndexersForType): Ditto.
8272
8273         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8274
8275         * iterators.cs: Updated after MemberAccess clean up.
8276
8277         * location.cs: Uses Length for empty string test.
8278
8279         * namespace.cs: Uses Length for empty string test.
8280
8281          * report.cs (CheckWarningCode): Made static.
8282
8283         * statement.cs (LabeledStatement): Removed unused argument.
8284
8285         * typemanager.cs (FilterNone): Removed.
8286
8287 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8288
8289         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8290         obsolete.
8291
8292         * class.cs: Updated.
8293
8294 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8295
8296         * cs-parser.jay.cs: __arglist is not allowed for delegates.
8297
8298 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8299
8300         A fix for #77822.
8301
8302         * expression.cs (VerifyArgumentsCompat): Reverted to double error
8303         reporting, it's more tricky than I thought.
8304
8305 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8306
8307         A fix for #77816.
8308
8309         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
8310         host container.
8311         (AnonymousMethod.ImplicitStandardConversionExists): New method.
8312         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
8313         Add more error reporting; Fixed issue with params.
8314
8315         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
8316
8317         * cs-parser.jay: AnonymousMethod requires host container.
8318
8319         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
8320
8321 2006-03-18  Raja R Harinath  <harinath@gmail.com>
8322
8323         * class.cs: Change 'TypeContainer ds' constructor argument to
8324         'DeclSpace parent'.  Some classes were missed below due to
8325         different naming convention.
8326
8327         * class.cs (MemberCore.Parent): Delete.  This makes the
8328         ParentContainer changes below enforceable by the compiler.
8329
8330         Treat pointers to enclosing declaration space as 'DeclSpace', not
8331         'TypeContainer'.
8332         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
8333         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
8334
8335         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
8336         of TypeContainer.
8337         (Block.AddThisVariable): Likewise.
8338         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
8339         (AbstractPropertyEventMethod.Emit): Likewise.
8340         (AbstractPropertyEventMethod.EmitMethod): Likewise.
8341         (GetMethod.Define, SetMethod.Define): Likewise.
8342         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
8343         (DelegateMethod.EmitMethod): Likewise.
8344
8345         Fix regression test-partial-13.cs.
8346         Rationalize use of PartialContainer.  Ensure that the partial
8347         class semantics can be tied to type-correctness, i.e., any
8348         violation will cause a compile error.
8349         * class.cs, const.cs: Access all fields that belong to class
8350         TypeContainer via ParentContainer.  Arguments of EmitContexts and
8351         Resolve()-like functions still use 'Parent'.
8352
8353         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
8354         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
8355         (PropertyMethod.CheckModifiers): Remove unused argument.
8356         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
8357         DeclSpace.
8358
8359 2006-03-17  Raja R Harinath  <harinath@gmail.com>
8360
8361         Make semantics of PartialContainer simpler.
8362         * decl.cs (DeclSpace.IsPartial): Remove.
8363         * class.cs (TypeContainer.IsPartial): Likewise.
8364         (TypeContainer..ctor): Set PartialContainer to point to self.
8365         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
8366         (TypeContainer.FindNestedType): Likewise.
8367         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
8368
8369 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
8370
8371         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
8372
8373 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8374
8375         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
8376         classes.
8377
8378 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
8379
8380         * class.cs (Operator.Define): An error for base conversion was not
8381         reported correctly.
8382
8383 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
8384
8385         * iterator.cs : yield break is allowed in try statement which has
8386           catch clauses. Fixed bug #77767.
8387
8388 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
8389
8390         A fix for #77593, #77574.
8391
8392         * class.cs (MethodCore.CheckBase): Another if for operator.
8393
8394 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
8395
8396         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
8397         were not resolved
8398
8399         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
8400         (DelegateCreation.ImplicitStandardConversionExists): New method for just
8401         conversion test.
8402         
8403         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
8404         not needed.
8405
8406         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
8407         Updated after another emitcontext usage was clean up. It should help us to
8408         synchronize with gmcs easier.
8409
8410 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
8411
8412         A fix for #77353.
8413
8414         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
8415         (Event.Define): ditto
8416         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
8417
8418         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
8419         Removed redundant code and set NewSlot for Invoke method too.
8420
8421         * parameter.cs (Parameters.ctor): Add custom, type ctor.
8422         (Parameters.MergeGenerated): New method. Use this method when you merge
8423         compiler generated argument with user arguments.
8424
8425 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
8426
8427         * attribute.cs (ResolveAsTypeTerminal): Removed.
8428
8429         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
8430         specialization for predefined types; 30% speed up.
8431         Finally placed obsolete check to right place.
8432         (Expression.ResolveType): Removed.
8433
8434         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
8435         Updated after ResolveType was removed.
8436
8437         * expression.cs (Cast.ctor): Check void cast.
8438         (Binary.ResolveAsTypeTerminal): Is never type.
8439         (Conditional.ResolveAsTypeTerminal): Is never type.
8440
8441         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
8442
8443 2006-03-01  Raja R Harinath  <rharinath@novell.com>
8444
8445         Fix #77679.
8446         * expression.cs (ParameterReference.DoResolveBase): Change return
8447         type to bool.
8448         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
8449         Update.
8450
8451         Fix #77628.
8452         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
8453
8454         Fix #77642.
8455         * typemanager.cs (GetFullNameSignature): Don't nullref on
8456         protected accessors.
8457
8458 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
8459
8460         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
8461         these two separated members to simplify the code.
8462         (Attribute.Resolve): Refactored to use new fields and methods.
8463         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
8464         implemented obsolete attribute checking.
8465         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
8466         implemented obsolete checking again. It look line never ending quest ;-)
8467         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
8468
8469         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
8470
8471         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
8472
8473         *class.cs (Property.Define): Add RegisterProperty call.
8474
8475         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
8476         argument groups (only 2).
8477
8478         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
8479         encoding expression to arguments.
8480         (Expression.ExprClassToResolveFlags): Just turned to property.
8481
8482         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
8483         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
8484         optimized as well as implemented support for zero-length attributes.
8485
8486         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
8487         Add caching of PropertyInfo's.
8488
8489 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8490
8491         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
8492         error multiple times.
8493
8494 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
8495
8496         New partial class implementation.
8497         A fix for #77027, #77029, #77403
8498
8499         * attribute.cs (Attributable): Made attributes protected.
8500
8501         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
8502         the replacements of ClassPart and PartialContainer.
8503         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
8504         (TypeContainer.AddInterface): Ditto.
8505         (TypeContainer.AddPartial): The main method for partial classes. It checks
8506         for errors and merges ModFlags and attributes. At the end class is added to
8507         partial_parts list.
8508         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
8509         required here.
8510         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
8511         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
8512         from the rest of partial classes.
8513         (TypeContainer.GetClassBases): Simplified.
8514         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
8515         DefineType.
8516         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
8517         (TypeContainer.HasExplicitLayout): Uses Flags now.
8518         (PartialContainer): Removed.
8519         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
8520         (StaticClass): Was merged with Class.
8521         (Class.GetClassBases): class and static class bases are verified here.
8522         (Class.TypeAttr): Added static attributes when class is static.
8523         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
8524         (MemberBase): In some cases we need to call parent container for partial
8525         class. It should be eliminated but it's not easy now.
8526
8527         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
8528
8529         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
8530         partial classed to accumulate class comments.
8531         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
8532
8533         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
8534
8535         * driver.cs (MainDriver): Tree.GetDecl was removed.
8536
8537         * modifiers.cs (Modifiers): Add partial modifier.
8538
8539         * tree.cs (Tree.decl): Removed.
8540         (RootTypes): Started to use this class more often for root types
8541         specializations.
8542
8543 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8544
8545         A fix for #77615
8546
8547         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
8548         external interface does not have an attribute.
8549
8550 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
8551
8552         Another prerequisites for new partial classs implementation.
8553         
8554         * attribute.cs (Attribute.Equal): Implemented.
8555         (Attribute.Emit): Changed as attributes can be applied more than twice.
8556         (Attributes.Emit): Check for duplicate attributes here.
8557
8558         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
8559         as a parameter, clean-up.
8560
8561 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8562
8563         A fix for #77485
8564
8565         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
8566         contains obsolete attribute check which can in some cases look for base
8567         type of current class which is not initialized yet.
8568         (TypeContainer.BaseType): Replacement of ptype.
8569
8570         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
8571
8572 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
8573
8574         First of prerequisites for new partial classs implemention.
8575         
8576         * attribute.cs (Attributable): Extended by ResolveContext;
8577         Attributes finally have correct context for resolving in all cases.
8578         (AttachTo): Attribute owner is assigned here.
8579
8580         * codegen.cs (IResolveContext): Introduce new interface to hold
8581         all information needed in resolving phase.
8582         (EmitContext): Implements IResolveContext; more clean-up needed here.
8583         
8584         * decl.cs (MemberCore): Implemented IResolveContext.
8585
8586         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
8587         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
8588         parameter.cs, statement.cs, tree.cs, typemanager.cs:
8589         Refactored to use new IResolveContext instead of EmitContext; cleanup
8590
8591 2006-02-06  Miguel de Icaza  <miguel@novell.com>
8592
8593         * codegen.cs (EmitScopeInitFromBlock): check here the
8594         capture_context, there is no need to make two calls to the
8595         EmitContext. 
8596
8597         * anonymous.cs: Add some debugging messages that might help me
8598         track other instances of this problem in the future (the
8599         regression of test 467).
8600
8601         * cs-parser.jay: track the variable block, as we need to initalize
8602         any captured variables declared in this block for the "catch"
8603         portion of the "Try" statement.
8604
8605         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
8606         scope initialization for captured variables. 
8607
8608         Also, move the emit for the variables after the block location has
8609         been marked.
8610
8611 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
8612
8613         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
8614
8615 2006-02-02  Miguel de Icaza  <miguel@novell.com>
8616
8617         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
8618         commit yesterday, the initialization for the roots is necessary.
8619         What is not necessary is the scope activation.
8620
8621 2006-02-02  Raja R Harinath  <rharinath@novell.com>
8622
8623         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
8624         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
8625         CS0206 checks.
8626         (Argument.Resolve): Remove CS0206 checks.
8627
8628 2006-02-01  Miguel de Icaza  <miguel@novell.com>
8629
8630         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
8631         scopes for all the roots, the scopes will now be emitted when the
8632         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
8633
8634         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
8635         code.  This reduces a lot of existing cruft.
8636         
8637         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
8638         that the ScopeInfo is generated as we enter the scope, not at the
8639         time of use, which is what we used to do before.
8640
8641         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
8642         every time a Block is about to be emitted if we have a
8643         CaptureContext. 
8644
8645 2006-02-01  Raja R Harinath  <rharinath@novell.com>
8646
8647         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
8648         (Reset): Update.
8649         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
8650
8651         * typemanager.cs (cons_param_array_attribute): Make private.
8652         (Reset): Set it to null.
8653         (InitCoreHelpers): Don't initialize it.
8654         (ConsParamArrayAttribute): New.  Initialize it as needed.
8655         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
8656
8657 2006-01-31  Miguel de Icaza  <miguel@novell.com>
8658
8659         * expression.cs: There might be errors reported during the
8660         selection of applicable methods.  If there are errors, do not
8661         continue execution as it will lead the compiler to crash.
8662
8663 2006-01-30  Miguel de Icaza  <miguel@novell.com>
8664
8665         * expression.cs: Member access is not allowed on anonymous
8666         methods.  Fixes #77402.
8667
8668 2006-01-30  Raja R Harinath  <rharinath@novell.com>
8669
8670         Fix #77401
8671         * cs-parser.jay (VariableDeclaration): Don't set
8672         current_array_type to null.
8673         (field_declaration, event_declaration, declaration_statement):
8674         Set it to null here.
8675
8676 2006-01-28  Raja R Harinath  <harinath@gmail.com>
8677
8678         * typemanager.cs (GenericParameterPosition): New.
8679         * doc.cs: Use it.
8680
8681 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
8682
8683         * doc.cs : To process "include" elements, first we should create
8684           another list than XmlNodeList, because it could result in node
8685           removal, which could result in that the XmlNodeList gives up
8686           yielding next node.
8687
8688           (Also made code identical to gmcs again.)
8689
8690 2006-01-25  Miguel de Icaza  <miguel@novell.com>
8691
8692         * ecore.cs: Introduce an error report that we were not catching
8693         before, if not silent, we must report the error.  Gonzalo ran into
8694         it.
8695
8696 2006-01-23  Miguel de Icaza  <miguel@novell.com>
8697
8698         A fix for bug: #76957
8699         
8700         * iterators.cs (MoveNextMethod.CreateMethodHost): call
8701         ComputeMethodHost before creating the method, this is a new
8702         requirement. 
8703
8704         * anonymous.cs (AnonymousContainer): Now we track all the scopes
8705         that this method references (RegisterScope).  The actual scope
8706         where the method is hosted is computed with the ComputeMethodHost
8707         before we create the method.
8708
8709         Moved the Deepest routine here.
8710
8711         (AnonymousContainer.ComputeMethodHost): New routine used to
8712         compute the proper ScopeInfo that will host the anonymous method.
8713
8714         (ScopeInfo): Deal with multiple roots.  The problem was that we
8715         did not have a unique root where all ScopeInfos could be hanged
8716         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
8717         of roots.  
8718
8719         Remove AdjustMethodScope which is now computed at the end.  Remove
8720         LinkScope which did a partial link, instead link all ScopeInfos
8721         before code generation from the new "LinkScopes" routine. 
8722
8723         Simplify all the Add* routines as they no longer need to maintain
8724         the tree, they just need to record that they are using variables
8725         from a ScopeInfo.
8726
8727         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
8728         routines to produce the forest of ScopeInfo trees.
8729
8730         * class.cs (TypeContainer.AppendMethod): This is just like
8731         AddMethod, but ensures that an interface implementation method
8732         (IEnumerable.XXX) is not inserted at the beginning of the queue of
8733         methods, but at the end.
8734
8735         We use this functionality to ensure that the generated MoveNext
8736         method in the iterator class is resolved/emitted before the
8737         enumerator methods created.   
8738
8739         This is required because the MoveNext method computes the right
8740         ScopeInfo for the method.  And the other methods will eventually
8741         need to resolve and fetch information computed from the anonymous
8742         method. 
8743
8744 2006-01-21  Raja R Harinath  <harinath@gmail.com>
8745             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
8746
8747         Fix rest of #76995.
8748         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
8749         the 'aliases' hash.
8750         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
8751         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
8752
8753 2006-01-18  Raja R Harinath  <rharinath@novell.com>
8754
8755         Fix #76656, cs0231-2.cs.
8756         * cs-parser.jay (formal_parameter_list): Make error case catch
8757         more issues.
8758         (parenthesized_expression_0): Add CS1026 check.
8759         (invocation_expression): Remove unused { $$ = lexer.Location }.
8760
8761 2006-01-17  Raja R Harinath  <rharinath@novell.com>
8762
8763         Fix #76824.
8764         * cs-parser.jay (statement_expression): Don't list out the
8765         individual statement-expressions.  Convert syntax error into
8766         CS0201 check.
8767
8768 2006-01-16  Raja R Harinath  <rharinath@novell.com>
8769
8770         Fix #76874.
8771         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
8772         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
8773         CheckIntermediateModification.
8774         (FieldExpr.DoResolve): Add new two-argument version that
8775         allows us to resolve the InstanceExpression as an lvalue.
8776         The one-argument variant is now just a wrapper.
8777         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
8778         Resolve the lhs as an lvalue if the it has a value type.
8779         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
8780         from Assign.DoResolve.
8781         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
8782         resolved as an lvalue.
8783         (PropertyExpr.DoResolve): Update.
8784         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
8785         has a value type.  Move CS1612 check here from
8786         CheckIntermediateModification.
8787         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
8788         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
8789         'right_side' of a ResolveLValue on an 'out' argument.
8790         (EmptyExpression.LValueMemberAccess): New.  Used as the
8791         'right_side' of a propagated ResolveLValue on a value type.
8792         (LocalVariableReference.DoResolveBase): Recognize
8793         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
8794         Add CS1654 check.
8795         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
8796         EmptyExpression.Null.
8797
8798 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
8799
8800         * typemanager.cs : added IsGenericParameter(). In mcs it always
8801           return false.
8802         * doc.cs : for generic parameters, use GenericParameterPosition,
8803           not FullName.
8804
8805 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
8806
8807         * expression.cs: Fix Console.WriteLine ((this = x).foo);
8808
8809 2006-01-12  Miguel de Icaza  <miguel@novell.com>
8810
8811         This fixes the problem where we used ldfld instead of ldflda to
8812         load the "THIS" pointer on captured parameters, when THIS is a
8813         value type.  See bug #77205.
8814         
8815         * iterators.cs (CapturedThisReference.Emit): Pass false to
8816         EmitThis (we do not need the address).
8817
8818         * codegen.cs (EmitThis): it needs to know whether we need the
8819         address of `this' or not.  This is used by value types.  
8820
8821         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
8822         every other call passes false.
8823
8824 2006-01-12  Raja R Harinath  <rharinath@novell.com>
8825
8826         Fix #77221.
8827         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
8828         GetOverride.
8829         * expression.cs (Invocation.OverloadResolve): Update.
8830         (Invocation.DoResolve): Avoid double resolution of invocation.
8831
8832 2006-01-11  Raja R Harinath  <rharinath@novell.com>
8833
8834         Fix #77180.
8835         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
8836         unary negation of floating point types as 0-expr; negation cannot
8837         overflow in floating point types.
8838
8839         Fix #77204.
8840         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
8841         on operands of 'void' type.
8842
8843         Fix #77200.
8844         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
8845         and ExclusiveOr for boolean constants too.
8846
8847 2006-01-09  Raja R Harinath  <rharinath@novell.com>
8848
8849         Fix #75636.
8850         * expression.cs (Invocation.OverloadResolve): Replace reflected
8851         override methods with their base virtual methods, rather than
8852         skipping over them.
8853         * typemanager.cs (TypeManager.GetOverride): New.
8854
8855 2006-01-05  Jb Evain  <jbevain@gmail.com>
8856
8857         * class.cs (Property.Define, Indexer.Define): do not tag the
8858         properties as SpecialName | RTSpecialName.
8859
8860 2006-01-04  Miguel de Icaza  <miguel@novell.com>
8861
8862         * class.cs (MethodCore.IsDuplicateImplementation): This method was
8863         doing a low-level comparission of parameter types.  It was lacking
8864         a check for __argslist. 
8865
8866 2005-12-30  Miguel de Icaza  <miguel@novell.com>
8867
8868         * expression.cs (ParameterReference.DoResolveBase): Allow
8869         reference parameters if they are local to this block. 
8870
8871         This allows the ref and out parameters of a delegate to be used in
8872         an anonymous method, for example:
8873
8874         delegate void set (out int x);
8875
8876         set s = delegate (out int x){
8877                 x = 0;
8878         };
8879
8880         This is used by functionality introduced late in the C# language.
8881         
8882         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
8883         method that take ref and out parameters. 
8884
8885         Fixes #77119 which was a late change in the spec.
8886
8887 2005-12-23  Miguel de Icaza  <miguel@novell.com>
8888
8889         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
8890         parent if its the same scope.  Fixes #77060.
8891
8892 2005-12-21  Miguel de Icaza  <miguel@novell.com>
8893
8894         * driver.cs: Report the case of no source files and no -out:
8895         argument provided.
8896
8897 2005-12-20  Raja R Harinath  <rharinath@novell.com>
8898
8899         Fix #77035.
8900         * expression.cs (ComposedCast.GetSignatureForError): Define.
8901
8902 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8903
8904         Fix #76995
8905
8906         * namespace.cs (NamespaceEntry): Add extern_aliases as a
8907         ListDictionary, to contain the ExternAliasEntry entries (in
8908         addition to the NamespaceEntry.aliases hashtable). This field is
8909         shared between the original entry and its doppelganger (bodyless 
8910         copy of it).
8911         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
8912         extern_aliases field.
8913         (NamespaceEntry.Lookup): Move the IsImplicit check after the
8914         lookup in extern_aliases.
8915
8916 2005-12-16  Raja R Harinath  <rharinath@novell.com>
8917
8918         Fix #77006.
8919         * class.cs (TypeContainer.Mark_HasEquals): New.
8920         (TypeContainer.Mark_HasGetHashCode): New.
8921         (ClassPart): Override them.
8922         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
8923
8924         Fix #77008.
8925         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
8926         'parent' argument to the base constructor.
8927
8928         Remove all mention of TypeContainer from decl.cs.
8929         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
8930         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
8931         (DeclSpace.DeclSpace): Likewise.
8932         (DeclSpace.DefineMembers): Remove unused argument.
8933         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
8934         debugging check -- we don't care if the debug code throws an
8935         InvalidCastException instead of an InternalErrorException.
8936         * class.cs (TypeContainer.DefineMembers): Update to changes.
8937         (TypeContainer.DoDefineMembers): Likewise.
8938         (TypeContainer.GetMethods): Likewise.
8939         (PropertyMember.Define): Likewise.
8940         (MemberBase.Parent): New property that forwards to
8941         MemberCore.Parent, but ensures that we get a TypeContainer.
8942         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
8943         (RootContext.PopulateTypes): Likewise.  Remove special case code
8944         for !RootContext.StdLib: DefineMembers is idempotent.
8945
8946 2005-12-14  Miguel de Icaza  <miguel@novell.com>
8947
8948         * convert.cs (ExplicitConversionCore): Check the return value from
8949         ExplicitConversionCore which can return null on failure.  Fixes #76914
8950
8951 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
8952
8953         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
8954
8955 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
8956
8957         * doc.cs : The search for referenced namespace was insufficient to
8958           get global one as it used to do. Fixed bug #76965.
8959
8960 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
8961
8962         * doc.cs : check name in cref in the last phase that whether it is
8963           namespace or not.
8964
8965 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8966
8967         * cs-tokenizer.cs : reverted the latest change: it somehow broke
8968           Mono.C5.
8969
8970 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8971
8972         * doc.cs : so it turned out that we cannot skip override check for 
8973           interface members. Fixed bug #76954.
8974
8975 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
8976
8977         * cs-tokenizer.cs : fixed bug #75984:
8978           - #warning and #error should not be handled when the source line
8979             is disabled.
8980           - #line is not checked strictly when the source line is disabled.
8981           - #define and #undef is on the other hand checked strictly at any
8982             state.
8983
8984 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
8985
8986         * cs-tokenizer.cs : missing Location (actually, filename) in one of
8987           CS1027 report.
8988
8989 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
8990
8991         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
8992
8993         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
8994         event initializers.
8995         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
8996         (FieldBase.Initializer): Initializer is now optional.
8997         (EventField.Define): Only event field can have initializer.
8998
8999         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9000
9001         * const.cs (Const): Reuse initializer.
9002
9003         * cs-parser.jay: Updated after FieldBase changes.
9004         Added current_array_type to simplify array initializers.
9005
9006         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9007
9008         * expression.cs, iterators.cs: Updated.
9009
9010         * namespace.cs (NamespaceEntry): Made UsingFound private.
9011
9012 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9013
9014         * parameterCollection.cs: Obsolete, removed.
9015         * parser.cs: Obsolete, removed.
9016
9017 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9018
9019         Fix #76849.
9020         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9021
9022         * enum.cs (Enum.Define): Set obsolete context here.
9023
9024 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9025
9026         * doc.cs :
9027           - FindDocumentedMember() now expects 1) paramList as null
9028             when "we don't have to check the number of parameters" and
9029             2) Type.EmptyTypes when "there is no arguments".
9030           - Introduced FoundMember struct to hold the exact type which was
9031             used to find the documented member (the above change broke
9032             test-xml-044; it might be better just to use DeclaringType than
9033             what MS does, like this change does, but it depends on usage.)
9034
9035 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9036
9037         * doc.cs : documented member might be from DeclaringType for nested
9038           types. Fixed bug #76782.
9039
9040 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9041
9042         * anonymous.cs: Have the param code handle leaving copies on the
9043         stack etc. Allows anonymous params to take part in the assignment
9044         code (++, +=, etc). Fixes bug #76550
9045
9046         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9047         it down to the anon code.
9048
9049         * iterators.cs: Use dummy var here
9050
9051         * codegen.cs: Handle new vars
9052
9053 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9054
9055         Fix #76849.
9056         * class.cs (MethodData.Define): Set proper Obsolete context.
9057
9058         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9059         obsolete context.
9060         (FieldExpr.DoResolve): Ditto.
9061
9062 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9063
9064         Fix #76849.
9065         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9066         parent is not obsolete.
9067
9068 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9069
9070         * doc.cs : (FindDocumentedMember) find parameterless members first
9071           and get CS0419 in the early stage. Fixed first case of bug #76727.
9072
9073 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9074
9075         Fix #76859.
9076         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9077         no error was reported.
9078
9079         *expression.cs (Binary.DoResolve): left can be null.
9080
9081 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9082
9083         Fix #76783.
9084         * class.cs (MethodData.Emit): Parameters should be labeled first.
9085
9086 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9087
9088         Fix #76761.
9089         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9090
9091 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9092
9093         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9094
9095         * class.cs (MethodCore): Parameter clean up.
9096         (IMethodData): Added ParameterInfo.
9097         (MethodData): Parameter clean up.
9098         (Indexer.Define): Parameter clean up.
9099
9100         * anonymous.cs,
9101         * codegen.cs,
9102         * cs-parser.jay,
9103         * decl.cs,
9104         * doc.cs,
9105         * ecore.cs,
9106         * flowanalysis.cs,
9107         * iterators.cs,
9108         * pending.cs,
9109         * statement.cs,
9110         * typemanager.cs: Parameter clean up.
9111
9112         * delegate.cs (Define): Get rid of duplicated code.
9113
9114         * expression.cs (ParameterReference): Removed useless parameters
9115         and simplified.
9116         (Invocation): Ditto.
9117
9118         * parameter.cs (ParamsParameter): New class, params specialization.
9119         (ArglistParameter): Attemp to separate arglist.
9120         (Parameter): Refactored to be reusable and faster.
9121         (Parameter.Modifier): Made understandable.
9122         (Parameters): Changed to be used as a class for `this' assembly
9123         parameters. Refactored to use new specialized classes.
9124
9125         * support.cs (ParameterData): Added Types property.
9126         (InternalParameters): Deleted.
9127
9128 2005-08-20  Martin Baulig  <martin@ximian.com>
9129
9130         Merging this patch from GMCS to fix #75867.
9131
9132         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9133         scope if we don't already have it.
9134
9135 2005-11-17  Martin Baulig  <martin@ximian.com>
9136
9137         * anonymous.cs
9138         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9139         inherit the scope from our parent.  Fixes #76653.
9140
9141 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9142
9143         * doc.cs : the previous patch does not actually fix the bug.
9144           PropertyInfo override check is now implemented and really fixed it.
9145         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9146
9147 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9148
9149         * doc.cs : apply "override filter" also to properties.
9150           Fixed bug #76730.
9151
9152 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9153
9154         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9155           no need to check overrides. For classes, omit those results from 
9156           interfaces since they must exist in the class. Fixed bug #76726.
9157
9158 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9159
9160         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9161           with different parameters. Fixed the second problem in #76685.
9162
9163 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9164
9165         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9166           get expected 'protected' access in CheckValidFamilyAccess()).
9167           Fixed bug #76692.
9168
9169 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9170
9171         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9172           Fixed bug #76705.  CS1569 was incorrectly commented out.
9173
9174 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9175
9176         * doc.cs : use Invocation.IsOverride() to do real override check.
9177         * expression.cs : made Invocation.IsOverride() internal.
9178
9179 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9180
9181         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9182           TypeBuilder.FindMembers() and filter overriden base members out.
9183           Fixed bug #76990.
9184
9185 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9186
9187         * doc.cs : ref/out parameters are represented as '@' (instead of
9188           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9189
9190 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9191
9192         * doc.cs : when there was no '.' in cref to methods in doc comment,
9193           then parameters were missing in the output. Fixed bug #76691.
9194
9195 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9196
9197         * driver.cs : don't output docs when there is an error.
9198           Fixed bug #76693.
9199
9200 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9201
9202         * doc.cs :
9203           Now it should detect indexers. Fixed primary concern in bug #76685.
9204           Fixed CS0419 message to not show the identical member signature in
9205           the message.
9206
9207 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9208
9209         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9210           instead of Type.FindMembers() since it does not handle events.
9211           Fixed bug #71604.
9212
9213 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9214
9215         * codegen.cs: Fixed typo (speficied -> specified).
9216
9217 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9218
9219         Fix #76369.
9220         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9221
9222 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9223
9224         * attribute.cs: Changed error message.
9225
9226         * cs-tokenizer.cs: One more check.
9227
9228 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9229
9230         * statement.cs (Block.Resolve): Ignore empty statement.
9231
9232 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9233
9234         * report.cs: Made error/warning methods more strict to avoid
9235         their misuse.
9236
9237         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9238         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9239         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9240         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9241
9242 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9243
9244         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9245         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9246
9247         * class.cs (TypeContainer.IsComImport): New property.
9248         (Constructor.Define): Create proper ctor for ComImport types.
9249
9250         * expression.cs (New.CheckComImport): Fixed.
9251
9252 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9253
9254         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9255         that a parameter has been captured does not mean that we do not
9256         have to do the rest of the processing.  This fixes the second part
9257         of #76592.  If there was another anonymous method capturing
9258         values in the past, the Scope would never be set for the second
9259         method that captured the same parameter.
9260
9261         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9262         properly manipulate the stack.   Second part of fix for #76592.
9263
9264         * expression.cs (New): Add support for invoking "new" on
9265         interfaces that have been flagged with the ComImport attribute and
9266         the CoClass.  Fixes #76637 
9267
9268         * statement.cs (Try.DoEmit): When a variable is captured, do not
9269         try to emit the vi.LocalBuilder variable as it has been captured.
9270         Create a temporary variable and store the results on the
9271         FieldBuilder.  Fixes #76642
9272
9273 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9274
9275         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9276
9277         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9278
9279         * expression.cs (Binary.DoResolve): Added && optimalization.
9280     
9281         * typemanager.cs (AddUserType): Removed useless argument.
9282
9283 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9284
9285         * statement.cs (Block.variables): Uses ListDictionary.
9286
9287 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9288
9289         Fix #75969.
9290         * class.cs (PartialContainer.EmitType): Customized to emit
9291         security attributes.
9292         (ClassPart.ApplyAttributeBuilder): Transform security attribute
9293         for partial classes.
9294
9295 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9296
9297         Fix #76599.
9298         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
9299         access has to be fixed.
9300         
9301         * typemanager.cs (IsUnmanagedType): Wrong common field type.
9302
9303 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
9304
9305         Fix #76590.
9306         * ecore.cs (NullCast.Reduce): Implemented.
9307
9308         * expression.cs (ArrayCreation.CheckIndices): Correcly check
9309         constant type.
9310         
9311         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
9312         properly.
9313         (Foreach.Resolve): Catch null properly.
9314
9315 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9316  
9317         * cs-tokenizer.cs: Warning text fix.
9318
9319         * driver.cs: AllWarningNumbers exposed on public interface.
9320
9321         * report.cs (): Reviewed warning numbers.
9322         (IsValidWarning): Use binary search.
9323
9324 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
9325  
9326         * driver.cs: Implemeted resource visibility.
9327         (Resources): New class for code sharing between /res: and
9328         /linkres:
9329  
9330 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
9331
9332         Fix #76568.
9333         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
9334         folding.
9335         
9336         * convert (Convert.ImplicitReferenceConversion): NullCast holds
9337         contants only.
9338         
9339         * ecore.cs (NullCast): Child is contant only.
9340         
9341         * literal.cs (NullLiteral.Reduce): null can be converted to any
9342         reference type.
9343
9344 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
9345
9346         * driver.cs: Use Encoding.Default as default code page instead
9347           of ISO-28591.
9348
9349 2005-10-27  Raja R Harinath  <rharinath@novell.com>
9350
9351         Fix #76085.
9352         * expression.cs (Invocation.Error_InvalidArguments): Handle
9353         __arglist parameters.
9354         (Invocation.VerifyArgumentsCompat): Likewise.
9355         * support.cs (ReflectionParameters.GetSignatureForError): Print
9356         __arglist parameters.
9357         (InternalParamters.GetSignatureForError): Likewise.
9358         * parameter.cs (Parameters.GetSignatureForError): Likewise.
9359
9360 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
9361
9362         * attribute.cs (GetPropertyValue): Made public.
9363
9364         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
9365         Resolve.
9366         Add new property WrapNonExceptionThrows to handle 2.0 assembly
9367         attribute.
9368         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
9369         is not defined.
9370         
9371         * driver.cs: Reflect method name change.
9372         
9373         * statement.cs (Try.Resolve): Warn when try has both general
9374         exception handlers.
9375         
9376         * typemanager.cs: runtime_compatibility_attr_type new predefined
9377         type.
9378
9379 2005-10-26  Raja R Harinath  <harinath@gmail.com>
9380
9381         Fix #76419.
9382         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
9383         treat it as an empty parameter list.
9384
9385 2005-10-26  Raja R Harinath  <rharinath@novell.com>
9386
9387         Fix #76271.     
9388         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
9389         ResolveAsTypeStep silent.
9390         * statement.cs (Block.AddConstant): Mark block as used.
9391         (Block.ResolveMeta): Avoid piling on error messages
9392         if a constant initializer resolution fails.
9393
9394 2005-10-25  Raja R Harinath  <rharinath@novell.com>
9395
9396         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
9397         Remove.
9398         (NamespaceEntry.VerifyAllUsing): New.
9399         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
9400         behaviour.  Delegates actual resolution of alias to ...
9401         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
9402         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
9403         Update.
9404         * driver.cs (Driver.MainDriver): Update.
9405         
9406         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
9407         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
9408         property.
9409         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
9410         Remove.
9411         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
9412         RootNamespace.DefineNamespacesForAll.
9413
9414 2005-10-24  Raja R Harinath  <harinath@gmail.com>
9415
9416         * typemanager.cs (assemblies, external_aliases, modules)
9417         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
9418         (ComputeNamespaces, GetRootNamespace): Remove extra staging
9419         overhead.  Move resposibility ...
9420         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
9421         * driver.cs, attribute.cs, codegen.cs: Update to changes.
9422
9423 2005-10-23  Raja R Harinath  <harinath@gmail.com>
9424
9425         * namespace.cs (RootNamespace.all_namespaces): Renamed from
9426         cached_namespaces.  Improve usage.
9427         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
9428         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
9429         Move from GlobalRootNamespace and simplify.
9430         (RootNamespace.Global): Make instance variable.
9431         (RootNamespace.RootNamespace): Add "alias name" parameter.
9432         (GlobalRootNamespace): Simplify drastically.
9433         (Namespace.Lookup): Don't use GetNamespace.
9434         * typemanager.cs (GetRootNamespace): Rename from
9435         ComputeNamespaceForAlias.
9436         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
9437
9438 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9439
9440         * anonymous.cs (AnonymousContainer): Don't crash when container
9441         doesn't exist.
9442
9443 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9444
9445         * expression.cs (Binary.DoResolve): Warn when comparing same
9446         values.
9447
9448 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
9449
9450         Fix #76486.
9451         * expression.cs (Binary.DoResolve): It looks like there are no
9452         convetsion rules in enum context.
9453
9454 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9455
9456         Add support for extern alias qualifiers.
9457         * typemanager.cs: Move some LookupTypeReflection code
9458         to namespace.cs, to have cleaner code. Added some methods
9459         to help us keep track of the extern aliased references.
9460         * driver.cs: Add suport for extern alias assemblies on command
9461         line and check for their warnings/errors. Also keep track of the
9462         extern aliased assemblies.
9463         * namespace.cs: Move the global functionality of Namespace
9464         to GlobalRootNamespace/RootNamespace. Now the global namespace
9465         is GlobalRootNamespace.Globa. Also the code moved from 
9466         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
9467         Finally added LocalAliasEntry (AliasEntry before) and
9468         ExternAliasEntry, to handle alias statements.
9469         * cs-parser.jay: Add support in the grammar for extern alias
9470         statement.
9471         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
9472         Update callings to Namespace (now in GlobalRootNamespace).
9473
9474 2005-10-18  Raja R Harinath  <rharinath@novell.com>
9475
9476         Fix #76371.
9477         * class.cs (TypeContainer.DefineType): Move updating of
9478         topological sort earlier in the code.
9479         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
9480
9481 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
9482
9483         Fix #76273.
9484         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
9485         
9486         * constant.cs (Constant.TryReduce): Moved from Cast class.
9487         (Reduce): Made little bit more OO and fixed missing conversions.
9488         
9489         * ecore.cs (Reduce): Implemented.
9490         (Binary.EnumLiftUp): New method to upgrade values to enum values.
9491         
9492         * literal.cs (Reduce): Implemented.
9493         
9494         * class.cs: Reverted Miguel's wrong commit.
9495
9496 2005-10-14  Miguel de Icaza  <miguel@novell.com>
9497
9498         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
9499
9500 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
9501
9502         * cs-parser.jay, expression.cs : CS0214 was missing error location
9503           for constants. Fixed bug #76404.
9504
9505 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
9506
9507         Fix #76370.
9508         * convert.cs (ExplicitConversionCore): Fixed object->enum
9509         conversion.
9510
9511 2005-10-10  Raja R Harinath  <rharinath@novell.com>
9512
9513         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
9514         InstanceExpression.
9515         (PropertyExpr.EmitCall): Likewise.
9516         * expression.cs (Invocation.EmitArguments): Handle case where
9517         arguments == null.
9518         (Invocation.EmitCall): Avoid allocating temporary variable if
9519         there are no arguments.
9520
9521 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9522
9523         Fix #76323.
9524         * convert.cs (ImplicitConversionStandard): Move conversion of
9525         void* to arbitrary pointer types ...
9526         (ExplicitConversionStandard): .. here.
9527         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
9528         error to always print typenames.
9529
9530 2005-10-07  Raja R Harinath  <rharinath@novell.com>
9531
9532         * convert.cs (GetConversionOperator): Rename from
9533         GetConversionOperators.  Move operator selection code from ...
9534         (UserDefinedConversion): ... here.
9535
9536 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
9537
9538         * convert.cs (ExplicitConversionCore): Removed duplicate enum
9539         conversion.
9540
9541 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
9542
9543         * assign.cs (Assign.DoResolve): Error method changed.
9544
9545         * cfold.cs (DoConstantNumericPromotions): Error method changed.
9546         
9547         * const.cs (ResolveValue): Reset in_transit immediately.
9548         
9549         * constant.cs: Error method changed.
9550         
9551         * convert.cs: Removed useless location parameter.
9552         (ExplicitNumericConversion): Don't do double enum check.
9553         (ExplicitConversionCore): Renamed from ExplicitConversion.
9554         (ExplicitUnsafe): Extracted from ExplicitConversion.
9555         (ExplicitConversion): Uses for error reporting.
9556         
9557         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
9558         error messages.
9559         (ResolveBoolean): Uses common error method.
9560         (CastToDecimal): Get rid of ec.
9561         (CastFromDecimal): Optimized.
9562         (ConvCast): Get rid of ec.
9563         
9564         * enum.cs (ResolveValue): Reset in_transit immediately.
9565         (Emit): Return after first error.
9566         
9567         * expression.cs: Convert changes.
9568         
9569         * literal.cs: Error method changed.
9570         
9571         * statement.cs: Error method changed.
9572
9573 2005-10-03  Raja R Harinath  <rharinath@novell.com>
9574
9575         * support.cs (SeekableStreamReader.Position): Don't error out when
9576         the requested position is just beyond the end of the current
9577         buffered data.
9578
9579 2005-09-28  Raja R Harinath  <rharinath@novell.com>
9580
9581         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
9582         try to keep in sync with the byte count of the underlying Stream.
9583         However, this limits us to a window size of 2048 characters: i.e.,
9584         the maximum lookahead of our lexer/parser can be 2048 characters.
9585
9586 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
9587
9588         Fix #76255.
9589         * driver.cs: Fix compilation files with full root path.
9590
9591 2005-09-25  Miguel de Icaza  <miguel@novell.com>
9592
9593         * report.cs (SymbolRelatedToPreviousError): Format the output so
9594         it does not use an open parenthesis that is never closed. 
9595
9596         * driver.cs: Follow coding guidelines
9597
9598 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9599
9600         Fix #72930.
9601         * const.cs (Const.ResolveValue): Check for assigning non-null
9602         value to reference type.
9603
9604 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
9605
9606         * anonymous.cs: Implemented ExprClassName.
9607         
9608         * assign.cs (Assign.DoResolve): Don't chrash when type is not
9609         delegate.
9610         
9611         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
9612         check.
9613         
9614         * class.cs (StaticClass.DefineContainerMembers): Report protected
9615         members as error.
9616         
9617         * codegen.cs: if(ed) PRODUCTION.
9618         
9619         * convert.cs (Error_CannotImplicitConversion): Better error
9620         distinction.
9621         
9622         * cs-parser.jay: More error checks.
9623         
9624         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
9625         
9626         * driver.cs (CSCParseOption): Enabled wrong option check.
9627         
9628         * ecore.cs (Expression.ExprClassName): Turned to property.
9629         (MemberExpr.CheckIntermediateModification): For checking boxed
9630         value types     modification.
9631         
9632         * statement.cs (Fixed.Resolve): Expression type must be
9633         convertible to fixed type.
9634         (CollectionForeach.GetEnumeratorFilter,TryType):
9635         Small refactoring for easier error checking.
9636
9637 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
9638
9639         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
9640         attributes.
9641         
9642         * class.cs (GeneratedBaseInitializer): New class for customization
9643         compiler generated initializers.
9644         (MemberBase.DoDefine): Check Obsolete attribute here.
9645         (FieldMember.DoDefine): Ditto.
9646         
9647         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
9648         constants.
9649         
9650         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
9651         (MemberCore.GetObsoleteAttribute): Removed argument.
9652         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
9653         (MemberCore.CheckObsoleteType): New helper.
9654         
9655         * delegate.cs,
9656         * enum.cs,
9657         * statement.cs: Updates after MemberCore changes.
9658         
9659         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
9660         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
9661         
9662         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
9663         obsolete attribute for compiler construct.
9664         (As.DoResolve): Cache result.
9665         
9666         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
9667
9668 2005-09-26  Raja R Harinath  <rharinath@novell.com>
9669
9670         Fix #76133.
9671         * expression.cs (This.VerifyFixed): In a value type T, the type of
9672         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
9673         value type R, 'this' is treated as a value parameter.
9674
9675 2005-09-22  Miguel de Icaza  <miguel@novell.com>
9676
9677         * statement.cs (Lock): Use the TemporaryVariable class instead of
9678         manually using local variables as those do not work when variables
9679         are captured.
9680
9681         * ecore.cs: Moved the TemporaryVariable class from being a nested
9682         class inside Foreach to be a public class that can be employed in
9683         other places. 
9684
9685 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
9686
9687         * cs-parser.jay: interface_accessors replaced by
9688         accessor_declarations.
9689
9690         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
9691         location.
9692         
9693         * statement.cs (GotoCase.Resolve): Convert null constant to
9694         null case.
9695         (SwitchLabel.ResolveAndReduce): Ditto.
9696         (SwitchLabel.NullStringCase): Custom null stamp.
9697         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
9698         
9699         typemanager.cs (CSharpSignature): Don't skip first argument
9700         for full names.
9701
9702 2005-09-18  Miguel de Icaza  <miguel@novell.com>
9703
9704         * driver.cs: Set InEmacs based on the environment variable EMACS. 
9705
9706         * location.cs (InEmacs): in this mode, do not report column
9707         location as it confuses Emacs.
9708
9709 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
9710
9711         * cfold.cs, constant.cs, convert.cs, ecore.cs,
9712         expression.cs, iterators.cs, literal.cs: Store constants and
9713         literals location.
9714         
9715         * class.cs (MemberBase.ShortName): Pass location.
9716         
9717         * cs-parser.jay: Some location fixes.
9718         
9719         * ecore.cs (Expression.Location): Made virtual.
9720
9721 2005-09-05  Miguel de Icaza  <miguel@novell.com>
9722
9723         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
9724         if the underlying types are the same, otherwise we need to produce
9725         code that will do the proper cast.
9726
9727         This was exposed by Marek's constant rewrite which produced
9728         invalid code for the call site:
9729
9730         enum X : long { a }
9731         void Method (X v) {}
9732
9733         Method ((X) 5)
9734
9735         This fixes test-49.cs
9736
9737 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9738
9739         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
9740           Type/Object should be allowed as well. Fixed bug #75968.
9741
9742 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
9743
9744         * expression.cs : (Binary.DoResolve): when one is enum constant and
9745           another is constant 0, then return enum one *as enum type*.
9746           Fixed bug 74846.
9747
9748 2005-09-02  Raja R Harinath  <rharinath@novell.com>
9749
9750         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
9751         internal.
9752
9753         Fix #75941.
9754         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
9755         flow-branching for LocalVariableReferences in case we were invoked
9756         from a MemberAccess.
9757         * expression.cs (LocalVariableReference.VerifyAssigned): New.
9758         Carved out of ...
9759         (LocalVariableReference.DoResolveBase): ... this.
9760         (MemberAccess.Resolve): Do the check that was disabled during
9761         SimpleNameResolve.
9762
9763 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9764
9765         * class.cs :
9766           (PartialContainer.Create): check abstract/sealed/static strictly
9767           but abstract/sealed can exist only at one side. Fixed bug #75883.
9768
9769 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
9770
9771         Fix #75945.
9772         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
9773         specified, don't default to UnmanagedType.I4.
9774
9775 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
9776
9777         * expression.cs : conditional operator should check possibly
9778           incorrect assign expression. Fixed bug #75946.
9779
9780 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9781
9782         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
9783           Reverting the change. gmcs is much complex than mcs on this matter.
9784
9785 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
9786
9787         * cs-tokenizer.cs : To read another token ahead of the actual 
9788           consumption, use new SavedToken and cache token instead of moving
9789           back the stream with SeekableStreamReader (it seemed problematic).
9790         * cs-parser.jay,
9791           driver.cs : Thus use StreamReader directly.
9792         * support.cs : Thus removed SeekableStreamReader.
9793
9794 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9795
9796         Fix #75934.
9797         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
9798         (ScopeInfo.EmitScopeType): Use it to construct field names from
9799         names of captured locals.
9800
9801         Fix #75929.
9802         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
9803         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
9804         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
9805         (ExplicitConversion): Remove enum cases already handled by
9806         implicit conversion.  Move implicit conversion check to the beginning.
9807         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
9808         * expression.cs (ArrayCreation.EmitDynamicInitializers):
9809         Don't treat System.Enum as a struct.
9810
9811 2005-08-30  Jb Evain  <jbevain@gmail.com>
9812
9813         * attribute.cs: handles as expression in parameters.
9814
9815 2005-08-30  Raja R Harinath  <rharinath@novell.com>
9816
9817         Fix #75802.
9818         * class.cs (TypeContainer.VerifyClsName): Don't use a
9819         PartialContainer when verifying CLS compliance.
9820         (AbstractPropertyEventMethod): Set Parent here, ...
9821         (PropertyMethod): ... not here.
9822
9823 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
9824
9825         * attribute.cs : escaped attribute name should not be allowed to be
9826           resolved (e.g. @class as classAttribute). Fixed bug #75930.
9827
9828 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9829
9830         Fix #75927.
9831         * convert.cs (ImplicitStandardConversionExists): Allow zero also
9832         when converting a long constant to unsigned long.
9833         * expression.cs (Invocation.OverloadResolve): Add sanity check to
9834         detect where IsApplicable and VerifyArgumentsCompat disagree.
9835
9836 2005-08-29  Raja R Harinath  <rharinath@novell.com>
9837         and Carlos Alberto Cortez  <carlos@unixmexico.org>
9838
9839         Fix #75848.
9840         * class.cs (TypeContainer.CanElideInitializer): New helper.
9841         (TypeContainer.EmitFieldInitializers): Use it to determine if we
9842         can safely emitting the initializer of a field.
9843
9844 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9845
9846         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
9847           allowed inside a switch (without loop). Fixed bug #75433.
9848
9849 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
9850
9851         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9852         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
9853
9854 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9855
9856         * driver.cs : kinda reverting the default encoding changes (not exact 
9857           revert since I noticed that "codepage:reset" might not work fine).
9858
9859 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9860
9861         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
9862           Location. Now getter and setter store location correctly.
9863           (errors/cs0111-12.cs now reports the expected location.)
9864
9865 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
9866
9867         * driver.cs : Use default encoding on the environment.
9868           Removed (now that) extra parameter for SeekableStreamReader.
9869         * support.cs : (SeekableStreamReader) third .ctor() argument for
9870           StreamReader is not required (always true). preamble size could
9871           be acquired in simpler and safe way.
9872
9873 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
9874
9875         * cs-parser.jay: report CS0642 at warning level 3
9876           and report CS0642 for an if else statement also
9877           fixes bug #74745. Patch by John Luke (and a bit
9878           modified by me).
9879           Removed extra CS0642 warning check for "while",
9880           "for" and "fixed".
9881         * statement.cs: In Block.Resolve(), CS0642 check
9882           is reimplemented to check a sequence of an empty
9883           statement and a block.
9884
9885           Both fix bug #66777.
9886
9887 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
9888
9889         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
9890         detection until I fix it.
9891         
9892         * cs-tokenizer.cs: Changed error message.
9893         
9894         * cs-parser.jay: Fixed 2 error locations.
9895         
9896         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
9897         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
9898         properties.
9899         
9900         * enum.cs (GetSignatureForError): Fixed.
9901         
9902         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
9903         method detection.
9904         
9905         * class.cs,
9906         * typemanager.cs (RegisterProperty): Removed.
9907         
9908         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
9909
9910 2005-08-24  Raja R Harinath  <rharinath@novell.com>
9911
9912         Fix #75874.
9913         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
9914         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
9915
9916 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9917
9918         * expression.cs : tiny fix is required for not warning positive ulong.
9919           See test-441.cs.
9920
9921 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9922
9923         * expression.cs : add CS0652 check for constant and integral
9924           expression. Fixed bug #53974.
9925
9926 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9927
9928         * expression.cs : in DoNumericPromotions(), check if there is implicit
9929           conversion overload for string (to check CS0034). Fixed bug #52492.
9930
9931 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9932
9933         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
9934
9935 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9936
9937         * ecore.cs : report location when it is *not* Null.
9938
9939 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
9940
9941         * codegen.cs,
9942           ecore.cs,
9943           flowanalysis.cs,
9944           expression.cs:
9945           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
9946           correctly. Fixed bug #75721.
9947
9948 2005-08-23  Raja R Harinath  <rharinath@novell.com>
9949
9950         * support.cs (SeekableStreamReader.Position): Avoid an expensive
9951         loop that performs 'min (pos, char_count)'.
9952
9953         Fix #75862.
9954         * expression.cs (Unary.ResolveOperator): Don't discard implicit
9955         converted value in Operator.OnesComplement.
9956
9957 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
9958
9959         * anonymous.cs: If the anon method is pulled into a helper class,
9960         it needs to be `internal' not `private'. Fixes runtime behavior on
9961         msft. bug #75704
9962
9963 2005-08-20  Martin Baulig  <martin@ximian.com>
9964
9965         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9966         scope if we don't already have it.
9967
9968         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
9969         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
9970         fixes #75867.
9971
9972 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
9973
9974         Fix #75803
9975         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
9976         is a partial class.
9977
9978 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
9979
9980         The big constants rewrite
9981         Fix #75746, #75685 and more
9982         As a side effect saved 1MB for MWF ;-)
9983         
9984         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
9985         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
9986         enum based for corlib compilation.
9987         
9988         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
9989         subtractions.
9990         
9991         * class.cs (FixedField.Define): Use ResolveAsConstant.
9992         
9993         * const.cs (IConstant): Interface constants and enums.
9994         (Const.ResolveValue): New method for constant resolvning.
9995         (ExternalConstant): Constants from imported assemblies.
9996         
9997         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
9998         conversion; like enums.
9999         (Constant.ToType): Converts this constant to different type.
10000         (Constant.Increment): Adds 1.
10001         
10002         * convert.cs (ImplicitConversionRequired): Simplified.
10003         
10004         * cs-parser.jay: Create EnumMember directly.
10005         
10006         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10007         
10008         * doc.cs (GenerateEnumDocComment): Removed.
10009         
10010         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10011         (ConvertIntLiteral): Removed.
10012         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10013         
10014         * enum.cs (EnumMember): Implement IConstant.
10015         (Enum.IsValidEnumConstant): Removed.
10016         (Enum.GetNextDefaultValue): Removed.
10017         (Enum.FindMembers): Updated.
10018         (Enum.GenerateDocComment): Iterate enum members.
10019         
10020         * expression.cs (Cast.TryReduce): Handle enums correctly.
10021         (New.Constantify): Made public.
10022         (MemberAccess.DoResolve): Removed contant specific if(s).
10023         
10024         * literal.cs (NullLiteral): Implement new abstract methods.
10025         
10026         * statement.cs (GotoCase.Resolve): Use new constant methods.
10027         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10028         
10029         * typemanager.cs (LookupEnum): Removed.
10030         (IsEnumType): Fixed to work with corlib.
10031         (RegisterConstant): Removed.
10032         (LookupConstant): Removed.
10033         (GetConstant): Changed to work with IConstant.
10034
10035 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10036
10037         * location.cs : Fixed overflown (>255) column number.
10038
10039 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10040
10041         First cut of the qualified-alias-member feature.
10042         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10043         token.
10044         * cs-parser.jay (DOUBLE_COLON): New token.
10045         (namespace_or_type_name): Add rule for recognizing
10046         qualified-alias-members.
10047         (primary_expression): Likewise.
10048         (element_access): Allow QualifiedAliasMember as a possible
10049         type-bearing expression.
10050         (local_variable_type, local_variable_pointer_type): Likewise.
10051         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10052         aliases in the current and enclosing namespace declarations.
10053         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10054         * decl.cs (MemberName.is_double_colon): New.
10055         (MemberName.MemberName): Add new constructor for alias-member.
10056         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10057         * expression.cs (QualifiedAliasMember): New expression type.
10058
10059 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10060
10061         * location.cs : it borked when no argument was specified.
10062
10063 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10064
10065         * location.cs : tiny ToString() format fix.
10066
10067 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10068
10069         * statement.cs : oops, it was missing.
10070
10071 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10072
10073         A set of fixes for precise line/column location.
10074
10075         * location.cs :
10076           "token" field now holds a file/line "delta", a line number offset 
10077           from the segment, and a column number. See also:
10078           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10079           December/009508.html
10080           Removed static IsNull. Use instance IsNull property instead.
10081         * cs-tokenizer.cs :
10082           For some tokens it stores Location. For Identifier it stores
10083           LocatedToken which is a pair of string name and location.
10084           Column numbers are adjusted only at getChar().
10085         * report.cs :
10086           Use Location.ToString() for reporting (it now contains column).
10087         * cs-parser.jay :
10088           Largely modified to use LocatedToken instead of
10089           string (IDENTIFIER), and to acquire Location from some tokens.
10090         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10091           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10092           codegen.cs :
10093           Now MemberName holds Location. DeclSpace.ctor() receives Location
10094           as a parameter. Removed extra parameters to all derived classes.
10095           Replaced Location.IsNull() with instance property.
10096         * assign.cs, expression.cs :
10097           Added .ctor() overload that omits Location.
10098         * attribute.cs :
10099           Added "nameEscaped" flag that indicates the identifier was escaped
10100           in the source file. This fixes bug #57047.
10101
10102 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10103
10104         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10105         New method, looking for lo-case imported cls type.
10106
10107         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10108         here.
10109
10110         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10111
10112         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10113
10114         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10115         all_imported_types.
10116         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10117
10118         Optimized to save 3.5 MB for SWF compilation.
10119
10120 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10121
10122         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10123         (PartialContainer.Create): Moved logic AddToContainer.
10124         (PartialContainer.MarkForDuplicationCheck): Shares name.
10125         
10126         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10127         place.
10128         
10129         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10130         initialization.
10131         (Namespace.GetSignatureForError): New method.
10132         
10133         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10134         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10135
10136 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10137
10138         Fix #75669.
10139         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10140         member lookup rather than qualifier_type, since qualifier_type can
10141         be null.
10142
10143 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10144
10145         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10146         enum member.
10147
10148 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10149
10150         * statement.cs: Copy the local exception into the exception
10151         captured local.  Fixes 75674
10152
10153 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10154
10155         Fix #75658.
10156         * expression.cs (Invocation.OverloadResolve): Don't report error
10157         CS1501 if error CS1502 has been reported.
10158         (New.DoResolve): Delegate CS1501 reporting to
10159         Invocation.OverloadResolve.
10160
10161         Fix #75656.
10162         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10163         invariant-meaning-in-block property in an enclosing block if
10164         necessary.
10165
10166 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10167
10168         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10169         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10170         (Switch.CheckSwitch): Just save 50kb for SWF.
10171
10172 2005-07-27  Martin Baulig  <martin@ximian.com>
10173
10174         * anonymous.cs (CaptureContext.AddField): Added
10175         `AnonymousContainer am' argument; compute its toplevel scope if
10176         it's not already computed.  Fixes #75649.
10177
10178 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10179
10180         Fix #75628.
10181         * class.cs (Constructor.Emit): Reset block to null if the block
10182         resolve fails.
10183
10184 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10185
10186         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10187
10188 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10189
10190         * class.cs (MethodData.Define): Check whether accessor implementing
10191         interface is public.
10192
10193         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10194
10195 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10196
10197         Fix #57245
10198         * namespace.cs (LookupType): Moved same type check to...
10199         
10200         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10201         with the same name.
10202
10203 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10204
10205         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10206         already found a typebuilder.
10207         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10208         MemberNames, not strings.
10209
10210         * const.cs (Error_ExpressionMustBeConst): 
10211         Rename from Error_EpressionMustBeConst.
10212         * const.cs, class.cs, statement.cd: Update.
10213
10214 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10215
10216         Fix #65573
10217
10218         * const.cs (Const.LookupConstantValue): Report missing contant expression
10219         everytime.
10220         (Error_EpressionMustBeConstant): Only one error method.
10221
10222         * class.cs, statement.c: Updated.
10223
10224 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10225
10226         * statement.cs (Block.Flags): Add back HasVarargs.
10227         (Block.flags): Make protected.
10228         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10229
10230         * typemanager.cs (types, typecontainers, user_types): Remove.
10231         (UserTypes, TypeContainers): Likewise.
10232         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10233         (CleanUp, Reset): Update.
10234         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10235         (GetNestedType): Use Type.GetNestedType.
10236         (CoreLookupType): Take two arguments, the namespace and the
10237         basename of the type.  Update to use the Namespace.Lookup
10238         mechanism.
10239         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10240         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10241         string concatenation and substring matches.
10242         * class.cs, enum.cs, delegate.cs: Update to changes.
10243
10244 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10245
10246         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10247         Expression and made virtual.
10248
10249         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10250         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10251
10252         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10253
10254         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10255         error message.
10256
10257         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10258         change.
10259
10260 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10261
10262         Fix #57707
10263         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10264         AssemblyCultureAttribute is not used on executable.
10265
10266         * rootcontext.cs,
10267         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10268
10269 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10270
10271         Fix #60638.
10272         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10273         New.  Reports CS0252/CS0253.
10274         Mostly taken from preliminary patch by Duncak Mak.
10275         (Binary.DoResolveOperator): Store results of operator lookup.
10276         Use them to detect if we need to warn about unintended reference
10277         comparisons.
10278
10279 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10280
10281         Fix #72969.
10282         * namespace.cs (Namespace.Lookup): Add back location parameter.
10283         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10284         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10285
10286         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10287         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10288         (Namespace.LookupType): ... this.
10289         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10290         of namespaces.
10291         * typemanager.cs (LookupTypeReflection): Remove buggy code that
10292         purported to handle pointers.
10293         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
10294         CoreLookupType.
10295
10296 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
10297
10298         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
10299         type as namespace.
10300
10301 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10302
10303         * namespace.cs (Namespace.Lookup): Drop location parameter.
10304         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
10305         (NamespaceEntry.Lookup): ... this.
10306         (NamespaceEntry.Error_AmbiguousTypeReference):
10307         Move here from DeclSpace.
10308         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
10309         names ...
10310         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
10311         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
10312         Move to NamespaceEntry.
10313         * delegate.cs, expression.cs: Update to changes.
10314
10315 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
10316
10317         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
10318         CheckAttributeType and refactored.
10319         (Attribute.ResolvePossibleAttributeType): Changed to reuse
10320         ResolveAsTypeTerminal error handling.
10321         (ResolveAsTypeTerminal): Introduced because of global attributes extra
10322         handling.
10323         (GetSignatureForError): Print errors in same way.
10324
10325         * class.cs,
10326         * codegen.cs: Reflect attribute GetSignatureForError change.
10327
10328         * ecore.cs,
10329         * expression.cs: Add silent parameter to ResolveAsTypeStep.
10330
10331         * namespace.cs (UsingEntry): Refactored to make fields private.
10332
10333         * assign.cs,
10334         statement.cs: Error_UnexpectedKind has extra parameter.
10335
10336 2005-07-14  Raja R Harinath  <rharinath@novell.com>
10337
10338         * ecore.cs (IAlias): Remove.
10339         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
10340         that implement the interface.
10341         * namespace.cs (Namespace): Likewise.
10342         (Namespace.declspaces): Renamed from 'defined_names'.
10343         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
10344         DeclSpace instead of an IAlias.
10345         * tree.cs (Tree.AddDecl): Update.
10346
10347 2005-07-12  Raja R Harinath  <rharinath@novell.com>
10348
10349         * statement.cs (Block.Flags); Remove HasVarargs.
10350         (Block.HasVarargs): Move to ToplevelBlock.
10351         (Block.ThisVariable, Block.AddThisVariable): Likewise.
10352         (Block.Variables): Make protected.  Initialize variable hashtable
10353         if necessary.
10354         (Block.AddVariable): Update.
10355         (Block.Resolve): Update to changes.
10356         (ToplevelBlock.HasVarargs): New boolean.
10357         (ToplevelBlock.ThisVariable): Move here from Block.
10358         (ToplevelBlock.AddThisVariable): Likewise.
10359         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
10360         * expression.cs (This.ResolveBase): Update to changes.
10361         (ArglistAccess.DoResolve): Likewise.
10362
10363 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10364
10365         Fix #75321
10366         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
10367
10368         * class.cs (TypeContainer.VerifyMembers): Distinguish between
10369         not used and not used & assigned.
10370         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
10371
10372 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
10373
10374         Fix #75053
10375         * expression.cs (Is.DoResolve): null is never provided type.
10376
10377 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
10378
10379         Fix #52496
10380         * cs-parser.jay: Less strict event error rule to catch more errors.
10381
10382 2005-07-08  Martin Baulig  <martin@ximian.com>
10383
10384         Fix test-iter-10.cs - distinguish whether we `yield' in a property
10385         gettter (allowed) or setter (not allowed).
10386
10387         * class.cs (Accessor): Implement IIteratorContainer.
10388         (Accessor.Yields): New public field.
10389         (PropertyBase.PropertyMethod.Define): Handle iterators on a
10390         per-accessor basis.
10391
10392         * cs-parser.jay
10393         (get_accessor_declaration, set_accessor_declaration): Set the
10394         `yields' flag on the accessor, not the property.
10395         (property_declaration): Do the iterators check on a per-accessor
10396         basis and not for the whole property.
10397
10398 2005-07-08  Martin Baulig  <martin@ximian.com>
10399
10400         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
10401         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
10402
10403 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
10404
10405         Fix #74975
10406         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
10407         (ExtractSecurityPermissionSet): Cope with self referencing security
10408         attributes properly.
10409
10410         * driver.cs (SetOutputFile): Made public property OutputFile.
10411
10412 2005-07-07  Raja R Harinath  <rharinath@novell.com>
10413
10414         Fix #75486.
10415         * class.cs (TypeContainer.first_nonstatic_field): Rename from
10416         has_nonstatic_fields.  Make into a FieldBase pointer.
10417         (TypeContainer.AddField): Add CS0282 check.
10418         (TypeContainer.EmitType): Update.
10419
10420 2005-07-06  Miguel de Icaza  <miguel@novell.com>
10421
10422         * cs-tokenizer.cs (consume_identifier): Do not create strings to
10423         compare if they start with __.
10424
10425 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10426
10427         * statement.cs (Switch.SwitchGoverningType): Only look at
10428         UserCasts that don't need implicit standard conversions to one of
10429         the allowed switch types (Fixes test-322.cs).
10430         (LocalInfo.Resolve): Re-enable sanity-test.
10431
10432 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
10433
10434         * cs-tokenizer.cs (consume_identifier): Detect double undescores
10435         
10436         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
10437         
10438         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
10439
10440 2005-07-06  Raja R Harinath  <rharinath@novell.com>
10441
10442         Fix #75472.
10443         * ecore.cs (SimpleName.GetSignatureForError): Add.
10444         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
10445         (MemberAccess.GetSignatureForError): Add.
10446
10447 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
10448  
10449         The big error and warning messages review.
10450         
10451         * anonymous.cs,
10452         * assign.cs,
10453         * attribute.cs,
10454         * class.cs,
10455         * codegen.cs,
10456         * convert.cs,
10457         * cs-parser.jay,
10458         * cs-tokenizer.cs,
10459         * decl.cs,
10460         * delegate.cs,
10461         * doc.cs,
10462         * driver.cs,
10463         * ecore.cs,
10464         * enum.cs,
10465         * expression.cs,
10466         * flowanalysis.cs,
10467         * iterators.cs,
10468         * literal.cs,
10469         * location.cs,
10470         * modifiers.cs,
10471         * namespace.cs,
10472         * parameter.cs,
10473         * pending.cs,
10474         * report.cs,
10475         * rootcontext.cs,
10476         * statement.cs,
10477         * support.cs,
10478         * tree.cs,
10479         * typemanager.cs: Updated.
10480         
10481         * class.cs: (MethodCore.SetYields): Moved here to share.
10482         (PropertyMethod.Define): Moved iterator setup here.
10483         
10484         * iterators.cs: Add orig_method to have full access to parent
10485         container.
10486
10487 2005-07-05  Raja R Harinath  <rharinath@novell.com>
10488
10489         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
10490         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
10491         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
10492         variable of struct type.
10493         * expression.cs (Unary.ResolveOperator): Update to change.
10494         (Indirection.VerifyFixed): Likewise.
10495         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
10496         (ParameterReference.VerifyFixed): Value parameters are fixed.
10497         (This.VerifyFixed): Treat 'this' as a value parameter.
10498         * statement.cs (LocalInfo.IsFixed): Remove.
10499
10500 2005-07-01  Martin Baulig  <martin@ximian.com>
10501
10502         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
10503         `ec.EmitThis ()' to get the correct scope.
10504
10505 2005-07-01  Martin Baulig  <martin@ximian.com>
10506
10507         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
10508         instance is a ParameterReference; fixes #75299.
10509
10510 2005-07-01  Martin Baulig  <martin@ximian.com>
10511
10512         Reverted Marek's latest patch (r46725):
10513         - it contains structural changes which are neither mentioned in
10514           the ChangeLog nor explained anywhere; for example the additional
10515           argument of EmitContext's and Iterator's .ctor's and the
10516           TypeContainer.DefineMembers() change.
10517         - structural changes like this should go in in seperate patches
10518           and not be hidden in a huge patch which just seems to affect
10519           warnings and errors.
10520           a big and hard to understand patch.
10521         - it breaks iterators and causes regressions, for instance in
10522           test-iter-03.cs.      
10523
10524 2005-06-30  Raja R Harinath  <rharinath@novell.com>
10525
10526         Fix #75412.
10527         * expression.cs (Indexers.map): Remove.
10528         (Indexers.Append): Filter out inaccessible setters and getters.
10529         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
10530
10531         Fix #75283.
10532         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
10533         Refactored from ...
10534         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
10535         (FieldExpr.Emit, PropertyExpr.Emit): Update.
10536         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
10537         * expression.cs (Invocation.EmitCall): Add CS0120 check.
10538
10539 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
10540
10541         Fix #75322
10542         * class.cs (FieldBase.GetInitializerExpression): One more field
10543         for backup.
10544
10545 2005-06-28  Miguel de Icaza  <miguel@novell.com>
10546
10547         * pending.cs: Do not define a proxy if the base method is virtual,
10548         it will be picked up by the runtime (bug 75270).
10549
10550 2005-06-08  Martin Baulig  <martin@ximian.com>
10551
10552         The big Iterators rewrite :-)
10553
10554         * iterators.cs: Rewrite this to use the anonymous methods framework.
10555
10556         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
10557         before the TypeContainers; see 2test-21.cs.
10558
10559         * class.cs
10560         (TypeContainer.DefineType): Don't create a new EmitContext if we
10561         already have one (this only happens if we're an Iterator).
10562         (TypeContainer.Define): Also call Define() on all our iterators.
10563         (Method.CreateEmitContext): Added support for iterators.
10564
10565         * anonymous.cs
10566         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
10567         (AnonymousContainer.CreateMethodHost): Moved here from
10568         AnonymousMethod and made abstract.
10569         (AnonymousContainer.CreateScopeType): New abstract method.
10570         (AnonymousContainer.IsIterator): New public property.
10571         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
10572         get the ScopeTypeBuilder rather than manually defining it here. 
10573         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
10574         iterators here.
10575
10576         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
10577         before RootContext.DefineTypes().
10578
10579         * codegen.cs (EmitContext.RemapToProxy): Removed.
10580         (EmitContext.CurrentAnonymousMethod): Changed type from
10581         AnonymousMethod -> AnonymousContainer.
10582         (EmitContext.ResolveTopBlock): Protect from being called twice.
10583         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
10584         (EmitContext.EmitThis): Removed the iterators hacks; use the
10585         anonymous methods framework for that.
10586
10587         * statement.cs
10588         (ToplevelBlock.Container): Make this a property, not a field.
10589         (ToplevelBlock.ReParent): New public method; move the
10590         ToplevelBlock into a new container.
10591         (Foreach.TemporaryVariable): Simplify.
10592
10593 2005-06-05  Martin Baulig  <martin@ximian.com>
10594
10595         * statement.cs (LocalInfo.CompilerGenerated): New flag.
10596         (Block.AddTemporaryVariable): New public method; creates a new
10597         `LocalInfo' for a temporary variable.
10598         (Block.EmitMeta): Create the LocalBuilders for all the temporary
10599         variables here.
10600         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
10601         non-iterator variables.
10602
10603 2005-06-05  Martin Baulig  <martin@ximian.com>
10604
10605         * statement.cs (Foreach.TemporaryVariable): Create the
10606         LocalBuilder in the Emit phase and not in Resolve since in some
10607         situations, we don't have an ILGenerator during Resolve; see
10608         2test-19.cs for an example.
10609
10610 2005-06-04  Martin Baulig  <martin@ximian.com>
10611
10612         **** Merged r45395 from GCS ****
10613
10614         The big Foreach rewrite - Part II.
10615
10616         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
10617         with `PropertyInfo ienumerator_getcurrent'.
10618
10619         * codegen.cs (VariableStorage): Removed.
10620
10621         * statement.cs
10622         (Foreach): Derive from Statement, not ExceptionStatement.
10623         (Foreach.CollectionForeach): New nested class.  Moved all the code
10624         dealing with collection foreach here.
10625         (Foreach.ForeachHelperMethods): Removed.
10626         (Foreach.TemporaryVariable): Implement IMemoryLocation.
10627
10628 2005-05-23  Martin Baulig  <martin@ximian.com>
10629
10630         * statement.cs (Try.DoResolve): Don't create a `finally' if we
10631         don't need to.  Fix #75014.
10632
10633 2005-05-20  Martin Baulig  <martin@ximian.com>
10634
10635         Merged r44808 from GMCS.
10636
10637         * class.cs (TypeContainer.CircularDepException): Removed.
10638         (TypeContainer.DefineType): Removed the `InTransit' stuff.
10639         (TypeContainer.CheckRecursiveDefinition): Check for circular class
10640         (CS0146) and interface (CS0529) dependencies here.
10641
10642 2005-06-21  Raja R Harinath  <rharinath@novell.com>
10643
10644         * expression.cs (Invocation.EmitCall): Fix initialization
10645         'this_call' to reflect current behaviour.  Fix indentation.
10646
10647         * convert.cs (FindMostEncompassedType): Add two trivial special
10648         cases (number_of_types == 0 || number_of_types == 1).
10649         (FindMostEncompasingType): Likewise.
10650
10651 2005-06-17  Raja R Harinath  <rharinath@novell.com>
10652
10653         Some cleanups preparing for the fix of #75283.
10654         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
10655         error testing.
10656         (EventExpr.InstanceResolve): Likewise.
10657         (EventExpr.DoResolve): Remove redundant checks.
10658
10659 2005-06-10  Duncan Mak  <duncan@novell.com>
10660
10661         * cs-tokenizer.cs (process_directives): New flag for controlling
10662         the processing of preprocessor directives.
10663         (x_token): After seeing a '#', return Token.NONE instead of going
10664         to handle_preprocessing_directive() when not processing
10665         directives. This avoids unnecessary processing during the token peek in
10666         is_punct().
10667
10668         This fixes #74939.
10669
10670         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
10671         the existing error reporting methods instead of Report.Error.
10672
10673         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
10674         after Raja's rewrite.
10675
10676 2005-06-08  Miguel de Icaza  <miguel@novell.com>
10677
10678         * class.cs: Small fix.
10679
10680 2005-06-08  Raja R Harinath  <rharinath@novell.com>
10681
10682         Fix #75160.
10683         * class.cs (GetPartialBases): Fix return value check of
10684         part.GetClassBases.
10685
10686 2005-06-07  Raja R Harinath  <rharinath@novell.com>
10687
10688         Ensure that partial classes are registered in their enclosing
10689         namespace.  Initial part of fix of #75160.
10690         * tree.cs (Tree.RecordDecl): Add new namespace argument.
10691         Register declspace with namespace here, not in
10692         DeclSpace.RecordDecl.
10693         * cs-parser.jay: Pass namespace to RecordDecl.
10694         * class.cs (PartialContainer.Create): Likewise.
10695         (ClassPart.DefineType): New sanity-check.  Throws an exception if
10696         called.
10697         * decl.cs (Declspace.RecordDecl): Remove.
10698         * namespace.cs (NamespaceEntry.DefineName): Remove.
10699
10700 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
10701
10702         * rootcontext.cs: Reset TargetExt as well.
10703
10704 2005-06-03  Raja R Harinath  <rharinath@novell.com>
10705
10706         * ecore.cs (Expression.Resolve): Emit CS0654 error when
10707         -langversion:ISO-1.
10708
10709 2005-06-02  Raja R Harinath  <rharinath@novell.com>
10710
10711         Fix #75080, cs0119.cs.
10712         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
10713         of ...
10714         (Expression.Resolve): ... this.  Use it.  Remove bogus code
10715         allowing ExprClass.Type and ExprClass.Namespace for
10716         ResolveFlags.VariableOrValue.
10717         (Expression.Resolve) [1-argument variant]: Change default resolve
10718         flags based on language version.
10719         (Expression.Error_UnexpectedKind): Use a simple string array
10720         rather than an ArrayList.
10721         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
10722         not ExprClass.Type.
10723         (TypeOfVoid.DoResolve): Likewise.
10724         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
10725         flags argument -- it always has the same value.
10726
10727 2005-05-31  Raja R Harinath  <rharinath@novell.com>
10728
10729         Fix #75081.
10730         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
10731         Use it in the error message.
10732         * assign.cs, expression.cs, statement.cs: Update.
10733
10734 2005-05-30  Raja R Harinath  <rharinath@novell.com>
10735
10736         Fix #75088.
10737         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
10738         the "almostMatchedMember" case too.
10739         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
10740         that failed the accessibility checks to 'almost_match'.
10741
10742 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
10743
10744         * attribute.cs: Use internal MethodBuilder methods to set
10745         ExactSpelling and SetLastError on PInvoke methods, instead
10746         of passing them via charset.  Fixes #75060.
10747
10748 2005-05-27  Raja R Harinath  <rharinath@novell.com>
10749
10750         * parameter.cs (Parameter): Remove TODO comment.
10751         (Parameter.DefineParameter): Remove Location parameter.
10752         (Parameters.LabelParameters): Likewise.
10753         * class.cs (Constructor.Emit): Update to change.
10754         (MethodData.Emit): Likewise.
10755         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
10756         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
10757
10758 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
10759
10760         * parameter.cs,
10761           Removed Parameters.Location and added Parameter.Location instead.
10762           Removed Location parameter from Emit() and GetSignature().
10763         * anonymous.cs,
10764           class.cs,
10765           cs-parser.jay,
10766           delegate.cs,
10767           iterators.cs,
10768           statement.cs :
10769           Modified all related calls.
10770
10771 2005-05-26  Raja R Harinath  <rharinath@novell.com>
10772
10773         Improve user-defined conversion handling.
10774         * convert.cs (GetConversionOperators): Rewrite.  Return only the
10775         applicable operators.
10776         (AddConversionOperators): New.  Helper for GetConversionOperators.
10777         (FindMostEncompassedType, FindMostEncompassingType): Verify that
10778         there is only one most encompassed/encompassing type.
10779         (FindMostSpecificSource, FindMostSpecificTarget): Remove
10780         "applicable operator" handling.
10781         (UserConversion): Move cache here from GetConversionOperators.
10782         Directly cache the chosen operator, rather than the whole
10783         MethodGroup.
10784         (ExplicitNumericConversion): Fix buggy implementation of Decimal
10785         case.  Allow conversion of decimal to sbyte and byte too.
10786         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
10787         New static methods.  Used to avoid allocating EmptyExpressions in
10788         convert.cs.
10789
10790 2005-05-24  Duncan Mak  <duncan@novell.com>
10791
10792         * ecore.cs (CastFromDecimal): New class for casting a decimal to
10793         another class, used in Convert.ExplicitNumericConversion.
10794         (CastToDecimal): New class, similar to above, but casts to
10795         System.Decimal, used in Convert.ImplicitNumericConversion and also
10796         in explicit convesion from double/float to decimal.
10797
10798         * convert.cs (ImplicitNumericConversion): Handle implicit
10799         conversions to System.Decimal.
10800         (ExplicitNumericConversion): handle explicit conversions to
10801         System.Decimal.
10802
10803         This fixes #68711.
10804         
10805 2005-05-20  Miguel de Icaza  <miguel@novell.com>
10806
10807         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
10808         know the type at this stage, just break through.   Fixes #75008 
10809
10810 2005-05-19  Martin Baulig  <martin@ximian.com>
10811
10812         * delegate.cs
10813         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
10814         to disable error reporting.
10815
10816         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
10817         here since we don't want to report an error; see the new test-336.cs.
10818
10819 2005-05-19  Raja R Harinath  <rharinath@novell.com>
10820
10821         * statement.cs (ToplevelBlock.GetParameterReference)
10822         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
10823         Move here from class Block.
10824         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
10825         * expression.cs (ParameterReference.DoResolveBase): Likewise.
10826
10827 2005-05-18  Martin Baulig  <martin@ximian.com>
10828
10829         Fix #74978.
10830
10831         * flowanalysis.cs
10832         (FlowBranching.Reachability): Add non-static public And() and Or()
10833         methods.
10834         (FlowBranchingSwitch): New class; do the `break_origins' thing
10835         like in FlowBranchingLoop.
10836         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
10837         reachability, not just locals and parameters.
10838         (FlowBranching.MergeChild): Remove some of the hacks for loop and
10839         switch; MergeBreakOrigins() now takes care of that.
10840
10841 2005-05-18  Martin Baulig  <martin@ximian.com>
10842
10843         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10844         a loop and may leave it, reset the barrier; fixes #74974.
10845
10846 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
10847         
10848         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
10849         is back.
10850         
10851         * cs-parser.jay: Catch more lexical errors.
10852         
10853         * report.cs: Add one more Error method.
10854         
10855         * rootcontext.cs,
10856         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
10857
10858 2005-05-17  Martin Baulig  <martin@ximian.com>
10859
10860         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
10861         #70970. 
10862
10863 2005-05-16  Raja R Harinath  <rharinath@novell.com>
10864
10865         Fix test-382.cs.  Emit values of decimal constants.
10866         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
10867         Carved out of ...
10868         (TypeContainer.AddField): ... this.
10869         (TypeContainer.EmitFieldInitializers): Allow the list of fields
10870         with initializers to include 'Const's.
10871         (ClassPart.RegisterFieldForInitialization): Forward to
10872         PartialContainer.
10873         * const.cs (Const.Const): Pass initializer to base class.
10874         (Const.Define): In case of decimal constants, register them for
10875         initialization in a static constructor.
10876
10877 2005-05-14  Martin Baulig  <martin@ximian.com>
10878
10879         * statement.cs (Block.Resolve): Correctly handle unreachable code;
10880         do not call ResolveUnreachable() on unreachable statements in
10881         here, see the comment in the source code.
10882
10883 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10884
10885         Fix #74934.
10886         * expression.cs (BinaryResolveOperator): If one of the operands of
10887         an equality comparison is 'null' and the other is a pointer type,
10888         convert the null to a NullPointer.
10889         * convert.cs (ImplicitReferenceConversion): If the expression is a
10890         NullLiteral and the target type is a pointer type, return a
10891         NullPointer instead.
10892         (ImplicitConversionStandard): Likewise.
10893
10894 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
10895         
10896         * cs-parser.jay: Set readonly context based on special constructs.
10897         
10898         * expression.cs (LocalVariableReference.DoResolveBase): Improved
10899         readonly variable error handling.
10900         
10901         * rootcontext.cs (EmitCode): Don't verify members when error
10902         occurred.
10903         
10904         * statement.cs (LocalInfo): Add reaodnly context information.
10905         (SetReadOnlyContext, GetReadOnlyContext): New methods.
10906
10907 2005-05-13  Raja R Harinath  <rharinath@novell.com>
10908
10909         * statement.cs (Block.Resolve): Revert change below.  Modify fix
10910         for #74041 to initialize 'resolved' to false only for explicit
10911         blocks.  Fixes #74873.
10912
10913 2005-05-12  Raja R Harinath  <harinath@gmail.com>
10914
10915         Fix #74920.
10916         * typemanager.cs (unmanaged_enclosing_types): New.
10917         (IsUnmanagedType): Avoid infloops by using
10918         'unmanaged_enclosing_types' to talk with recursive invocations.
10919
10920 2005-05-13  Martin Baulig  <martin@ximian.com>
10921
10922         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
10923         instance variable, not a local.  Fix #74873.
10924         (Block.ResolveUnreachable): Set it to true here.
10925
10926 2005-05-11  Duncan Mak  <duncan@novell.com>
10927
10928         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
10929         continuing to process for 'arg'.
10930         (handle_preprocessing_directive): Check the argument of the #endif
10931         directive and report error CS1025 if there are any trailing
10932         characters.
10933
10934         According to the C# spec, having even whitespace after the #endif
10935         directive is illegal; however, because we call arg.TrimEnd ()
10936         beforehand, we have the same behavior as csc, allowing whitespace
10937         after the directive.
10938
10939         Fixes #74892.
10940
10941 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
10942
10943         Fix #74863.
10944         
10945         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
10946         (Constructor.GetObsoleteAttribute): Implemented correctly.
10947
10948 2005-05-10  Martin Baulig  <martin@ximian.com>
10949
10950         * support.cs (ReflectionParameters.ParameterModifier): Use
10951         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
10952         and `ParameterAttributes.In'.  Fixes #74884.
10953
10954 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
10955
10956         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
10957         
10958         * expression.cs (Argument.GetParameterModifier): Turned to property.
10959         (Invocation.Error_InvalidArguments): Add more descriptive errors.
10960         
10961         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
10962         its C# equivalent.
10963         
10964 2005-05-09  Raja R Harinath  <rharinath@novell.com>
10965
10966         Fix #74852.
10967         * decl.cs (MemberCache.AddMethods): Register override methods,
10968         rather than non-override methods.
10969         * typemanager.cs (RegisterOverride): New.
10970         (IsOverride): Update.
10971
10972 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
10973
10974         Fix #73105.
10975         
10976         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
10977         recursive declaration.
10978         
10979         * statement.cs (Block.ResolveMeta): Report any error in resolving.
10980         
10981 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
10982
10983         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
10984         
10985         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
10986
10987 2005-05-05  Raja R Harinath  <rharinath@novell.com>
10988
10989         Fix #74797.
10990         * decl.cs (DeclSpace.FamilyAccessible): 
10991         Use TypeManager.IsNestedFamilyAccessible.
10992
10993         Fix reopened #64812.
10994         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
10995         internal'.
10996
10997 2005-05-04  Raja R Harinath  <rharinath@novell.com>
10998             Abin Thomas  <projectmonokochi@rediffmail.com>
10999             Anoob V E  <projectmonokochi@rediffmail.com>
11000             Harilal P R  <projectmonokochi@rediffmail.com>
11001
11002         Fix #64812.
11003         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11004         allow access to all static members.
11005
11006 2005-05-04  Martin Baulig  <martin@ximian.com>
11007
11008         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11009
11010 2005-05-04  Martin Baulig  <martin@ximian.com>
11011
11012         Fix #74655.
11013
11014         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11015         section at the end; make things work if `default' is not the last
11016         section.        
11017
11018 2005-05-04  Martin Baulig  <martin@ximian.com>
11019
11020         Fix #70400.
11021
11022         * statement.cs (Switch): Replaced the `got_default' field with a
11023         `default_section' one.
11024         (Switch.CheckSwitch): Set `default_section' here.
11025         (Switch.Resolve): If we're a constant switch and the constant is
11026         not found, use the default section.
11027
11028 2005-05-03  Martin Baulig  <martin@ximian.com>
11029
11030         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11031
11032         * statement.cs (Foreach.ArrayForeach): New nested class.
11033         (Foreach.TemporaryVariable): New nested class.
11034         (Foreach.EmitArrayForeach): Removed; this is now in the new
11035         ArrayForeach class.
11036
11037 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11038
11039         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11040         more conservative.
11041         (VerifyPendingMethods): Revert change below.
11042
11043         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11044         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11045         that used to trigger warning -28.  Remove warning -28.
11046         * expression.cs (Invocation.OverloadResolve): Use
11047         TypeManager.IsOverride to distinguish override methods.
11048
11049         Fix #74773.
11050         * pending.cs (VerifyPendingMethods): If a base type implements the
11051         requested interface, don't bother checking individual methods of
11052         the base type.  As a side-effect, this prevents the creation of
11053         unnecessary proxies.
11054
11055 2005-05-02  Martin Baulig  <martin@ximian.com>
11056
11057         Fix #70182.
11058
11059         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11060         Also `And' the locals if the old vector is null.
11061         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11062         null; in this case we basically reset all the variables.        
11063
11064 2005-05-02  Martin Baulig  <martin@ximian.com>
11065
11066         Fix #74529.
11067
11068         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11069         Added `FlowBranching branching' argument; always `and' the
11070         variables instead of `or'ing them unless we're an infinite loop.
11071
11072         * statement.cs (While.Resolve): Create a new sibling unless we're
11073         infinite.       
11074
11075 2005-05-02  Martin Baulig  <martin@ximian.com>
11076
11077         Fix #70140.
11078
11079         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11080         arguments; use it instead of creating a new TopLevelBlock.
11081         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11082         our ConstructorInitializer.
11083
11084         * statement.cs
11085         (TopLevelBlock.TopLevelBranching): New public property.
11086         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11087         and create our `TopLevelBranching'.
11088
11089         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11090         anonymous method host, use `block.TopLevelBranching' rather than
11091         creating a new branching.
11092
11093 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11094
11095         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11096         a ScopeInfo, if any of the current children is a child of the new
11097         entry, move those children there.
11098
11099 2005-04-30  Martin Baulig  <martin@ximian.com>
11100
11101         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11102         at the beginning of a SwitchSection.  Fix #73335.
11103
11104 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11105
11106         Fix #74378
11107         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11108         
11109         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11110         (FieldExpr.DoResolve): Obsolete members are ignored for field
11111         initializers.
11112         
11113 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11114
11115         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11116         of arrays detection.
11117
11118         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11119         verification.
11120         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11121
11122         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11123         arrays report.
11124
11125 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11126
11127         * cs-parser.jay: Use the prefered version of -unsafe in error
11128         message.
11129
11130 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11131
11132         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11133         circumstances.
11134
11135 2005-04-20  John Luke  <john.luke@gmail.com>
11136
11137         * driver.cs: fix typo in error message, --outout to --output
11138
11139 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11140
11141         * codegen.cs (InRefOutArgumentResolving): New field.
11142         
11143         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11144         fields outside contructor.
11145         
11146         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11147         
11148 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11149
11150         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11151         parameter code was not completed ever, so it was not as up-to-date
11152         as local variables.  Must finish it.
11153
11154         The bug fix was to compare the Toplevel of the block, not the
11155         current block.  Thanks for Ben for pointing this out. 
11156
11157 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11158
11159         * decl.cs (AddMethods): Use the declaring type of the problem
11160         method to determine if we want to squash a warning.
11161
11162 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11163
11164         * attribute.cs: Removed debug output.
11165
11166         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11167         
11168         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11169         Report.Stderr.
11170         
11171 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11172
11173         Fix #74481.
11174         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11175         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11176         all null comparisons against reference types.
11177
11178 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11179
11180         Fix# 74565
11181         * class.cs (TypeContainer.CircularDepException) New nested
11182         exception class.
11183         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11184         (TypeContainer.DefineType): Removed error, reset InTransit before
11185         exit.
11186         (Class.DefineType): Throw exception when is in Transit.
11187         Catch exception and report error.
11188         (Struct.DefineType): Throw exception when is in Transit.
11189         Catch exception and report error.
11190         (Interface.DefineType): Throw exception when is in Transit.
11191         Catch exception and report error.
11192
11193         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11194         handle nested exception handlers.
11195
11196         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11197         a catch.
11198
11199         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11200         InFinally and InCatch storage.
11201
11202         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11203         (Catch.Resolve): Set and Restore ec.InCatch.
11204         (Try.Resolve): Set and Restore ec.InFinally.
11205         (Try.HasCatch): True when try has catch.
11206
11207 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11208
11209         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11210           for the same event member, so exclude such cases from warning 419.
11211           Fixed bug #74633.
11212
11213 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11214
11215         * expression.cs (Binary.ResolveOperator): Apply patch from John
11216         Luke to fix bug 59864: operators &, | and ^ on enumerations
11217         require that the same enum type on both sides.
11218
11219         * driver.cs: Add warnings to old flag usage, this is to assist
11220         people who produce Makefiles and hope that the Makefiles will be
11221         used on Windows.
11222
11223         * class.cs (TypeContainer.EmitType): Moved the definition of the
11224         special $PRIVATE$ field from the resolve phase to the Emit phase.
11225         During resolve we do not know if we are a struct with
11226         HasExplicitLayout, we know this only after the attributes for the
11227         type are emitted.
11228
11229         Set the FieldOffset to zero on the dummy field that we create for
11230         the class.   Fixes 74590.
11231
11232 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11233
11234         Fix #73834.
11235         * ecore.cs (PropertyExpr.resolved): New.
11236         (DoResolve): Use it to handle a case of double resolution here.
11237         Handle a case of identical-name-and-type-name.
11238         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11239         resolution by storing the results of expression resolution back
11240         into the "probes" array.
11241
11242 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11243
11244         Fix cs0208-7.cs and cs0208-8.cs.
11245         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11246         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11247         error reporting to point out the reason a struct is not unmanaged.
11248
11249 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11250
11251         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11252           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11253
11254 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11255
11256         Fix #74528.
11257         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11258         IdenticalNameAndTypeName here.
11259         (EventExpr.InstanceResolve): Likewise.
11260
11261 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11262
11263         C# 2.0 DefaultCharSetAttribute implementation
11264         
11265         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11266         which allows us to set GlobalNamespace for every resolve.
11267         (Attribute.ResolveArguments): Cut from Resolve.
11268         (Attribute.GetCharSetValue): Returns CharSet named argument.
11269         (Attribute.DefinePInvokeMethod): Gets default charset from
11270         module settings.
11271         (GlobalAttribute.ResolveAsTypeStep): Override.
11272         (GlobalAttribute.ResolveArguments): Override.
11273         
11274         * class.cs (TypeAttr): Is protected.
11275         
11276         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11277         (ModuleClass.DefaultCharSetType): New memeber.
11278         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11279         
11280         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11281         charset from module.
11282         
11283         * delegate.cs (TypeAttr): Override.
11284         (Delegate.DefineType): Use this TypeAttr.
11285         
11286         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11287         at very early stage (before types are defined) to resolve model
11288         module attributes. It will probably not work with corlib but it
11289         should be ok.
11290         
11291         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
11292         charset from module.
11293         
11294         * typemanager.cs (default_charset_type): New type.
11295
11296 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11297
11298         * decl.cs (MemberCache.AddMethods): Don't warn if
11299         System.Object.Finalize has buggy MethodAttributes.
11300
11301         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
11302         removed below.
11303
11304 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11305
11306         * doc.cs : detect ambiguous reference to overloaded members.
11307           Fixed bug #71603. MS 1.1 csc does not detect it.
11308
11309 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11310
11311         * doc.cs : delegates must not be referenced with parameters.
11312           Fixed bug #71605.
11313
11314 2005-04-12  Miguel de Icaza  <miguel@novell.com>
11315
11316         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
11317
11318 2005-04-10  Miguel de Icaza  <miguel@novell.com>
11319
11320         * driver.cs (MainDriver): Stop processing if the CLS stage found
11321         errors. 
11322
11323         (CompilerCallableEntryPoint.InvokeCompiler): Always
11324         reset after execution;   Take a TextWriter argument for the
11325         output.
11326
11327         * report.cs: Use the error stream instead of hardcoding stderr. 
11328
11329 2005-04-09  Miguel de Icaza  <miguel@novell.com>
11330
11331         * class.cs: Reduce code paths to test, too small of an
11332         optimization to make it worth the extra testing.  Always perform
11333         it. 
11334
11335 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11336
11337         Fix #74510.
11338         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
11339         operators that had errors reported on them.
11340
11341 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
11342
11343         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
11344         argument types.
11345         (Attribute.Resolve): Add named argument type checking.
11346         
11347         * class.cs (FixedField.Define): Use IsPrimitiveType
11348         
11349         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
11350         
11351         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
11352         unsafe parameter types.
11353         
11354         * statement.cs (Using.ResolveExpression): Add better error description.
11355         
11356         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
11357         
11358 2005-04-08  Raja R Harinath  <rharinath@novell.com>
11359
11360         Fix #74484.
11361         * attribute.cs (Attribute.GetAttributeUsage): Resolve
11362         AttributeUsageAttribute in the emitcontext of the attribute class,
11363         not in the emitcontext of the attributable entity it was attached to.
11364         * cs-parser.jay: Use 'current_class', not 'current_container',
11365         when creating a GlobalAttribute.
11366
11367 2005-04-08  Alp Toker  <alp@atoker.com>
11368
11369         * pending.cs: The fix to #58413 failed to compile methods implementing
11370         interfaces with/without params modifiers and vice versa, even though
11371         params modifiers aren't part of the signature. Make the modifier check
11372         less strict as in csc.
11373
11374 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
11375             Anoob V E  <projectmonokochi@rediffmail.com>
11376             Harilal P R  <projectmonokochi@rediffmail.com>
11377
11378         Fix #58413.
11379         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
11380         modifiers of pending methods.
11381         (PendingImplementation.PendingImplementation): Initialize it.
11382         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
11383         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
11384         with ParameterData.  Add check for modifiers.
11385         * class.cs (MethodData.Define): Update to changes.
11386
11387 2005-04-07  Raja R Harinath  <rharinath@novell.com>
11388
11389         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
11390
11391 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
11392
11393         * class.cs (PropertyMethod.Define): Check private accessor in abstract
11394         property.
11395         
11396         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
11397         
11398         * rootcontext.cs,
11399         * typemanager.cs: Registered RequiredAttributeAttribute.
11400         
11401 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
11402
11403         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
11404         Warning CS0169 is back at level 3.
11405         (IMethodData.SetMemberIsUsed): New method.
11406         
11407         * decl.cs (IsUsed): New value; moved from FieldBase.Status
11408         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
11409         
11410         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
11411
11412         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
11413         contants.
11414         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
11415         is used.
11416         
11417         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
11418         is used.
11419         
11420         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
11421         to avoid the problems with nested types.
11422
11423 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
11424             Anoob V.E  <projectmonokochi@rediffmail.com>
11425             Harilal P.R  <projectmonokochi@rediffmail.com>
11426             Raja R Harinath  <rharinath@novell.com>
11427
11428         Fix #73820.
11429         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
11430         attribute.
11431         * typemanager (GetConstructor): Make public.
11432
11433 2005-04-05  John Luke  <john.luke@gmail.com>
11434             Raja R Harinath  <rharinath@novell.com>
11435
11436         Fix #62232.
11437         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
11438         struct too.  Return false quicker in a few cases.
11439         (VerifyUnManaged): Use it.
11440
11441 2005-04-05  Raja R Harinath  <rharinath@novell.com>
11442
11443         Fix #74041.
11444         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
11445         not 'unreachable_seen'.
11446
11447 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
11448
11449         * attribute.cs (Attribute.GetValue): Removed unused.
11450         
11451         * codegen.cs (CodeGen.TrimExt): Removed unused.
11452         
11453         * cs-parser.jay (output): Removed unused.
11454         
11455         * cs-tokenizer.cs (hex_digits): Removed unused.
11456         
11457         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
11458         
11459         * expression.cs (Indirection.LoadExprValue): Removed unused.
11460         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
11461         
11462         * iterators.cs (Iterator.param_types): Removed unused.
11463         
11464         * statement.cs (Goto.block): Removed unused.
11465         (ToplevelBlock.did): Removed unused.
11466         (Switch.ResolveConstantSwitch): Removed unused.
11467
11468 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
11469
11470         * rootcontext.cs: Allow mcs to bootstrap with the compilation
11471         resetting thingy.
11472
11473 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11474
11475         Fix #74232 and cs0208-3.cs.
11476         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
11477         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
11478         unmanaged type.  Don't use FieldBuilders when 't' is a
11479         TypeBuilder.  Use ModFlags and MemberType fields.
11480         * class.cs (MemberBase.member_type): Rename from MemberType.
11481         (MemberBase.MemberType): New property.  Determines member_type on
11482         demand.
11483         (MemberBase.DoDefine): Don't initialize MemberType here.
11484         (FieldMember.Define): Likewise.
11485
11486 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
11487
11488         Fix #74241
11489         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
11490         Attributes are emitted there.
11491         
11492 2005-04-01  Raja R Harinath  <rharinath@novell.com>
11493
11494         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
11495         keyword in 'partial enum' too.
11496         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
11497         is not allowed).
11498         Report from Kamil Skalski <nazgul@omega.pl>.
11499
11500         Fix #74309.
11501         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
11502         have partial containers too.
11503
11504         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
11505         in block' checks to Block.CheckInvariantMeaningInBlock.
11506         * statement.cs (Block.GetKnownVariableInfo): Make private.
11507         (Block.IsVariableUsedInChildBlock): Remove.
11508         (Block.IsVariableUsedInBlock): Likewise.
11509         (Block.CheckInvariantMeaningInBlock): New.  Show location of
11510         conflicting declaration.
11511         (Block.AddVariable): Make error messages less long-winded and more
11512         specific.  Show location of conflicting declaration.
11513         * parameter.cs (Parameters.Location): New readonly property.
11514
11515 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11516
11517         Clean up semantics of invoking ResolveMemberAccess.
11518         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
11519         can have an instance, ensure that we pass in a non-TypeExpression
11520         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
11521         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
11522         argument.  Update to changes and simplify.
11523         (FieldExpr.Emitinstance): Remove CS0120 check.
11524         (PropertyExpr.EmitInstance): Likewise.
11525         * expression.cs (Argument.Resolve): Likewise.
11526         (Invocation.DoResolve): Update to changes in semantics of
11527         InstanceExpression.
11528
11529 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
11530
11531         Fix #74241
11532         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
11533         customization.
11534         
11535         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
11536
11537 2005-03-31  Raja R Harinath  <rharinath@novell.com>
11538
11539         Fix difference in behaviour with commandline invocation.
11540         * driver.cs (Driver.Reset): New.
11541         (CompilerCallableEntryPoint): Call it.
11542
11543         * statement.cs (If.Resolve): Avoid spurious "uninitialized
11544         variable" warnings if the boolean expression failed to resolve.
11545
11546 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
11547
11548         * attribute.cs: Fix the union of several permissions when some of them
11549         are unrestricted (so the result isn't an unrestricted permission set).
11550         Fix #74036.
11551
11552 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11553
11554         * ecore.cs (MemberExpr): New class.  Convert from interface
11555         IMemberExpr.
11556         (MemberExpr.ResolveMemberAccess): Refactor and move here from
11557         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
11558         error checks.
11559         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
11560         (MethodGroupExpr.IsExplicitImpl): Remove.
11561         (Expression.GetFieldFromEvent): Remove.
11562         (SimpleName.MemberStaticCheck): Remove.
11563         (SimpleName.DoSimpleNameResolve): Update to changes.
11564         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
11565         (MemberAccess.IdenticalNameAndTypeName): Remove.
11566         (MemberAccess.error176): Move to MemberExpr.
11567         (MemberAccess.DoResolve): Update to changes.
11568         (BaseAccess.DoResolve): Likewise.
11569
11570 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
11571
11572         C# 2.0 Conditional attribute class implementation
11573         
11574         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
11575         Analyzes class whether it has attribute which has ConditionalAttribute
11576         and its condition is not defined.
11577         
11578         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
11579         (Class.IsExcluded): New method. Search for at least one defined
11580         condition in ConditionalAttribute of attribute class.
11581
11582 2005-03-30  Raja R Harinath  <rharinath@novell.com>
11583
11584         * ecore.cs (PropertyExpr): Derive from Expression, not
11585         ExpressionStatement.
11586         (PropertyExpr.EmitStatement): Remove.
11587
11588 2005-03-29  Raja R Harinath  <rharinath@novell.com>
11589
11590         Fix #74060.
11591         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
11592         internal field "value__" of an enum be private.  The examples for
11593         "value__" that I found on MSDN all used FieldAttributes.Private.
11594
11595         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
11596         Don't mention IL method attribute names.
11597
11598         Fix #47991.  Remove a TODO.
11599         * statement.cs (Block.Toplevel): Make into a field.
11600         (Block.Parameters): Move into ToplevelBlock.
11601         (Block.known_variables): Rename from child_variable_names.
11602         (Block.Block): Remove variants that take Parameters.  Initialize
11603         'Toplevel' with the immediately surrounding toplevel block.
11604         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
11605         LocalInfo parameter.
11606         (Block.GetKnownVariableInfo): New.
11607         (Block.IsVariableNameUsedInChildBlock): Update.
11608         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
11609         the block, even though it may not be in scope.
11610         (Block.AddVariable): Remove Parameters parameter.  Use
11611         Toplevel.Parameters instead.
11612         (Block.AddConstant): Remove Parameters parameter.
11613         (Block.GetParameterReference): Update to use Toplevel.Parameters.
11614         (Block.IsParamaterReference): Likewise.
11615         (Block.IsLocalParameter): Likewise.  Simplify a lot.
11616         (ToplevelBlock.Parameters): New.  Moved from Block.
11617         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
11618         initialize Parameters to a non-null value.
11619         * cs-parser.jay: Update to changes.
11620         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
11621         simple names that mean different things in the same block.  Use
11622         Block.IsVariableNameUsedInBlock.
11623
11624 2005-03-28  Raja R Harinath  <rharinath@novell.com>
11625
11626         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
11627         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
11628         GetTypeHandle.  It is possible for a reflected type to derive from
11629         a TypeBuilder (e.g., int[] derives from the TypeBuilder
11630         System.Array during mscorlib compilation).
11631         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
11632         contain a method_hash, don't create one either.  Don't create a
11633         deep copy of the base cache's method_hash.
11634         (MemberCache.SetupCache): Rename back from DeepCopy.
11635         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
11636         already initialized.  If we see an override function, add its
11637         underlying base virtual function to the member_hash too.
11638
11639         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
11640
11641 2005-03-26  Raja R Harinath  <harinath@acm.org>
11642
11643         Fix #73038.
11644         * assign.cs (Assign.DoResolve): When the RHS of an assignment
11645         fails to resolve, ensure that the LHS is still resolved as an
11646         lvalue.
11647
11648 2005-03-25  Raja R Harinath  <harinath@acm.org>
11649
11650         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
11651         ec.ContainerType.
11652         (Enum.current_ec): Remove.
11653         (Enum.LookupEnumValue): Remove EmitContext argument.
11654         Just uses the one created during DefineType.
11655         (Enum.FindMembers): Update.
11656         * expression.cs (MemberAccess.DoResolve): Update.
11657
11658 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
11659
11660         * assign.cs (Assign.DoResolve): Check for CS1717 when
11661         source and target are same (uses Equals).
11662
11663         * expression.cs (LocalVariableReference, ParameterReference,
11664         This): Implemented Equals, GetHashCode.
11665
11666         * statement.cs (Block.GetParameterReference): Removed useless
11667         local variable.
11668
11669 2005-03-22  Raja R Harinath  <rharinath@novell.com>
11670
11671         Fix cs0128.cs
11672         * statement.cs (Block.AddVariable): Ensure that we skip implicit
11673         blocks before deciding whether the error is cs0136 or cs0128.
11674
11675         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
11676         (using_alias_directive, using_namespace_directive): Pass
11677         MemberName, not an expression to Namespace.UsingAlias and
11678         Namespace.Using.
11679         (MakeName): Use the MemberName of the namespace.
11680         * namespace.cs (Namespace.MemberName): New.
11681         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
11682         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
11683         Likewise.
11684         * decl.cs (MemberName.Name): Make readonly.
11685         (MemberName.FromDotted): New "constructor".
11686         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
11687         (MemberCore.Name): Compute from MemberName on demand.
11688         (MemberCore.SetMemberName): Provide a way to change the
11689         MemberName.
11690         (MemberCore.AddToContainer): Don't take a fullname parameter.
11691         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
11692         fully qualified name of the container to the member name.
11693         (TypeContainer.AddToTypeContainer): Use a fully qualified name
11694         only if the type is a member of the root container.
11695         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
11696         MemberName.Left rather than searching for an embedded ".".
11697         (PartialContainer.CreatePart): Update to changes in RootContext.
11698         (MemberBase.ShortName): Turn into a property.  Use
11699         MemberCore.SetMemberName.
11700         (MemberBase.ExplicitInterfaceName): Remove.
11701         (MemberBase.UpdateMemberName): Remove.
11702         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
11703         (PropertyBase.SetMemberName): New override.
11704         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
11705         (Tree.GetDecl): New.
11706         (Tree.AllDecls): Rename from Decls.
11707         * attribute.cs, enum.cs, report.cs: Update to changes.
11708         * driver.cs (MainDriver): Use MemberName.FromDotted on
11709         RootContext.MainClass.
11710
11711 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
11712
11713         * class.cs (FixedField.Define): Check for CS1664 and more sanity
11714         checks.
11715
11716         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
11717
11718 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
11719
11720         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
11721         property accessor modifiers.
11722
11723         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
11724         fixed buffer attribute (CS1716).
11725         (PropertyMethod.HasCustomAccessModifier): When property accessor
11726         has custom modifier.
11727
11728         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
11729         modifiers.
11730         (PropertyExpr.DoResolveLValue): Add CS0272.
11731
11732 2005-03-17  Miguel de Icaza  <miguel@novell.com>
11733
11734         * convert.cs: When converting to a pointer, use the proper Conv.U
11735         or Conv.I depending on the source data type.
11736
11737         * cs-tokenizer.cs: Make the size for large decimal constants,
11738         fixes #72957.
11739
11740 2005-03-17  Martin Baulig  <martin@ximian.com>
11741
11742         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
11743         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
11744
11745 2005-03-17  Martin Baulig  <martin@ximian.com>
11746
11747         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
11748         to bool so we can return an error condition.
11749         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
11750         returned an error.
11751
11752 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
11753
11754         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
11755         attributes.
11756
11757 2005-03-16  Raja R Harinath  <rharinath@novell.com>
11758
11759         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
11760         Refactor to avoid traversing the list of assemblies, and to avoid
11761         string concatenation.
11762         * typemanager.cs (guid_attr_type): Remove.
11763         (negative_hits, pointers, references): Remove hashes.
11764         (type_hash): New.
11765         (GetConstructedType): New.  Uses type_hash to handle constructed
11766         types (arrays, references, pointers).
11767         (GetReferenceType, GetPointerType): Use it.
11768         (GetNestedType): New.  Uses type_hash to handle nested types of
11769         reflected types.
11770         (LookupType, LookupTypeDirect): Remove.
11771         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
11772         'types' hash and LookupTypeReflection directly.
11773         (params_string, params_object): Use GetConstructedType.
11774         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
11775         top-level types.
11776         (Namespace.Lookup): Use cached_types.
11777         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
11778         provided by old TypeManager.LookupType.
11779         * rootcontext.cs (MakeFQN): Remove.
11780         * decl.cs (DeclSpace.MakeFQN): Likewise.
11781         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
11782         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11783         TypeManager.GetConstructedType.
11784         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
11785
11786 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
11787
11788         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
11789         indexers.
11790
11791         * cs-parser.jay: Reports CS1527 for any namespace element.
11792
11793         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
11794         Added CS0407.
11795
11796         * expression.cs (ParameterReference.IsAssigned): Changed error to
11797         CS0269.
11798         (Error_WrongNumArguments): Moved CS0245 detection here.
11799
11800         * statement.cs (Return.Resolve): Add CS1622 report.
11801
11802 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
11803
11804         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
11805
11806 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
11807
11808         * attribute.cs expression.cs: Get rid of some allocations.
11809
11810 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
11811
11812         * doc.cs : just eliminate the latest change.
11813
11814 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11815
11816         * doc.cs : commented out the latest change. It breaks xml-030.cs
11817
11818 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11819
11820         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
11821           fail. So invoke CreateType() in FindDocumentedType().
11822
11823 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
11824
11825         * cs-tokenizer.cs : added IsKeyword().
11826         * doc.cs : Detect keyword incorrectly used as identifier.
11827           Allow identifiers prefixed by @.
11828
11829 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
11830
11831         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
11832         It caused exception in namespace resolving (again!).
11833         
11834         * class.cs (Class.ctor): Removed exit.
11835         (PropertyMethod.ctor): ditto.
11836         
11837         * codegen.cs (Codegen.Reset): Reset static data.
11838         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11839         
11840         * cs-tokenizer.cs (Cleanup): Removed.
11841         
11842         * driver.cs (GetSystemDir): Rewrote to one line command.
11843         It caused problem with unloaded dynamic modules.
11844         (UnixParseOption): Removed Exit.
11845         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
11846         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
11847         Now can be mcs used as library.
11848         
11849         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
11850         empty location.
11851         
11852         * location.cs (Reset): Reset static data.
11853         
11854         * namespace.cs (Reset): Reset static data.
11855         
11856         * report.cs (Report.Reset): Reset static data.
11857         
11858         * rootcontext.cs (RootContext.Reset): Reset static data.
11859         
11860         * tree.cs (RootTypes.ctor): Use Location.Null
11861         
11862         * typemanager.cs (TypeManager.Reset): Reset static data.
11863         (CoreLookupType): Removed Exit.
11864         (TypeHandle.Reset): Reset static data.
11865         
11866 2005-03-10  Raja R Harinath  <rharinath@novell.com>
11867
11868         Fix #73516.
11869         * typemanager.cs (ComputeNamespaces): Import namespaces from
11870         referenced modules too.
11871
11872 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11873
11874         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
11875         than '.'.
11876
11877 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11878
11879         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
11880         enclosing DeclSpace.  This ensures that a name-lookup populates
11881         more caches and there are fewer 'TypeExpression's.  Carve out
11882         nested type lookup into ...
11883         (LookupNestedTypeInHierarchy): ... this.
11884
11885 2005-03-09  Raja R Harinath  <rharinath@novell.com>
11886
11887         Clean up a few partial-class semantics.  
11888         Fixes test-357.cs and cs1618-2.cs.
11889         * cs-parser.jay (struct_declaration): Use 'current_class' as
11890         parent of newly-created struct.  Remove call to Register ().
11891         Use 'pop_current_class' to complete handing the current struct.
11892         (interface_declaration): Likewise.
11893         (class_declaration): Likewise.
11894         (enum_declaration): Use 'current_class' as parent of newly created
11895         enum.
11896         (delegate_declaration): Likewise.
11897         (pop_current_class): New function.  This is used to handle closing
11898         up the 'current_class' and 'current_container', and pointing them
11899         to the enclosing class/container.
11900         (CSharpParser): Initialize 'current_class' too.
11901         * decl.cs (MemberCore): Add check for invariant: a partial
11902         container is not a parsed entity, and thus does not enclose any
11903         parsed members.
11904         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
11905         (DeclSpace.BaseTypeExpr): Use it.
11906         (DeclSpace.LookupType): Add check for invariant.
11907         * class.cs (TypeContainer): Add check for invariant: a nested
11908         class should have the same NamespaceEntry as its enclosing class.
11909         (TypeContainer.EmitFieldInitializers): Make virtual.
11910         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
11911         MemberCore.
11912         (TypeContainer.Register): Remove.
11913         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
11914         null.  Use TypeResolveEmitContext for resolving base types and
11915         interfaces.  Move initialization of Parts.TypeBuilder here from
11916         ...
11917         (TypeContainer.DefineNestedTypes): ... here.
11918         (PartialContainer): Take a Namespace not a NamespaceEntry.
11919         (PartialContainer.Create): Don't use Register.  Call the
11920         appropriate Add... function directly.
11921         (ClassPart): Take both the PartialContainer and the enclosing
11922         class as constructor arguments.
11923         (ClassPart.EmitFieldInitializers): Override.
11924         (ClassPart.PartFindNestedTypes): Remove.
11925         (FieldBase.GetInitializerExpression): Resolve the initializer
11926         expression in the emit context of the enclosing class.
11927         * tree.cs (RootTypes): Remove Register ().
11928         
11929 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
11930
11931         * cs-parser.jay: Removed CS0134.
11932         
11933         * driver.cs: Removed CS1901.
11934         
11935         * expression.cs (SizeOf.DoResolve): Don't report CS0233
11936         for predefined types.
11937
11938 2005-03-07  Duncan Mak  <duncan@novell.com>
11939
11940         * codegen.cs (Save):  Catch UnauthorizedAccessException as
11941         well. Fixes bug #73454.
11942
11943 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
11944
11945         * cs-tokenizer.cs (xtoken): Add CS1035.
11946         
11947         * class.cs (MethodData.Define): Add CS0683.
11948         (FieldMember.ctor): Add CS0681.
11949
11950 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11951
11952         * ecore.cs (SimpleName.DoResolve): Rename from
11953         SimpleName.DoResolveAllowStatic.
11954         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
11955         Pass 'intermediate' flag to MemberStaticCheck.
11956         (SimpleName.MemberStaticCheck): Skip "static check" only in case
11957         of "intermediate" lookups via MemberAccess.
11958         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
11959         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
11960
11961 2005-03-07  Raja R Harinath  <rharinath@novell.com>
11962
11963         Fix #73394.
11964         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
11965         slipped in because of variable names that are identical to a
11966         builtin type's BCL equivalent ('string String;', 'int Int32;').
11967         (PropertyExpr.EmitInstance): Likewise.
11968
11969 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
11970
11971         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
11972         
11973         * report.cs (warning_ignore_table): Made public.
11974
11975 2005-03-04  Raja R Harinath  <rharinath@novell.com>
11976
11977         Fix #73282.
11978         * class.cs (MethodData.Emit): Pass 'container' to
11979         container.GetObsoleteAttribute instead of 'container.Parent'.
11980
11981 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
11982
11983         * cs-parser.jay: Add 1534 error test.
11984
11985         * iterators.cs (Yield.CheckContext): Add error 1629.
11986         (Iterator.ctor): Save unsafe modifier.
11987         (MoveNextMethod.DoEmit): Restore unsafe context.
11988
11989         * namespace.cs (UsingAlias): Better error message.
11990
11991 2005-03-03  Dan Winship  <danw@novell.com>
11992
11993         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
11994         the warning message [#73219]
11995
11996 2005-03-03  Raja R Harinath  <rharinath@novell.com>
11997
11998         Fix compile with MCS 1.0.0.0.
11999         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12000         w_restore to not depend on string constant folding.
12001
12002 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12003
12004         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12005         CS0246 check to users who passed 'silent = false'.
12006         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12007         check.
12008         (SimpleName.SimpleNameResolve): Update.
12009         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12010         (MemberAccess.IdenticalNameAndTypeName): Update.
12011         * doc.cs (FindDocumentedTypeNonArray): Update.
12012
12013 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12014
12015         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12016         * parameters.cs (ComputeAndDefineParameters): Remove.
12017         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12018         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12019         Use GetParameterInfo.
12020
12021 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12022
12023         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12024
12025 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12026
12027         Unify DeclSpace.LookupType and DeclSpace.FindType.
12028         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12029         is in charge of defining nested types on demand.
12030         (DeclSpace.LookupType): Use it when the current_type is a
12031         TypeBuilder.  Use LookupTypeDirect for reflected types.
12032         (DeclSpace.FindType): Remove.
12033         (DeclSpace.LookupInterfaceOrClass): Likewise.
12034         (DeclSpace.DefineTypeAndParents): Likewise.
12035         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12036         DeclSpace.LookupType.
12037         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12038         * typemanager.cs (LookupType): Simplify.
12039         (AddUserType): Remove type from negative_hits.
12040         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12041         * class.cs (TypeContainer.FindMembers): Move handling of nested
12042         types ...
12043         (TypeContainer.FindMembers_NestedTypes): ... here.
12044         (TypeContainer.FindNestedType): Implement override.
12045         (ClassPart.FindNestedType): Delegate to PartialContainer.
12046         (ClassPart.PartFindNestedType): Looks up the nested types of the
12047         part alone.
12048
12049 2005-03-02  Martin Baulig  <martin@ximian.com>
12050
12051         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12052         static constructor in static classes.
12053
12054 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12055
12056         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12057         sizeParamIndex is not specified.
12058
12059 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12060
12061         Fix #73117
12062         * report.cs (WarningMessage.IsEnabled): Missing null check.
12063
12064 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12065
12066         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12067         in the fields and not in the properties.
12068
12069 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12070
12071         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12072         fields as well.
12073
12074 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12075
12076         * attribute.cs: Small refactoring (improved robustness).
12077         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12078         (ValidateGuid): Removed.
12079         (Resolve): Removed referenced to above mentioned.
12080         (GetAttributeUsage): Made private and changed to work without
12081         class assistance.
12082         (GetIndexerAttributeValue): Don't crash.
12083         (GetConditionalAttributeValue): Ditto.
12084         (GetClsCompliantAttributeValue): Ditto.
12085         (ExtractSecurityPermissionSet): All attributes exceptions are
12086         error 648.
12087         (GetPropertyValue): New helper.
12088         (GetMethodImplOptions): New method.
12089         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12090         some missing properties.
12091         
12092         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12093         (Method.ApplyAttributeBuilder): Updated.
12094         
12095         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12096         exception.
12097
12098 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12099
12100         Fix #73052.
12101         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12102         non-simple types (array, pointer, reference).
12103
12104 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12105
12106         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12107
12108         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12109         for operators.
12110         (Method.CheckBase): Catch wrong destructor here.
12111         (MethodData.Define): Add errors 550, 668.
12112
12113         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12114
12115         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12116
12117         * pending.cs (VerifyPendingMethods): Add error 551.
12118
12119         * typemanager.cs (CSharpName): Next error report helper.
12120
12121 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12122
12123         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12124         attributes. Removed useless attribute double check.
12125         It saves almost 2MBs for corlib.
12126
12127 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12128
12129         Fix #72924.
12130         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12131         called twice in case of error.
12132
12133 2005-02-23  Chris Toshok  <toshok@ximian.com>
12134
12135         Fix compiler portions of #72827.
12136         * statement.cs (Block.Emit): call Begin/EndScope on the
12137         EmitContext instead of the ILGenerator.
12138
12139         * codegen.cs (EmitContext.BeginScope): new method, call
12140         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12141         we have one.)
12142         (EmitContext.BeginScope): same, but EndScope and CloseScope
12143
12144         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12145         offset and call the superclass's OpenScope(int) with it.
12146         (SymbolWriter.CloseScope): get the current il
12147         offset and call superclass's CloseScope(int) with it.
12148
12149 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12150
12151         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12152         CS1677 for out and ref as well.
12153
12154         * class.cs (Method.Define): Add error CS1599 detection.
12155         
12156         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12157         
12158         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12159         
12160         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12161         
12162         * support.cs.cs (ModifierDesc): New helper method.
12163
12164 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12165             Abin Thomas  <projectmonokochi@rediffmail.com>
12166             Anoob V E  <projectmonokochi@rediffmail.com>
12167             Harilal P R  <projectmonokochi@rediffmail.com>
12168
12169         Fix #57851, #72718.
12170         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12171         MemberLookup (used for error reporting) actually returns a result.
12172         Fix error report number (122, not 112).
12173
12174 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12175             Anoob V E  <projectmonokochi@rediffmail.com>
12176             Harilal P R  <projectmonokochi@rediffmail.com>
12177
12178         Fix #71134.
12179         * pending.cs (PendingImplementation.GetAbstractMethods):
12180         Find NonPublic members too.
12181
12182 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12183
12184         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12185         Fixed error 217.
12186         
12187         * class.cs (MethodCore.CheckMethodAgainstBase):
12188         Add error 239 report.
12189
12190 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12191
12192         Fix #68955.
12193         * expression.cs (Invocation.IsApplicable): Make public.
12194         (Invocation.IsParamsMethodApplicable): Likewise.
12195         * delegate.cs (Delegate.VerifyApplicability): Don't use
12196         Invocation.VerifyArgumentCompat for parameter applicability
12197         testing.  Use Invocation.IsApplicable and
12198         Invocation.IsParamsMethodApplicable.
12199
12200 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12201
12202         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12203         
12204         * class.cs (Operator.Define): Add error 217 report.
12205         
12206 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12207
12208         * namespace.cs (UsingEntry.Resolve): Undo change below.
12209
12210 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12211
12212         Fix #72756.
12213         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12214         disable the error message when the extended MemberLookup also
12215         fails.
12216         (Expression.MemberLookupFinal): Update.
12217         (SimpleName.DoSimpleNameResolve): Update.
12218         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12219         Don't use MemberLookupFinal.
12220         (New.DoResolve): Update.
12221         (BaseAccess.CommonResolve): Update.
12222
12223 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12224
12225         Fix #72732.
12226         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12227         occured previously, don't resolve again.
12228
12229 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12230
12231         Fix #69949
12232         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12233         argument. Call ResolveAttributeUsage for unresolved.
12234         when types doesn't match ctor arguments.
12235         
12236         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12237         for nested attribute classes.
12238         (Class.attribute_usage): Removed.
12239         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12240         for attribute class.
12241         
12242         * ecore.cs (IsAttribute): Removed.
12243         
12244         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12245         
12246         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12247         now normal types.
12248         (attribute_types): Removed.
12249         (EmitCode): Global attributes are emited as the latest.
12250
12251 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12252
12253         * class.cs (EmitFieldInitializers): Don't emit field initializer
12254         for default values when optimilization is on.
12255         
12256         * constant.cs (Constant.IsDefaultValue): New property.
12257         
12258         * driver.cs: Add /optimize handling.
12259         
12260         * constant.cs,
12261         * ecore.cs,
12262         * literal.cs: Implement new IsDefaultValue property.
12263         
12264         * rootcontext.cs (Optimize): New field, holds /optimize option.
12265
12266 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12267
12268         Fix crasher in re-opened #72347.
12269         * namespace.cs (Namespace.Lookup): Return null if
12270         DeclSpace.DefineType returns null.
12271
12272         Fix #72678.
12273         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12274
12275 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12276
12277         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12278         now returns null if it cannot resolve to an lvalue.
12279         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12280         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12281         returned null.  Remove check for SimpleName.
12282         (EventExpr.DoResolveLValue): New.
12283         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12284         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12285         error from ...
12286         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12287         avoid CS0131 error.
12288         (Unary.ResolveOperator): Move CS0211 check ...
12289         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12290         CS0131 error.
12291         (Unary.DoResolveLValue): Simplify.
12292         (AddressOf.DoResolveLValue): New.
12293         (ArrayAccess.DoResolveLValue): New.
12294
12295 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
12296
12297         * attribute.cs (Attribute.Resolve): Add arguments casting for
12298         when types doesn't match ctor arguments.
12299
12300 2005-02-16  Raja R Harinath  <rharinath@novell.com>
12301
12302         Fix parts of #63202.
12303         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
12304         lookup of operator in base type.  Ensure that all checks happen
12305         when the operator resolves to an "op_..." method.
12306
12307 2005-02-15  Raja R Harinath  <rharinath@novell.com>
12308
12309         Fix #71992.
12310         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
12311         'ignore_cs0104' parameter.  Pass it to ...
12312         (NamespaceEntry.Lookup): ... this.
12313         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
12314         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
12315         (TypeLookupExpression.DoResolveAsTypeStep): Update.
12316         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
12317         Update.  Request that cs0104 errors be ignored.
12318         (ComposedCast.ResolveAsTypeStep): Update.
12319
12320 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12321
12322         Fix #59209.
12323         * expression.cs (Invocation.BetterFunction): Remove support for
12324         comparing virtual functions and their overrides.
12325         (Invocation.IsOverride): New.
12326         (Invocation.OverloadResolve): Don't consider 'override' functions
12327         during candidate selection.  Store them in a lookaside list.
12328         If the selected method is a 'virtual' function, use the list to
12329         find any overrides that are closer to the LHS type.
12330
12331 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
12332
12333         * expression.cs (New.DoResolve): Add complex core type reduction.
12334         (New.Constantify): Converts complex core type syntax like 'new int ()'
12335         to simple constant.
12336         
12337 2005-02-14  Raja R Harinath  <rharinath@novell.com>
12338
12339         * decl.cs (EntryType.EntryType): New constructor to create an
12340         updated copy of a cache entry.
12341         (MemberCache.AddMethods): Use it.
12342         (MemberCache.ClearDeclaredOnly): Remove.
12343         (MemberCache.MemberCache): Update.
12344
12345 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12346
12347         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
12348         variable.  This one is represents the actual low-level declaration
12349         of the method, as opposed to the semantic level `IsStatic'.   
12350
12351         An anonymous method which is hosted into a static method might be
12352         actually an instance method.  IsStatic would reflect the
12353         container, while MethodIsStatic represents the actual code
12354         generated.
12355
12356         * expression.cs (ParameterReference): Use the new MethodIsStatic
12357         instead of IsStatic.
12358
12359         * anonymous.cs (AnonymousMethod.Compatible): Pass the
12360         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
12361         set on the current EmitContext. 
12362
12363         * expression.cs (Cast): Overload DoResolveLValue so we can pass
12364         resolve our casted expression as an LValue.  This triggers the
12365         proper LValue processing that is later required by Assign.
12366
12367         This fixes 72347.
12368
12369         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
12370
12371 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
12372
12373         C# 2.0 Fixed buffer implementation
12374
12375         * anonymous.cs: Update after RegisterHelperClass renaming.
12376
12377         * attribute.cs (AttributeTester.fixed_buffer_cache):
12378         Cache of external fixed buffers.
12379         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
12380         implementation if field is fixed buffer else null.
12381
12382         * class.cs
12383         (TypeContainer.AddField): Accept FieldMember instead of Field.
12384         (FieldBase.IsFieldClsCompliant): Extracted code from
12385         VerifyClsCompliance descendant customization.
12386         (FixedField): New class handles fixed buffer fields.
12387         (FixedFieldExternal): Keeps information about imported fixed
12388         buffer.
12389         (IFixedField): Make access to internal or external fixed buffer
12390         same.
12391
12392         * cs-parser.jay: Add fixed buffer parsing.
12393
12394         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
12395         buffer.
12396
12397         * expression.cs (Indirection): Extended implementation to accept
12398         fixed buffer field.
12399         (PointerArithmetic.Emit): Get element from fixed buffer as well.
12400         (ElementAccess.MakePointerAccess): Get type as parameter.
12401         (DoResolve): Add fixed buffer field expression conversion.
12402         (DoResolveLValue): Ditto.
12403         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
12404         (ArrayPtr): Derives from FixedBufferPtr.
12405         (ArrayPtr.Emit): Add extra emit for array elements.
12406
12407         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
12408
12409         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
12410         for compiler generated types.
12411         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
12412
12413         * statement.cs (Fixed): Refactored to be easier add fixed buffer
12414         and consume less memory.
12415         (Fixed.Resolve): Add fixed buffer case.
12416
12417         * typemanager.cs (compiler_generated_attr_ctor,
12418         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
12419         (HasElementType): Add our own implementation to work on every
12420         runtime.
12421
12422 2005-02-11  Miguel de Icaza  <miguel@novell.com>
12423
12424         * anonymous.cs (CaptureContext): Track whether `this' has been
12425         referenced.   
12426
12427         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
12428         only captured `this' if it was implicitly done (instance
12429         methods/variables were used). 
12430
12431         * codegen.cs (EmitContext.CaptureThis): New method to flag that
12432         `this' must be captured.
12433
12434 2005-01-30  Miguel de Icaza  <miguel@novell.com>
12435  
12436         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
12437         is null it means that there has been no need to capture anything,
12438         so we just create a sibling.
12439
12440         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
12441
12442         Just a partial fix.  The other half is fairly elusive.
12443         
12444 2005-02-10  Raja R Harinath  <rharinath@novell.com>
12445
12446         Fix #52586, cs0121-4.cs.
12447         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
12448         and return a hashtable.
12449         (MemberCache.ClearDeclaredOnly): New.
12450         (MemberCache.MemberCache): Update to change.  Make a deep copy of
12451         the method_hash of a base type too.
12452         (MemberCache.AddMethods): Adapt to having a deep copy of the base
12453         type methods.  Overwrite entries with the same MethodHandle so
12454         that the ReflectedType is correct.  The process leaves in base
12455         virtual functions and their overrides as distinct entries.
12456         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
12457         matters since it was boxed in a ArrayList before.
12458         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
12459         modifier.
12460         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
12461         case of a virtual function and its override (choose the overload
12462         as better).
12463         (Invocation.OverloadResolve): Avoid 'override' members during
12464         'applicable_type' calculation.
12465
12466 2005-02-09  Raja R Harinath  <rharinath@novell.com>
12467
12468         Combine two near-redundant caches.
12469         * typemanager.cs (method_params): Rename from method_internal_params.
12470         (TypeManager.GetParameterData): New.  Replace
12471         Invocation.GetParameterData.
12472         (TypeManager.LookupParametersByBuilder): Remove.
12473         * expression.cs (Invocation.method_parameter_cache): Remove.
12474         (Invocation.GetParameterData): Remove.
12475         Update to changes.
12476         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
12477         Update to changes.
12478
12479 2005-02-08  Raja R Harinath  <rharinath@novell.com>
12480
12481         Fix #72015.
12482         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
12483         TypeManager.multicast_delegate_type is null, resolve it by looking
12484         up "System.MulticastDelegate".
12485         * rootcontext.cs (RootContext.ResolveCore): Simplify.
12486
12487 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
12488             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
12489             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
12490
12491         Fix cs0164.cs.
12492         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
12493         (LabeledStatement.AddReference): New.  Set 'referenced'.
12494         (Goto.Resolve): Use it.
12495
12496 2005-02-05  John Luke  <john.luke@gmail.com>
12497
12498         * driver.cs: remove duplicate -doc line in Usage ()
12499
12500 2005-02-04  Raja R Harinath  <rharinath@novell.com>
12501
12502         * location.cs (Location.AddFile): Fix CS2002 error report.
12503
12504 2005-02-02  Martin Baulig  <martin@ximian.com>
12505
12506         * delegate.cs (Delegate.DefineType): Report an internal error if
12507         TypeManager.multicast_delegate_type is null.  See bug #72015 for
12508         details.        
12509
12510 2005-02-02  Raja R Harinath  <rharinath@novell.com>
12511
12512         Fix a crasher in a variant of #31984.
12513         * const.cs (Constant.CheckBase): New override that defers the
12514         new-or-override check in case the base type hasn't been populated
12515         yet.
12516         (Constant.Define): Ensure the new-or-override check is performed.
12517
12518 2005-02-01  Duncan Mak  <duncan@ximian.com>
12519
12520         * const.cs (LookupConstantValue): Check that `ce' is not null
12521         before calling GetValue ().
12522
12523 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12524
12525         Fix test-334.cs (#69519).
12526         * cs-parser.jay (using_alias_directive): Pass in an expression to
12527         NamespaceEntry.UsingAlias.
12528         (using_namespace_directive): Pass in an expression to
12529         NamespaceEntry.Using.
12530         (namespace_name): Don't flatten to a string.
12531         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
12532         (NamespaceEntry.AliasEntry.Resolve): Lookup using
12533         ResolveAsTypeStep.
12534         (NamespaceEntry.UsingEntry): Likewise.
12535         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
12536         changes.
12537         (NamespaceEntry.LookupForUsing): Remove.
12538         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
12539         names.
12540         (NamespaceEntry.Lookup): Remove support for dotted names.
12541
12542 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12543
12544         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
12545         split into two.
12546         (NamespaceEntry.ImplicitParent): Compute on demand.
12547         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
12548         parallels the current.
12549         (NamespaceEntry.LookupForUsing): Use it.
12550         (NamespaceEntry.Lookup): If the current namespace-entry is
12551         implicit, don't search aliases and using tables.
12552
12553 2005-02-01  Raja R Harinath  <rharinath@novell.com>
12554
12555         Fix #31984.
12556         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
12557         BaseCache here.
12558         (TypeContainer.BaseCache): Compute on demand.
12559         (TypeContainer.FindMembers): Define constants and types if they're
12560         not already created.
12561         (FieldMember.Define): Move resetting of ec.InUnsafe before error
12562         check.
12563         * const.cs (Constant.Define): Make idempotent.
12564
12565 2005-01-29  Miguel de Icaza  <miguel@novell.com>
12566
12567         * pending.cs: Produce better code (no nops produced by using Ldarg
12568         + value).
12569         
12570         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
12571         i - 1' it should be arg + 1.
12572
12573         Fixes bug #71819.
12574
12575 2005-01-28  Raja R Harinath  <rharinath@novell.com>
12576
12577         * attribute.cs (Attribute.CheckAttributeType): Make private
12578         non-virtual.
12579         (Attribute.ResolveType): Make virtual.
12580         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
12581         handling of RootContext.Tree.Types.
12582
12583 2005-01-27  Raja R Harinath  <rharinath@novell.com>
12584
12585         Update attribute-handling to use the SimpleName/MemberAccess
12586         mechanisms.
12587         * cs-parser.jay (attribute): Pass in an expression to the
12588         constructors of Attribute and GlobalAttribute.
12589         * attribute.cs (Attribute): Take an expression for the name.
12590         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
12591         passed in attribute name expression.
12592         (Attribute.CheckAttributeType): Use it.
12593         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
12594         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
12595         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
12596         argument to prevent error messages if the lookup fails.
12597
12598 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
12599
12600         * expression.cs (Indirection): Implemented IVariable interface
12601         to support indirection in AddressOf operator.
12602         (PointerArithmetic.Emit): Add optimalization for case where
12603         result can be precomputed.
12604
12605 2005-01-26  Martin Baulig  <martin@ximian.com>
12606
12607         * class.cs (TypeContainer.AttributeTargets): Return the correct
12608         AttributeTargets depending on our `Kind' instead of throwing an
12609         exception; fixes #71632.
12610
12611 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
12612
12613         Fix #71257
12614         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
12615         constant members.
12616
12617 2005-01-25  Raja R Harinath  <rharinath@novell.com>
12618
12619         Fix #71602.
12620         * expression.cs (MemberAccess.DoResolve): Don't complain with
12621         cs0572 when the LHS of a member access has identical name and type
12622         name.
12623
12624 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
12625
12626         Fix #71651, #71675
12627         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
12628         CreatePermission.
12629         Create custom PermissionSet only for PermissionSetAttribute.
12630
12631 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
12632
12633         Fix #71649
12634         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
12635         delegates in static class.
12636
12637 2005-01-24  Martin Baulig  <martin@ximian.com>
12638
12639         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12640         merging an implicit block, just use its reachability.
12641
12642         * statement.cs (Block.Resolve): Make the unreachable code check
12643         work wrt. implicit blocks; see test-337 from #63842.
12644
12645 2005-01-21  Alp Toker  <alp@atoker.com>
12646  
12647         * cs-parser.jay: destructor_declaration's container is PartialContainer
12648         not Class when partial types are used, so use Kind prop instead of
12649         'is'.
12650         
12651 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
12652
12653         * cs-parser.jay: Improve error reporting when an interface
12654         declares new types.
12655
12656 2005-01-20  Dick Porter  <dick@ximian.com>
12657
12658         * support.cs: SeekableStreamReader fix from Sandor Dobos
12659         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
12660         chars are read.  Fixes bug 70369.
12661
12662 2005-01-20  Raja R Harinath  <rharinath@novell.com>
12663
12664         * cs-parser.jay (catch_clause): Simplify current_block handling
12665         somewhat.
12666
12667 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * convert.cs (ImplicitStandardConversionExists): Synchronize the
12670         code with ImplicitStandardConversion to handle the implicit
12671         conversion of method groups into valid delegate invocations. 
12672
12673         The problem is that in parameter handling we were using this code
12674         path.  Fixes bug #64698
12675
12676 2005-01-19  Raja R Harinath  <rharinath@novell.com>
12677
12678         * cs-parser.jay: Fix several infelicities.
12679         - Avoid assigning to the parser value stack.  Code like 
12680           '$3 = null' is unclean.  Synthesize a value for the code block
12681           instead. 
12682         - Avoid using oob_stack for storing location information.  Use ...
12683         (_mark_): ... this.  New (empty) rule.  Saves the current location
12684         in $$.
12685         (foreach_statement): Avoid using oob_stack for current_block
12686         handling.  Use technique used in for_statement and
12687         using_statement.  Synthesize a value for the code block to store
12688         additional intermediate information.
12689
12690 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
12691
12692         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
12693         of a different type is only allowed to private fields of a
12694         containing type, not on fields of a base class.
12695
12696         See test-174.cs and error cs0122-9.cs
12697
12698 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12699
12700         Fix test-335.cs (bug #58126).
12701         * cs-parser.jay (argument): Split out non-expression parts of the
12702         rule into 'non_simple_argument'.
12703         (invocation_expression): Support parenthesized invocations with
12704         multiple arguments, and with single non-simple arguments.
12705
12706 2005-01-13  Raja R Harinath  <rharinath@novell.com>
12707
12708         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
12709         places.
12710
12711 2005-01-12  Raja R Harinath  <rharinath@novell.com>
12712
12713         Fix cs0038-1.cs, cs1640-6.cs.
12714         * ecore.cs (Expression.Resolve): Remove special-case for
12715         SimpleName in error-handling.
12716         (Expression.almostMatchedMembers): Relax access permission to
12717         protected.
12718         (Expression.MemberLookupFailed): Handle duplicates in
12719         almostMatchedMembers list.
12720         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
12721         * expression.cs (New.DoResolve): Report CS1540 for more cases.
12722         * typemanager.cs (GetFullNameSignature): Use the MethodBase
12723         overload if the passed in MemberInfo is a MethodBase.
12724
12725 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
12726
12727         Fix #70749
12728         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
12729         for non-CAS & merge permission sets properly.
12730
12731 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12732
12733         Improve standard-compliance of simple name and member access 
12734         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
12735         * ecore.cs (FullNamedExpression): New abstract base class 
12736         for Namespaces and TypeExpressions.
12737         (ResolveFlags.SimpleName): Remove.
12738         (SimpleName): Remove support for dotted names.
12739         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
12740         DeclSpace.FindType and DeclSpace.LookupType.
12741         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
12742         (Expression.ExprClassName): Make member function.
12743         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
12744         a namespace.  Remove creation of dotted "SimpleName"s.
12745         (MemberAccess.DoResolve): Likewise.
12746         * decl.cs (DeclSpace.Cache): Make private.
12747         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
12748         (DeclSpace.FindType): Update.
12749         (DeclSpace.LookupType): Move here from RootContext.  Return a 
12750         FullNamedExpression.
12751         * namespace.cs (Namespace): Derive from FullNamedExpression
12752         so that it can be part of expression resolution.
12753         (Namespace.Lookup): Return an FullNamedExpression.
12754         (NamespaceEntry.LookupAlias): Lookup aliases only in current
12755         namespace.
12756         * rootcontext.cs (NamespaceLookup): Remove.
12757         (LookupType): Move to DeclSpace.
12758         * attribute.cs (CheckAttributeType): Update.
12759         * doc.cs (FindDocumentedType): Remove allowAlias argument.
12760         (FindDocumentedTypeNonArray): Likewise.
12761
12762 2005-01-11  Raja R Harinath  <rharinath@novell.com>
12763
12764         Fix cs0509.cs, cs1632.cs.
12765         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
12766         is the same as IsInterface.
12767         (TypeContainer.GetClassBases): Likewise.
12768         * statement.cs (LabeledStatement.ig): New field.
12769         (LabeledStatement.LabelTarget): Save ILGenerator which created the
12770         label.
12771         (LabeledStatement.DoEmit): Check that the label was created with
12772         the same ILGenerator.
12773
12774 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12775
12776         Fix #71058
12777         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
12778         accessors to its properties.
12779
12780         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
12781         from accessors to property.
12782         
12783 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
12784
12785         Fix #70722
12786         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
12787         only for overrides.
12788         
12789 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
12790
12791         * attribute.cs: Check for null and empty strings.  
12792
12793         I have lost another battle to Paolo.
12794
12795 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
12796
12797         Fix #70942
12798         * class.cs (PropertyMethod): Set Parent field in ctors.
12799         (SetMethod.InternalParameters): Add unsafe switch hack.
12800         Override MarkForDuplicationCheck where it is appropriate.
12801
12802         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
12803         It says whether container allows members with the same name.
12804         Base default is no.
12805         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
12806         Removed is_method parameter.
12807
12808 2005-01-06  Duncan Mak  <duncan@ximian.com>
12809
12810         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
12811         because the previous change led to incorrect reporting of CS1032
12812         ("Cannot define/undefine preprocessor symbols after first token in
12813         file"). Instead of using `tokens_seen' as the only flag that
12814         triggers CS1040, introduce `comments_seen'. This new flag is used
12815         to signify having seen comments on the current line, so it is
12816         unset after a newline.
12817
12818 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12819
12820         * doc.cs : When searching for a type, find nested type too.
12821           This fixes bug #71040.
12822
12823 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
12824
12825         * doc.cs :
12826           - Warn missing member comment on those classes which also does not
12827             have doc comments. Fixed bug #71041.
12828           - Don't warn missing doc comment on default constructor.
12829             Fixed bug #71042.
12830
12831 2005-01-06  Duncan Mak  <duncan@ximian.com>
12832
12833         * cs-tokenizer.cs (xtoken): After handling traditional C-style
12834         comments, set `tokens_seen' to true. This allows us to detect
12835         misplaced preprocessor directives (i.e. not at the beginning of
12836         the a line, nor after whitespaces). In that case, report error
12837         CS1040. This fixes bug #56460.
12838
12839         * cs-parser.jay (interface_member_declaration): Add checks for
12840         IsExplicitImpl, and report CS0541 error if an interface member is
12841         defined as an explicit interface declaration.
12842
12843 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
12844
12845         Fix #70817
12846         * class.cs (PropertyMethod): Set Parent field in ctors.
12847         (SetMethod.InternalParameters): Add unsafe switch hack.
12848         
12849         * decl.cs (MemberCore.Parent): Cannot be readonly.
12850
12851 2005-01-06  Raja R Harinath  <rharinath@novell.com>
12852
12853         * decl.cs (DeclSpace.ResolveType): Remove.
12854         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
12855         Merge in code from ...
12856         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
12857         * class.cs, enum.cs: Update to changes.
12858
12859 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * anonymous.cs: Ensure that we init the scope of our parent if it
12862         has not been initialized yet.
12863
12864 2004-12-30  Duncan Mak  <duncan@ximian.com>
12865
12866         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
12867         if field.FieldBuilder is null. Fixes #70758.
12868
12869         * convert.cs: Fixed some typos and updated some of the comments.
12870         (ImplicitStandardConversionExists):
12871         (TryImplicitIntConversion): If `target_type' is an interface and
12872         the type of `ic' implements this interface, return true or a new
12873         BoxedCast instead of null. This fixes #70468.
12874
12875 2004-12-29  Duncan Mak  <duncan@ximian.com>
12876
12877         * expression.cs (Argument.Emit): Check that Expr is
12878         IMemoryLocation before casting to it, and report CS1510 otherwise.
12879
12880         This fixes #70402.
12881
12882 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
12883
12884         * statement.cs (Block.ThisVariable): remove the recursion here, to
12885         make the --profile more sane.
12886
12887 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
12888
12889         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
12890         assembly, by JB Evain.
12891
12892 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12893
12894         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
12895           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
12896         "parent" refers to enclosing type/class.  "base" refers to superclass.
12897
12898 2004-12-17  Raja R Harinath  <rharinath@novell.com>
12899
12900         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
12901         Ensure that we only have GlobalAttributes.
12902         * attribute.cs (Attribute.Emit): Make non-virtual.
12903         (GlobalAttribute.Emit): Remove.
12904         (Attribute.Resolve): Make virtual.
12905         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
12906         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
12907         the argument. Don't create one.
12908         (Attribute.GetObsoleteAttribute): Likewise.
12909         (Attribute.GetClsCompliantAttributeValue): Likewise.
12910         * class.cs, decl.cs: Update to changes.
12911
12912 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
12913
12914         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
12915         
12916         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
12917         
12918         * statement.cs (Foreach.Resolve): Add error 186 report.
12919
12920 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
12921
12922         * expression.cs (Conditional.DoResolve): Add warning 429.
12923         
12924         * statement.cs (If.Resolve): Add warning 665.
12925
12926 2004-12-16  Raja R Harinath  <rharinath@novell.com>
12927
12928         New invariant: RootContext.Tree.Types.NamespaceEntry == null
12929         except when in the parser, and in GlobalAttribute.
12930         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
12931         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
12932         RootContext.Tree.Types.NamespaceEntry once work is done.
12933         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
12934         and resets RootContext.Tree.Types.NamespaceEntry.
12935
12936 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
12937
12938         * cs-parser.jay: Don't create a block for every variable.
12939
12940 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * location.cs: Provide extra information.
12943
12944         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
12945         variables from the captured environment, it is the ldarg_0.
12946
12947 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12948
12949         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
12950         find a conclusion.
12951         
12952         * class.cs: Changed warning level for 169 to avoid developer
12953         displeasure from warning flooding. It will be changed back when they
12954         fix most of current BCL warnings.
12955         
12956         * RootContext.cs: Pushed default WarningLevel to 3.
12957         
12958         * statement.cs: Removed unused variable.
12959
12960 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
12961
12962         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
12963         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
12964         Add error 502 report.
12965         (StaticClass.DefineType): Add error 441 report.
12966         (Class.AllowedModifiersProp): New virtual property as temporary
12967         extension to AllowedModifiers.
12968         (Class.DefineType): Add error 418 report. Moved ModFlags check here
12969         to share implementation with StaticClass and don't call virtual
12970         methods from ctor.
12971         
12972         * driver.cs (MainDriver): Add error 1558 test.
12973
12974         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
12975         report. Moved error 36 test here.
12976
12977         * statement.cs (Throw.Resolve): Add error 724 report.
12978
12979         * typemanager.cs: Add out_attribute_type core type.
12980         
12981 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
12982
12983         * class.cs (TypeContainer.VerifyClsCompliance): Add error
12984         3018 report.
12985         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
12986
12987         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
12988         3017 report.
12989         
12990         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
12991
12992         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
12993         Add error 3023 report.
12994         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
12995
12996         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
12997         implementation.
12998
12999 2004-12-12  John Luke  <john.luke@gmail.com>
13000
13001         * driver.cs (AddArgs): take -- into account when
13002         adding arguments, fixes bug 65710 
13003
13004 2004-12-12  Martin Baulig  <martin@ximian.com>
13005
13006         * expression.cs (Unary.TryReduceNegative): Added support for
13007         SByteConstant and ByteConstant.
13008         (Unary.Reduce): Check error values from TryReduceNegative().
13009
13010 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13011
13012         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13013         and report exception as error 182.
13014
13015 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13016
13017         * driver.cs (Main): Fix message when there are warnings.
13018
13019 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13020
13021         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13022
13023 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13024
13025         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13026         Reduced number of warnings.
13027         
13028         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13029
13030 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13031
13032         * driver.cs: Removed message.
13033
13034         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13035
13036 2004-12-08    <vargaz@freemail.hu>
13037
13038         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13039
13040 2004-12-08  Martin Baulig  <martin@ximian.com>
13041
13042         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13043         instead of a CS3002 for properties and indexer.
13044
13045 2004-12-08  Martin Baulig  <martin@ximian.com>
13046
13047         * decl.cs (MemberName.ToString): Make this work again.
13048
13049 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13050
13051         * attribute.cs (Resolve): Add error 591 detection.
13052
13053         * class.cs (FieldMember.Define): Add error 1547 detection.
13054         (Indexer.Define): Add error 620 detection.
13055         (Operator.Define): Add error 590 detection.
13056
13057         * ecore.cs: Missing argument for error 79.
13058
13059         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13060         detection.
13061
13062 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13063
13064         Fix #70106
13065         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13066         only.
13067
13068 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13069
13070         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13071           Some operator comments were suppressed.
13072         * doc.cs : Implicit/explicit operator name in doc comments are like
13073           "op_Explicit(type)~returnType", so added suffix handling.
13074
13075 2004-12-07  Martin Baulig  <martin@ximian.com>
13076
13077         * decl.cs
13078         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13079         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13080         (DeclSpace.ec): New protected field; store the EmitContext here.
13081         (DeclSpace.EmitContext): New public property; moved here from
13082         `TypeContainer'.
13083         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13084         EmitContext.
13085
13086         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13087         (Enum.Emit): Don't create a new EmitContext.
13088
13089         * delegate.cs (Delegate.DefineType): Always create the
13090         EmitContext.
13091
13092         * iterators.cs (Iterators.DefineIterator): Create a new
13093         EmitContext and store it in `ec'.
13094
13095 2004-08-24  Martin Baulig  <martin@ximian.com>
13096
13097         * typemanager.cs
13098         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13099         this for accessibility checks.
13100         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13101         IsNestedFamilyAccessible.
13102         (TypeManager.IsSubclassOf): New method, do what the name actually
13103         says.   
13104
13105 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13106
13107         Fix crash on cs0657-17.cs.
13108         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13109         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13110         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13111         the case where the NamespaceEntry gets overwritten.
13112
13113 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13114
13115         Fixed #69195, #56821
13116         * ecore.cs (ResolveBoolean): Tiny refactoring.
13117
13118         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13119         of right expression resolving when left is false constant and
13120         operator is LogicalAnd OR true constant and operator is LogicalOr.
13121
13122         * statement.cs (ResolveUnreachable): Always reports warning.
13123
13124 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13125
13126         * class.cs: Distinguish between 1721 and 1722 (just a little help
13127         for the programmer).
13128
13129 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13130
13131         * delegate.cs: Only allow this on new versions of the language. 
13132
13133 2004-12-02  Duncan Mak  <duncan@ximian.com>
13134
13135         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13136         Expression class.
13137         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13138         here as a static method. Take an additional bool out parameter
13139         `must_do_cs1540_check' for signaling to InstanceResolve.
13140         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13141         member field from PropertyExpr class and made it an argument of
13142         the method instead.
13143         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13144         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13145         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13146         and `remove_accessor' as well as InstanceResolve: report CS0122
13147         where applicable.
13148
13149         Fixes #70129.
13150
13151 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13152
13153         Fix test-327.cs, test-328.cs, and put in early infrastructure
13154         for eventually fixing #52697.
13155         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13156         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13157         from other methods.
13158         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13159         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13160         (VerifyUsing, error246): Update.
13161         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13162         'NamespaceEntry.LookupNamespaceOrType'.
13163
13164 2004-12-03  Martin Baulig  <martin@ximian.com>
13165
13166         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13167         method as our child, call AnonymousMethod.Compatible() on it.
13168
13169 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13170
13171         Disable XML documentation support in 'basic' profile.
13172         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13173         Redirect XmlElement to System.Object.
13174         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13175         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13176         * mcs.exe.sources: Add doc-bootstrap.cs.
13177         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13178         of doc.cs.
13179
13180 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13181
13182         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13183           comments are allowed.
13184
13185 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13186
13187         * delegate.cs: Add checks for subtypes in paramaters and return values
13188         in VerifyMethod () to add support for Covariance/Contravariance
13189         in delegates.
13190         
13191 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * report.cs: Remove extra closing parenthesis.
13194
13195         * convert.cs (Error_CannotImplicitConversion): If the name of the
13196         types are the same, provide some extra information.
13197
13198         * class.cs (FieldBase): Use an unused bit field from the field to
13199         encode the `has_offset' property from the FieldMember.  This saves
13200         a couple of Ks on bootstrap compilation.
13201
13202         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13203         method as our child, return the AnonymousMethod resolved
13204         expression.
13205
13206         * expression.cs (New.DoResolve): Allow return values from
13207         NewDelegate to also include AnonymousMethods.
13208
13209         Fixes #70150.
13210
13211 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13212
13213         Fix bug #70102
13214         * attribute.cs (Resolve): Improved implementation of params
13215         attribute arguments.
13216
13217         * support.cs (ParameterData): Add HasParams to be faster.
13218
13219 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13220
13221         all things are for /doc support:
13222
13223         * doc.cs: new file that supports XML documentation generation.
13224         * mcs.exe.sources: added doc.cs.
13225         * driver.cs:
13226           Handle /doc command line option.
13227           Report error 2006 instead of 5 for missing file name for /doc.
13228           Generate XML documentation when required, after type resolution.
13229         * cs-tokenizer.cs:
13230           Added support for picking up documentation (/// and /** ... */),
13231           including a new XmlCommentState enumeration.
13232         * cs-parser.jay:
13233           Added lines to fill Documentation element for field, constant,
13234           property, indexer, method, constructor, destructor, operator, event
13235           and class, struct, interface, delegate, enum.
13236           Added lines to warn incorrect comment.
13237         * rootcontext.cs :
13238           Added Documentation field (passed only when /doc was specified).
13239         * decl.cs:
13240           Added DocComment, DocCommentHeader, GenerateDocComment() and
13241           OnGenerateDocComment() and some supporting private members for
13242           /doc feature to MemberCore.
13243         * class.cs:
13244           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13245         * delegate.cs:
13246           Added overriden DocCommentHeader.
13247         * enum.cs:
13248           Added overriden DocCommentHeader and GenerateDocComment().
13249
13250 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13251
13252         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13253         unwrapping the enumeration values, chain to
13254         DoConstantNumericPromotions again, so we can promote things to the
13255         fundamental types (takes care of enums that are bytes, sbytes).
13256
13257         Fixes bug #62054.
13258
13259 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13260
13261         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13262         Fix long-standing bug in type-lookup.  Use FindType instead of
13263         LookupType when ec.ResolvingTypeTree.
13264         (Attribute.ResolveType, Attribute.Resolve)
13265         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13266         Update to changes.
13267         (Attributes.Search): Remove internal version.  Update.
13268         (Attributes.SearchMulti): Update.
13269         (Attributes.GetClsCompliantAttribute): Remove.
13270         (Attributes.GetIndexerNameAttribute): Remove.
13271         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13272         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13273         * class.cs (Indexer.Define): Likewise.
13274
13275 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13276
13277         Fix bug #68790
13278         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13279         MarshallByReference members access.
13280
13281         * expression.cs: Use CheckMarshallByRefAccess;
13282         Better error CS0197 message.
13283
13284         * report.cs: Print whole related error message.
13285
13286 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13287
13288         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13289         the current directory to help debugging.
13290
13291 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13292
13293         * class (GetClassBases): Better error 60 report.
13294         (EventProperty): Disabled warning 67 detection.
13295
13296 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13297
13298         Fix bug #60324
13299         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
13300
13301         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
13302         precise values.
13303
13304 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
13305
13306         Fix bug #49488
13307         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
13308
13309         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
13310
13311 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
13312
13313         * attribute.cs (Attribute.Resolve): Refine error reporting and
13314         report a cs0117 if the identifier does not exist, to distinguish
13315         from 0617 which is a miss-use of the actual identifier.
13316
13317         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
13318         between cs0070 and cs0079.
13319
13320         * class.cs (MemberBase.DoDefine): When reporting a wrong
13321         accessibility level, we use MethodCore to compare instead of
13322         Method (this was a regression in some refactoring effort).
13323
13324         So now we correctly report cs0056 again.
13325
13326         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
13327         testing the target_type (which was known to be object_type) and
13328         not the source type (which is anonymous_method).
13329
13330         Fixed reporting of error cs1660.
13331
13332         * expression.cs (UserCast.Source): Expose the underlying cast.
13333
13334         * statement.cs (Switch.SwitchGoverningType): Sort the list of
13335         allowed types to find a match to int32 first (most common).
13336
13337         In addition, it ignores any ImplicitUserConversions that did an
13338         internal implicit conversion (as the switch statement allows only
13339         one integral conversion to exist).
13340
13341         * class.cs (PartialContainer.Create): rename `name' to
13342         `member_name' for clarity.  Then replace the string calls with a
13343         call to MemberName.GetPartialName, as now using
13344         MemberName.ToString is an error (this is due to the side effects
13345         it had, that were fixed in the past).
13346
13347         This will restore the error reporting on a number of partial class
13348         errors that were missusing this (and getting an exception as a
13349         results, which is now just a plain textual warning, because
13350         yyparse debug output would crash otherwise).
13351
13352 2004-11-26  Raja R Harinath  <rharinath@novell.com>
13353
13354         * Makefile (PROGRAM_INSTALL_DIR): Remove.
13355
13356 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13357
13358         * rootcontext.cs (LookupType): Make sure to cache lookups that
13359         don't give us a negative result. This saves about 5% of corlib
13360         compilation time.
13361
13362 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13363
13364         * report.cs (AbstractMessage.Print): messages are sent to stderr
13365
13366         * class.cs (TypeContainer.GetClassBases): It is an error to have a
13367         non-interface in the list of interfaces (at this point, either
13368         parent was properly set, or a base class is being listed in the
13369         interfaces section).
13370
13371         This flags error 1722, and resolves the crash from bug 69259.
13372
13373 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
13374
13375         * statement.cs (Using.EmitExpressionFinally): make this work right
13376         for valuetypes. Fixes 69926.
13377
13378 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
13379
13380         * const.cs (Const.ChangeType): Cope with the "0 literal can be
13381         converted to an enum" here, before we try to change the underlying
13382         type.  This code exists, but it is a different code path than the
13383         one used while encoding constants.
13384
13385         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
13386         old bug: when converting from the null literal to a pointer,
13387         return an EmptyCast, not the NullLiteral.
13388
13389         This fixes #69921, the recent null_type changes probably made this
13390         bug more prominent.
13391
13392         (ImplicitReferenceConversionExists): In addition, resynchronized
13393         the code here, so it matches the same code in
13394         ImplicitReferenceConversionExists for the `from any class-type S
13395         to any interface-type T'.
13396         
13397
13398 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
13399
13400         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
13401
13402 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * cs-parser.jay: Use verbosity accordingly. 
13405
13406 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13407
13408         * expression.cs (Unary.ResolveOperator): Do not report warning;
13409         AddressOf reads from variable.
13410         
13411         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
13412
13413 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
13414
13415         Fix bug #69462
13416
13417         * attribute.cs (Attributable): Removed CheckTargets.
13418         (Attributes.Emit): Explicit attribute targets are tested here.
13419
13420         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
13421         not enabled for interfaces.
13422
13423         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
13424         (GetAssemblyName): Ouch next bug there.
13425
13426 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13427
13428         * expression.cs: Error 275 added.
13429         
13430 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
13431
13432         Fix bug #69177 (Implemented decimal constant support)
13433
13434         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
13435         (BinaryFold): Add DecimalConstant.
13436
13437         * const.cs (Define): Decimal constant 
13438         (is not constant.
13439         (ChangeType): Add decimal type handling.
13440         (LookupConstantValue): Don't set value for decimal type but
13441         emit DecimalConstantAttribute. Needed for constant optimization.
13442
13443         * constant.cs (ToDecimal): New method.
13444         (ConvertToDecimal): New method.
13445         (IntConstant): Implemented ConvertToDecimal.
13446         (DecimalConstant.Emit): Emit optimized version for decimals in
13447         int range.
13448
13449         * expression.cs (ResolveOperator): Changed order of constant
13450         reduction to work correctly with native types which have
13451         overloaded operators.
13452         (ResolveMemberAccess): Extract constant value from attribute
13453         for decimal type.
13454
13455         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
13456
13457         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
13458         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
13459         (ChangeType): Decimal is special.
13460         (TypeToCoreType): Add decimal type.
13461
13462 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13463
13464         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
13465         decimal types.
13466
13467 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
13468
13469         * class.cs (EventField.ApplyAttributeBuilder): Fix error
13470         test cs1667-5.cs.
13471
13472 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13473
13474         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
13475
13476         * pending.cs (PendingImplementation): Grab only interfaces.
13477
13478 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
13479
13480         * statement.cs (ForeachHelperMethods): Add location member and
13481         error 202 detection.
13482
13483 2004-11-19  Raja R Harinath  <rharinath@novell.com>
13484
13485         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
13486         automatically handled by executable.make.
13487         (PROGRAM): Make profile-specific.
13488
13489 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
13490
13491         * expression.cs (DoResolveBase): Fixed wrong warning for out
13492         variables.
13493
13494 2004-11-18  Martin Baulig  <martin@ximian.com>
13495
13496         Merged latest changes into gmcs.  Please keep this comment in
13497         here, it makes it easier for me to see what changed in MCS since
13498         the last time I merged.
13499
13500 2004-11-17  Raja R Harinath  <rharinath@novell.com>
13501
13502         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
13503         (TypeHandle.GetMemberCache): New.
13504         (TypeHandle.TypeHandle): Update.
13505         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
13506         (TypeManager.LookupParentInterfacesCache):
13507         Rename from LookupInterfaceCache.  Optimize slightly.
13508         (TypeManager.MemberLookup_FindMembers): Update.
13509         * decl.cs (MemberCache.MemberCache): Set Container to null in the
13510         multi-type variant.
13511         (AddCacheContents): Rename from AddHashtable.
13512         * class.cs (TypeContainer.parent_container): Remove.
13513         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
13514         (TypeContainer.DoDefineMembers): Don't initialize it.
13515         Update to name changes.
13516         
13517 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
13518
13519         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
13520         that factors the code to check access modifiers on override.  
13521
13522         (PropertyBase): Use the code here.
13523
13524         Patch from Lluis S'anchez, fixes bug #69361.
13525
13526 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
13529         routine that is used to report the use of a captured variable
13530         whose address has been taken.
13531
13532         There are two checks: one when variables are being captured and
13533         the other check is when the address of a variable is taken. 
13534         
13535         (because an anonymous methods might be resolved before *or* after
13536         the address has been taken) and 
13537
13538         * expression.cs (Conditional.DoResolve): Remove the special
13539         casing that Martin added to trueExpr and falseExpr being both
13540         NullLiteral.  We get the right behavior now just by introducing
13541         the null_type into the compiler. 
13542
13543         * convert.cs (ExplicitConversion): Change the code to use
13544         null_type instead of testing `expr is NullLiteral'.
13545         (ImplicitConversionStandard): use null_type too.
13546         (ImplicitReferenceConversionExists): use null_type too.
13547         (ImplicitReferenceConversion): use null_type too.
13548
13549         * literal.cs: The type of `NullLiteral' is now null_type instead
13550         of object_type. 
13551         (Resolve): Set the type here.
13552
13553         * typemanager.cs: Introduce null_type.
13554
13555 2004-11-17  Martin Baulig  <martin@ximian.com>
13556
13557         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
13558         direction, like FindMembers() does.  Fixes #69546, testcase is in
13559         test-315.cs.    
13560
13561 2004-11-16  Martin Baulig  <martin@ximian.com>
13562
13563         This is based on a patch from Marek Safar, see bug #69082.
13564         Fixes bugs #63705 and #67130.
13565
13566         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
13567         method; create a MemberCache for an interface type and cache the
13568         result.
13569
13570         * decl.cs (IMemberContainer.ParentContainer): Removed.
13571         (IMemberContainer.ParentCache): New property.
13572         (MemberCache.SetupCacheForInterface): Removed.
13573         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
13574         to create a cache for an interface's "parent".
13575
13576         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
13577         interfaces too.
13578
13579 2004-11-16  Martin Baulig  <martin@ximian.com>
13580
13581         Merged back from gmcs; these changes already went into gmcs a
13582         couple of weeks ago.
13583
13584         * typemanager.cs
13585         (TypeManager.AddUserType): Removed the `ifaces' argument.
13586         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
13587         `TypeExpr []'.
13588         (TypeManager.AddUserInterface): Removed.
13589         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
13590         `TypeExpr []'.
13591         (TypeManager.GetInterfaces): Likewise.
13592         (TypeManager.GetExplicitInterfaces): Likewise.
13593
13594         * ecore.cs (TypeExpr.GetInterfaces): Removed.
13595
13596         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
13597         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
13598
13599 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
13600
13601         * statement.cs: Avoid adding bools to a hashtable.
13602
13603 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * expression.cs (Invocation.OverloadResolve): Flag error if we are
13606         calling an unsafe method from a safe location.
13607
13608 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
13609
13610         Fix #69167
13611         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
13612
13613 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
13614
13615         * namespace.cs (VerifyUsing): use GetPartialName instead of
13616         ToString. 
13617
13618 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
13619
13620         * statement.cs (Return.Resolve): Fix regression in typo: if
13621         `in_exc', we have to request a NeedReturnLabel, this was a typo
13622         introduced in the anonymous method check-in.  Fixes #69131.
13623
13624         * Indexers were using the ShortName when defining themselves,
13625         causing a regression in the compiler bootstrap when applying the
13626         patch from 2004-11-02 (first part), now they use their full name
13627         and the bug is gone.
13628
13629 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
13630
13631         * driver.cs: Strip the path from the names of embedded resources. Fixes
13632         #68519.
13633
13634 2004-11-04  Raja R Harinath  <rharinath@novell.com>
13635
13636         Fix error message regression: cs0104-2.cs.
13637         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
13638         (AliasEntry.Resolve): Update.
13639         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
13640         'silent' flag.
13641         (RootContext.LookupType): Update.
13642
13643 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
13644
13645         * cs-parser.jay: Add support for handling accessor modifiers
13646         * class: Add support port accessor modifiers and error checking,
13647         define PropertyMethod.Define as virtual (not abstract anymore)
13648         * ecore.cs: Add checking for proeprties access with access modifiers
13649         * iterators.cs: Modify Accessor constructor call based in the modified
13650         constructor
13651 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
13652
13653         * expression.cs (StringConcat): Handle being called twice,
13654         as when we have a concat in a field init with more than two
13655         ctors in the class
13656
13657 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
13660         special case explicit implementations, we should always produce
13661         the .property or .event declaration.
13662         
13663         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
13664         since it will not return correct data if people use this
13665         unresolved in the presence of using statements (see test-313).
13666
13667         * class.cs (MethodData.Define): If we are an explicit interface
13668         implementation, set the method name to the full name of the
13669         interface plus the name of the method.  
13670
13671         Notice that using the method.MethodName.GetFullName() does not
13672         work, as it will only contain the name as declared on the source
13673         file (it can be a shorthand in the presence of using statements)
13674         and not the fully qualifed type name, for example:
13675
13676         using System;
13677
13678         class D : ICloneable {
13679                 object ICloneable.Clone ()  {
13680                 }
13681         }
13682
13683         Would produce a method called `ICloneable.Clone' instead of
13684         `System.ICloneable.Clone'.
13685
13686         * namespace.cs (Alias.Resolve): Use GetPartialName.
13687         
13688 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13689
13690         * cs-parser.jay: Add error 1055 report.
13691
13692 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * assign.cs (Assign.DoResolve): Only do the transform of
13695         assignment into a New if the types are compatible, if not, fall
13696         through and let the implicit code deal with the errors and with
13697         the necessary conversions. 
13698
13699 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
13700
13701         * cs-parser.jay: Add error 1031 report.
13702
13703         * cs-tokenizer.cs: Add location for error 1038.
13704
13705 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13706
13707         * cs-parser.jay: Add error 1016 report.
13708
13709 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13710
13711         * cs-parser.jay: Add errors 1575,1611 report.
13712
13713 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13714
13715         * cs-parser.jay: Add error 1001 report.
13716
13717 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13718
13719         Fix #68850
13720         * attribute.cs (GetMarshal): Add method argument for
13721         caller identification.
13722
13723         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
13724         agument for GetMarshal and RuntimeMissingSupport.
13725
13726 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
13727
13728         * attribute.cs (ExtractSecurityPermissionSet): Removed
13729         TypeManager.code_access_permission_type.
13730
13731         * typemanager.cs: Removed TypeManager.code_access_permission_type.
13732
13733 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * expression.cs (LocalVariableReference.DoResolveLValue): Check
13736         for obsolete use of a variable here.   Fixes regression on errors
13737         cs0619-25 and cs0619-26.
13738
13739 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
13740
13741         Fix #62358, implemented security attribute encoding.
13742
13743         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
13744         Tests permitted SecurityAction for assembly or other types.
13745         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
13746         data from SecurityPermissionAttribute to PermisionSet class.
13747
13748         * class.cs (ApplyAttributeBuilder): Added special handling
13749         for System.Security.Permissions.SecurityAttribute based types.
13750
13751         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
13752         special handling for System.Security.Permissions.SecurityAttribute
13753         based types.
13754
13755         * enum.cs (ApplyAttributeBuilder): Added special handling
13756         for System.Security.Permissions.SecurityAttribute based types.
13757
13758         * parameter.cs (ApplyAttributeBuilder): Added special handling
13759         for System.Security.Permissions.SecurityAttribute based types.
13760
13761         * rootcontext.cs: Next 2 core types.
13762
13763         * typemanager.cs (TypeManager.security_permission_attr_type):
13764         Built in type for the SecurityPermission Attribute.
13765         (code_access_permission_type): Build in type.
13766
13767 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
13770         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
13771         all of this information into
13772         EmitContext.EmitCapturedVariableInstance.
13773         
13774         * codegen.cs (EmitCapturedVariableInstance): move here the
13775         funcionality of emitting an ldarg.0 in the presence of a
13776         remapping.   This centralizes the instance emit code.
13777
13778         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
13779         then emit a load of this: it means that we have reached the
13780         topmost ScopeInfo: the one that contains the pointer to the
13781         instance of the class hosting the anonymous method.
13782
13783         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
13784         captures to the topmost CaptureContext.
13785
13786 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * expression.cs (LocalVariableReference): Move the knowledge about
13789         the iterators into codegen's EmitCapturedVariableInstance.
13790
13791 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
13792
13793         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
13794         all code paths return a value from an anonymous method (it is the
13795         same as the 161 error, but for anonymous methods).
13796
13797 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
13798
13799         The introduction of anonymous methods in the compiler changed
13800         various ways of doing things in the compiler.  The most
13801         significant one is the hard split between the resolution phase
13802         and the emission phases of the compiler.
13803
13804         For instance, routines that referenced local variables no
13805         longer can safely create temporary variables during the
13806         resolution phase: they must do so from the emission phase,
13807         since the variable might have been "captured", hence access to
13808         it can not be done with the local-variable operations from the runtime.
13809         
13810         * statement.cs 
13811
13812         (Block.Flags): New flag `IsTopLevel' to indicate that this block
13813         is a toplevel block.
13814
13815         (ToplevelBlock): A new kind of Block, these are the blocks that
13816         are created by the parser for all toplevel method bodies.  These
13817         include methods, accessors and anonymous methods.
13818
13819         These contain some extra information not found in regular blocks:
13820         A pointer to an optional CaptureContext (for tracking captured
13821         local variables and parameters).  A pointer to the parent
13822         ToplevelBlock.
13823         
13824         (Return.Resolve): Catch missmatches when returning a value from an
13825         anonymous method (error 1662).
13826         Invoke NeedReturnLabel from the Resolve phase instead of the emit
13827         phase.
13828
13829         (Break.Resolve): ditto.
13830
13831         (SwitchLabel): instead of defining the labels during the
13832         resolution phase, we now turned the public ILLabel and ILLabelCode
13833         labels into methods called GetILLabelCode() and GetILLabel() that
13834         only define the label during the Emit phase.
13835
13836         (GotoCase): Track the SwitchLabel instead of the computed label
13837         (its contained therein).  Emit the code by using
13838         SwitchLabel.GetILLabelCode ().
13839
13840         (LocalInfo.Flags.Captured): A new flag has been introduce to track
13841         whether the Local has been captured or not.
13842
13843         (LocalInfo.IsCaptured): New property, used to tell whether the
13844         local has been captured.
13845         
13846         * anonymous.cs: Vastly updated to contain the anonymous method
13847         support.
13848
13849         The main classes here are: CaptureContext which tracks any
13850         captured information for a toplevel block and ScopeInfo used to
13851         track the activation frames for various local variables.   
13852
13853         Each toplevel block has an optional capture context associated
13854         with it.  When a method contains an anonymous method both the
13855         toplevel method and the anonymous method will create a capture
13856         context.   When variables or parameters are captured, they are
13857         recorded on the CaptureContext that owns them, for example:
13858
13859         void Demo () {
13860              int a;
13861              MyDelegate d = delegate {
13862                  a = 1;
13863              }
13864         }
13865
13866         Here `a' will be recorded as captured on the toplevel
13867         CapturedContext, the inner captured context will not have anything
13868         (it will only have data if local variables or parameters from it
13869         are captured in a nested anonymous method.
13870
13871         The ScopeInfo is used to track the activation frames for local
13872         variables, for example:
13873
13874         for (int i = 0; i < 10; i++)
13875                 for (int j = 0; j < 10; j++){
13876                    MyDelegate d = delegate {
13877                         call (i, j);
13878                    }
13879                 }
13880
13881         At runtime this captures a single captured variable `i', but it
13882         captures 10 different versions of the variable `j'.  The variable
13883         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
13884         recorded on a child.  
13885
13886         The toplevel ScopeInfo will also track information like the `this'
13887         pointer if instance variables were referenced (this is necessary
13888         as the anonymous method lives inside a nested class in the host
13889         type of the method). 
13890
13891         (AnonymousMethod): Expanded to track the Toplevel, implement
13892         `AnonymousMethod.Compatible' to tell whether an anonymous method
13893         can be converted to a target delegate type. 
13894
13895         The routine now also produces the anonymous method content
13896
13897         (AnonymousDelegate): A helper class that derives from
13898         DelegateCreation, this is used to generate the code necessary to
13899         produce the delegate for the anonymous method that was created. 
13900
13901         * assign.cs: API adjustments for new changes in
13902         Convert.ImplicitStandardConversionExists.
13903
13904         * class.cs: Adjustments to cope with the fact that now toplevel
13905         blocks are of type `ToplevelBlock'. 
13906
13907         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
13908         insteda of standard blocks.
13909
13910         Flag errors if params arguments are passed to anonymous methods.
13911
13912         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
13913         `CurrentAnonymousMethod' which points to the current Anonymous
13914         Method.  The variable points to the AnonymousMethod class that
13915         holds the code being compiled.  It is set in the new EmitContext
13916         created for the anonymous method.
13917
13918         (EmitContext.Phase): Introduce a variable and an enumeration to
13919         assist in enforcing some rules about when and where we are allowed
13920         to invoke certain methods (EmitContext.NeedsReturnLabel is the
13921         only one that enfonces this right now).
13922
13923         (EmitContext.HaveCaptureInfo): new helper method that returns
13924         whether we have a CapturedContext initialized.
13925
13926         (EmitContext.CaptureVariable): New method used to register that a
13927         LocalInfo must be flagged for capturing. 
13928
13929         (EmitContext.CapturedParameter): New method used to register that a
13930         parameters must be flagged for capturing. 
13931         
13932         (EmitContext.CapturedField): New method used to register that a
13933         field must be flagged for capturing. 
13934
13935         (EmitContext.HaveCapturedVariables,
13936         EmitContext.HaveCapturedFields): Return whether there are captured
13937         variables or fields. 
13938
13939         (EmitContext.EmitMethodHostInstance): This is used to emit the
13940         instance for the anonymous method.  The instance might be null
13941         (static methods), this (for anonymous methods that capture nothing
13942         and happen to live side-by-side with the current method body) or a
13943         more complicated expression if the method has a CaptureContext.
13944
13945         (EmitContext.EmitTopBlock): Routine that drives the emission of
13946         code: it will first resolve the top block, then emit any metadata
13947         and then emit the code.  The split is done so that we can extract
13948         any anonymous methods and flag any captured variables/parameters.
13949         
13950         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
13951         during this phase, the ILGenerator should not be used as labels
13952         and local variables declared here might not be accessible to any
13953         code that is part of an anonymous method.  
13954
13955         Exceptions to this include the temporary variables that are
13956         created by some statements internally for holding temporary
13957         variables. 
13958         
13959         (EmitContext.EmitMeta): New routine, in charge of emitting all the
13960         metadata for a cb
13961
13962         (EmitContext.TemporaryReturn): This method is typically called
13963         from the Emit phase, and its the only place where we allow the
13964         ReturnLabel to be defined other than the EmitMeta.  The reason is
13965         that otherwise we would have to duplicate a lot of logic in the
13966         Resolve phases of various methods that today is on the Emit
13967         phase. 
13968
13969         (EmitContext.NeedReturnLabel): This no longer creates the label,
13970         as the ILGenerator is not valid during the resolve phase.
13971
13972         (EmitContext.EmitThis): Extended the knowledge in this class to
13973         work in anonymous methods in addition to iterators. 
13974
13975         (EmitContext.EmitCapturedVariableInstance): This emits whatever
13976         code is necessary on the stack to access the instance to a local
13977         variable (the variable will be accessed as a field).
13978
13979         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
13980         EmitContext.EmitAddressOfParameter): Routines to support
13981         parameters (not completed at this point). 
13982         
13983         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
13984         will also remove the parameters.
13985
13986         * convert.cs (Convert): Define a `ConstantEC' which points to a
13987         null.  This is just to prefity some code that uses
13988         ImplicitStandardConversion code and do not have an EmitContext
13989         handy.
13990
13991         The idea is to flag explicitly that at that point in time, it is
13992         known that the conversion will not trigger the delegate checking
13993         code in implicit conversions (which requires a valid
13994         EmitContext). 
13995
13996         Everywhere: pass new EmitContext parameter since
13997         ImplicitStandardConversionExists now requires it to check for
13998         anonymous method conversions. 
13999
14000         (Convert.ImplicitStandardConversionExists): If the type of an
14001         expression is the anonymous_method_type, and the type is a
14002         delegate, we invoke the AnonymousMethod.Compatible method to check
14003         whether an implicit conversion is possible. 
14004
14005         (Convert.ImplicitConversionStandard): Only do implicit method
14006         group conversions if the language level is not ISO_1.
14007
14008         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14009         MethodInfo for the Invoke method.  used by Delegate and
14010         AnonymousDelegate.
14011
14012         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14013         method conversions if the target type is a delegate.
14014
14015         Removed extra debugging nops.
14016
14017         (LocalVariableReference): Turn the `local_info' into a public
14018         field. 
14019
14020         Add `prepared' field, the same hack used for FieldExprs to cope
14021         with composed assignments, as Local variables do not necessarily
14022         operate purely on the stack as they used to: they can be captured
14023         fields. 
14024
14025         Add `temp' for a temporary result, like fields.
14026
14027         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14028
14029         It now copes with Local variables that are captured and emits the
14030         proper instance variable to load it from a field in the captured
14031         case. 
14032
14033         (ParameterReference.DoResolveBase): During the resolve phase,
14034         capture parameters if we are in an anonymous method.
14035
14036         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14037         anonymous method, use the EmitContext helper routines to emit the
14038         parameter reference.
14039
14040         * iterators.cs: Set RemapToProxy to true/false during the
14041         EmitDispose class.
14042
14043         * parameters.cs (GetParameterByName): New helper method. 
14044
14045         * typemanager.cs (anonymous_method_type) a new type that
14046         represents an anonyous method.  This is always an internal type,
14047         used as a fencepost to test against the anonymous-methodness of an
14048         expression. 
14049         
14050 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14051
14052         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14053         561 report.
14054         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14055
14056 2004-10-18  Martin Baulig  <martin@ximian.com>
14057
14058         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14059         `Type' directly, but call ResolveType() on it.
14060         (Catch.Resolve): Likewise.
14061         (Foreach.Resolve): Likewise.
14062
14063 2004-10-18  Martin Baulig  <martin@ximian.com>
14064
14065         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14066         `Type' directly, but call ResolveType() on it.
14067         (Probe.DoResolve): Likewise.
14068         (ArrayCreation.LookupType): Likewise.
14069         (TypeOf.DoResolve): Likewise.
14070         (SizeOf.DoResolve): Likewise.
14071
14072 2004-10-18  Martin Baulig  <martin@ximian.com>
14073
14074         * expression.cs (Invocation.BetterFunction): Put back
14075         TypeManager.TypeToCoreType().
14076
14077 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14078
14079         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14080         the ResolveType.
14081
14082 2004-10-18  Martin Baulig  <martin@ximian.com>
14083
14084         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14085         `Type' directly, but call ResolveType() on it.
14086
14087 2004-10-18  Martin Baulig  <martin@ximian.com>
14088
14089         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14090         `Type' directly, but call ResolveType() on it.
14091         (MemberBase.DoDefine): Likewise.
14092
14093         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14094         `Type' directly, but call ResolveType() on it.
14095         (ComposedCast.DoResolveAsTypeStep): Likewise.
14096
14097         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14098         `Type' directly, but call ResolveType() on it.
14099
14100 2004-10-17  John Luke  <john.luke@gmail.com>
14101
14102         * class.cs (Operator.GetSignatureForError): use CSharpName
14103
14104         * parameter.cs (Parameter.GetSignatureForError): Returns
14105         correct name even if was not defined.
14106
14107 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14108
14109         Fix #65816.
14110         * class.cs (TypeContainer.EmitContext): New property.
14111         (DefineNestedTypes): Create an emitcontext for each part.
14112         (MethodCore.DoDefineParameters): Use container's emitcontext.
14113         Pass type array to InternalParameters.
14114         (MemberBase.DoDefine): Use container's emitcontext.
14115         (FieldMember.Define): Likewise.
14116         (Event.Define): Likewise.
14117         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14118         Pass type array to InternalParameters.
14119         (SetIndexerMethod.GetParameterInfo): Likewise.
14120         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14121         * delegate.cs (Define): Pass emitcontext to
14122         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14123         array to InternalParameters.
14124         * expression.cs (ParameterReference.DoResolveBase): Pass
14125         emitcontext to GetParameterInfo.
14126         (ComposedCast.DoResolveAsTypeStep): Remove check on
14127         ec.ResolvingTypeTree.
14128         * parameter.cs (Parameter.Resolve): Change argument to
14129         EmitContext.  Use ResolveAsTypeTerminal.
14130         (Parameter.GetSignature): Change argument to EmitContext.
14131         (Parameters.ComputeSignature): Likewise.
14132         (Parameters.ComputeParameterTypes): Likewise.
14133         (Parameters.GetParameterInfo): Likewise.
14134         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14135         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14136         * support.cs (InternalParameters..ctor): Remove variant that takes
14137         a DeclSpace.
14138         * typemanager.cs (system_intptr_expr): New.
14139         (InitExpressionTypes): Initialize it.
14140
14141 2004-10-12  Chris Toshok  <toshok@ximian.com>
14142
14143         * cs-parser.jay: fix location for try_statement and catch_clause.
14144
14145 2004-10-11  Martin Baulig  <martin@ximian.com>
14146
14147         * report.cs: Don't make --fatal abort on warnings, we have
14148         -warnaserror for that.
14149
14150 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14151
14152         More DeclSpace.ResolveType avoidance.
14153         * decl.cs (MemberCore.InUnsafe): New property.
14154         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14155         with newly created EmitContext.
14156         (FieldMember.Define): Likewise.
14157         * delegate.cs (Delegate.Define): Likewise.
14158         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14159         only if normal name-lookup fails.
14160         (TypeExpr.DoResolve): Enable error-checking.
14161         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14162         (SizeOf.DoResolve): Likewise.
14163         (ComposedCast.DoResolveAsTypeStep): Likewise.
14164         (StackAlloc.DoResolve): Likewise.
14165         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14166         (Block.Unsafe): New property.
14167         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14168         (Unsafe): Set 'unsafe' flag of contained block.
14169         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14170         (Fixed.Resolve): Likewise.
14171         (Catch.Resolve): Likewise.
14172         (Using.ResolveLocalVariableDecls): Likewise.
14173         (Foreach.Resolve): Likewise.
14174
14175 2004-10-05  John Luke <john.luke@gmail.com>
14176
14177         * cs-parser.jay: add location to error CS0175
14178
14179 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14180
14181         * ecore.cs (Expression.Constantity): Add support for turning null
14182         into a constant.
14183
14184         * const.cs (Const.Define): Allow constants to be reference types
14185         as long as the value is Null.
14186
14187 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14188
14189         * namespace.cs (NamespaceEntry.Using): No matter which warning
14190         level is set, check if this namespace name has already been added.
14191
14192 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14193
14194         * expression.cs: reftype [!=]= null should always use br[true,false].
14195         # 67410
14196
14197 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14198
14199         Fix #67108
14200         * attribute.cs: Enum conversion moved to 
14201         GetAttributeArgumentExpression to be applied to the all
14202         expressions.
14203
14204 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14205
14206         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14207         * class.c (TypeContainer.DefineType): Flag error if
14208         base types aren't accessible due to access permissions.
14209         * decl.cs (DeclSpace.ResolveType): Move logic to
14210         Expression.ResolveAsTypeTerminal.
14211         (DeclSpace.ResolveTypeExpr): Thin layer over
14212         Expression.ResolveAsTypeTerminal.
14213         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14214         Refactor code into NestedAccess.  Use it.
14215         (DeclSpace.NestedAccess): New.
14216         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14217         argument to silence errors.  Check access permissions.
14218         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14219         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14220         (Cast.DoResolve): Likewise.
14221         (New.DoResolve): Likewise.
14222         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14223         (TypeOf.DoResolve): Likewise.
14224
14225         * expression.cs (Invocation.BetterConversion): Return the Type of
14226         the better conversion.  Implement section 14.4.2.3 more faithfully.
14227         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14228         section 14.4.2.2 explicit.
14229         (Invocation.OverloadResolve): Update.
14230         (Invocation): Remove is_base field.
14231         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14232         (Invocation.Emit): Likewise.
14233
14234 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14235
14236         * README: Update to changes.
14237
14238 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14239
14240         * cs-parser.jay: Reverted 642 warning fix.
14241
14242 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14243
14244         Fix bug #66615
14245         * decl.cs (FindMemberWithSameName): Indexer can have more than
14246         1 argument.
14247
14248 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14249
14250         * expression.cs (LocalVariableReference.DoResolveLValue):
14251         Do not report warning 219 for out values.
14252         (EmptyExpression.Null): New member to avoid extra allocations.
14253
14254 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14255
14256         * cs-parser.jay: Fix wrong warning 642 report.
14257
14258         * cs-tokenizer.cs (CheckNextToken): New helper;
14259         Inspect next character if is same as expected.
14260
14261 2004-09-23  Martin Baulig  <martin@ximian.com>
14262
14263         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14264         (Convert.ImplicitReferenceConversionExists): Likewise.
14265
14266 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14267
14268         * class.cs (Operator.Define): Add error 448 and 559 report.
14269
14270 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14271
14272         * class.cs (MemberBase.IsTypePermitted): New protected
14273         method for checking error CS0610.
14274
14275 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14276
14277         * class.cs (TypeContainer.HasExplicitLayout): New property
14278         Returns whether container has StructLayout attribute set Explicit.
14279         (FieldMember): New abstract class for consts and fields.
14280         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14281         (Field): Reuse FieldMember.
14282
14283         * const.cs (Const): Reuse FieldMember.
14284
14285         * rootcontext.cs: EmitConstants call moved to class.
14286
14287 2004-09-22  Martin Baulig  <martin@ximian.com>
14288
14289         Thanks to Peter Sestoft for this bug report.
14290
14291         * expression.cs (Conditional): If both the `trueExpr' and the
14292         `falseExpr' is a NullLiteral, return a NullLiteral.
14293
14294 2004-09-22  Martin Baulig  <martin@ximian.com>
14295
14296         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
14297         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
14298         for the "get_Current" call.
14299
14300 2004-09-22  Martin Baulig  <martin@ximian.com>
14301
14302         Marek and me just fixed one of our oldest bugs: #28562 :-)
14303
14304         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
14305
14306         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
14307         we're an EnumConstant, just return that.
14308         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
14309         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
14310         to get the value which'll actually be written into the attribute.
14311         However, we have to use GetValue() to access the attribute's value
14312         in the compiler.        
14313
14314 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14315
14316         * constant.cs (Constant.IsNegative): New abstract property
14317         IsNegative.
14318
14319         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
14320         (StackAlloc.DoResolve): Reused IsNegative.
14321
14322 2004-09-21  Martin Baulig  <martin@ximian.com>
14323
14324         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
14325         if we're used in an iterator, we may be called from different
14326         methods.
14327
14328         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
14329         we actually have an exception block.
14330
14331 2004-09-20  John Luke <jluke@cfl.rr.com>
14332
14333         * class.cs, cs-parser.jay: Improve the error report for 1520:
14334         report the actual line where the error happens, not where the
14335         class was declared.
14336
14337         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
14338         Pass location information that was available elsewhere.
14339
14340 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
14341
14342         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
14343         runtime to delay sign assemblies.
14344
14345 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * cs-parser.jay: Do not report the stack trace, this is barely
14348         used nowadays.
14349
14350 2004-08-22  John Luke  <john.luke@gmail.com>
14351  
14352         * driver.cs : check that a resource id is not already used
14353         before adding it, report CS1508 if it is, bug #63637
14354
14355 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
14356
14357         * ecore.cs: Removed dead code.
14358
14359 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
14360
14361         * class.cs: Do not report warning CS0067 on the interfaces.
14362
14363 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14364
14365         * cs-parser.jay: Add error 504 report.
14366
14367 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14368
14369         * rootcontext.cs: WarningLevel is 4 by default now.
14370
14371         * statement.cs (Fixed.Resolve): Do not null
14372         VariableInfo.
14373
14374 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
14375
14376         Fixed bug #55780
14377         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
14378         deep search when property is not virtual.
14379         (PropertyExpr.ResolveAccessors): Make one call for both
14380         accessors.
14381
14382 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14383
14384         Fixed bug #65766
14385         * statement.cs: Error 152 report constains also location.
14386
14387 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14388
14389         Fixed bug #65766
14390         * const.cs: Explicitly set constant as static.
14391
14392 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14393
14394         Fixed bug #64226
14395         * cs-parser.jay: Add error 1017 report.
14396
14397 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
14398
14399         Fixed bug #59980, #64224
14400         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
14401
14402         * typemanager.cs (IsSpecialMethod): Simplified
14403
14404 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14405
14406         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
14407         condition with better params.
14408
14409 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14410
14411         Fixed bug #65238
14412         * attribute.cs (Resolve): Property has to have both
14413         accessors.
14414
14415 2004-09-14  Martin Baulig  <martin@ximian.com>
14416
14417         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
14418
14419 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
14420
14421         Fixed bug #61902
14422         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
14423         called and is obsolete then this member suppress message
14424         when call is inside next [Obsolete] method or type.
14425
14426         * expression.cs: Use TestObsoleteMethodUsage member.
14427
14428 2004-09-14  Martin Baulig  <martin@ximian.com>
14429
14430         * cs-parser.jay: Sync a bit with the GMCS version.
14431
14432 2004-09-14  Martin Baulig  <martin@ximian.com>
14433
14434         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
14435         (CSharpParser.yacc_verbose_flag): New public field.
14436
14437         * genericparser.cs: Removed.
14438
14439 2004-09-14  Raja R Harinath  <rharinath@novell.com>
14440
14441         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
14442
14443 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
14444
14445         * class.cs (MethodCore.CheckBase): Fix bug #65757.
14446
14447 2004-09-10  Martin Baulig  <martin@ximian.com>
14448
14449         Backported my MemberName changes from GMCS into MCS.
14450
14451         - we are now using a special `MemberName' class instead of using
14452         strings; in GMCS, the `MemberName' also contains the type
14453         arguments.
14454
14455         - changed the grammar rules a bit:
14456           * the old `member_name' is now a `namespace_or_type_name':
14457             The rule is that we use `namespace_or_type_name' everywhere
14458             where we expect either a "member name" (GetEnumerator) or a
14459             "member name" with an explicit interface name
14460             (IEnumerable.GetEnumerator).
14461             In GMCS, the explicit interface name may include type arguments
14462             (IEnumerable<T>.GetEnumerator).
14463           * we use `member_name' instead of just `IDENTIFIER' for
14464             "member names":
14465             The rule is that we use `member_name' wherever a member may
14466             have type parameters in GMCS.       
14467
14468         * decl.cs (MemberName): New public class.
14469         (MemberCore.MemberName): New public readonly field.
14470         (MemberCore.ctor): Take a `MemberName' argument, not a string.
14471         (DeclSpace): Likewise.
14472
14473         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
14474         * enum.cs (Enum.ctor): Likewise.
14475
14476         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
14477         MemberName.     
14478         (AliasEntry.ctor): Take a MemberName, not an Expression.
14479         (AliasEntry.UsingAlias): Likewise.
14480
14481         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
14482         (IMethodData.MemberName): Changed type from string to MemberName.
14483         (MemberBase.ExplicitInterfaceName): Likewise.
14484         (AbstractPropertyEventMethod.SetupName): Make this private.
14485         (AbstractPropertyEventMethod.ctor): Added `string prefix'
14486         argument; compute the member name here.
14487         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
14488         on the `member.MemberName' and the `prefix'.
14489
14490         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
14491         not `type_name'.
14492         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
14493         thus, we get a `MemberName' instead of a `string'.  These
14494         declarations may have type parameters in GMCS.
14495         (interface_method_declaration, delegate_declaration): Likewise.
14496         (class_declaration, interface_declaration): Likewise.
14497         (method_header): Use `namespace_or_type_name' instead of
14498         `member_name'.  We may be an explicit interface implementation.
14499         (property_declaration, event_declaration): Likewise.
14500         (member_name): This is now just an `IDENTIFIER', not a
14501         `namespace_or_type_name'.
14502         (type_name, interface_type): Removed.
14503         (namespace_or_type_name): Return a MemberName, not an Expression.
14504         (primary_expression): Use `member_name' instead of `IDENTIFIER';
14505         call GetTypeExpression() on the MemberName to get an expression.
14506         (IndexerDeclaration.interface_type): Changed type from string to
14507         MemberName.
14508         (MakeName): Operate on MemberName's instead of string's.
14509
14510 2004-09-13  Raja R Harinath  <rharinath@novell.com>
14511
14512         Fix bug #55770.
14513         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
14514         (NamespaceEntry.Lookup): Add new argument to flag if we want the
14515         lookup to avoid symbols introduced by 'using'.
14516         * rootcontext.cs (NamespaceLookup): Update.
14517
14518 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14519
14520         * class.cs (TypeContainer.DoDefineMembers): Do not call
14521         DefineDefaultConstructor for static classes.
14522
14523 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
14524
14525         * attribute.cs (Attribute.Resolve): Add error 653 report.
14526
14527         * class.cs (Class.ApplyAttributeBuilder): Add error 641
14528         report.
14529         (Method.ApplyAttributeBuilder): Add error 685 report.
14530         (Operator.Define): Add error 564 report.
14531
14532         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
14533
14534         * expression.cs (Invocation.DoResolve): Add error
14535         245 and 250 report.
14536
14537         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
14538         error 674 report.
14539
14540 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14541
14542         * class.cs (ConstructorInitializer.Resolve):
14543         Wrong error number (515->516).
14544
14545 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14546
14547         * class.cs (Indexer.Define): Add error 631 report.
14548
14549 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14550
14551         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
14552
14553 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
14554
14555         * expression.cs (Probe.DoResolve): Add error CS0241 report.
14556
14557 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
14558
14559         * cs-parser.jay: Added error CS0241 report.
14560
14561 2004-09-10  Raja R Harinath  <rharinath@novell.com>
14562
14563         * cs-parser.jay (fixed_statement): Introduce a scope for the
14564         declaration in the 'fixed' statement.
14565
14566 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14567
14568         * cs-parser.jay: Added CS0230 error report.
14569
14570 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14571
14572         * cs-parser.jay: Added errors CS0231 and CS0257 report.
14573
14574 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14575
14576         * expression.cs (Argument.Resolve): Added error CS0192 and
14577         CS0199 report.
14578
14579 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
14580
14581         C# 2.0 #pragma warning feature
14582
14583         * cs-tokenizer.cs (PreProcessPragma): New method; 
14584         Handles #pragma directive.
14585
14586         * report.cs (WarningRegions): New class; Support
14587         class for #pragma warning directive. It tests whether
14588         warning is enabled for a given line.
14589
14590 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * const.cs: Add more descriptive error report, tahnks to
14593         Sebastien. 
14594
14595 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
14596
14597         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
14598
14599 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
14600
14601         * expression.cs: Apply patch from Ben: Remove dead code from
14602         ArrayCreation, and remove the TurnintoConstant call in const.cs,
14603         as that code just threw an exception anwyays.
14604
14605         * const.cs: Remove the call to the turnintoconstant, for details
14606         see bug: #63144
14607         
14608         * literal.cs: The type of the null-literal is the null type;  So
14609         we use a placeholder type (literal.cs:System.Null, defined here)
14610         for it.
14611
14612         * expression.cs (Conditional.DoResolve): Remove some old code that
14613         is no longer needed, conversions have been fixed.
14614
14615         (ArrayCreationExpression.DoResolve): Return false if we fail to
14616         resolve the inner expression.
14617
14618 2004-09-07  Raja R Harinath  <rharinath@novell.com>
14619
14620         Fix test-290.cs.
14621         * cs-parser.jay (delegate_declaration): Record a delegate
14622         declaration as a type declaration.
14623         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
14624
14625 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * parameter.cs: Do not crash if the type can not be resolved. 
14628
14629         * expression.cs: Report errors with unsafe pointers, fixes #64896
14630
14631 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14632
14633         * expression.cs: Pointer arith always needs to do a conv.i
14634         if the operand is a long. fix 65320
14635
14636 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14637
14638         Fixed cs0619-37.cs, cs0619-38.cs
14639
14640         * enum.cs (GetObsoleteAttribute): Removed.
14641
14642         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
14643         on Enum member is double staged. The first is tested member
14644         and then enum.
14645
14646 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
14647
14648         Fixed #56986, #63631, #65231
14649
14650         * class.cs: (TypeContainer.AddToMemberContainer): New method,
14651         adds member to name container.
14652         (TypeContainer.AddToTypeContainer): New method, adds type to
14653         name container.
14654         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
14655         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
14656         AddOperator): Simplified by reusing AddToMemberContainer.
14657         (TypeContainer.UserDefinedStaticConstructor): Changed to property
14658         instead of field.
14659         (Method.CheckForDuplications): Fixed implementation to test all
14660         possibilities.
14661         (MemberBase): Detection whether member is explicit interface
14662         implementation is now in constructor.
14663         (MemberBase.UpdateMemberName): Handles IndexerName.
14664         (Accessor): Changed to keep also location information.
14665         (AbstractPropertyEventMethod): Is derived from MemberCore.
14666         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
14667         will be emited or not.
14668         (PropertyBase.AreAccessorsDuplicateImplementation):
14669         Tests whether accessors are not in collision with some method.
14670         (Operator): Is derived from MethodCore to simplify common
14671         operations.
14672
14673         * decl.cs (Flags.TestMethodDuplication): Test for duplication
14674         must be performed.
14675         (DeclSpace.AddToContainer): Adds the member to defined_names
14676         table. It tests for duplications and enclosing name conflicts.
14677
14678         * enum.cs (EnumMember): Clean up to reuse the base structures
14679
14680 2004-09-03  Martin Baulig  <martin@ximian.com>
14681
14682         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
14683         into TypeContainer, to make partial classes work again.
14684
14685 2004-09-03  Martin Baulig  <martin@ximian.com>
14686
14687         * rootcontext.cs (RootContext.V2): Removed.
14688
14689 2004-03-23  Martin Baulig  <martin@ximian.com>
14690
14691         * expression.cs (Invocation.OverloadResolve): Added `bool
14692         may_fail' argument and use it instead of the Location.IsNull() hack.
14693
14694 2004-09-03  Martin Baulig  <martin@ximian.com>
14695
14696         Merged latest changes into gmcs.  Please keep this comment in
14697         here, it makes it easier for me to see what changed in MCS since
14698         the last time I merged.
14699
14700 2004-09-03  Raja R Harinath  <rharinath@novell.com>
14701
14702         Fix #61128.
14703         * expression.cs (BetterConversion): Don't allow either conversion 
14704         to be null.  Remove redundant implicit conversion test when 'q ==
14705         null' -- when this function is invoked, we already know that the
14706         implicit conversion exists.
14707         (BetterFunction): Assume that 'best' is non-null.  Remove
14708         redundant reimplementation of IsApplicable when 'best' is null.
14709         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
14710         number of arguments.
14711         (IsAncestralType): Extract from OverloadResolve.
14712         (OverloadResolve): Make robust to the MethodGroupExpr being
14713         unsorted.  Implement all the logic of Section 14.5.5.1, and
14714         support overloading of methods from multiple applicable types.
14715         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
14716
14717         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
14718         (RealError, Warning): Append type of report to related symbol.
14719
14720 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
14721
14722         * enum.cs: Fixed CLS-Compliance checks for enum members.
14723         Error tests cs3008-8.cs, cs3014-8.cs
14724
14725 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14726
14727         Fixed bug #62342, #63102
14728         * class.cs: ImplementIndexer uses member.IsExplicitImpl
14729         like ImplementMethod.
14730
14731 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
14732
14733         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14734         Fixed bug #65170.
14735
14736 2004-09-02  Martin Baulig  <martin@ximian.com>
14737
14738         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
14739         TypeManager.GetArgumentTypes() rather than calling GetParameters()
14740         on the MethodBase.
14741
14742 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
14743
14744         C# 2.0 Static classes implemented
14745
14746         * class.cs (TypeContainer): instance_constructors,
14747         initialized_fields, initialized_static_fields,
14748         default_constructor, base_inteface_types are protected to be
14749         accessible from StaticClass.
14750         (TypeContainer.DefineDefaultConstructor): New virtual method
14751         for custom default constructor generating
14752         (StaticClass): New class to handle "Static classes" feature.
14753
14754         * cs-parser.jay: Handle static keyword on class like instance
14755         of StaticClass.
14756
14757         * driver.cs: Added "/langversion" command line switch with two
14758         options (iso-1, default).
14759
14760 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
14761
14762         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
14763
14764 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
14765
14766         * delegate.cs: Style.
14767
14768 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14769
14770         * delegate.cs: Add seperate instance expr field for miguel.
14771
14772 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14773
14774         * PointerArithmetic (Resolve): make sure we are not doing
14775         pointer arith on void*. Also, make sure we are resolved
14776         by not setting eclass until resolve.
14777
14778         All callers: Make sure that PointerArithmetic gets resolved.
14779
14780 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14781
14782         * ArrayCreation (LookupType): If the type does not resolve 
14783         to an array, give an error.
14784
14785 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
14786
14787         * statement.cs (Try.Resolve): Fixed bug #64222
14788
14789 2004-08-27  Martin Baulig  <martin@ximian.com>
14790
14791         * class.cs
14792         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
14793         crash here.     
14794
14795 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14796
14797         * ecore.cs (Constantify): Get underlying type via
14798         System.Enum.GetUnderlyingType to avoid StackOverflow on the
14799         Windows in special cases.
14800
14801 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
14802
14803         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
14804         for obtaining also private methods.
14805         (GetRemoveMethod): Used GetRemoveMethod (true)
14806         for obtaining also private methods.
14807
14808 2004-08-24  Martin Baulig  <martin@ximian.com>
14809
14810         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
14811         MethodAttributes.HideBySig for operators.
14812
14813 2004-08-23  Martin Baulig  <martin@ximian.com>
14814
14815         Back to the old error reporting system :-)
14816
14817         * report.cs (Message): Removed.
14818         (Report.MessageData, ErrorData, WarningData): Removed.
14819         (Report.Error, Warning): Back to the old system.
14820
14821 2004-08-23  Martin Baulig  <martin@ximian.com>
14822
14823         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
14824
14825         * class.cs (TypeContainer.ParentContainer): New public virtual
14826         method; replaces the explicit interface implementation.
14827         (ClassPart.ParentContainer): Override.
14828
14829 2004-08-23  Martin Baulig  <martin@ximian.com>
14830
14831         * statement.cs (Switch): Added support for constant switches; see
14832         #59428 or test-285.cs.
14833
14834 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14835
14836         Fixed bug #62740.
14837         * statement.cs (GetEnumeratorFilter): Removed useless
14838         logic because C# specs is strict. GetEnumerator must be
14839         public.
14840
14841 2004-08-22  Martin Baulig  <martin@ximian.com>
14842
14843         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14844         a switch and may break, reset the barrier.  Fixes #59867.
14845
14846 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
14847
14848         CLS-Compliance speed up (~5% for corlib)
14849
14850         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
14851         New method. Tests container for CLS-Compliant names
14852
14853         * class.cs (TypeContainer.VerifyClsName): New method.
14854         Checks whether container name is CLS Compliant.
14855         (Constructor): Implements IMethodData.
14856
14857         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
14858         low-case table for CLS Compliance test.
14859         (MemberCache.VerifyClsParameterConflict): New method.
14860         Checks method parameters for CS3006 error.
14861
14862         * enum.cs (EnumMember): Is derived from MemberCore.
14863         (Enum.VerifyClsName): Optimized for better performance.
14864
14865 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14866
14867         * report.cs: Renamed Error_T to Error and changed all
14868         references.
14869
14870 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
14871
14872         * class.cs (TypeContainer.IndexerArrayList): New inner class
14873         container for indexers.
14874         (TypeContainer.DefaultIndexerName): New constant for default
14875         indexer name. Replaced all "Item" with this constant.
14876         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
14877
14878         * typemanager.cs (TypeManager.default_member_ctor): Cache here
14879         DefaultMemberAttribute constructor.
14880
14881 2004-08-05  Martin Baulig  <martin@ximian.com>
14882
14883         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14884         Fix bug #59429.
14885
14886 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
14887
14888         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
14889         multi platforms problem.
14890
14891         * compiler.csproj: Included shared files.
14892
14893 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14894
14895         Fix bug 60333, 55971 in the more general way
14896         * attribute.cs (Attribute.GetAttributeArgumentExpression):
14897         Added arg_type argument for constant conversion.
14898         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
14899
14900 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14901
14902         Fix bug #59760
14903         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
14904         OperatorArrayList, MethodCoreArrayList for typecontainer
14905         containers. Changed class member types to these new types.
14906         (MethodArrayList.DefineMembers): Added test for CS0659.
14907
14908 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * cfold.cs: Synchronize the folding with the code in expression.cs
14911         Binary.DoNumericPromotions for uint operands.
14912
14913         * attribute.cs: Revert patch from Raja, it introduced a regression
14914         while building Blam-1.2.1 (hard to isolate a test case).
14915
14916 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
14917
14918         Fix for #55382
14919         * class.cs:
14920         (TypeContainer.Define): Renamed to DefineContainerMembers because of
14921         name collision.
14922         (MethodCore.parent_method): New member. The method we're overriding
14923         if this is an override method.
14924         (MethodCore.CheckBase): Moved from Method class and made common.
14925         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
14926         private.
14927         (MethodCore.CheckForDuplications): New abstract method. For custom
14928         member duplication search in a container
14929         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
14930         method and its return type.
14931         (Event.conflict_symbol): New member. Symbol with same name in the
14932         parent class.
14933
14934         * decl.cs:
14935         (MemberCache.FindMemberWithSameName): New method. The method
14936         is looking for conflict with inherited symbols.
14937
14938 2004-08-04  Martin Baulig  <martin@ximian.com>
14939
14940         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
14941
14942         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
14943
14944 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14945
14946         * report.cs (Message): New enum for better error, warning reference in
14947         the code.
14948         (MessageData): New inner abstract class. It generally handles printing of
14949         error and warning messages.
14950         Removed unused Error, Warning, Message methods.
14951
14952 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14953
14954         Fix for cs0592-8.cs test
14955         * attribute.cs
14956         (Attributable.ValidAttributeTargets): Made public.
14957         (Attribute.ExplicitTarget): New member for explicit target value.
14958         (Attribute.CheckTargets): Now we translate explicit attribute
14959         target to Target here.
14960
14961 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
14962
14963         * ecore.cs (MethodGroupExpr): new IsBase property.
14964
14965         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
14966
14967         * delegate.cs (DelegateCreation): store a MethodGroupExpr
14968         rather than an instance expr.
14969
14970         (DelegateCreation.Emit): Use the method group rather than
14971         the instance expression. Also, if you have base.Foo as the
14972         method for a delegate, make sure to emit ldftn, not ldftnvirt.
14973
14974         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
14975
14976         (NewDelegate.DoResolve): Only check for the existance of Invoke
14977         if the method is going to be needed. Use MethodGroupExpr.
14978
14979         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
14980
14981         * expression.cs: For pointer arith., make sure to use
14982         the size of the type, not the size of the pointer to
14983         the type.
14984
14985 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
14986
14987         Fix for #60722
14988         * class.cs (Class): Added error CS0502 test.
14989
14990 2004-08-03  John Luke  <jluke@cfl.rr.com>
14991             Raja R Harinath  <rharinath@novell.com>
14992
14993         Fix for #60997.
14994         * attribute.cs (Attribute.complained_before): New flag.
14995         (Attribute.ResolveType, Attribute.Resolve),
14996         (Attribute.DefinePInvokeMethod): Set it.
14997         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
14998         
14999 2004-08-03  Martin Baulig  <martin@ximian.com>
15000
15001         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15002         use a user-defined operator; we still need to do numeric
15003         promotions in case one argument is a builtin type and the other
15004         one has an implicit conversion to that type.  Fixes #62322.
15005
15006 2004-08-02  Martin Baulig  <martin@ximian.com>
15007
15008         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15009         (LocalInfo.IsThis): New public property.
15010         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15011
15012 2004-08-01  Martin Baulig  <martin@ximian.com>
15013
15014         * class.cs (TypeContainer.GetClassBases): Don't set the default
15015         here since we may get called from GetPartialBases().
15016         (TypeContainer.DefineType): If GetClassBases() didn't return a
15017         parent, use the default one.
15018
15019 2004-07-30  Duncan Mak  <duncan@ximian.com>
15020
15021         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15022
15023 2004-07-30  Martin Baulig  <martin@ximian.com>
15024
15025         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15026
15027         * class.cs (SourceMethod): New public class, derive from the
15028         symbol writer's ISourceMethod.
15029         (Method): Use the new symbol writer API.
15030
15031         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15032         as argument and use the new symbol writer.
15033
15034         * location.cs
15035         (SourceFile): Implement the symbol writer's ISourceFile.
15036         (Location.SymbolDocument): Removed.
15037         (Location.SourceFile): New public property.
15038
15039         * symbolwriter.cs: Use the new symbol writer API.
15040
15041 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15042
15043         * Makefile (install-local): Remove.  Functionality moved to
15044         executable.make.
15045
15046 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15047
15048         * Makefile: Install mcs.exe.config file together with mcs.exe.
15049         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15050         correct runtime version.
15051         
15052 2004-07-25  Martin Baulig  <martin@ximian.com>
15053
15054         * class.cs
15055         (TypeContainer.RegisterOrder): Removed, this was unused.
15056         (TypeContainer, interface_order): Removed.
15057         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15058         TypeContainer as argument since we can also be called with a
15059         `PartialContainer' for a partial class/struct/interface.
15060         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15061         of checking whether we're an `Interface' - we could be a
15062         `PartialContainer'.
15063         (PartialContainer.Register): Override; call
15064         AddClass()/AddStruct()/AddInterface() on our parent.
15065
15066         * cs-parser.jay (interface_member_declaration): Add things to the
15067         `current_container', not the `current_class'.
15068
15069         * rootcontext.cs (RegisterOrder): The overloaded version which
15070         takes an `Interface' was unused, removed.
15071
15072         * typemanager.cs (TypeManager.LookupInterface): Return a
15073         `TypeContainer', not an `Interface'.
15074         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15075         contain a `PartialContainer' for an interface, so check it's
15076         `Kind' to figure out what it is.
15077
15078 2004-07-25  Martin Baulig  <martin@ximian.com>
15079
15080         * class.cs (Class.DefaultTypeAttributes): New public constant.
15081         (Struct.DefaultTypeAttributes): Likewise.
15082         (Interface.DefaultTypeAttributes): Likewise.
15083         (PartialContainer.TypeAttr): Override this and add the
15084         DefaultTypeAttributes.
15085
15086 2004-07-25  Martin Baulig  <martin@ximian.com>
15087
15088         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15089         we can just use the `Parent' field instead.
15090
15091 2004-07-25  Martin Baulig  <martin@ximian.com>
15092
15093         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15094
15095 2004-07-25  Martin Baulig  <martin@ximian.com>
15096
15097         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15098         our parts before defining any methods.
15099         (TypeContainer.VerifyImplements): Make this virtual.
15100         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15101         on our PartialContainer.
15102
15103 2004-07-25  Martin Baulig  <martin@ximian.com>
15104
15105         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15106
15107         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15108         argument, we can just use the `Parent' field instead.
15109
15110         * class.cs
15111         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15112         (MemberBase.DoDefine): Likewise.
15113
15114 2004-07-24  Martin Baulig  <martin@ximian.com>
15115
15116         * decl.cs (MemberCore.Parent): New public field.
15117         (DeclSpace.Parent): Moved to MemberCore.
15118
15119         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15120         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15121         parent's .ctor.
15122         (FieldBase, Field, Operator): Likewise.
15123         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15124         (EventField, Event): Likewise.
15125
15126 2004-07-23  Martin Baulig  <martin@ximian.com>
15127
15128         * class.cs (PartialContainer): New public class.
15129         (ClassPart): New public class.
15130         (TypeContainer): Added support for partial classes.
15131         (TypeContainer.GetClassBases): Splitted some of the functionality
15132         out into GetNormalBases() and GetPartialBases().
15133
15134         * cs-tokenizer.cs (Token.PARTIAL): New token.
15135         (Tokenizer.consume_identifier): Added some hacks to recognize
15136         `partial', but only if it's immediately followed by `class',
15137         `struct' or `interface'.
15138
15139         * cs-parser.jay: Added support for partial clases.
15140
15141 2004-07-23  Martin Baulig  <martin@ximian.com>
15142
15143         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15144         a `DeclSpace' and also made it readonly.
15145         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15146         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15147         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15148
15149         * cs-parser.jay: Pass the `current_class', not the
15150         `current_container' (at the moment, this is still the same thing)
15151         to a new Method, Property, Event, Indexer or Constructor.
15152
15153 2004-07-23  Martin Baulig  <martin@ximian.com>
15154
15155         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15156         and removed the `current_interface' one.
15157         (struct_declaration, class_declaration, interface_declaration):
15158         Set `current_class' to the newly created class/struct/interface;
15159         set their `Bases' and call Register() before parsing their body.
15160
15161 2004-07-23  Martin Baulig  <martin@ximian.com>
15162
15163         * class.cs (Kind): New public enum.
15164         (TypeContainer): Made this class abstract.
15165         (TypeContainer.Kind): New public readonly field.
15166         (TypeContainer.CheckDef): New public method; moved here from
15167         cs-parser.jay.
15168         (TypeContainer.Register): New public abstract method.
15169         (TypeContainer.GetPendingImplementations): New public abstract
15170         method.
15171         (TypeContainer.GetClassBases): Removed the `is_class' and
15172         `is_iface' parameters.
15173         (TypeContainer.DefineNestedTypes): Formerly known as
15174         DoDefineType().
15175         (ClassOrStruct): Made this class abstract.
15176
15177         * tree.cs (RootTypes): New public type. 
15178
15179 2004-07-20  Martin Baulig  <martin@ximian.com>
15180
15181         * tree.cs (Tree.RecordNamespace): Removed.
15182         (Tree.Namespaces): Removed.
15183
15184         * rootcontext.cs (RootContext.IsNamespace): Removed.
15185
15186         * cs-parser.jay (namespace_declaration): Just create a new
15187         NamespaceEntry here.
15188
15189 2004-07-20  Martin Baulig  <martin@ximian.com>
15190
15191         * statement.cs (ExceptionStatement): New abstract class.  This is
15192         now used as a base class for everyone who's using `finally'.
15193         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15194         our local variables before using them.
15195
15196         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15197         virtual method.  This is used by Yield.Resolve() to "steal" an
15198         outer block's `finally' clauses.
15199         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15200         argument.
15201
15202         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15203         version which takes an ExceptionStatement.  This version must be
15204         used to create exception branchings.
15205
15206         * iterator.cs
15207         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15208         (Iterator.EmitMoveNext): Added exception support; protect the
15209         block with a `fault' clause, properly handle 'finally' clauses.
15210         (Iterator.EmitDispose): Run all the `finally' clauses here.
15211
15212 2004-07-20  Martin Baulig  <martin@ximian.com>
15213
15214         * iterator.cs: This is the first of a set of changes in the
15215         iterator code.  Match the spec more closely: if we're an
15216         IEnumerable, then GetEnumerator() must be called.  The first time
15217         GetEnumerator() is called, it returns the current instance; all
15218         subsequent invocations (if any) must create a copy.
15219
15220 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15221
15222         * expression.cs: Resolve the constant expression before returning
15223         it. 
15224
15225 2004-07-19  Martin Baulig  <martin@ximian.com>
15226
15227         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15228         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15229         the return type of the new EmitContext.
15230
15231 2004-07-18  Martin Baulig  <martin@ximian.com>
15232
15233         * class.cs (Property.Define): Fix iterators.
15234
15235         * iterators.cs (Iterator.Define): Moved the
15236         `container.AddInterator (this)' call here from the .ctor; only do
15237         it if we resolved successfully.
15238
15239 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15242         `true' for preprocessing directives that we parse.  The return
15243         value indicates whether we should return to regular tokenizing or
15244         not, not whether it was parsed successfully.
15245
15246         In the past if we were in: #if false ... #line #endif, we would
15247         resume parsing after `#line'.  See bug 61604.
15248
15249         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15250         building: IsEnumType should return true only for enums, not for
15251         enums or System.Enum itself.  This fixes #61593.
15252
15253         Likely what happened is that corlib was wrong: mcs depended on
15254         this bug in some places.  The bug got fixed, we had to add the
15255         hack, which caused bug 61593.
15256
15257         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15258         that was a workaround for the older conditions.
15259
15260 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15261
15262         * assign.cs: IAssignMethod has a new interface, as documented
15263         inline. All assignment code now uses this new api.
15264
15265         * ecore.cs, expression.cs: All classes which implement
15266         IAssignMethod now use the new interface.
15267
15268         * expression.cs (Invocation): add a hack to EmitCall so that
15269         IndexerAccess can be the target of a compound assignment without
15270         evaluating its arguments twice.
15271
15272         * statement.cs: Handle changes in Invocation api.
15273
15274 2004-07-16  Martin Baulig  <martin@ximian.com>
15275
15276         * iterators.cs: Rewrote this.  We're now using one single Proxy
15277         class for both the IEnumerable and the IEnumerator interface and
15278         `Iterator' derives from Class so we can use the high-level API.
15279
15280         * class.cs (TypeContainer.AddIterator): New method.
15281         (TypeContainer.DoDefineType): New protected virtual method, which
15282         is called from DefineType().
15283         (TypeContainer.DoDefineMembers): Call DefineType() and
15284         DefineMembers() on all our iterators.
15285         (TypeContainer.Emit): Call Emit() on all our iterators.
15286         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15287
15288         * codegen.cs (EmitContext.CurrentIterator): New public field.
15289
15290 2004-07-15  Martin Baulig  <martin@ximian.com>
15291
15292         * typemanager.cs
15293         (TypeManager.not_supported_exception_type): New type.   
15294
15295 2004-07-14  Martin Baulig  <martin@ximian.com>
15296
15297         * iterators.cs: Use real error numbers.
15298
15299 2004-07-14  Martin Baulig  <martin@ximian.com>
15300
15301         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
15302         requires this to be a System.Collection.IEnumerable and not a
15303         class implementing that interface.
15304         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
15305
15306 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
15307
15308         * class.cs: Fixed previous fix, it broke some error tests.
15309
15310 2004-07-12  Martin Baulig  <martin@ximian.com>
15311
15312         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
15313         Fixes #61293.
15314
15315 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * assign.cs (LocalTemporary): Add new argument: is_address,If
15318         `is_address' is true, then the value that we store is the address
15319         to the real value, and not the value itself.
15320         
15321         * ecore.cs (PropertyExpr): use the new local temporary
15322         stuff to allow us to handle X.Y += z (where X is a struct)
15323
15324 2004-07-08  Martin Baulig  <martin@ximian.com>
15325
15326         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
15327         not always return, just like we're doing in Using.Resolve().
15328
15329 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
15330
15331         * cs-parser.jay (fixed_statement): flag this as Pinned.
15332
15333 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
15334
15335         * typemanager.cs (TypeManager): Removed MakePinned method, this
15336         mechanism is replaced with the .NET 2.x compatible mechanism of
15337         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
15338
15339         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
15340         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
15341         `IsFixed' property which has a different meaning.
15342
15343 2004-07-02  Raja R Harinath  <rharinath@novell.com>
15344
15345         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
15346         visible from inside a nested class, not just the names of the
15347         immediately enclosing class.
15348         Fix for bug #60730.
15349
15350 2004-06-24  Raja R Harinath  <rharinath@novell.com>
15351
15352         * expression.cs (BetterConversion): Remove buggy special-case
15353         handling of "implicit constant expression conversions".  At this
15354         point, we already know that the conversion is possible -- we're
15355         only checking to see which is better.
15356
15357 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15358
15359         * cs-parser.jay: Added error CS0210 test.
15360
15361 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15362
15363         * cs-parser.jay: Added error CS0134 test.
15364
15365 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15366
15367         Fix bug #52507
15368         * cs-parser.jay: Added error CS0145 test.
15369
15370 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
15371
15372         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
15373
15374 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
15375         
15376         * expression.cs (StackAlloc.Resolve): The argument may not
15377         be a constant; deal with this case.
15378         
15379 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
15380
15381         * attribute.cs (IndexerName_GetIndexerName): Renamed to
15382         GetIndexerAttributeValue.
15383         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
15384
15385         * class.cs (Indexer.Define): Added error tests for CS0415,
15386         CS0609.
15387
15388 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
15389
15390         * attribute.cs (Attribute.Resolve): Keep field code in sync with
15391         property code.
15392
15393 2004-06-23  Martin Baulig  <martin@ximian.com>
15394
15395         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
15396         neither return nor throw, reset the barrier as well.  Fixes #60457.
15397
15398 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
15399
15400         * class.cs : EventAttributes is now set to None by default.
15401           This fixes bug #60459.
15402
15403 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15404
15405         Fix bug #60219
15406         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15407         Don't throw exception but return null (it's sufficient now).
15408
15409 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
15410
15411         * typemanager.cs (GetArgumentTypes): Faster implementation.
15412
15413 2004-06-18  Martin Baulig  <martin@ximian.com>
15414
15415         * attribute.cs (Attribute.Resolve): Check whether we're an
15416         EmptyCast which a Constant child.  Fixes #60333.
15417
15418 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
15419
15420         * statement.cs (EmitCollectionForeach): Account for the fact that
15421         not all valuetypes are in areas which we can take the address of.
15422         For these variables, we store to a temporary variable. Also, make
15423         sure that we dont emit a `callvirt' on a valuetype method.
15424
15425 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15426
15427         * expression.cs (StackAlloc.DoReSolve): Added test for
15428         negative parameter (CS0247).
15429
15430 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15431
15432         Fix bug #59792
15433         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
15434
15435 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
15436
15437         Fix bug #59781
15438         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
15439         ulong.
15440
15441 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15442
15443         Fix bug #58254 & cs1555.cs, cs1556.cs
15444         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
15445
15446 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
15447
15448         * cs-parser.jay: Added error CS1669 test for indexers.
15449
15450 2004-06-11  Martin Baulig  <martin@ximian.com>
15451
15452         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
15453         call this twice: for params and varargs methods.
15454
15455 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15456
15457         * class.cs:
15458         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
15459
15460 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15461
15462         * attribute.cs (Attribute.GetValidTargets): Made public.
15463
15464         * class.cs: 
15465         (AbstractPropertyEventMethod): New class for better code sharing.
15466         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
15467         CS1667 report.
15468         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
15469
15470 2004-06-11  Raja R Harinath  <rharinath@novell.com>
15471
15472         Fix bug #59477.
15473         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
15474         that the call to Resolve is part of a MemberAccess.
15475         (Expression.Resolve): Use it for SimpleName resolution.
15476         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
15477         Add 'intermediate' boolean argument.
15478         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
15479         error message when the SimpleName can be resolved ambiguously
15480         between an expression and a type.
15481         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
15482         public.
15483         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
15484         call on the left-side.
15485
15486 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15487
15488         * class.cs:
15489         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
15490
15491 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15492
15493         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
15494
15495 2004-06-11  Martin Baulig  <martin@ximian.com>
15496
15497         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
15498         varargs methods if applicable.
15499
15500 2004-06-11  Martin Baulig  <martin@ximian.com>
15501
15502         * expression.cs (Invocation.EmitCall): Don't use
15503         `method.CallingConvention == CallingConventions.VarArgs' since the
15504         method could also have `CallingConventions.HasThis'.
15505
15506 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
15507
15508         * class.cs (Event.GetSignatureForError): Implemented.
15509         Fixed crash in error test cs3010.cs
15510
15511 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * cs-tokenizer.cs: Change the way we track __arglist to be
15514         consistent with the other keywords.
15515
15516 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
15519         tomorrow.
15520
15521 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
15522
15523         * codegen.cs: Check that all referenced assemblies have a strongname
15524         before strongnaming the compiled assembly. If not report error CS1577.
15525         Fix bug #56563. Patch by Jackson Harper.
15526         * typemanager.cs: Added a method to return all referenced assemblies.
15527         Fix bug #56563. Patch by Jackson Harper.
15528
15529 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15530
15531         * class.cs:
15532         (Method.ApplyAttributeBuilder): Moved and added conditional
15533         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
15534
15535         * delegate.cs:
15536         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
15537
15538 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
15539
15540         Fixed #59640
15541         * class.cs: (EventField.attribute_targets): Changed default target.
15542
15543 2004-06-08  Martin Baulig  <martin@ximian.com>
15544
15545         * expression.cs (Invocation.EmitCall): Enable varargs methods.
15546
15547 2004-06-08  Martin Baulig  <martin@ximian.com>
15548
15549         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
15550
15551 2004-06-07  Martin Baulig  <martin@ximian.com>
15552
15553         Added support for varargs methods.
15554
15555         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
15556         keyword.
15557
15558         * cs-parser.jay: Added support for `__arglist'.
15559
15560         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
15561
15562         * expression.cs (Argument.AType): Added `ArgList'.
15563         (Invocation): Added support for varargs methods.
15564         (ArglistAccess): New public class.
15565         (Arglist): New public class.
15566
15567         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
15568
15569         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
15570         a method's top-level block if the method has varargs.
15571
15572         * support.cs (ReflectionParameters, InternalParameters): Added
15573         support for varargs methods.    
15574
15575 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
15576
15577         * class.cs: Provide location in indexer error report.
15578
15579         * driver.cs: Use standard names.
15580
15581         * namespace.cs: Catch the use of using after a namespace has been
15582         declared also on using aliases.
15583
15584 2004-06-03  Raja R Harinath  <rharinath@novell.com>
15585
15586         Bug #50820.
15587         * typemanager.cs (closure_private_ok, closure_invocation_type)
15588         (closure_qualifier_type, closure_invocation_assembly)
15589         (FilterWithClosure): Move to ...
15590         (Closure): New internal nested class.
15591         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
15592         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
15593         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
15594         (MemberLookup, MemberLookupFailed): Use it.
15595         * expression.cs (New.DoResolve): Treat the lookup for the
15596         constructor as being qualified by the 'new'ed type.
15597         (Indexers.GetIndexersForTypeOrInterface): Update.
15598
15599 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
15600
15601         * attribute.cs
15602         (GetConditionalAttributeValue): New method. Returns
15603         condition of ConditionalAttribute.
15604         (SearchMulti): New method.  Returns all attributes of type 't'.
15605         Use it when attribute is AllowMultiple = true.
15606         (IsConditionalMethodExcluded): New method.
15607
15608         * class.cs
15609         (Method.IsExcluded): Implemented. Returns true if method has conditional
15610         attribute and the conditions is not defined (method is excluded).
15611         (IMethodData): Extended interface for ConditionalAttribute support.
15612         (PropertyMethod.IsExcluded): Implemented.
15613
15614         * decl.cs
15615         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
15616
15617         * expression.cs
15618         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
15619         on the method.
15620
15621 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15622
15623         * expression.cs (ArrayCreationExpression): Make this just an
15624         `expression'. It can't be a statement, so the code here was
15625         dead.
15626
15627 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15628
15629         Fixed #59072
15630         * typemanager.cs (GetFullNameSignature): New method for
15631         MethodBase types.
15632
15633 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
15634
15635         Fixed #56452
15636         * class.cs (MemberBase.GetSignatureForError): New virtual method.
15637         Use this method when MethodBuilder is null.
15638         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
15639         Added test for error CS0626 (MONO reports error for this situation).
15640         (IMethodData.GetSignatureForError): Extended interface.
15641
15642 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15643
15644         * attribute.cs
15645         (AttributeTester.GetObsoleteAttribute): Returns instance of
15646         ObsoleteAttribute when type is obsolete.
15647
15648         * class.cs
15649         (TypeContainer.VerifyObsoleteAttribute): Override.
15650         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
15651         (MethodCode.VerifyObsoleteAttribute): Override.
15652         (MemberBase.VerifyObsoleteAttribute): Override.
15653
15654         * decl.cs
15655         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
15656         and report proper error.
15657
15658         *delegate.cs
15659         Delegate.VerifyObsoleteAttribute): Override.
15660
15661         * ecore.cs
15662         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
15663         and report proper error.
15664         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
15665
15666         * enum.cs
15667         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
15668         and enum member.
15669
15670         * expression.cs
15671         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
15672         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
15673         Added test for ObsoleteAttribute.
15674
15675         * statement.cs
15676         (Catch): Derived from Statement.
15677
15678 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
15679  
15680         Fixed bug #59071 & cs0160.cs
15681  
15682         * statement.cs (Try.Resolve): Check here whether order of catch
15683         clauses matches their dependencies.
15684
15685 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
15688         caused a regression: #59343.  Referencing nested classes from an
15689         assembly stopped working.
15690
15691 2004-05-31  Martin Baulig  <martin@ximian.com>
15692
15693         MCS is now frozen for beta 2.
15694
15695 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15696
15697         * convert.cs: add a trivial cache for overload operator resolution.
15698
15699 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15700
15701         * decl.cs: If possible, use lookuptypedirect here. We can only do
15702         this if there is no `.' after the namespace. Avoids using
15703         LookupType, which does lots of slow processing.
15704         (FindNestedType) New method, does what it says :-).
15705         * namespace.cs: use LookupTypeDirect.
15706         * rootcontext.cs: use membercache, if possible.
15707         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
15708
15709 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15710
15711         * expression.cs:
15712         According to the spec, 
15713
15714         In a member access of the form E.I, if E is a single identifier,
15715         and if the meaning of E as a simple-name (§7.5.2) is a constant,
15716         field, property, localvariable, or parameter with the same type as
15717         the meaning of E as a type-name (§3.8), then both possible
15718         meanings of E are permitted.
15719
15720         We did not check that E as a simple-name had the same type as E as
15721         a type name.
15722
15723         This trivial check gives us 5-7% on bootstrap time.
15724
15725 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15726
15727         * expression.cs (Invocation.OverloadResolve): Avoid the
15728         use of hashtables and boxing here by allocating on demand.
15729
15730 2004-05-30  Martin Baulig  <martin@ximian.com>
15731
15732         * rootcontext.cs (RootContext.LookupType): Don't cache things if
15733         we're doing a silent lookup.  Don't try to lookup nested types in
15734         TypeManager.object_type (thanks to Ben Maurer).
15735
15736 2004-05-30  Martin Baulig  <martin@ximian.com>
15737
15738         Committing a patch from Ben Maurer.
15739
15740         * rootcontext.cs (RootContext.LookupType): Cache negative results.
15741
15742 2004-05-29  Martin Baulig  <martin@ximian.com>
15743
15744         * class.cs (IMethodData.ShouldIgnore): New method.
15745
15746         * typemanager.cs (TypeManager.MethodFlags): Don't take a
15747         `Location' argument, we don't need it anywhere.  Use
15748         `IMethodData.ShouldIgnore ()' instead of
15749         `MethodData.GetMethodFlags ()'.
15750         (TypeManager.AddMethod): Removed.
15751         (TypeManager.AddMethod2): Renamed to AddMethod.
15752
15753 2004-05-29  Martin Baulig  <martin@ximian.com>
15754
15755         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
15756
15757         * convert.cs (Convert.ImplicitReferenceConversion): If we're
15758         converting from a class type S to an interface type and we already
15759         have an object on the stack, don't box it again.  Fixes #52578.
15760
15761 2004-05-29  Martin Baulig  <martin@ximian.com>
15762
15763         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
15764         Added support for `params' parameters.  Fixes #59267.
15765
15766 2004-05-29  Martin Baulig  <martin@ximian.com>
15767
15768         * literal.cs (NullPointer): Provide a private .ctor which sets
15769         `type' to TypeManager.object_type.  Fixes #59048.
15770
15771 2004-05-29  Martin Baulig  <martin@ximian.com>
15772
15773         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
15774         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
15775
15776         * ecore.cs (EventExpr.instance_expr): Make the field private.
15777
15778 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
15779
15780         Fixed bug #50080 & cs0214-2.cs
15781         * expression.cs (Cast.DoResolve): Check unsafe context here.
15782         
15783         * statement.cs (Resolve.DoResolve): Likewise.
15784
15785 2004-05-26  Martin Baulig  <martin@ximian.com>
15786
15787         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
15788
15789         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
15790         (RootContext.LookupType): Pass down the `silent' flag.
15791
15792 2004-05-25  Martin Baulig  <martin@ximian.com>
15793
15794         * expression.cs
15795         (MethodGroupExpr.IdenticalTypeName): New public property.
15796         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
15797         expression actually refers to a type.
15798
15799 2004-05-25  Martin Baulig  <martin@ximian.com>
15800
15801         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
15802         for #56176 and made it actually work.
15803
15804 2004-05-25  Martin Baulig  <martin@ximian.com>
15805
15806         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
15807         (FieldExpr, PropertyExpr): Override and implement
15808         CacheTemporaries.  Fixes #52279.
15809
15810 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
15811
15812         * location.cs: In the new compiler listing a file twice is a
15813         warning, not an error.
15814
15815 2004-05-24  Martin Baulig  <martin@ximian.com>
15816
15817         * enum.cs (Enum.DefineType): For the `BaseType' to be a
15818         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
15819
15820 2004-05-24  Martin Baulig  <martin@ximian.com>
15821
15822         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
15823         walking the `using' list.  Fixes #53921.
15824
15825 2004-05-24  Martin Baulig  <martin@ximian.com>
15826
15827         * const.cs (Const.LookupConstantValue): Added support for
15828         EmptyCast's; fixes #55251.
15829
15830 2004-05-24  Martin Baulig  <martin@ximian.com>
15831
15832         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
15833         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
15834         which does the CS0135 check.  The reason is that we first need to
15835         check whether the variable actually exists.
15836
15837 2004-05-24  Martin Baulig  <martin@ximian.com>
15838
15839         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
15840         than RootContext.LookupType() to find the explicit interface
15841         type.  Fixes #58584.
15842
15843 2004-05-24  Raja R Harinath  <rharinath@novell.com>
15844
15845         * Makefile: Simplify.  Use executable.make.
15846         * mcs.exe.sources: New file.  List of sources of mcs.exe.
15847
15848 2004-05-24  Anders Carlsson  <andersca@gnome.org>
15849
15850         * decl.cs:
15851         * enum.cs:
15852         Use the invariant culture when doing String.Compare for CLS case
15853         sensitivity.
15854         
15855 2004-05-23  Martin Baulig  <martin@ximian.com>
15856
15857         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
15858         don't have any dots.  Fixes #52622, added cs0246-8.cs.
15859
15860         * namespace.cs (NamespaceEntry.Lookup): Likewise.
15861         
15862 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15863
15864         * class.cs (MemberBase.Define): Reuse MemberType member for 
15865         resolved type. Other methods can use it too.
15866
15867 2004-05-23  Martin Baulig  <martin@ximian.com>
15868
15869         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
15870         the variable also exists in the current block (otherwise, we need
15871         to report a CS0103).  Fixes #58670.
15872
15873 2004-05-23  Martin Baulig  <martin@ximian.com>
15874
15875         * flowanalysis.cs (Reachability.Reachable): Compute this
15876         on-the-fly rather than storing it as a field.
15877
15878 2004-05-23  Martin Baulig  <martin@ximian.com>
15879
15880         * flowanalysis.cs (Reachability.And): Manually compute the
15881         resulting `barrier' from the reachability.      
15882        
15883 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
15884
15885         Fix bug #57835
15886         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
15887         instance of ObsoleteAttribute when symbol is obsolete.
15888
15889         * class.cs
15890         (IMethodData): Extended interface for ObsoleteAttribute support.
15891
15892 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15893
15894         * attribute.cs: Fix bug #55970
15895
15896 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
15897
15898         Fix bug #52705
15899         * attribute.cs
15900         (GetObsoleteAttribute): New method. Creates the instance of
15901         ObsoleteAttribute.
15902         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
15903         ObsoleteAttribute when member is obsolete.
15904         (AttributeTester.Report_ObsoleteMessage): Common method for
15905         Obsolete error/warning reporting.
15906
15907         * class.cs
15908         (TypeContainer.base_classs_type): New member for storing parent type.
15909
15910         * decl.cs
15911         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
15912         for this MemberCore.
15913
15914 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15915
15916         * attribute.cs, const.cs: Fix bug #58590
15917
15918 2004-05-21  Martin Baulig  <martin@ximian.com>
15919
15920         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
15921         out parameters if the end of the method is unreachable.  Fixes
15922         #58098. 
15923
15924 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15925
15926         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
15927         Hari was right, why extra method.
15928
15929 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
15930
15931         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
15932
15933 2004-05-20  Martin Baulig  <martin@ximian.com>
15934
15935         Merged this back from gmcs to keep the differences to a minumum.
15936
15937         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
15938         instead of a Declspace.
15939         (Attribute.ResolveType): Likewise.
15940         (Attributes.Search): Likewise.
15941         (Attributes.Contains): Likewise.
15942         (Attributes.GetClsCompliantAttribute): Likewise.
15943
15944         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
15945         argument.
15946         (MethodData.ApplyAttributes): Take an EmitContext instead of a
15947         DeclSpace.
15948
15949 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
15950
15951         Fix bug #58688 (MCS does not report error when the same attribute
15952         is assigned twice)
15953
15954         * attribute.cs (Attribute.Emit): Distinction between null and default.
15955
15956 2004-05-19  Raja R Harinath  <rharinath@novell.com>
15957
15958         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
15959         of a top-level attribute without an attribute target.
15960         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
15961         Make non-static.
15962         (Attribute.Conditional_GetConditionName), 
15963         (Attribute.Obsolete_GetObsoleteMessage): Update.
15964         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
15965         part of ScanForIndexerName.
15966         (Attribute.CanIgnoreInvalidAttribute): New function.
15967         (Attribute.ScanForIndexerName): Move to ...
15968         (Attributes.ScanForIndexerName): ... here.
15969         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
15970         (Attributes.Search): New internal variant that can choose not to
15971         complain if types aren't resolved.  The original signature now
15972         complains.
15973         (Attributes.GetClsCompliantAttribute): Use internal variant, with
15974         complaints suppressed.
15975         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
15976         only if it not useful.
15977         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
15978         top-level for attributes that are shared between the assembly
15979         and a top-level class.
15980         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
15981         * class.cs: Update to reflect changes.
15982         (DefineIndexers): Fuse loops.
15983         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
15984         a couple more variants of attribute names.
15985
15986 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
15987
15988         Fix bug #52585 (Implemented explicit attribute declaration)
15989
15990         * attribute.cs:
15991         (Attributable.ValidAttributeTargets): New abstract method. It gets
15992         list of valid attribute targets for explicit target declaration.
15993         (Attribute.Target): It holds target itself.
15994         (AttributeSection): Removed.
15995         (Attribute.CheckTargets): New method. It checks whether attribute
15996         target is valid for the current element.
15997
15998         * class.cs:
15999         (EventProperty): New class. For events that are declared like
16000         property (with add and remove accessors).
16001         (EventField): New class. For events that are declared like field.
16002         class.cs
16003
16004         * cs-parser.jay: Implemented explicit attribute target declaration.
16005
16006         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16007         Override ValidAttributeTargets.
16008
16009         * parameter.cs:
16010         (ReturnParameter): Class for applying custom attributes on 
16011         the return type.
16012         (ParameterAtribute): New class. Class for applying custom
16013         attributes on the parameter type.
16014
16015 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16018         definitions. 
16019
16020         (Method): Allow UNSAFE here.
16021
16022         * modifiers.cs: Support unsafe reporting.
16023
16024 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16025
16026         * decl.cs: Fix bug #58478.
16027
16028 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16029
16030         * statement.cs: When checking for unreachable code on an EmptyStatement,
16031         set the location. Fixes bug #58488.
16032
16033 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16034
16035         * driver.cs: Add -pkg handling.
16036
16037         From Gonzalo: UseShelLExecute=false
16038
16039 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16040
16041         * attribute.cs:
16042         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16043         for attribute.
16044         (Attribute.IsClsCompliaceRequired): Moved to base for better
16045         accesibility.
16046         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16047         when attribute is AttributeUsageAttribute.
16048         (Attribute.GetValidTargets): Simplified.
16049         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16050         attribute for this type.
16051         (Attribute.ApplyAttributes): Method renamed to Emit and make
16052         non-static.
16053         (GlobalAttributeSection): New class for special handling of global
16054         attributes (assembly, module).
16055         (AttributeSection.Emit): New method.
16056
16057         * class.cs: Implemented Attributable abstract methods.
16058         (MethodCore.LabelParameters): Moved to Parameter class.
16059         (Accessor): Is back simple class.
16060         (PropertyMethod): Implemented Attributable abstract class.
16061         (DelegateMethod): Implemented Attributable abstract class.
16062         (Event): New constructor for disctintion between normal Event
16063         and Event with accessors.
16064
16065         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16066
16067         * codegen.cs, const.cs, decl.cs, delegate.cs:
16068         (CommonAssemblyModulClass): Implemented Attributable abstract class
16069         and simplified.
16070
16071         * enum.cs: Implement IAttributeSupport interface.
16072         (EnumMember): New class for emum members. Implemented Attributable
16073         abstract class
16074
16075         * parameter.cs:
16076         (ParameterBase): Is abstract.
16077         (ReturnParameter): New class for easier [return:] attribute handling.
16078
16079         * typemanager.cs: Removed builder_to_attr.
16080
16081 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16082
16083         Fix bug #57151.
16084         * attribute.cs (Attribute.GetPositionalValue): New function.
16085         * class.cs (TypeContainer.VerifyMembers): New function.
16086         (TypeContainer.Emit): Use it.
16087         (ClassOrStruct): New base class for Class and Struct.
16088         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16089         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16090         class.
16091         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16092         then each non-static field should have a FieldOffset attribute.
16093         Otherwise, none of the fields should have a FieldOffset attribute.
16094         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16095         and FieldOffset attributes.
16096         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16097         (TypeManager.field_offset_attribute_type): New core types.
16098         (TypeManager.InitCoreTypes): Initialize them.
16099
16100 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16101
16102         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16103         Return correct type.
16104         From bug #58270.
16105
16106 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16107
16108         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16109         be implicitly converted to ulong.
16110         
16111         * expression.cs: The logic for allowing operator &, | and ^ worked
16112         was wrong, it worked before because we did not report an error in
16113         an else branch.  Fixes 57895.
16114
16115         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16116         allow volatile fields to be reference types.
16117
16118 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16119
16120         * driver.cs: Add support for /debug-
16121
16122 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16123
16124         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16125         Add a 'complain' parameter to silence errors.
16126         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16127         silently overlooked type-resolutions.
16128         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16129         to reflect changes.
16130         (Attributes.Search): New function.
16131         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16132         (Attributes.GetAttributeFullName): Remove hack.
16133         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16134         Update to reflect changes.
16135         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16136         Use Attributes.Search instead of nested loops.
16137
16138 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16139
16140         * decl.cs:
16141         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16142         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16143         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16144
16145         * report.cs: (Report.Warning): Renamed to Warning_T because of
16146         parameter collision.
16147
16148 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16149
16150         * expression.cs (MemberAccess.ResolveMemberAccess):
16151         Exit with non-zero status after Report.Error.
16152         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16153         Likewise.
16154         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16155
16156 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16157
16158         * support.cs: Don't hang when the file is empty.
16159
16160 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16161
16162         * support.cs: In SeekableStreamReader, compute the preamble size of the
16163           underlying stream. Position changes should take into account that initial
16164           count of bytes.
16165
16166 2004-05-03  Todd Berman  <tberman@sevenl.net>
16167
16168         * driver.cs: remove unused GetSysVersion function.
16169
16170 2004-05-03  Todd Berman  <tberman@sevenl.net>
16171
16172         * driver.cs: Remove the hack from saturday, as well as the hack
16173         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16174         link_paths to get that bit proper.
16175
16176 2004-05-01  Todd Berman  <tberman@sevenl.net>
16177
16178         * driver.cs: Try a LoadFrom before a Load, this checks the current
16179         path. This is currently a bug in mono that is be fixed, however, this
16180         provides a workaround for now. This will be removed when the bug
16181         is fixed.
16182
16183 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16184
16185         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16186         incomplete key pairs (#57941).
16187
16188 2004-05-01  Todd Berman  <tberman@sevenl.net>
16189
16190         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16191         from the GAC
16192
16193 2004-04-30  Jackson Harper  <jackson@ximian.com>
16194
16195         * codegen.cs: Open keys readonly.
16196         
16197 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16198
16199         * typemanager.cs: don't report cyclic struct layout when a struct
16200         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16201         which has 2 Pango.Rectangle fields.
16202
16203 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16204
16205         * expression.cs: Handle IntPtr comparisons with IL code
16206         rather than a method call.
16207
16208 2004-04-29  Martin Baulig  <martin@ximian.com>
16209
16210         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16211         the list of PropertyInfo's in class hierarchy and find the
16212         accessor.  Fixes #56013.
16213
16214 2004-04-29  Martin Baulig  <martin@ximian.com>
16215
16216         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16217
16218 2004-04-29  Martin Baulig  <martin@ximian.com>
16219
16220         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16221
16222         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16223
16224 2004-04-29  Martin Baulig  <martin@ximian.com>
16225
16226         * class.cs (ConstructorInitializer.Resolve): Check whether the
16227         parent .ctor is accessible.  Fixes #52146.
16228
16229 2004-04-29  Martin Baulig  <martin@ximian.com>
16230
16231         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16232
16233         * statement.cs (Using.EmitLocalVariableDecls): Use
16234         TypeManager.idisposable_type, not typeof (IDisposable).
16235         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16236
16237 2004-04-29  Martin Baulig  <martin@ximian.com>
16238
16239         * class.cs (Event.Define): Don't emit the field and don't set
16240         RTSpecialName and SpecialName for events on interfaces.  Fixes
16241         #57703. 
16242
16243 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16244
16245         Refactor Attribute.ApplyAttributes.
16246         * attribute.cs (Attributable): New base class for objects that can
16247         have Attributes applied on them.
16248         (Attribute): Make AttributeUsage fields public.
16249         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16250         (Attribute.IsInternalCall): New property.
16251         (Attribute.UsageAttr): Convert to a public read-only property.
16252         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16253         (Attribute.ResolveType, Attribute.Resolve)
16254         (Attribute.ScanForIndexerName): Update to reflect changes.
16255         (Attribute.CheckAttributeTarget): Re-format.
16256         (Attribute.ApplyAttributes): Refactor, to various
16257         Attributable.ApplyAttributeBuilder methods.
16258         * decl.cs (MemberCore): Make Attributable.
16259         * class.cs (Accessor): Make Attributable.
16260         (MethodData.ApplyAttributes): Use proper attribute types, not
16261         attribute names.
16262         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16263         (TypeContainer.ApplyAttributeBuilder)
16264         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16265         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16266         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16267         (Operator.ApplyAttributeBuilder): New factored-out methods.
16268         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16269         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16270         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16271         * parameter.cs (ParameterBase): New Attributable base class
16272         that can also represent Return types.
16273         (Parameter): Update to the changes.
16274
16275 2004-04-29  Jackson Harper  <jackson@ximian.com>
16276
16277         * driver.cs: Prefer the corlib system version when looking for
16278         assemblies in the GAC. This is still a hack, but its a better hack
16279         now.
16280         
16281 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16282
16283         * decl.cs, enum.cs: Improved error 3005 reporting.
16284   
16285         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16286         (related_symbols): New private member for list of symbols
16287         related to reported error/warning.
16288         
16289         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16290
16291 2004-04-29  Martin Baulig  <martin@ximian.com>
16292
16293         * ecore.cs (Expression.Constantify): If we're an enum and
16294         TypeManager.TypeToCoreType() doesn't give us another type, use
16295         t.UnderlyingSystemType.  Fixes #56178.  
16296
16297 2004-04-29  Martin Baulig  <martin@ximian.com>
16298
16299         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
16300         interfaces and for each interface, only add members directly
16301         declared in that interface.  Fixes #53255.
16302
16303 2004-04-28  Martin Baulig  <martin@ximian.com>
16304
16305         * expression.cs (ConditionalLogicalOperator): Use a temporary
16306         variable for `left' to avoid that we evaluate it more than once;
16307         bug #52588.
16308
16309 2004-04-28  Martin Baulig  <martin@ximian.com>
16310
16311         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
16312         `void[]' (CS1547).
16313
16314 2004-04-28  Martin Baulig  <martin@ximian.com>
16315
16316         * statement.cs (LocalInfo.Resolve): Check whether the type is not
16317         void (CS1547).
16318
16319         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
16320         whether the type is not void (CS1547).
16321
16322 2004-04-28  Martin Baulig  <martin@ximian.com>
16323
16324         * expression.cs (Unary.DoResolveLValue): Override this and report
16325         CS0131 for anything but Operator.Indirection.
16326
16327 2004-04-28  Martin Baulig  <martin@ximian.com>
16328
16329         Committing a patch from Ben Maurer; see bug #50820.
16330
16331         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16332         check for classes.
16333
16334         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16335         classes.        
16336
16337 2004-04-28  Martin Baulig  <martin@ximian.com>
16338
16339         Committing a patch from Ben Maurer; see bug #50820.
16340
16341         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
16342         check for classes.
16343
16344         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
16345         classes.        
16346
16347 2004-04-28  Martin Baulig  <martin@ximian.com>
16348
16349         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
16350         (Block.AddLabel): Call DoLookupLabel() to only search in the
16351         current block.
16352
16353 2004-04-28  Martin Baulig  <martin@ximian.com>
16354
16355         * cfold.cs (ConstantFold.BinaryFold): Added special support for
16356         comparing StringConstants and NullLiterals in Equality and Inequality.
16357
16358 2004-04-28  Jackson Harper  <jackson@ximian.com>
16359
16360         * driver.cs: Attempt to load referenced assemblies from the
16361         GAC. This is the quick and dirty version of this method that
16362         doesnt take into account versions and just takes the first
16363         canidate found. Will be good enough for now as we will not have more
16364         then one version installed into the GAC until I update this method.
16365
16366 2004-04-28  Martin Baulig  <martin@ximian.com>
16367
16368         * typemanager.cs (TypeManager.CheckStructCycles): New public
16369         static method to check for cycles in the struct layout.
16370
16371         * rootcontext.cs (RootContext.PopulateTypes): Call
16372         TypeManager.CheckStructCycles() for each TypeContainer.
16373         [Note: We only need to visit each type once.]
16374
16375 2004-04-28  Martin Baulig  <martin@ximian.com>
16376
16377         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
16378
16379         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
16380         success and added `out object value'.  Use a `bool resolved' field
16381         to check whether we've already been called rather than
16382         `ConstantValue != null' since this breaks for NullLiterals.
16383
16384 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16385
16386         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
16387         setting of this flag, since the 'set' method may be non-public.
16388
16389 2004-04-28  Raja R Harinath  <rharinath@novell.com>
16390
16391         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
16392         check on current_vector.Block.
16393
16394 2004-04-27  Martin Baulig  <martin@ximian.com>
16395
16396         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
16397         a field initializer.  Fixes #56459.
16398
16399 2004-04-27  Martin Baulig  <martin@ximian.com>
16400
16401         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
16402         we're not attempting to use an indexer.  Fixes #52154.
16403
16404 2004-04-27  Martin Baulig  <martin@ximian.com>
16405
16406         * statement.cs (Return): Don't create a return label if we don't
16407         need it; reverts my change from January 20th.  Thanks to Ben
16408         Maurer for this.
16409
16410 2004-04-27  Martin Baulig  <martin@ximian.com>
16411
16412         According to the spec, `goto' can only leave a nested scope, but
16413         never enter it.
16414
16415         * statement.cs (Block.LookupLabel): Only lookup in the current
16416         block, don't recurse into parent or child blocks.
16417         (Block.AddLabel): Check in parent and child blocks, report
16418         CS0140/CS0158 if we find a duplicate.
16419         (Block): Removed this indexer for label lookups.
16420         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
16421         this already does the error reporting for us.
16422
16423         * flowanalysis.cs
16424         (FlowBranching.UsageVector.Block): New public variable; may be null.
16425         (FlowBranching.CreateSibling): Added `Block' argument.
16426         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
16427         label for the target of a `goto' and check whether we're not
16428         leaving a `finally'.
16429
16430 2004-04-27  Martin Baulig  <martin@ximian.com>
16431
16432         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16433         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
16434         just for returns).
16435
16436 2004-04-27  Martin Baulig  <martin@ximian.com>
16437
16438         * statement.cs (Block.AddLabel): Also check for implicit blocks
16439         and added a CS0158 check.
16440
16441 2004-04-27  Martin Baulig  <martin@ximian.com>
16442
16443         * flowanalysis.cs (FlowBranchingLoop): New class.
16444         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
16445         UsageVector's instead of an ArrayList.
16446         (FlowBranching.Label): Likewise.
16447         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
16448         (FlowBranching.AddBreakVector): New method.
16449
16450 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * attribute.cs: Small regression fix: only convert the type if we
16453         the type is different, fixes System.Drawing build.
16454
16455 2004-04-27  Martin Baulig  <martin@ximian.com>
16456
16457         * attribute.cs (Attribute.Resolve): If we have a constant value
16458         for a named field or property, implicity convert it to the correct
16459         type.
16460
16461 2004-04-27  Raja R Harinath  <rharinath@novell.com>
16462
16463         * statement.cs (Block.Block): Implicit blocks share
16464         'child_variable_names' fields with parent blocks.
16465         (Block.AddChildVariableNames): Remove.
16466         (Block.AddVariable): Mark variable as "used by a child block" in
16467         every surrounding block.
16468         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
16469         been used in a child block, complain about violation of "Invariant
16470         meaning in blocks" rule.
16471         * cs-parser.jay (declare_local_variables): Don't use
16472         AddChildVariableNames.
16473         (foreach_statement): Don't create an implicit block: 'foreach'
16474         introduces a scope.
16475
16476 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
16477
16478         * convert.cs (ImplicitNumericConversion): 0 is also positive when
16479         converting from 0L to ulong.  Fixes 57522.
16480
16481 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16482
16483         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
16484         derived class hides via 'new' keyword field from base class (test-242.cs).
16485         TODO: Handle this in the more general way.
16486         
16487         * class.cs (CheckBase): Ditto.
16488
16489 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
16490
16491         * decl.cs (caching_flags): New member for storing cached values
16492         as bit flags.
16493         (MemberCore.Flags): New enum where bit flags for caching_flags
16494         are defined.
16495         (MemberCore.cls_compliance): Moved to caching_flags.
16496         (DeclSpace.Created): Moved to caching_flags.
16497
16498         * class.cs: Use caching_flags instead of DeclSpace.Created
16499         
16500 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
16501
16502         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
16503         if we are only a derived class, not a nested class.
16504
16505         * typemanager.cs: Same as above, but do this at the MemberLookup
16506         level (used by field and methods, properties are handled in
16507         PropertyExpr).   Allow for the qualified access if we are a nested
16508         method. 
16509
16510 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
16511
16512         * class.cs: Refactoring.
16513         (IMethodData): New inteface; Holds links to parent members
16514         to avoid member duplication (reduced memory allocation).
16515         (Method): Implemented IMethodData interface.
16516         (PropertyBase): New inner classes for get/set methods.
16517         (PropertyBase.PropertyMethod): Implemented IMethodData interface
16518         (Event): New inner classes for add/remove methods.
16519         (Event.DelegateMethod): Implemented IMethodData interface.
16520
16521         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
16522         EmitContext (related to class.cs refactoring).
16523
16524 2004-04-21  Raja R Harinath  <rharinath@novell.com>
16525
16526         * delegate.cs (Delegate.VerifyApplicability): If the number of
16527         arguments are the same as the number of parameters, first try to
16528         verify applicability ignoring  any 'params' modifier on the last
16529         parameter.
16530         Fixes #56442.
16531
16532 2004-04-16  Raja R Harinath  <rharinath@novell.com>
16533
16534         * class.cs (TypeContainer.AddIndexer): Use
16535         'ExplicitInterfaceName' to determine if interface name was
16536         explicitly specified.  'InterfaceType' is not initialized at this time.
16537         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
16538         Indexers array is already in the required order.  Initialize
16539         'IndexerName' only if there are normal indexers.
16540         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
16541         (TypeContainer.Emit): Emit DefaultMember attribute only if
16542         IndexerName is initialized.
16543         Fixes #56300.
16544
16545 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
16546
16547         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
16548         Fixes #57007
16549
16550 2004-04-15  Raja R Harinath  <rharinath@novell.com>
16551
16552         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
16553         attributes.
16554         Fix for #56456.
16555
16556         * attribute.cs (Attribute.Resolve): Check for duplicate named
16557         attributes.
16558         Fix for #56463.
16559
16560 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
16561
16562         * iterators.cs (MarkYield): track whether we are in an exception,
16563         and generate code accordingly.  Use a temporary value to store the
16564         result for our state.
16565
16566         I had ignored a bit the interaction of try/catch with iterators
16567         since their behavior was not entirely obvious, but now it is
16568         possible to verify that our behavior is the same as MS .NET 2.0
16569
16570         Fixes 54814
16571
16572 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
16573
16574         * iterators.cs: Avoid creating temporaries if there is no work to
16575         do. 
16576
16577         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
16578         Enumerations, use TypeManager.EnumToUnderlying and call
16579         recursively. 
16580
16581         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
16582         bug #57013
16583
16584         (This.Emit): Use EmitContext.EmitThis to emit our
16585         instance variable.
16586
16587         (This.EmitAssign): Ditto.
16588
16589         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
16590         codepaths, we will move all the functionality into
16591         Mono.CSharp.This 
16592
16593         (FieldExpr.EmitAssign): Ditto.
16594
16595         This fixes several hidden bugs that I uncovered while doing a code
16596         review of this today.
16597
16598         * codegen.cs (EmitThis): reworked so the semantics are more clear
16599         and also support value types "this" instances.
16600
16601         * iterators.cs: Changed so that for iterators in value types, we
16602         do not pass the value type as a parameter.  
16603
16604         Initialization of the enumerator helpers is now done in the caller
16605         instead of passing the parameters to the constructors and having
16606         the constructor set the fields.
16607
16608         The fields have now `assembly' visibility instead of private.
16609
16610 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * expression.cs (Argument.Resolve): Check if fields passed as ref
16613         or out are contained in a MarshalByRefObject.
16614
16615         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
16616         another compiler type.
16617
16618 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16619
16620         * class.cs (Indexer.Define): use the new name checking method.
16621         Also, return false on an error.
16622         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
16623         (is_identifier_[start/part]_character): make static.
16624
16625 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * expression.cs (Binary.ResolveOperator): Do no append strings
16628         twice: since we can be invoked more than once (array evaluation)
16629         on the same concatenation, take care of this here.  Based on a fix
16630         from Ben (bug #56454)
16631
16632 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
16633
16634         * codegen.cs: Fix another case where CS1548 must be reported (when 
16635         delay-sign isn't specified and no private is available #56564). Fix
16636         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
16637         error when MCS is used on the MS runtime and we need to delay-sign 
16638         (which seems unsupported by AssemblyBuilder - see #56621).
16639
16640 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
16641
16642         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
16643         (TypeManager.ComputeNamespaces): Faster implementation for
16644         Microsoft runtime.
16645
16646         * compiler.csproj: Updated AssemblyName to mcs.
16647
16648 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * rootcontext.cs: Add new types to the boot resolution.
16651
16652         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
16653         MulticastDelegate is not allowed.
16654
16655         * typemanager.cs: Add new types to lookup: System.TypedReference
16656         and ArgIterator.
16657
16658         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
16659         check for TypedReference or ArgIterator, they are not allowed. 
16660
16661         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
16662         makes us properly catch 1510 in some conditions (see bug 56016 for
16663         details). 
16664
16665 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
16666
16667         * CryptoConvert.cs: update from corlib version
16668         with endian fixes.
16669
16670 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
16671
16672         * class.cs (Indexer.Define): Check indexername declaration
16673
16674 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
16675
16676         * attribute.cs (IsClsCompliant): Fixed problem with handling
16677         all three states (compliant, not-compliant, undetected).
16678
16679 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
16680
16681         * attribute.cs (Attribute): Location is now public.
16682         (Resolve): Store resolved arguments (pos_values) in attribute class.
16683         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
16684         (GetClsCompliantAttributeValue): New method that gets
16685         CLSCompliantAttribute value.
16686         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
16687         if exists else null.
16688         (AttributeTester): New class for CLS-Compliant verification routines.
16689
16690         * class.cs (Emit): Add CLS-Compliant verification.
16691         (Method.GetSignatureForError): Implemented.
16692         (Constructor.GetSignatureForError): Implemented
16693         (Constructor.HasCompliantArgs): Returns if constructor has
16694         CLS-Compliant arguments.
16695         (Constructor.Emit): Override.
16696         (Construcor.IsIdentifierClsCompliant): New method; For constructors
16697         is needed to test only parameters.
16698         (FieldBase.GetSignatureForError): Implemented.
16699         (TypeContainer): New member for storing base interfaces.
16700         (TypeContainer.FindMembers): Search in base interfaces too.
16701
16702         * codegen.cs (GetClsComplianceAttribute): New method that gets
16703         assembly or module CLSCompliantAttribute value.
16704         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
16705         for assembly.
16706         (ModuleClass.Emit): Add error 3012 test.
16707
16708         * const.cs (Emit): Override and call base for CLS-Compliant tests.
16709
16710         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
16711         state for all decl types.
16712         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
16713         if CLS-Compliant tests are required.
16714         (IsClsCompliaceRequired): New method. Analyze whether code
16715         must be CLS-Compliant.
16716         (IsExposedFromAssembly): New method. Returns true when MemberCore
16717         is exposed from assembly.
16718         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
16719         value or gets cached value.
16720         (HasClsCompliantAttribute): New method. Returns true if MemberCore
16721         is explicitly marked with CLSCompliantAttribute.
16722         (IsIdentifierClsCompliant): New abstract method. This method is
16723         used to testing error 3005.
16724         (IsIdentifierAndParamClsCompliant): New method. Common helper method
16725         for identifier and parameters CLS-Compliant testing.
16726         (VerifyClsCompliance): New method. The main virtual method for
16727         CLS-Compliant verifications.
16728         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
16729         null. I don't know why is null (too many public members !).
16730         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
16731         and get value of first CLSCompliantAttribute that found.
16732
16733         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
16734         (VerifyClsCompliance): Override and add extra tests.
16735
16736         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
16737         clscheck- disable CLS-Compliant verification event if assembly is has
16738         CLSCompliantAttribute(true).
16739
16740         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
16741         ApllyAttribute is now called in emit section as in the other cases.
16742         Possible future Emit integration.
16743         (IsIdentifierClsCompliant): New override.
16744         (VerifyClsCompliance): New override.
16745         (GetEnumeratorName): Returns full enum name.
16746
16747         * parameter.cs (GetSignatureForError): Implemented.
16748
16749         * report.cs (WarningData): New struct for Warning message information.
16750         (LocationOfPreviousError): New method.
16751         (Warning): New method. Reports warning based on the warning table.
16752         (Error_T): New method. Reports error based on the error table.
16753
16754         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
16755         verifications are done here.
16756
16757         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
16758
16759         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
16760         CLSCompliantAttribute.
16761         (all_imported_types): New member holds all imported types from other
16762         assemblies.
16763         (LoadAllImportedTypes): New method fills static table with exported types
16764         from all referenced assemblies.
16765         (Modules): New property returns all assembly modules.
16766
16767 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
16770         throwing a parser error.
16771
16772         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
16773         which removes the hardcoded get_/set_ prefixes for properties, as
16774         IL allows for the properties to be named something else.  
16775
16776         Bug #56013
16777
16778         * expression.cs: Do not override operand before we know if it is
16779         non-null.  Fix 56207
16780
16781 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16782
16783         * typemanager.cs: support for pinned variables.
16784
16785 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16786
16787         * decl.cs, typemanager.cs: Avoid using an arraylist
16788         as a buffer if there is only one result set.
16789
16790 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16791
16792         * expression.cs: Make sure you cant call a static method
16793         with an instance expression, bug #56174.
16794
16795 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
16796
16797         * class.cs (IsDuplicateImplementation): Improve error reporting to
16798         flag 663 (method only differs in parameter modifier).
16799
16800         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
16801         in preprocessor directives.
16802
16803         * location.cs (LookupFile): Allow for the empty path.
16804
16805         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
16806         better approach for some of that patch, but its failing with the
16807         CharSet enumeration.  For now try/catch will do.
16808
16809         * typemanager.cs: Do not crash if a struct does not have fields.
16810         Fixes 56150.
16811
16812 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16813
16814         * expression.cs: cs0213, cant fix a fixed expression.
16815         fixes 50231.
16816
16817 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16818
16819         * cs-parser.jay: detect invalid embeded statements gracefully.
16820         bug #51113.
16821
16822 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16823
16824         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
16825         As a regex:
16826         s/
16827         the invocation type may not be a subclass of the tye of the item/
16828         The type of the item must be a subclass of the invocation item.
16829         /g
16830
16831         Fixes bug #50820.
16832
16833 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
16834
16835         * attribute.cs: Added methods to get a string and a bool from an
16836         attribute. Required to information from AssemblyKeyFileAttribute,
16837         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
16838         * codegen.cs: Modified AssemblyName creation to include support for
16839         strongnames. Catch additional exceptions to report them as CS1548.
16840         * compiler.csproj: Updated include CryptoConvert.cs.
16841         * compiler.csproj.user: Removed file - user specific configuration.
16842         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
16843         Mono.Security assembly. The original class is maintained and tested in
16844         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
16845         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
16846         like CSC 8.0 (C# v2) supports.
16847         * Makefile: Added CryptoConvert.cs to mcs sources.
16848         * rootcontext.cs: Added new options for strongnames.
16849
16850 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
16851
16852         * driver.cs: For --expect-error, report error code `2'
16853         if the program compiled with no errors, error code `1' if
16854         it compiled with an error other than the one expected.
16855
16856 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
16857
16858         * compiler.csproj: Updated for Visual Studio .NET 2003.
16859         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
16860         * compiler.sln: Updated for Visual Studio .NET 2003.
16861
16862 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
16863
16864         * expression.cs: Fix bug #47234. We basically need to apply the
16865         rule that we prefer the conversion of null to a reference type
16866         when faced with a conversion to 'object' (csc behaviour).
16867
16868 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16869
16870         * statement.cs: Shorter form for foreach, eliminates
16871         a local variable. r=Martin.
16872
16873 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16874
16875         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
16876         checks if we can use brtrue/brfalse to test for 0.
16877         * expression.cs: use the above in the test for using brtrue/brfalse.
16878         cleanup code a bit.
16879
16880 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16881
16882         * expression.cs: Rewrite string concat stuff. Benefits:
16883
16884         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
16885         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
16886         rather than a concat chain.
16887
16888         * typemanager.cs: Add lookups for more concat overloads.
16889
16890 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16891
16892         * expression.cs: Emit shorter il code for array init.
16893
16894         newarr
16895         dup
16896         // set 1
16897
16898         // set 2
16899
16900         newarr
16901         stloc.x
16902
16903         ldloc.x
16904         // set 1
16905
16906         ldloc.x
16907         // set 2
16908
16909 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
16910
16911         * statement.cs: Before, two switch blocks would be merged if the
16912         total size of the blocks (end_item - begin_item + 1) was less than
16913         two times the combined sizes of the blocks.
16914
16915         Now, it will only merge if after the merge at least half of the
16916         slots are filled.
16917
16918         fixes 55885.
16919
16920 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
16921
16922         * class.cs : csc build fix for GetMethods(). See bug #52503.
16923
16924 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
16925
16926         * expression.cs: Make sure fp comparisons work with NaN.
16927         This fixes bug #54303. Mig approved this patch a long
16928         time ago, but we were not able to test b/c the runtime
16929         had a related bug.
16930
16931 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
16932
16933         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
16934
16935 2004-03-19  Martin Baulig  <martin@ximian.com>
16936
16937         * class.cs (MemberCore.IsDuplicateImplementation): Report the
16938         error here and not in our caller.
16939
16940 2004-03-19  Martin Baulig  <martin@ximian.com>
16941
16942         * interface.cs: Completely killed this file.
16943         (Interface): We're now a TypeContainer and live in class.cs.
16944
16945         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
16946         argument; we're now also called for interfaces.
16947         (TypeContainer.DefineMembers): Allow this method being called
16948         multiple times.
16949         (TypeContainer.GetMethods): New public method; formerly known as
16950         Interface.GetMethod().  This is used by PendingImplementation.
16951         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
16952         it's now private and non-static.
16953         (Interface): Moved this here; it's now implemented similar to
16954         Class and Struct.
16955         (Method, Property, Event, Indexer): Added `bool is_interface'
16956         argument to their .ctor's.
16957         (MemberBase.IsInterface): New public field.
16958
16959         * cs-parser.jay: Create normal Method, Property, Event, Indexer
16960         instances instead of InterfaceMethod, InterfaceProperty, etc.
16961         (opt_interface_base): Removed; we now use `opt_class_base' instead.
16962         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
16963
16964 2004-03-19  Martin Baulig  <martin@ximian.com>
16965
16966         * class.cs (MethodCore.IsDuplicateImplementation): New private
16967         method which does the CS0111 checking.
16968         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
16969         Use IsDuplicateImplementation().
16970
16971 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
16972
16973         * decl.cs (FindMemberToOverride): New method to find the correct
16974         method or property to override in the base class.
16975         * class.cs
16976             - Make Method/Property use the above method to find the
16977               version in the base class.
16978             - Remove the InheritableMemberSignatureCompare as it is now
16979               dead code.
16980
16981         This patch makes large code bases much faster to compile, as it is
16982         O(n) rather than O(n^2) to do this validation.
16983
16984         Also, it fixes bug 52458 which is that nested classes are not
16985         taken into account when finding the base class member.
16986
16987         Reviewed/Approved by Martin.
16988
16989 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
16990
16991         * interface.cs: In all interface classes removed redundant
16992         member initialization.
16993
16994 2004-03-16  Martin Baulig  <martin@ximian.com>
16995
16996         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
16997
16998 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
16999
17000         * decl.cs (DefineTypeAndParents): New helper method to define a
17001         type's containers before the type itself is defined;  This is a
17002         bug exposed by the recent changes to Windows.Forms when an
17003         implemented interface was defined inside a class that had not been
17004         built yet.   
17005
17006         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17007
17008         (Check): Loop correctly to report errors modifiers
17009         (UNSAFE was not in the loop, since it was the same as TOP).
17010
17011         * interface.cs: Every interface member now takes a ModFlags,
17012         instead of a "is_new" bool, which we set on the base MemberCore. 
17013
17014         Every place where we called "UnsafeOk" in the interface, now we
17015         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17016         the unsafe settings from the member declaration instead of the
17017         container interface. 
17018
17019         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17020
17021         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17022         `set_indexer_name' to the pending bits (one per type).
17023
17024         We fixed a bug today that was picking the wrong method to
17025         override, since for properties the existing InterfaceMethod code
17026         basically ignored the method name.  Now we make sure that the
17027         method name is one of the valid indexer names.
17028
17029 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17030  
17031         * support.cs (SeekableStreamReader): Keep track of stream byte
17032         positions and don't mix them with character offsets to the buffer.
17033
17034         Patch from Gustavo Giráldez
17035
17036 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17037
17038         * interface.cs (InterfaceSetGetBase): Removed double member
17039         initialization, base class does it as well.
17040
17041 2004-03-13  Martin Baulig  <martin@ximian.com>
17042
17043         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17044         when compiling corlib.
17045
17046 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17047
17048         * convert.cs (ExplicitConversion): We were reporting an error on
17049         certain conversions (object_type source to a value type, when the
17050         expression was `null') before we had a chance to pass it through
17051         the user defined conversions.
17052
17053         * driver.cs: Replace / and \ in resource specifications to dots.
17054         Fixes 50752
17055
17056         * class.cs: Add check for duplicate operators.  Fixes 52477
17057
17058 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17059
17060         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17061         that are in the middle of the statements, not only at the end.
17062         Fixes #54987
17063
17064         * class.cs (TypeContainer.AddField): No longer set the
17065         `HaveStaticConstructor' flag, now we call it
17066         `UserDefineStaticConstructor' to diferentiate the slightly
17067         semantic difference.
17068
17069         The situation is that we were not adding BeforeFieldInit (from
17070         Modifiers.TypeAttr) to classes that could have it.
17071         BeforeFieldInit should be set to classes that have no static
17072         constructor. 
17073
17074         See:
17075
17076         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17077
17078         And most importantly Zoltan's comment:
17079
17080         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17081
17082         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17083          before its static fields are used', i.e. initialization does not need
17084          to be triggered by the first access to the type. Setting this flag
17085          helps the JIT to compile better code, since it can run the static
17086          constructor at JIT time, and does not need to generate code to call it
17087          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17088          this flag for lots of classes like String. 
17089          
17090          csc sets this flag if the type does not have an explicit static 
17091          constructor. The reasoning seems to be that if there are only static
17092          initalizers for a type, and no static constructor, then the programmer
17093          does not care when this initialization happens, so beforefieldinit
17094          can be used.
17095          
17096          This bug prevents the AOT compiler from being usable, since it 
17097          generates so many calls to mono_runtime_class_init that the AOT code
17098          is much slower than the JITted code. The JITted code is faster, 
17099          because it does not generate these calls if the vtable is type is
17100          already initialized, which is true in the majority of cases. But the
17101          AOT compiler can't do this."
17102
17103 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * class.cs (MethodData.Emit): Refactor the code so symbolic
17106         information is generated for destructors;  For some reasons we
17107         were taking a code path that did not generate symbolic information
17108         before. 
17109
17110 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17111
17112         * class.cs: Create a Constructor.CheckBase method that
17113         takes care of all validation type code. The method
17114         contains some code that was moved from Define.
17115
17116         It also includes new code that checks for duplicate ctors.
17117         This fixes bug #55148.
17118
17119 2004-03-09  Joshua Tauberer <tauberer@for.net>
17120
17121         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17122         a { ... }-style array creation invokes EmitStaticInitializers
17123         which is not good for reference-type arrays.  String, decimal
17124         and now null constants (NullCast) are not counted toward
17125         static initializers.
17126
17127 2004-03-05  Martin Baulig  <martin@ximian.com>
17128
17129         * location.cs (SourceFile.HasLineDirective): New public field;
17130         specifies whether the file contains or is referenced by a "#line"
17131         directive.
17132         (Location.DefineSymbolDocuments): Ignore source files which
17133         either contain or are referenced by a "#line" directive.        
17134
17135 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17136
17137         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17138         direct access to our parent, so check the method inline there.
17139
17140 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17141
17142         * expression.cs (Invocation.EmitCall): Miguel's last commit
17143         caused a regression. If you had:
17144
17145             T t = null;
17146             t.Foo ();
17147
17148         In Foo the implict this would be null.
17149
17150 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17151
17152         * expression.cs (Invocation.EmitCall): If the method is not
17153         virtual, do not emit a CallVirt to it, use Call.
17154
17155         * typemanager.cs (GetFullNameSignature): Improve the method to
17156         cope with ".ctor" and replace it with the type name.
17157
17158         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17159         as an argument the ConstructorBuilder where it is being defined,
17160         to catch the recursive constructor invocations.
17161
17162 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17163
17164         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17165         routines to check if a type is an enumerable/enumerator allow
17166         classes that implement the IEnumerable or IEnumerator interfaces.
17167
17168         * class.cs (Property, Operator): Implement IIteratorContainer, and
17169         implement SetYields.
17170
17171         (Property.Define): Do the block swapping for get_methods in the
17172         context of iterators.   We need to check if Properties also
17173         include indexers or not.
17174
17175         (Operator): Assign the Block before invoking the
17176         OperatorMethod.Define, so we can trigger the Iterator code
17177         replacement. 
17178
17179         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17180         Property and Operator classes are not created when we parse the
17181         declarator but until we have the block completed, so we use a
17182         singleton SimpleIteratorContainer.Simple to flag whether the
17183         SetYields has been invoked.
17184
17185         We propagate this setting then to the Property or the Operator to
17186         allow the `yield' to function.
17187
17188 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17189
17190         * codegen.cs: Implemented attribute support for modules.
17191         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17192         Assembly/Module functionality.
17193
17194         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17195         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17196         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17197
17198 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17199
17200         * interface.cs (FindMembers): The operation is performed on all base
17201         interfaces and not only on the first. It is required for future CLS Compliance patch.
17202
17203 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17204
17205         * statement.cs, codegen.cs:
17206         This patch deals with patterns such as:
17207
17208         public class List : IEnumerable {
17209
17210                 public MyEnumerator GetEnumerator () {
17211                         return new MyEnumerator(this);
17212                 }
17213
17214                 IEnumerator IEnumerable.GetEnumerator () {
17215                         ...
17216                 }
17217                 
17218                 public struct MyEnumerator : IEnumerator {
17219                         ...
17220                 }
17221         }
17222
17223         Before, there were a few things we did wrong:
17224         1) we would emit callvirt on a struct, which is illegal
17225         2) we emited ldarg when we needed to emit ldarga
17226         3) we would mistakenly call the interface methods on an enumerator
17227         type that derived from IEnumerator and was in another assembly. For example:
17228
17229         public class MyEnumerator : IEnumerator
17230
17231         Would have the interface methods called, even if there were public impls of the
17232         method. In a struct, this lead to invalid IL code.
17233
17234 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17235
17236         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17237           renamed to Emit.
17238
17239         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17240
17241 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17242
17243         * cs-parser.jay: Fix small regression: we were not testing V2
17244         compiler features correctly.
17245
17246         * interface.cs: If the emit context is null, then create one
17247
17248 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17249
17250         * decl.cs (GetSignatureForError): New virtual method to get full name
17251           for error messages.
17252
17253         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17254           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17255
17256         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17257           Duplicated members and code in these classes has been removed.
17258           Better encapsulation in these classes.
17259
17260 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * assign.cs (Assign.DoResolve): When dealing with compound
17263         assignments, there is a new rule in ECMA C# 2.4 (might have been
17264         there before, but it is documented here) that states that in:
17265
17266         a op= b;
17267
17268         If b is of type int, and the `op' is a shift-operator, then the
17269         above is evaluated as:
17270
17271         a = (int) a op b 
17272
17273         * expression.cs (Binary.ResolveOperator): Instead of testing for
17274         int/uint/long/ulong, try to implicitly convert to any of those
17275         types and use that in pointer arithmetic.
17276
17277         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17278         method to print information for from the type, not from the
17279         null-method we were given.
17280
17281 2004-02-01  Duncan Mak  <duncan@ximian.com>
17282
17283         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17284         parsing for cmd, fixes bug #53694.
17285
17286 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17287
17288         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17289         in the member name duplication tests. Property and operator name duplication
17290         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17291
17292 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
17293
17294         * interface.cs (PopulateMethod): Fixed crash when interface method
17295         returns not existing type (error test cs0246-3.cs).
17296
17297 2004-02-02  Ravi Pratap M <ravi@ximian.com>
17298
17299         * cs-parser.jay (interface_accessors): Re-write actions to also
17300         store attributes attached to get and set methods. Fix spelling
17301         while at it.
17302
17303         (inteface_property_declaration): Modify accordingly.
17304
17305         (InterfaceAccessorInfo): New helper class to store information to pass
17306         around between rules that use interface_accessors.
17307
17308         * interface.cs (Emit): Apply attributes on the get and set
17309         accessors of properties and indexers too.
17310
17311         * attribute.cs (ApplyAttributes): Modify accordingly to use the
17312         right MethodBuilder when applying attributes to the get and set accessors.
17313
17314 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
17315
17316         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
17317
17318 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
17319
17320         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
17321
17322 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
17323
17324         * cs-parser.jay: Remove YIELD token, instead use the new grammar
17325         changes that treat `yield' specially when present before `break'
17326         or `return' tokens.
17327
17328         * cs-tokenizer.cs: yield is no longer a keyword.
17329
17330 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
17331
17332         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
17333         setting for default constructors.
17334         For default constructors are almost every time set wrong Modifier. The
17335         generated IL code has been alright. But inside mcs this values was
17336         wrong and this was reason why several of my CLS Compliance tests
17337         failed.
17338
17339 2004-01-22  Martin Baulig  <martin@ximian.com>
17340
17341         * cs-parser.jay (namespace_or_type_name): Return an Expression,
17342         not a QualifiedIdentifier.  This is what `type_name_expression'
17343         was previously doing.
17344         (type_name_expression): Removed; the code is now in
17345         `namespace_or_type_name'.
17346         (qualified_identifier): Removed, use `namespace_or_type_name'
17347         instead.
17348         (QualifiedIdentifier): Removed this class.      
17349
17350 2004-01-22  Martin Baulig  <martin@ximian.com>
17351
17352         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
17353         not a string as alias name.
17354
17355 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
17356
17357         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
17358         #52730 bug, and instead compute correctly the need to use a
17359         temporary variable when requesting an address based on the
17360         static/instace modified of the field and the constructor.
17361  
17362 2004-01-21  Martin Baulig  <martin@ximian.com>
17363
17364         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
17365         class and namespace before looking up aliases.  Fixes #52517.
17366
17367 2004-01-21  Martin Baulig  <martin@ximian.com>
17368
17369         * flowanalysis.cs (UsageVector.Merge): Allow variables being
17370         assinged in a 'try'; fixes exception4.cs.
17371
17372 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17373         * class.cs : Implemented parameter-less constructor for TypeContainer
17374
17375         * decl.cs: Attributes are now stored here. New property OptAttributes
17376
17377         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
17378
17379         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
17380
17381 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17382
17383         * typemanager.cs (CSharpSignature): Now reports also inner class name.
17384           (CSharpSignature): New method for indexer and property signature.
17385
17386 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17387
17388         * pending.cs (IsVirtualFilter): Faster implementation.
17389
17390 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17391
17392         * typemanager.cs: Avoid inclusion of same assembly more than once.
17393
17394 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17395
17396         * cs-parser.jay: Fixed problem where the last assembly attribute
17397           has been applied also to following declaration (class, struct, etc.)
17398           
17399 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
17400
17401         * class.cs: Added error CS0538, CS0539 reporting.
17402         Fixed crash on Microsoft runtime when field type is void.
17403
17404         * cs-parser.jay: Added error CS0537 reporting.
17405
17406         * pending.cs: Added error CS0535 reporting.
17407         Improved error report for errors CS0536, CS0534.
17408
17409 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
17410
17411         Merge a few bits from the Anonymous Method MCS tree.
17412
17413         * statement.cs (ToplevelBlock): New class for toplevel methods,
17414         will hold anonymous methods, lifted variables.
17415
17416         * cs-parser.jay: Create toplevel blocks for delegates and for
17417         regular blocks of code. 
17418
17419 2004-01-20  Martin Baulig  <martin@ximian.com>
17420
17421         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
17422         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
17423         and `NeedExplicitReturn'; added `IsLastStatement'.
17424         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
17425         have a `ReturnLabel' or we're not unreachable.
17426
17427         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
17428         child's reachability; don't just override ours with it.  Fixes
17429         #58058 (lluis's example).
17430         (FlowBranching): Added public InTryOrCatch(), InCatch(),
17431         InFinally(), InLoop(), InSwitch() and
17432         BreakCrossesTryCatchBoundary() methods.
17433
17434         * statement.cs (Return): Do all error checking in Resolve().
17435         Unless we are the last statement in a top-level block, always
17436         create a return label and jump to it.
17437         (Break, Continue): Do all error checking in Resolve(); also make
17438         sure we aren't leaving a `finally'.
17439         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
17440         statement in a top-level block.
17441         (Block.Flags): Added `IsDestructor'.
17442         (Block.IsDestructor): New public property.
17443
17444 2004-01-20  Martin Baulig  <martin@ximian.com>
17445
17446         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
17447
17448 2004-01-20  Martin Baulig  <martin@ximian.com>
17449
17450         * statement.cs (Statement.ResolveUnreachable): New public method.
17451         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
17452         (Block.Resolve): Resolve unreachable statements.
17453
17454 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17455
17456         * expression.cs: We need to fix the case where we do
17457         not have a temp variable here.
17458
17459         * assign.cs: Only expression compound assignments need
17460         temporary variables.
17461
17462 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
17463
17464         * flowanalysis.cs: Reduce memory allocation in a few ways:
17465           - A block with no variables should not allocate a bit
17466             vector for itself.
17467           - A method with no out parameters does not need any tracking
17468             for assignment of the parameters, so we need not allocate
17469             any data for it.
17470           - The arrays:
17471                 public readonly Type[] VariableTypes;
17472                 public readonly string[] VariableNames;
17473             Are redundant. The data is already stored in the variable
17474             map, so we need not allocate another array for it.
17475           - We need to add alot of checks for if (params | locals) == null
17476             due to the first two changes.
17477
17478 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
17481         implement IMemoryLocation, we store a copy on a local variable and
17482         take the address of it.  Patch from Benjamin Jemlich
17483
17484         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
17485         to use a special "type_name_expression" rule which reduces the
17486         number of "QualifiedIdentifier" classes created, and instead
17487         directly creates MemberAccess expressions.
17488
17489 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
17490
17491         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
17492         that fixes #52853.  Null literal assignment to ValueType
17493
17494         * class.cs (MethodData.Emit): Instead of checking the name of the
17495         method to determine if its a destructor, create a new derived
17496         class from Method called Destructor, and test for that.  
17497
17498         * cs-parser.jay: Create a Destructor object instead of a Method.  
17499
17500         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
17501
17502         Fixes: 52933
17503
17504 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
17505
17506         * expression.cs (Binary.ResolveOperator): Perform an implicit
17507         conversion from MethodGroups to their delegate types on the
17508         Addition operation.
17509
17510         * delegate.cs: Introduce a new class DelegateCreation that is the
17511         base class for `NewDelegate' and `ImplicitDelegateCreation',
17512         factor some code in here.
17513
17514         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
17515         conversion from MethodGroups to compatible delegate types. 
17516
17517         * ecore.cs (Expression.Resolve): Do not flag error 654
17518         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
17519         we allow conversions from MethodGroups to delegate types now.
17520
17521         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
17522         assignments in v2 either.
17523
17524 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
17525
17526         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
17527         static read-only fields in ctors.
17528
17529         Applied patch from Benjamin Jemlich 
17530
17531         * expression.cs (UnaryMutator): Avoid leaking local variables. 
17532
17533 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
17534
17535         * cs-tokenizer.cs (IsCastToken): Allow the various native types
17536         here to return true, as they can be used like this:
17537
17538                 (XXX) int.MEMBER ()
17539
17540         Fixed 49836 and all the other dups
17541
17542 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
17543
17544         * driver.cs: Implement /win32res and /win32icon.
17545
17546 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
17547
17548         * cs-parser.jay: Add a rule to improve error handling for the
17549         common mistake of placing modifiers after the type.
17550
17551 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
17552
17553         * cs-parser.jay (interface_event_declaration): Catch
17554         initialization of events on interfaces, and report cs0068
17555
17556         * cs-parser.jay (interface_event_declaration): Catch
17557         initialization of events. 
17558
17559         * ecore.cs: Better report missing constructors.
17560
17561         * expression.cs (Binary.ResolveOperator): My previous bug fix had
17562         the error reporting done in the wrong place.  Fix.
17563
17564         * expression.cs (Binary.ResolveOperator): Catch the 
17565         operator + (E x, E y) error earlier, and later allow for implicit
17566         conversions in operator +/- (E e, U x) from U to the underlying
17567         type of E.
17568
17569         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
17570         52596, if the container class is abstract, the default constructor
17571         is protected otherwise its public (before, we were always public).
17572
17573         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
17574         fixed statement.
17575
17576         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
17577         Jemlich that fixes bug #52597, MCS was generating invalid code for
17578         idisposable structs.   Thanks to Ben for following up with this
17579         bug as well.
17580
17581 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
17582
17583         * driver.cs: Allow assemblies without code to be generated, fixes
17584         52230.
17585
17586 2004-01-07  Nick Drochak <ndrochak@gol.com>
17587
17588         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
17589
17590 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
17591
17592         * cs-parser.jay: Add rules to improve error reporting if fields or
17593         methods are declared at the namespace level (error 116)
17594
17595         * Add rules to catch event add/remove
17596
17597 2004-01-04  David Sheldon <dave-mono@earth.li>
17598
17599   * expression.cs: Added matching ")" to error message for 
17600   CS0077
17601
17602 2004-01-03 Todd Berman <tberman@gentoo.org>
17603
17604         * ecore.cs, attribute.cs:
17605         Applying fix from #52429.
17606
17607 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17608
17609         * ecore.cs, expression.cs, statement.cs:
17610         Total rewrite of how we handle branching. We
17611         now handle complex boolean expressions with fewer
17612         jumps. As well if (x == 0) no longer emits a ceq.
17613
17614         if (x is Foo) is much faster now, because we generate
17615         better code.
17616
17617         Overall, we get a pretty big improvement on our benchmark
17618         tests. The code we generate is smaller and more readable.
17619
17620         I did a full two-stage bootstrap. The patch was reviewed
17621         by Martin and Miguel.
17622
17623 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17624
17625         * cs-parser.jay: Make primary_expression not take a QI.
17626         we dont need this because the member_access rule covers
17627         us here. So we replace the rule with just IDENTIFIER.
17628
17629         This has two good effects. First, we remove a s/r conflict.
17630         Second, we allocate many fewer QualifiedIdentifier objects.
17631
17632 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17633
17634         * attribute.cs: Handle MarshalAs attributes as pseudo, and
17635         set the correct information via SRE. This prevents
17636         hanging on the MS runtime. Fixes #29374.
17637
17638 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
17639
17640         * convert.cs: correctly handle conversions to value types
17641         from Enum and ValueType as unboxing conversions.
17642
17643         Fixes bug #52569. Patch by Benjamin Jemlich.
17644
17645 2004-01-02  Ravi Pratap  <ravi@ximian.com>
17646
17647         * expression.cs (BetterConversion): Prefer int -> uint
17648         over int -> ulong (csc's behaviour). This fixed bug #52046.
17649
17650 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17651
17652         * decl.cs (MemberCache.FindMembers): now returns a
17653         MemberInfo [].
17654
17655         * typemanager.cs: In general, go with with ^^.
17656         (CopyNewMethods): take an IList.
17657         (RealMemberLookup): Only allocate an arraylist
17658         if we copy from two sets of methods.
17659
17660         This change basically does two things:
17661         1) Fewer array lists allocated due to CopyNewMethods.
17662         2) the explicit cast in MemberList costed ALOT.
17663
17664 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
17665
17666         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
17667         a hashtable to avoid needless string allocations when an identifier is
17668         used more than once (the common case).
17669
17670 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17671
17672         * pending.cs: MS's TypeBuilder.GetInterfaces ()
17673         is broken, it will not return anything. So, we
17674         have to use the information we have in mcs to
17675         do the task.
17676
17677         * typemanager.cs: Add a cache for GetInterfaces,
17678         since this will now be used more often (due to ^^)
17679
17680         (GetExplicitInterfaces) New method that gets the
17681         declared, not effective, interfaces on a type
17682         builder (eg, if you have interface IFoo, interface
17683         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
17684         { IBar }.
17685
17686         This patch makes MCS able to bootstrap itself on
17687         Windows again.
17688
17689 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
17690
17691         * expression.cs: Remove the Nop's that Miguel put
17692         in by mistake.
17693
17694 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17695
17696         * report.cs, codegen.cs: Give the real stack trace to
17697         the error when an exception is thrown.
17698
17699 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17700
17701         * decl.cs: only allocate hashtables for ifaces if 
17702         it is an iface!
17703
17704 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
17705
17706         * expression.cs: fix the error from cs0121-2.cs
17707         (a parent interface has two child interfaces that
17708         have a function with the same name and 0 params
17709         and the function is called through the parent).
17710
17711 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17712
17713         * class.cs, rootcontext.cs, typmanager.cs: do not
17714         leak pointers.
17715
17716 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17717
17718         * codegen.cs: remove stack for the ec flow branching.
17719         It is already a linked list, so no need.
17720
17721 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17722
17723         * Makefile: Allow custom profiler here.
17724
17725 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17726
17727         * typemanager.cs (LookupType):
17728           - Use a static char [], because split takes
17729             a param array for args, so it was allocating
17730             every time.
17731           - Do not store true in a hashtable, it boxes.
17732
17733 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
17734
17735         * flowanalysis.cs: bytify common enums.
17736
17737 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17738
17739         * modifiers.cs: Add a new set of flags for the
17740         flags allowed on explicit interface impls.
17741         * cs-parser.jay: catch the use of modifiers in
17742         interfaces correctly.
17743         * class.cs: catch private void IFoo.Blah ().
17744
17745         All related to bug #50572.
17746
17747 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17748
17749         * decl.cs: Rewrite the consistant accessability checking.
17750         Accessability is not linear, it must be implemented in
17751         a tableish way. Fixes #49704.
17752
17753 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
17754
17755         * expression.cs: Handle negation in a checked context.
17756         We must use subtraction from zero. Fixes #38674.
17757
17758 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17759
17760         * class.cs: Ignore static void main in DLLs.
17761         * rootcontext.cs: Handle the target type here,
17762         since we are have to access it from class.cs
17763         * driver.cs: account for the above.
17764
17765 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17766
17767         * report.cs: Give line numbers and files if available.
17768
17769 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
17770
17771         * driver.cs: Implement /addmodule.
17772
17773         * typemanager.cs:  Change 'modules' field so it now contains Modules not
17774         ModuleBuilders.
17775
17776 2003-12-20  Martin Baulig  <martin@ximian.com>
17777
17778         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
17779         (FieldBase.IsAssigned): Removed this field.
17780         (FieldBase.SetAssigned): New public method.
17781         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
17782
17783 2003-12-20  Martin Baulig  <martin@ximian.com>
17784
17785         * expression.cs (LocalVariableReference.DoResolve): Don't set
17786         `vi.Used' if we're called from DoResolveLValue().
17787
17788         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
17789         returns the usage vector it just merged into the current one -
17790         pass this one to UsageWarning().
17791         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
17792         of the `EmitContext', don't call this recursively on our children.
17793
17794 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
17795
17796         * driver.cs: Implement /target:module.
17797
17798 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
17799
17800         * support.cs (CharArrayHashtable): New helper class.
17801
17802         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
17803         char arrays, not strings, so we can avoid creating a string in
17804         consume_identifier if the identifier is a keyword.
17805
17806 2003-12-16  Martin Baulig  <martin@ximian.com>
17807
17808         * statement.cs (LocalInfo.Assigned): Removed this property.
17809         (LocalInfo.Flags): Removed `Assigned'.
17810         (LocalInfo.IsAssigned): New public method; takes the EmitContext
17811         and uses flow analysis.
17812         (Block.UsageWarning): Made this method private.
17813         (Block.Resolve): Call UsageWarning() if appropriate.
17814
17815         * expression.cs (LocalVariableReference.DoResolve): Always set
17816         LocalInfo.Used here.
17817
17818 2003-12-13  Martin Baulig  <martin@ximian.com>
17819
17820         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
17821         any value here; we're now using flow analysis to figure out
17822         whether a statement/block returns a value.
17823
17824 2003-12-13  Martin Baulig  <martin@ximian.com>
17825
17826         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
17827         working again.
17828         (FlowBranching.MergeFinally): Don't call
17829         `branching.CheckOutParameters()' here, this is called in
17830         MergeTopBlock().
17831         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
17832         when adding the `finally' vector.       
17833
17834 2003-12-13  Martin Baulig  <martin@ximian.com>
17835
17836         * flowanalysis.cs
17837         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
17838         actually work and also fix #48962.
17839
17840 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17841
17842         * decl.cs: Do not check System.Object for nested types,
17843         since we know it does not have any. Big bang for buck:
17844
17845         BEFORE:
17846            Run 1:   8.35 seconds
17847            Run 2:   8.32 seconds
17848            corlib:  17.99 seconds
17849         AFTER:
17850            Run 1:   8.17 seconds
17851            Run 2:   8.17 seconds
17852            corlib:  17.39 seconds
17853
17854 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17855
17856         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
17857         time we are returning 0 members, so we save alot here.
17858
17859 2003-12-11  Martin Baulig  <martin@ximian.com>
17860
17861         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
17862         `MergeChild()', also just take the `FlowBranching' as argument;
17863         call Merge() on it and return the result.
17864         (FlowBranching.Merge): We don't need to do anything if we just
17865         have one sibling.
17866
17867 2003-12-11  Martin Baulig  <martin@ximian.com>
17868
17869         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
17870         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
17871         Maurer for this idea.
17872
17873 2003-12-11  Martin Baulig  <martin@ximian.com>
17874
17875         * flowanalysis.cs (MergeResult): This class is now gone; we now
17876         use the `UsageVector' for this.  The reason for this is that if a
17877         branching just has one sibling, we don't need to "merge" them at
17878         all - that's the next step to do.
17879         (FlowBranching.Merge): We now return a `UsageVector' instead of a
17880         `MergeResult'.
17881
17882 2003-12-11  Martin Baulig  <martin@ximian.com>
17883
17884         Reworked flow analyis and made it more precise and bug-free.  The
17885         most important change is that we're now using a special `Reachability'
17886         class instead of having "magic" meanings of `FlowReturns'.  I'll
17887         do some more cleanups and optimizations and also add some more
17888         documentation this week.
17889
17890         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
17891         largely reworked this class.
17892         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
17893         the new `Reachability' class instead of having "magic" values here.
17894         (FlowBranching): We're now using an instance of `Reachability'
17895         instead of having separate `Returns', `Breaks' etc. fields.
17896
17897         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
17898         based on flow analysis; ignore the return value of block.Emit ().
17899
17900 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
17901
17902         * driver.cs typemanager.cs: Find the mono extensions to corlib even
17903         if they are private.
17904
17905 2003-12-09  Martin Baulig  <martin@ximian.com>
17906
17907         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
17908         call them directly on the UsageVector.
17909
17910 2003-12-09  Martin Baulig  <martin@ximian.com>
17911
17912         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
17913         Changed return type from `FlowReturns' to `Reachability'.
17914
17915 2003-12-09  Martin Baulig  <martin@ximian.com>
17916
17917         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
17918         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
17919         `Reachable' fields with a single `Reachability' one.
17920
17921 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17922
17923         * class.cs (FindMembers): Remove foreach's.
17924
17925         Bootstrap times:
17926
17927         BEFORE
17928                 Run 1:   8.74 seconds
17929                 Run 2:   8.71 seconds
17930
17931         AFTER
17932                 Run 1:   8.64 seconds
17933                 Run 2:   8.58 seconds
17934
17935
17936 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17937
17938         * cs-parser.jay:
17939         * gen-treedump.cs:
17940         * statement.cs:
17941         This patch does a few things:
17942                 1. EmptyStatement is now a singleton, so it is never reallocated.
17943                 2. All blah is EmptyStatement constructs have been changed to
17944                    blah == EmptyStatement.Value, which is much faster and valid
17945                    now that EmptyStatement is a singleton.
17946                 3. When resolving a block, rather than allocating a new array for
17947                    the non-empty statements, empty statements are replaced with
17948                    EmptyStatement.Value
17949                 4. Some recursive functions have been made non-recursive.
17950         Mainly the performance impact is from (3), however (1) and (2) are needed for
17951         this to work. (4) does not make a big difference in normal situations, however
17952         it makes the profile look saner.
17953
17954         Bootstrap times:
17955
17956         BEFORE
17957         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17958         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
17959         Total memory allocated: 56397 KB
17960
17961         AFTER
17962         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
17963         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
17964         Total memory allocated: 55666 KB
17965
17966 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17967
17968         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
17969         than the hashtable in a hashtable version
17970
17971         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
17972         we always end up concating a string. This results in a huge perf
17973         loss, because many strings have to be tracked by the GC. In this
17974         patch, we first use a hashtable that works with two keys, so that
17975         the strings do not need to be concat'ed.
17976
17977         Bootstrap times:
17978         BEFORE
17979                 Run 1:   8.74 seconds
17980                 Run 2:   8.71 seconds
17981
17982         AFTER
17983                 Run 1:   8.65 seconds
17984                 Run 2:   8.56 seconds
17985
17986 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
17987
17988         * Makefile: Add a new target `do-time' that does a quick and simple
17989         profile, leaving easy to parse output.
17990
17991 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
17992
17993         * codegen.cs (Init): Create the dynamic assembly with 
17994         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
17995
17996 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17997
17998         * support.cs: Make the PtrHashtable use only one
17999         instance of its comparer.
18000
18001 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18002
18003         * typemanager.cs: Fix lookup of GetNamespaces.
18004
18005 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * expression.cs: Removed redundant line.
18008
18009         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18010         ArrayLists, use for loops with bounds.  
18011
18012         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18013         arraylist.
18014
18015         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18016         arraylists, use for loop with bounds.
18017
18018         The above three changes give us a 0.071 second performance
18019         improvement out of 3.294 seconds down to 3.223.  On my machine
18020         the above changes reduced the memory usage by 1,387 KB during
18021         compiler bootstrap.
18022
18023         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18024         QualifiedIdentifiers.  Before we created a new string through
18025         concatenation, and mostly later on, the result would be
18026         manipulated by DecomposeQI through string manipulation.
18027
18028         This reduced the compiler memory usage for bootstrapping from
18029         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18030         compile times in 0.05 seconds.
18031
18032 2003-11-28  Dick Porter  <dick@ximian.com>
18033
18034         * support.cs: Do string compares with the Invariant culture.
18035
18036         * rootcontext.cs: 
18037         * gen-treedump.cs: 
18038         * expression.cs: 
18039         * driver.cs: 
18040         * decl.cs: 
18041         * codegen.cs: 
18042         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18043         the comparison is done with the Invariant culture.
18044
18045 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18048         GetEnumerator method.
18049
18050         (ProbeCollectionType): Iterate starting at the most specific type
18051         upwards looking for a GetEnumerator
18052
18053         * expression.cs: Shift count can be up to 31 for int/uint and 63
18054         for long/ulong.
18055
18056 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18057
18058         * statement.cs (Block.LookupLabel): Also look for the label on the
18059         children blocks.  Use a hash table to keep track of visited
18060         nodes. 
18061
18062         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18063         we actually did transform the other operand, otherwise fall back
18064         to the common codepath that casts to long.
18065
18066         * cs-tokenizer.cs: Use the same code pattern as the int case.
18067         Maybe I should do the parsing myself, and avoid depending on the
18068         Parse routines to get this done.
18069
18070 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18073         which fixes bug 51347.  This time test it.
18074
18075         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18076         attributes for example can not tell the difference between these.
18077         The difference was only a syntax feature of the language. 
18078
18079         * attribute.cs: Apply attributes to delegates.
18080
18081         * delegate.cs: Call the apply attributes method.
18082
18083 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18084
18085         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18086         comparing 0 vs Byte.MinValue, not the value
18087
18088         (ImplicitConversionRequired): When reporting a conversion error,
18089         use error 31 to print out the constant error instead of the
18090         simpler 29.
18091
18092         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18093         which fixes bug 51347.
18094
18095 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18098         which fixes the -warnaserror command line option.
18099
18100 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18101
18102         * cfold.cs (DoNumericPromotions): During constant folding of
18103         additions on UIntConstant, special case intconstants with
18104         IntConstants like we do on the expression binary operator. 
18105
18106 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * convert.cs (ImplicitReferenceConversion): We were missing a case
18109         (System.Enum are not value types or class types, so we need to
18110         classify them separatedly).
18111
18112         * driver.cs: We do not support error 2007.
18113
18114 2003-11-12 Jackson Harper <jackson@ximian.com>
18115
18116         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18117         system directory. Also use the full file name so users can
18118         libraries names mscorlib-o-tron.dll in a non system dir.
18119
18120 2003-11-10  Martin Baulig  <martin@ximian.com>
18121
18122         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18123         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18124         calling `ResolveType()' on them, directly assign their `Type'.
18125
18126 2003-11-08  Martin Baulig  <martin@ximian.com>
18127
18128         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18129         return value and the `out parent' parameter.
18130         (TypeContainer.DefineType): Moved the CS0644 check into
18131         GetClassBases().  Don't pass the interface types to the
18132         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18133         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18134
18135         * ecore.cs (TypeExpr.IsAttribute): New property.
18136         (TypeExpr.GetInterfaces): New method.
18137
18138         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18139         TypeExpr instead of a Type.
18140         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18141         (Interface.DefineType): Don't pass the interface types to the
18142         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18143         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18144
18145         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18146         instead of a `Type[]'.
18147         (TypeManager.RegisterBuilder): Likewise.
18148         (TypeManager.AddUserInterface): Likewise.
18149         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18150         `Type[]' and also return a `TypeExpr[]'.
18151         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18152
18153 2003-11-08  Martin Baulig  <martin@ximian.com>
18154
18155         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18156         Expression.     
18157
18158 2003-11-08  Martin Baulig  <martin@ximian.com>
18159
18160         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18161         TypeManager.ResolveExpressionTypes().
18162
18163         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18164         instead of an Expression.
18165         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18166         (TypeExpression): New public class; formerly known as `TypeExpr'.
18167
18168         * expression.cs (ComposedCast): Derive from TypeExpr.
18169
18170         * typemanager.cs (TypeManager.system_*_expr): These are now
18171         TypExpr's instead of Expression's.
18172         (TypeManager.ResolveExpressionTypes): New public static function;
18173         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18174         of them.        
18175
18176 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18177
18178         * expression.cs (New.DoResolve): Do not dereference value that
18179         might be a null return.
18180
18181         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18182         sure that the constant value has the right type.  Fixes an
18183         unreported bug, similar to 50425.
18184
18185         * const.cs (Const.LookupConstantValue): Call
18186         ImplicitStandardConversionExists before doing a conversion to
18187         avoid havng the TypeManager.ChangeType do conversions.
18188
18189         Reduced the number of casts used
18190
18191         (Const.ChangeType): New routine to enable reuse of the constant
18192         type changing code from statement.
18193
18194         * typemanager.cs (ChangeType): Move common initialization to
18195         static global variables.
18196
18197         Fixes #50425.
18198
18199         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18200         every value type to go through, even if it was void.  Fix that. 
18201
18202         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18203         character of the define, and the is_identifier_part_character for
18204         the rest of the string.
18205
18206 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * expression.cs (UnaryMutator.EmitCode): When I updated
18209         LocalVariableReference.DoResolve, I overdid it, and dropped an
18210         optimization done on local variable references.
18211
18212 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18213
18214         * ecore.cs: Convert the return from Ldlen into an int.
18215
18216 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18219         the accessibility, this is a special case for toplevel non-public
18220         classes (internal for instance).
18221
18222 2003-10-20  Nick Drochak <ndrochak@gol.com>
18223
18224         * ecore.cs: Fix typo and build.  Needed another right paren.
18225
18226 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18227
18228         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18229         `internal' case regular and protected, but not allowing protected
18230         to be evaluated later.  Bug 49840
18231
18232 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18235         to kb.Nlast, and not the kb.nFirst to isolate the switch
18236         statement.
18237
18238         Extract the underlying type, so enumerations of long/ulong are
18239         treated like long/ulong.
18240
18241 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * expression.cs (New): Overload the meaning of RequestedType to
18244         track the possible creation of the NewDelegate type, since
18245         DoResolve is invoked more than once for new constructors on field
18246         initialization.
18247
18248         See bugs: #48800 and #37014
18249
18250         * cs-parser.jay (declare_local_constants): Take an arraylist
18251         instead of a single constant.
18252
18253         (local_constant_declaration): It should take a
18254         constant_declarators, not a constant_declarator.  Fixes 49487
18255
18256         * convert.cs: Fix error report.
18257
18258 2003-10-13 Jackson Harper <jackson@ximian.com>
18259
18260         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18261         bug #49611
18262
18263 2003-10-09  Martin Baulig  <martin@ximian.com>
18264
18265         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18266         to the .ctor.
18267         (MethodCore.DoDefineParameters): Removed the TypeContainer
18268         argument; use the DeclSpace which was passed to the .ctor instead.
18269         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18270         TypeContainer; we only need a DeclSpace here.
18271
18272 2003-10-09  Martin Baulig  <martin@ximian.com>
18273
18274         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18275         to the .ctor.
18276         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18277         EmitContext's .ctor.    
18278
18279 2003-10-09  Martin Baulig  <martin@ximian.com>
18280
18281         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18282         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18283         AsAccessible(), moved them as well.
18284
18285         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18286
18287 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18288
18289         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18290
18291 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
18294         generation for >=, as spotted by Paolo, bug 48679.  
18295         Patch from David Waite.
18296
18297         * cs-tokenizer.cs: Add handling for #pragma.
18298
18299         * cs-parser.jay: Allow for both yield and yield return in the
18300         syntax.  The anti-cobolization of C# fight will go on!
18301
18302         * class.cs (TypeBuilder.DefineType): Catch error condition here
18303         (Parent.DefineType erroring out and returning null).
18304
18305         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18306         coping with enumerations variables, we were mistakenly processing
18307         them as a regular value type instead of built-in types.  Fixes the
18308         bug #48063
18309
18310         * typemanager.cs (IsBuiltinOrEnum): New method.
18311
18312 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
18313
18314         * cs-parser.jay: Upgrade: yield now needs the return clause.
18315
18316 2003-09-19  Martin Baulig  <martin@ximian.com>
18317
18318         * decl.cs (MemberCache.SetupCacheForInterface): Take a
18319         `MemberCache parent' argument.  Normally, an interface doesn't
18320         have a parent type except System.Object, but we use this in gmcs
18321         for generic type parameters.
18322
18323 2003-09-18  Martin Baulig  <martin@ximian.com>
18324
18325         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
18326         on `type.IsInterface'; don't check whether the type has a parent
18327         to determine whether it's an interface.
18328
18329 2003-09-15  Martin Baulig  <martin@ximian.com>
18330
18331         * class.cs (TypeContainer.DefineType): Added an error flag to
18332         avoid reporting duplicate CS0146's ("class definition is
18333         circular.").
18334
18335         * driver.cs (Driver.MainDriver): Abort if
18336         RootContext.ResolveTree() reported any errors.
18337
18338 2003-09-07  Martin Baulig  <martin@ximian.com>
18339
18340         * report.cs (Error, Warning): Added overloaded versions which take
18341         a `params object[] args' and call String.Format().
18342
18343 2003-09-07  Martin Baulig  <martin@ximian.com>
18344
18345         * decl.cs (DeclSpace..ctor): Don't call
18346         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
18347         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
18348         (DeclSpace.RecordDecl): New method.
18349
18350         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
18351
18352 2003-09-02  Ravi Pratap  <ravi@ximian.com>
18353
18354         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18355         value attributes to be applied to ParameterBuilders.
18356
18357         * class.cs (MethodCore.LabelParameters): Make static and more
18358         generic so that it can be used from other places - like interface
18359         methods, for instance.
18360
18361         * interface.cs (Interface.Emit): Call LabelParameters before
18362         emitting attributes on the InterfaceMethod.
18363
18364 2003-08-26  Martin Baulig  <martin@ximian.com>
18365
18366         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
18367         resolving aliases; fixes #47927.
18368
18369 2003-08-26  Martin Baulig  <martin@ximian.com>
18370
18371         * statement.cs (Using.DoResolve): This is internally emitting a
18372         try/finally clause, so we need to set ec.NeedExplicitReturn if we
18373         do not always return.  Fixes #47681.
18374
18375 2003-08-26  Martin Baulig  <martin@ximian.com>
18376
18377         * decl.cs (MemberCore): Moved WarningNotHiding(),
18378         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
18379         into MemberBase.
18380         (AdditionResult): Make this nested in DeclSpace.
18381         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
18382         argument; call NamespaceEntry.Define() unless we're nested in a
18383         class or struct.
18384
18385         * namespace.cs (Namespace.DefineName): New public function.  This
18386         is called from DeclSpace's .ctor to add 
18387         (Namespace.Lookup): Include DeclSpaces in the lookup.
18388
18389         * class.cs (Operator): Derive from MemberBase, not MemberCore.
18390
18391         * const.cs (Const): Derive from MemberBase, not MemberCore.     
18392
18393 2003-08-25  Martin Baulig  <martin@ximian.com>
18394
18395         * convert.cs (Convert.ExplicitReferenceConversion): When
18396         converting from an interface type to a class, unbox if the target
18397         type is a struct type.  Fixes #47822.
18398
18399 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18400
18401         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
18402         #47854.
18403
18404 2003-08-22  Martin Baulig  <martin@ximian.com>
18405
18406         * class.cs (TypeManager.DefineType): When defining a nested type,
18407         call DefineType() on our parent; fixes #47801.
18408
18409 2003-08-22  Martin Baulig  <martin@ximian.com>
18410
18411         * class.cs (MethodData.Define): While checking if a method is an
18412         interface implementation, improve the test a bit more to fix #47654.
18413
18414 2003-08-22  Martin Baulig  <martin@ximian.com>
18415
18416         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
18417         correctly; fixes #47722.
18418
18419 2003-08-22  Martin Baulig  <martin@ximian.com>
18420
18421         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
18422         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
18423
18424         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
18425
18426 2003-08-22  Martin Baulig  <martin@ximian.com>
18427
18428         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
18429         can only be assigned in static constructors.  Fixes #47161.
18430
18431 2003-08-22  Martin Baulig  <martin@ximian.com>
18432
18433         Rewrote and improved the flow analysis code.
18434
18435         * flowbranching.cs (FlowBranching): Make this class abstract.
18436         (FlowBranching.CreateBranching): New static function to create a
18437         new flow branching.
18438         (FlowBranchingBlock, FlowBranchingException): New classes.
18439         (FlowBranching.UsageVector.Type): New public readonly field.
18440         (FlowBranching.UsageVector.Breaks): Removed the setter.
18441         (FlowBranching.UsageVector.Returns): Removed the setter.
18442         (FlowBranching.UsageVector): Added Break(), Return(),
18443         NeverReachable() and Throw() methods to modify the reachability.
18444         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
18445         done by FlowBranching.Merge().
18446         (FlowBranching.UsageVector.MergeChild): New method; merges the
18447         merge result into the current vector.
18448         (FlowBranching.Merge): New abstract method to merge a branching.
18449
18450 2003-08-12  Martin Baulig  <martin@ximian.com>
18451
18452         * expression.cs (Indirection.CacheTemporaries): Create the
18453         LocalTemporary with the pointer type, not its element type.
18454
18455 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
18456
18457         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
18458         token was a keyword or not.
18459
18460         Add `error' options where an IDENTIFIER was expected;  Provide
18461         CheckToken and CheckIdentifierToken convenience error reporting
18462         functions. 
18463
18464         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
18465
18466         * decl.cs: Rename `NamespaceEntry Namespace' public field into
18467         NameSpaceEntry NameSpaceEntry.
18468
18469         (LookupInterfaceOrClass): Avoid creating a full qualified name
18470         from namespace and name: avoid doing lookups when we know the
18471         namespace is non-existant.   Use new Tree.LookupByNamespace which
18472         looks up DeclSpaces based on their namespace, name pair.
18473
18474         * driver.cs: Provide a new `parser verbose' to display the
18475         exception thrown during parsing.  This is turned off by default
18476         now, so the output of a failure from mcs is more graceful.
18477
18478         * namespace.cs: Track all the namespaces defined in a hashtable
18479         for quick lookup.
18480
18481         (IsNamespace): New method
18482
18483 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
18484
18485         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
18486         we know that we need to concatenate (full typename can never be
18487         null). 
18488
18489         * class.cs: ditto.
18490
18491         * statement.cs: Use a bitfield;  Do not initialize to null things
18492         which are done by the constructor by default.
18493
18494         * cs-parser.jay: bug fix, parameter was 4, not 3.
18495
18496         * expression.cs: Just use the property;
18497
18498         * statement.cs: No need for GetVariableInfo method.
18499
18500 2003-08-08  Martin Baulig  <martin@ximian.com>
18501
18502         * flowanalysis.cs (FlowReturns): This is now nested in the
18503         `FlowBranching' class.
18504         (MyBitVector): Moved this here from statement.cs.
18505         (FlowBranching.SiblingType): New enum type.
18506         (FlowBranching.CreateSibling): Added `SiblingType' argument.
18507
18508 2003-08-07  Martin Baulig  <martin@ximian.com>
18509
18510         * flowanalysis.cs (FlowBranchingType): This is now nested in the
18511         `FlowBranching' class and called `BranchingType'.
18512
18513 2003-08-07  Martin Baulig  <martin@ximian.com>
18514
18515         * flowanalysis.cs: Moved all the control flow analysis code into
18516         its own file.
18517
18518 2003-08-07  Martin Baulig  <martin@ximian.com>
18519
18520         * assign.cs (Assign.DoResolve): `target' must either be an
18521         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
18522         #37319.
18523
18524 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
18525
18526         * expression.cs (BinaryMethod): This kind of expression is created by the
18527         Binary class if it determines that the operator has to be handled
18528         by a method.
18529
18530         (BinaryDelegate): This kind of expression is created if we are
18531         dealing with a + or - operator on delegates.
18532
18533         (Binary): remove method, argumetns, and DelegateOperator: when
18534         dealing with methods, 
18535
18536         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
18537
18538         * statement.cs (Block): use bitfields for the three extra booleans
18539         we had in use.   Remove unused topblock parameter.
18540
18541         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
18542
18543         * assign.cs: Drop extra unneeded tests.
18544
18545 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
18548
18549         * statement.cs (Foreach): Use VariableStorage instead of
18550         LocalBuilders.   
18551
18552         * codegen.cs (VariableStorage): New class used by clients that
18553         require a variable stored: locals or fields for variables that
18554         need to live across yield.
18555
18556         Maybe provide a convenience api for EmitThis+EmitLoad?
18557
18558         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
18559         these bad boys.
18560
18561 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
18562
18563         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
18564         RemapParameterLValue): New methods that are used to turn a
18565         precomputed FieldInfo into an expression like this:
18566
18567                 instance.FieldInfo
18568
18569         The idea is to use this instead of making LocalVariableReference
18570         have more than one meaning.
18571
18572         * cs-parser.jay: Add error production to BASE.
18573
18574         * ecore.cs: Deal with TypeManager.GetField returning null, which
18575         is now a valid return value.
18576
18577         (FieldExprNoAddress): New expression for Fields whose address can
18578         not be taken.
18579
18580         * expression.cs (LocalVariableReference): During the resolve
18581         phases, create new expressions if we are in a remapping context.
18582         Remove code that dealt with remapping here.
18583
18584         (ParameterReference): same.
18585
18586         (ProxyInstance): New expression, like the `This' expression, but
18587         it is born fully resolved.  We know what we are doing, so remove
18588         the errors that are targeted to user-provided uses of `this'.
18589
18590         * statement.cs (Foreach): our variable is now stored as an
18591         Expression;  During resolution, follow the protocol, dont just
18592         assume it will return this.
18593
18594 2003-08-06  Martin Baulig  <martin@ximian.com>
18595
18596         * support.cs (SeekableStreamReader.cs): New public class.
18597
18598         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
18599         SeekableStreamReader instead of the normal StreamReader.
18600
18601 2003-08-04  Martin Baulig  <martin@ximian.com>
18602
18603         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
18604         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
18605         deambiguate casts and delegate invocations.
18606         (parenthesized_expression): Use the new tokens to ensure this is
18607         not a cast of method invocation.
18608
18609         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
18610         when reading a `)' and Deambiguate_CloseParens () was previously
18611         called.
18612
18613         * expression.cs (ParenthesizedExpression): New class.  This is
18614         just used for the CS0075 test.
18615         (Binary.DoResolve): Check for CS0075.   
18616
18617 2003-07-29  Ravi Pratap  <ravi@ximian.com>
18618
18619         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
18620         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
18621         reference comparison.
18622
18623         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
18624         examine the ReturnType for equality - this is necessary in the
18625         cases of implicit and explicit operators whose signature also
18626         includes the return type.
18627
18628 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * namespace.cs: Cache the result of the namespace computation,
18631         instead of computing it every time.
18632
18633 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * decl.cs: Use a global arraylist that we reuse over invocations
18636         to avoid excesive memory consumption.  Reduces memory usage on an
18637         mcs compile by one meg (45 average).
18638
18639         * typemanager.cs (LookupTypeReflection): In .NET pointers are
18640         private, work around that.
18641
18642 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * literal.cs (IntLiteral): Define Zero and One static literals. 
18645
18646         * cs-parser.jay (integer_literal): use static literals to reduce
18647         memory usage for the most used literals (0, 1 and -1).  211kb
18648         reduced in memory usage.
18649
18650         Replace all calls to `new ArrayList' with `new
18651         ArrayList(4)' which is a good average number for most allocations,
18652         and also requires only 16 bytes of memory for its buffer by
18653         default. 
18654
18655         This reduced MCS memory usage in seven megabytes for the RSS after
18656         bootstrapping.
18657
18658 2003-07-28  Ravi Pratap  <ravi@ximian.com>
18659
18660         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
18661         handle params methods the correct way by forming only one
18662         applicable set with params and normal methods in them. Earlier we
18663         were looking at params methods only if we found no normal methods
18664         which was not the correct thing to do.
18665
18666         (Invocation.BetterFunction): Take separate arguments indicating
18667         when candidate and the best method are params methods in their
18668         expanded form.
18669
18670         This fixes bugs #43367 and #46199.
18671
18672         * attribute.cs: Documentation updates.
18673
18674         (CheckAttribute): Rename to CheckAttributeTarget.
18675         (GetValidPlaces): Rename to GetValidTargets.
18676
18677         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
18678         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
18679
18680         Fixes bug #44468.
18681
18682 2003-07-28  Martin Baulig  <martin@ximian.com>
18683
18684         * class.cs (TypeContainer.DefineMembers): Use the base type's full
18685         name when looking up the base class of a nested class.  Fixes #46977.
18686
18687 2003-07-26  Martin Baulig  <martin@ximian.com>
18688
18689         * expression.cs (Indexers.Indexer): New nested struct; contains
18690         getter, setter and the indexer's type.
18691         (Indexers.Properties): This is now an ArrayList of
18692         Indexers.Indexer's.
18693         (IndexerAccess.DoResolveLValue): Correctly set the type if the
18694         indexer doesn't have any getters.
18695
18696         * assign.cs (Assign.DoResolve): Also do the implicit conversions
18697         for embedded property and indexer assignments.
18698
18699 2003-07-26  Martin Baulig  <martin@ximian.com>
18700
18701         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
18702         preprocessor directive is not the first non-whitespace character
18703         on a line.
18704
18705 2003-07-26  Martin Baulig  <martin@ximian.com>
18706
18707         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
18708         namespace parsing, follow the spec more closely.
18709
18710         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
18711         NamespaceEntry.Lookup().
18712
18713 2003-07-25  Martin Baulig  <martin@ximian.com>
18714
18715         * MethodCore.cs (OverridesSomething): New public field; it's set
18716         from TypeContainer.DefineMembers if this method overrides
18717         something (which doesn't need to be a method).  Fix #39462.
18718
18719 2003-07-25  Ravi Pratap  <ravi@ximian.com>
18720
18721         * typemanager.cs (GetMembers): Ensure that the list of members is
18722         reversed. This keeps things in sync.
18723
18724         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
18725         find an AttributeUsage attribute.
18726
18727         * expression.cs (Invocation.OverloadResolve): Perform the check
18728         which disallows Invoke to be directly called on a Delegate.
18729
18730         (Error_InvokeOnDelegate): Report error cs1533.
18731
18732 2003-07-25  Martin Baulig  <martin@ximian.com>
18733
18734         * expression.cs (Indexers.GetIndexersForType): Only look in the
18735         interface hierarchy if the requested type is already an
18736         interface.  Fixes #46788 while keeping #46502 fixed.
18737
18738 2003-07-25  Martin Baulig  <martin@ximian.com>
18739
18740         * class.cs (TypeContainer.DefineMembers): Check whether all
18741         readonly fields have been assigned and report warning CS0649 if
18742         not.
18743
18744         * statement.cs (LocalInfo.IsFixed): Always return true if this is
18745         a valuetype.
18746
18747 2003-07-24  Ravi Pratap  <ravi@ximian.com>
18748
18749         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
18750         returned from GetMethods to make things consistent with the
18751         assumptions MCS makes about ordering of methods.
18752
18753         This should comprehensively fix bug #45127 and it does :-)
18754
18755         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
18756         ordering is actually reverse.
18757
18758         * Clean up some debug messages I left lying around.
18759
18760         * interface.cs (Populate*): Get rid of code which emits attributes
18761         since the stage in which we emit attributes is the 'Emit' stage,
18762         not the define stage.
18763
18764         (Emit): Move attribute emission for interface members here.
18765
18766 2003-07-22  Ravi Pratap  <ravi@ximian.com>
18767
18768         * expression.cs (Invocation.OverloadResolve): Follow the spec more
18769         closely: we eliminate methods in base types when we have an
18770         applicable method in a top-level type.
18771
18772         Please see section 14.5.5.1 for an exact description of what goes
18773         on. 
18774
18775         This fixes bug #45127 and a host of other related to corlib compilation.
18776
18777         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
18778         array is the method corresponding to the top-level type (this is
18779         because of the changes made to icall.c) so we change this
18780         accordingly.
18781
18782         (MethodGroupExpr.Name): This too.
18783
18784         * typemanager.cs (GetElementType): New method which does the right
18785         thing when compiling corlib. 
18786
18787         * everywhere: Make use of the above in the relevant places.
18788
18789 2003-07-22  Martin Baulig  <martin@ximian.com>
18790
18791         * cs-parser.jay (invocation_expression): Moved
18792         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
18793         `cast_expression', but create a InvocationOrCast which later
18794         resolves to either an Invocation or a Cast.
18795
18796         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
18797         method; call this before EmitStatement() to make sure that this
18798         expression can be used as a statement.
18799
18800         * expression.cs (InvocationOrCast): New class; resolves to either
18801         an Invocation or a Cast.
18802
18803         * statement.cs (StatementExpression): Call ResolveStatement() on
18804         the ExpressionStatement before emitting it.
18805
18806 2003-07-21  Martin Baulig  <martin@ximian.com>
18807
18808         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
18809         `ref' and `out' attributes match; fixes #46220.
18810         (MemberAccess.ResolveMemberAccess): You can't reference a type
18811         through an expression; fixes #33180.
18812         (Indexers.GetIndexersForType): Don't return the indexers from
18813         interfaces the class implements; fixes #46502.
18814
18815 2003-07-21  Martin Baulig  <martin@ximian.com>
18816
18817         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
18818         CS0661 checks; fixes bug #30442.
18819
18820 2003-07-21  Martin Baulig  <martin@ximian.com>
18821
18822         * decl.cs (AdditionResult): Added `Error'.
18823
18824         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
18825
18826         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
18827         makes cs0031.cs actually work.
18828
18829 2003-07-20  Martin Baulig  <martin@ximian.com>
18830
18831         * namespace.cs: Fixed that bug which caused a crash when compiling
18832         the debugger's GUI.
18833
18834 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * typemanager.cs (LookupTypeReflection): Never expose types which
18837         are NotPublic, NestedPrivate, NestedAssembly, or
18838         NestedFamANDAssem.  We used to return these, and later do a check
18839         that would report a meaningful error, but the problem is that we
18840         would not get the real match, if there was a name override.
18841
18842 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
18843
18844         * namespace.cs (Namespace, Name): Do not compute the namespace
18845         name dynamically, compute it in the constructor.  This reduced
18846         memory usage by 1697 KB.
18847
18848         * driver.cs: Use --pause to pause at the end.
18849
18850 2003-07-17  Peter Williams  <peter@newton.cx>
18851
18852         * Makefile: Change the name of the test target so that it doesn't
18853         conflict with the recursive test target.
18854
18855 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
18856
18857         * expression.cs (LocalVariableReference.Emit, EmitAssign,
18858         AddressOf): Do not use EmitThis, that was wrong, use the actual
18859         this pointer.
18860
18861 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
18862
18863         * class.cs (MethodData.Define): While checking if a method is an
18864         interface implementation, improve the test: If we are not public
18865         (use new test here: use the computed MethodAttributes directly,
18866         instead of the parsed modifier flags) check if the `implementing'
18867         method comes from an interface or not.
18868
18869         * pending.cs (VerifyPendingMethods): Slightly better error
18870         message.
18871
18872         * makefile: add test target that does the mcs bootstrap.
18873
18874 2003-07-16  Ravi Pratap  <ravi@ximian.com>
18875
18876         * interface.cs (Define): Do nothing here since there are no
18877         members to populate etc. Move the attribute emission out of here
18878         since this was just totally the wrong place to put it. Attribute
18879         application happens during the 'Emit' phase, not in the 'Define'
18880         phase.
18881
18882         (Emit): Add this method and move the attribute emission here
18883
18884         * rootcontext.cs (EmitCode): Call the Emit method on interface
18885         types too.
18886
18887 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18888
18889         * expression.cs (OverloadResolve): Report error only if Location
18890         is not 'Null' which means that there was a probe going on.
18891
18892 2003-07-14  Martin Baulig  <martin@ximian.com>
18893
18894         * expression.cs (ConditionalLogicalOperator): New public class to
18895         implement user defined conditional logical operators.
18896         This is section 14.11.2 in the spec and bug #40505.
18897
18898 2003-07-14  Martin Baulig  <martin@ximian.com>
18899
18900         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
18901
18902 2003-07-14  Martin Baulig  <martin@ximian.com>
18903
18904         * codegen.cs (EmitContext.InFixedInitializer): New public field.
18905
18906         * ecore.cs (IVariable.VerifyFixed): New interface method.
18907
18908         * expression.cs (Unary.ResolveOperator): When resolving the `&'
18909         operator, check whether the variable is actually fixed.  Fixes bug
18910         #36055.  Set a variable definitely assigned when taking its
18911         address as required by the spec.
18912
18913         * statement.cs (LocalInfo.IsFixed): New field.
18914         (LocalInfo.MakePinned): Set `IsFixed' to true.
18915
18916 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
18917
18918         * attribute.cs (Attribute.Resolve): While doing a Member lookup
18919         for .ctors, ensure that we only ask for members declared in the
18920         attribute type (BindingFlags.DeclaredOnly).
18921
18922         Fixes bug #43632.
18923
18924         * expression.cs (Error_WrongNumArguments): Report error 1501
18925         correctly the way CSC does.
18926
18927 2003-07-13  Martin Baulig  <martin@ximian.com>
18928
18929         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
18930         lookup on the fully qualified name, to make things like "X.X" work
18931         where "X.X" is a fully qualified type name, but we also have a
18932         namespace "X" in the using list.  Fixes #41975.
18933
18934 2003-07-13  Martin Baulig  <martin@ximian.com>
18935
18936         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
18937         function. If we're a CompoundAssign, we need to create an embedded
18938         CompoundAssign, not an embedded Assign.
18939         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
18940         Fixes #45854.
18941
18942 2003-07-13  Martin Baulig  <martin@ximian.com>
18943
18944         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
18945         work to fix bug #46088.
18946
18947 2003-07-13  Ravi Pratap <ravi@ximian.com>
18948
18949         * class.cs (Operator.Emit): Do not emit attributes here - it is
18950         taken care of by the Method class that we delegate too. This takes
18951         care of bug #45876.
18952
18953 2003-07-10  Martin Baulig  <martin@ximian.com>
18954
18955         * expression.cs (TypeOfVoid): New class.
18956         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
18957
18958 2003-07-10  Martin Baulig  <martin@ximian.com>
18959
18960         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
18961         bug #35957.
18962
18963 2003-07-10  Martin Baulig  <martin@ximian.com>
18964
18965         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
18966         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
18967
18968         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
18969
18970         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
18971
18972 2003-07-10  Martin Baulig  <martin@ximian.com>
18973
18974         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
18975         of decimal.  Fixes #42850.
18976
18977         NOTE: I also fixed the created byte blob, but this doesn't work on
18978         the MS runtime and csc never produces any byte blobs for decimal
18979         arrays.
18980
18981 2003-07-10  Martin Baulig  <martin@ximian.com>
18982
18983         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
18984         structs; fixes #32068.
18985         (Block.AddChildVariableNames): Fixed #44302.
18986
18987 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18988
18989         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
18990
18991 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
18992
18993         * attribute.cs: And this test is onger needed.
18994
18995 2003-07-08  Martin Baulig  <martin@ximian.com>
18996
18997         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
18998         inaccessible types.  Fixes #36313.
18999
19000         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19001
19002         * namespace.cs (NamespaceEntry): Create implicit entries for all
19003         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19004         implicit entries for N1.N2 and N1.
19005
19006 2003-07-08  Martin Baulig  <martin@ximian.com>
19007
19008         Rewrote the handling of namespaces to fix a lot of the issues
19009         wrt. `using' aliases etc.
19010
19011         * namespace.cs (Namespace): Splitted this class into a
19012         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19013
19014         * typemanager.cs (TypeManager.IsNamespace): Removed.
19015         (TypeManager.ComputeNamespaces): Only compute namespaces from
19016         loaded assemblies here, not the namespaces from the assembly we're
19017         currently compiling.
19018
19019 2003-07-08  Martin Baulig  <martin@ximian.com>
19020
19021         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19022
19023 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19024
19025         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19026         already fixed it.  
19027
19028         I thought about the memory savings here, but LookupTypeReflection
19029         is used under already very constrained scenarios.  Compiling
19030         corlib or mcs only exposes one hit, so it would not really reduce
19031         any memory consumption.
19032
19033 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19034
19035         * typemanager.cs: fixes bug #45889 by only adding public types from
19036         other assemblies to the list of known types.
19037
19038 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19039
19040         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19041         on the type we resolved.
19042
19043 2003-07-05  Martin Baulig  <martin@ximian.com>
19044
19045         * pending.cs (PendingImplementation.ParentImplements): Don't
19046         create the proxy if the parent is abstract.
19047
19048         * class.cs (TypeContainer.DefineIndexers): Process explicit
19049         interface implementations first.  Fixes #37714.
19050
19051 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19052
19053         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19054         defined recursively;  but since we modify the input parameters
19055         (left is set to `this' temporarily), we reset this value if the
19056         left_is_explicit is false, which gives the original semantics to
19057         the code.  
19058
19059         * literal.cs (NullPointer): new class used to represent a null
19060         literal in a pointer context.
19061
19062         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19063         type is a pointer, use a NullPointer object instead of a
19064         NullLiteral.   Closes 43687
19065
19066         (ExplicitConversion): Convert pointer values using
19067         the conv opcode to the proper type.
19068
19069         * ecore.cs (New): change ValueTypeVariable property into a method,
19070         that returns whether the valuetype is suitable for being used.
19071
19072         * expression.cs (Binary.DoNumericPromotions): Only return if we
19073         the int constant was a valid uint, and we can return both left and
19074         right as uints.  If not, we continue processing, to trigger the
19075         type conversion.  This fixes 39018.
19076
19077         * statement.cs (Block.EmitMeta): During constant resolution, set
19078         the CurrentBlock property on the emitcontext, so that we resolve
19079         constants propertly.
19080
19081 2003-07-02  Martin Baulig  <martin@ximian.com>
19082
19083         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19084         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19085
19086         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19087         than emitting it here.
19088
19089         * statement.cs: Fixed some more flow analysis bugs.
19090
19091 2003-07-02  Martin Baulig  <martin@ximian.com>
19092
19093         * class.cs (MethodData.Define): When implementing interface
19094         methods, set Final unless we're Virtual.
19095
19096         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19097         check work for interface methods.
19098
19099 2003-07-01  Martin Baulig  <martin@ximian.com>
19100
19101         * ecore.cs (EmitContext.This): Replaced this property with a
19102         GetThis() method which takes a Location argument.  This ensures
19103         that we get the correct error location for a CS0188.
19104
19105 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19106
19107         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19108         ImplicitStandardConversion.
19109
19110         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19111
19112 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19113
19114         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19115         optimization.
19116
19117 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19120         constructors.
19121
19122         (MethodData.Define): Turn off initlocals for unsafe methods.
19123
19124 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19125
19126         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19127         complete;  Fixes #37521.
19128
19129         * delegate.cs: Use Modifiers.TypeAttr to compute the
19130         TypeAttributes, instead of rolling our own.  This makes the flags
19131         correct for the delegates.
19132
19133 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * class.cs (Constructor.Define): Set the private flag for static
19136         constructors as well.
19137
19138         * cs-parser.jay (statement_expression): Set the return value to
19139         null, to avoid a crash when we catch an error.
19140
19141 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19142
19143         * cs-parser.jay: Applied patch from Jackson that adds support for
19144         extern and unsafe modifiers to destructor declarations.
19145
19146         * expression.cs: Report error 21 if the user is trying to index a
19147         System.Array.
19148
19149         * driver.cs: Add an error message, suggested by the bug report.
19150
19151         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19152         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19153
19154 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19155
19156         * namespace.cs: Add some information to reduce FAQs.
19157
19158 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19159
19160         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19161         underlying enumeration types.  Fixes #43915.
19162
19163         * expression.cs: Treat ushort/short as legal values to be used in
19164         bitwise operations.
19165
19166 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19167
19168         * delegate.cs: transfer custom attributes for paramenters from
19169         the delegate declaration to Invoke and BeginInvoke.
19170
19171 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19172
19173         * attribute.cs: handle custom marshalers and emit marshal info
19174         for fields, too.
19175
19176 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19177
19178         * makefile.gnu: Added anonymous.cs to the compiler sources.
19179
19180 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * iterators.cs: Change the name of the proxy class to include two
19183         underscores.
19184
19185         * cs-parser.jay: Update grammar to include anonymous methods.
19186
19187         * anonymous.cs: new file.
19188
19189 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19190
19191         * class.cs (Field.Define): Add missing test for pointers and
19192         safety. 
19193
19194 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19195
19196         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19197         we use the stobj opcode.
19198
19199         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19200         since it wasn't the correct fix. 
19201
19202         It still is puzzling that we are required to use stobj for IntPtr
19203         which seems to be a ValueType.
19204
19205 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19208         during regular simple name resolution.   Now, the trick is that
19209         instead of returning for processing the simplename, we do a
19210         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19211         contextual lookup type).   If a match is found, return that, if
19212         not, return for further composition.
19213
19214         This fixes long-standing 30485.
19215
19216         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19217         using the address to initialize an object, do an Stobj instead of
19218         using the regular Stelem.
19219
19220         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19221         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19222         Because if we are a BaseIndexerAccess that value will be true.
19223         Fixes 43643.
19224
19225         * statement.cs (GotoCase.Resolve): Return after reporting an
19226         error, do not attempt to continue. 
19227
19228         * expression.cs (PointerArithmetic.Emit): If our operand is a
19229         long, convert our constants to match the operand before
19230         multiplying.  Convert to I type before adding.   Fixes 43670.
19231
19232 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19233
19234         * enum.cs (ImplicitConversionExists) : Rename to
19235         ImplicitEnumConversionExists to remove ambiguity. 
19236
19237         * ecore.cs (NullCast): New type of cast expression class which
19238         basically is very similar to EmptyCast with the difference being
19239         it still is a constant since it is used only to cast a null to
19240         something else
19241         (eg. (string) null)
19242
19243         * convert.cs (ImplicitReferenceConversion): When casting a null
19244         literal, we return a NullCast.
19245
19246         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19247         should be around anymore.
19248
19249         The renaming (reported was slightly wrong). Corrections:
19250
19251         ConvertImplicitStandard -> ImplicitConversionStandard
19252         ConvertExplicitStandard -> ExplicitConversionStandard
19253
19254         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19255         before passing them in !
19256
19257         * convert.cs (ImplicitConversionStandard): When comparing for
19258         equal expr and target types, ensure that expr is not a
19259         NullLiteral.
19260
19261         In general, we must not be checking (expr_type ==
19262         target_type) in the top level conversion methods
19263         (ImplicitConversion, ExplicitConversion etc). This checking is
19264         done in the methods that they delegate to.
19265
19266 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19267
19268         * convert.cs: Move Error_CannotConvertType,
19269         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19270         ImplicitNumericConversion, ImplicitConversionExists,
19271         ImplicitUserConversionExists, StandardConversionExists,
19272         FindMostEncompassedType, FindMostSpecificSource,
19273         FindMostSpecificTarget, ImplicitUserConversion,
19274         ExplicitUserConversion, GetConversionOperators,
19275         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19276         TryImplicitIntConversion, Error_CannotConvertImplicit,
19277         ConvertImplicitRequired, ConvertNumericExplicit,
19278         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19279         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19280         its own file.
19281
19282         Perform the following renames:
19283
19284         StandardConversionExists -> ImplicitStandardConversionExists
19285         ConvertImplicit -> ImplicitConversion
19286         ConvertImplicitStandard -> ImplicitStandardConversion
19287         TryImplicitIntConversion -> ImplicitIntConversion
19288         ConvertImplicitRequired -> ImplicitConversionRequired
19289         ConvertNumericExplicit -> ExplicitNumericConversion
19290         ConvertReferenceExplicit -> ExplicitReferenceConversion
19291         ConvertExplicit -> ExplicitConversion
19292         ConvertExplicitStandard -> ExplicitStandardConversion
19293
19294 2003-05-19  Martin Baulig  <martin@ximian.com>
19295
19296         * statement.cs (TypeInfo.StructInfo): Made this type protected.
19297         (TypeInfo): Added support for structs having structs as fields.
19298
19299         * ecore.cs (FieldExpr): Implement IVariable.
19300         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
19301         VariableInfo for the field.
19302
19303 2003-05-18  Martin Baulig  <martin@ximian.com>
19304
19305         * expression.cs (This.DoResolve): Report a CS0027 if we're
19306         emitting a field initializer.
19307
19308 2003-05-18  Martin Baulig  <martin@ximian.com>
19309
19310         * expression.cs (This.ResolveBase): New public function.
19311         (This.DoResolve): Check for CS0188.
19312
19313         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
19314         This.Resolve().
19315
19316         * ecore.cs (MethodGroupExpr.DoResolve): Set the
19317         `instance_expression' to null if we don't have any non-static
19318         methods.
19319
19320 2003-05-18  Martin Baulig  <martin@ximian.com>
19321
19322         Reworked the way how local variables and parameters are handled by
19323         the flow analysis code.
19324
19325         * statement.cs (TypeInfo, VariableMap): New public classes.
19326         (VariableInfo): New public class.  This is now responsible for
19327         checking whether a variable has been assigned.  It is used for
19328         parameters and local variables.
19329         (Block.EmitMeta): Take the InternalParameters as argument; compute
19330         the layout of the flow vectors here.
19331         (Block.LocalMap, Block.ParameterMap): New public properties.
19332         (FlowBranching): The .ctor doesn't get the InternalParameters
19333         anymore since Block.EmitMeta() now computes the layout of the flow
19334         vector.
19335         (MyStructInfo): This class is now known as `StructInfo' and nested
19336         in `TypeInfo'; we don't access this directly anymore.
19337
19338         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
19339         property and removed IsAssigned(), IsFieldAssigned(),
19340         SetAssigned() and SetFieldAssigned(); we now call them on the
19341         VariableInfo so we don't need to duplicate this code everywhere.
19342
19343         * expression.cs (ParameterReference): Added `Block block' argument
19344         to the .ctor.
19345         (LocalVariableReference, ParameterReference, This): The new
19346         VariableInfo class is now responsible for all the definite
19347         assignment stuff.
19348
19349         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
19350         IsParameterAssigned, SetParameterAssigned): Removed.
19351
19352 2003-05-18  Martin Baulig  <martin@ximian.com>
19353
19354         * typemanager.cs (InitCoreTypes): Try calling
19355         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
19356         the 3-args-version.  Corlib now also needs our `void_type'.
19357         (GetMethod): Added overloaded version which takes an optional
19358         `bool report_errors' to allow lookups of optional methods.
19359
19360 2003-05-12  Martin Baulig  <martin@ximian.com>
19361
19362         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
19363         only used for locals and not for parameters.
19364
19365 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
19366
19367         * support.cs (InternalParameters.ParameterType): Return the
19368         ExternalType of the parameter.
19369
19370         * parameter.cs (Parameter.ExternalType): drop the two arguments,
19371         they were unused.
19372
19373 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * class.cs (MethodData.Define): Do not set the `newslot' on
19376         interface members, if they are also flagged as "override".
19377
19378         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
19379         better code for ++i and i++.  This only works for static fields
19380         and local variables.
19381
19382         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
19383         want to pull the DeclSpace out of the builder_to_declspace instead
19384         of the TypeBuilder (like in TypeContainer.FindMembers).
19385
19386         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
19387         instead of LookupTypeContainer.  Fixes the crash on .NET for
19388         looking up interface members.
19389
19390         * const.cs: Create our own emit context during the Definition
19391         stage, so that constants are evaluated in the proper context, when
19392         a recursive definition happens.
19393
19394 2003-05-11  Martin Baulig  <martin@ximian.com>
19395
19396         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
19397         new block for a switch section.
19398         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
19399         the adding/lookup in the switch block.  Fixes #39828.
19400
19401 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
19402
19403         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
19404         functionality: I needed to convert the data after I had performed
19405         the add/sub operation into the operands type size.
19406
19407         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
19408         pass the type for the box operation, otherwise the resulting
19409         object would have been of type object.
19410
19411         (BoxedCast): Add constructor to specify the type to box as.
19412
19413 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * iterators.cs: I was reusing the `count' variable inadvertently,
19416         take steps to not allow this to happen.
19417
19418 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
19419
19420         * attribute.cs (Attribute.Resolve): Params attributes are encoded
19421         by creating an array at the point where the params starts and
19422         putting all those arguments there, then adjusting the size of the
19423         array.
19424
19425 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * expression.cs (New.AddressOf): Implement interface
19428         IMemoryLocation.  This is used when the `new' operator is used in
19429         the context of an invocation to a method on a value type.
19430
19431         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
19432         example. 
19433
19434         * namespace.cs: Also check the using aliases here.
19435
19436         * driver.cs: Move the test for using validity after the types have
19437         been entered, so we do a single pass that also includes the using
19438         aliases. 
19439
19440         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
19441         in the regular case.   CreateSiblingForFinally is doing extra
19442         error checking.
19443
19444         * attribute.cs (GetAttributeArgumentExpression): Store the result
19445         on an out value, and use the return value to indicate failure
19446         instead of using null (which is a valid return for Constant.GetValue).
19447
19448         * statement.cs: Perform the analysis flow for the increment
19449         portion after the statement, because this will be the real flow of
19450         execution.  Fixes #42385
19451
19452         * codegen.cs (EmitContext.EmitArgument,
19453         EmitContext.EmitStoreArgument): New helper functions when the
19454         RemapToProxy flag is set.
19455
19456         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
19457         function.
19458
19459         Add support for remapping parameters. 
19460
19461         * iterators.cs: Propagate parameter values;  Store parameter
19462         values in the proxy classes.
19463
19464 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
19467         need a proxy reference;  I do not know what I was thinking
19468
19469         * cs-parser.jay (constructor_initializer): catch another error,
19470         and display nice message.
19471
19472         (field_declaration): catch void field declaration
19473         to flag a better error. 
19474
19475         * class.cs (MemberBase.CheckBase): Report an error instead of a
19476         warning if a new protected member is declared in a struct. 
19477         (Field.Define): catch the error of readonly/volatile.
19478
19479         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
19480
19481         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
19482         volatile variable is taken
19483
19484 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
19485
19486         * statement.cs (Fixed.Resolve): Report an error if we are not in
19487         an unsafe context.
19488
19489 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * typemanager.cs: reuse the code that handles type clashes for
19492         delegates and enumerations.
19493
19494         * class.cs (Report28): Always report.
19495
19496         * expression.cs (EncodeAsAttribute): Allow nulls here.
19497
19498 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
19501         the functionality for testing whether an expression is valid for
19502         an attribute here.  Also handle the case of arrays of elements
19503         being stored. 
19504
19505         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
19506         encoding a linear array into an array of objects that are suitable
19507         to be passed to an CustomAttributeBuilder.
19508
19509         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
19510
19511         * ecore.cs: (FieldExpr): Handle field remapping here.
19512
19513         * iteratators.cs: Pass the instance variable (if the method is an
19514         instance method) to the constructors, so we can access the field
19515         variables on the class.
19516
19517         TODO: Test this with structs.  I think the THIS variable on
19518         structs might have to be a pointer, and not a refenrece
19519
19520 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
19521
19522         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
19523         local variables to fields in a proxy class.
19524
19525         * iterators.cs (PopulateProxy): Rename our internal fields to
19526         <XXX>.  
19527         Create a <THIS> field if we are an instance method, so we can
19528         reference our parent container variables.
19529         (MapVariable): Called back from the EmitContext code to enter a
19530         new variable to field mapping into the proxy class (we just create
19531         a FieldBuilder).
19532
19533         * expression.cs
19534         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
19535         for using the remapped locals to fields.
19536
19537         I placed the code here, because that gives the same semantics to
19538         local variables, and only changes the Emit code.
19539
19540         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
19541         statements inside iterators.
19542         (VariableInfo): Add a FieldBuilder for the cases when we are
19543         remapping local variables to fields in a proxy class
19544
19545         * ecore.cs (SimpleNameResolve): Avoid testing two times for
19546         current_block != null.
19547
19548         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
19549         not cope with strings, as it has been moved to the
19550         TableSwitchEmit.  Fixed bug in switch generation.
19551
19552         * expression.cs (New.DoResolve): Provide more context for the user
19553         when reporting an error.
19554
19555         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
19556         pointers. 
19557
19558         * expression.cs (MemberAccess.DoResolve): When we get a type back,
19559         check the permissions for it.  Note than in a type-resolution
19560         context the check was already present in DeclSpace.ResolveType,
19561         but was missing from the MemberAccess.
19562
19563         (ArrayCreation.CheckIndices): warn if the user has
19564         more nested levels of expressions, but there are no more
19565         dimensions specified.  Avoids crash on bug 41906.
19566
19567 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * statement.cs (Block): replace Implicit bool, for a generic
19570         flags.   
19571         New flag: `Unchecked'.  This is used during the EmitMeta phase
19572         (which is out-of-line with the regular Resolve/Emit process for a
19573         statement, as this is done ahead of time, but still gets a chance
19574         to call constant resolve).
19575
19576         (Block.Flags): new enum for adding a new flag.
19577
19578         (Block.EmitMeta): track the state of unchecked.
19579
19580         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
19581         to enable constant resolution to work there as well.
19582
19583 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * typemanager.cs (ienumerable_type): Also look up
19586         System.Collections.IEnumerable. 
19587
19588 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
19589
19590         TODO: Test more than one conditional per method.
19591
19592         * class.cs (Indexer.Define): Report the location where the user is
19593         referencing the unsupported feature.
19594
19595         (MethodData): Overload the use of `conditionals' to
19596         minimize the creation of needless ArrayLists.   This saves roughly
19597         212kb on my machine.
19598
19599         (Method): Implement the new IIteratorContainer interface.
19600         (Method.SetYields): Implement the method by setting the ModFlags
19601         to contain METHOD_YIELDS.
19602
19603         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
19604         which just got set to null.
19605
19606         * iterators.cs: New file.
19607
19608         (Yield, YieldBreak): New statements.
19609
19610         * statement.cs (Return.Resolve): Flag an error if we are used in
19611         an iterator method.
19612
19613         * codegen.cs (InIterator): New flag set if the code is being
19614         compiled in an iterator method.
19615
19616         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
19617         internal modifier, and we just use it to avoid adding extra
19618         fields, as this is seldom used.  
19619
19620         * cs-parser.jay: Add yield_statement (yield and yield break).
19621
19622         * driver.cs: New flag -v2 to turn on version 2 features. 
19623
19624         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
19625         hashtable when v2 is enabled.
19626
19627 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
19630         there is already a namespace defined with this name.
19631
19632         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
19633         people upgraded their corlibs.
19634
19635         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
19636         always use fully qualified types, no need to use the compiler
19637         front end.
19638
19639         (TypeManager.IsNamespace): Use binarysearch.
19640
19641         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
19642         AddDelegate): I did not quite use the new IsValid API properly: I
19643         have to pass the short-name and the fullname.  I was passing only
19644         the basename instead of the fullname sometimes. 
19645
19646         (TypeContainer.DefineType): call NamespaceClash.
19647
19648         * interface.cs (Interface.DefineType): use NamespaceClash before
19649         defining the type.
19650
19651         * delegate.cs (Delegate.DefineType): use NamespaceClash before
19652         defining the type.
19653
19654         * enum.cs: (Enum.DefineType): use NamespaceClash before
19655         defining the type.
19656
19657         * typemanager.cs (: 3-line patch that gives us some tasty 11%
19658         speed increase.  First, use the negative_hits cache when we get a
19659         negative.  Second, add the type with its full original name
19660         instead of the new . and + encoded name (reflection uses + to
19661         separate type from a nested type).  Use LookupTypeReflection
19662         directly which bypasses the type->name hashtable (that we already
19663         know does not contain the type.
19664
19665         * decl.cs (DeclSpace.ResolveTypeExpr): track the
19666         location/container type. 
19667
19668         * driver.cs: When passing utf8, use directly the UTF8Encoding.
19669
19670 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
19673
19674         * delegate.cs (NewDelegate.Resolve): Test whether an instance
19675         method is being referenced in the method group from a static
19676         context, and report error 120 if so.
19677
19678         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
19679         Error118. 
19680
19681         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
19682         is created, we create the A namespace).
19683
19684         * cs-parser.jay: A namespace also introduces a DeclarationFound.
19685         Fixes #41591
19686
19687 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
19690         invocation to ModuleBuilder.GetType with the same values will
19691         return a new type instance, so we need to cache its return
19692         values. 
19693
19694         * expression.cs (Binary.ResolveOperator): Only allow the compare
19695         operators on enums if they are of the same type.
19696
19697         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
19698         types of ValueType on their own case.  Before we were giving them
19699         the same treatment as objects.
19700
19701         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
19702         fullname.  Short name is used to compare against container name.
19703         Fullname is used to check against defined namespace names.
19704
19705         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
19706         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
19707
19708         (Method.CheckBase): Call parent.
19709         (MemberBase.CheckBase): Check for protected members on sealed
19710         classes.
19711         (PropertyBase.CheckBase): Call parent.
19712         (Field.Define): Call parent.
19713
19714         * report.cs: Negative error codes are now mapped to 8000 - code,
19715         so that the display is render more nicely.
19716
19717         * typemanager.cs: Do not use try/catch, instead report a regular
19718         error. 
19719
19720         (GetPointerType, GetReferenceType): These methods provide
19721         mechanisms to obtain the T* and T& from a T.  We had the code
19722         previously scattered around the code base, and it also used
19723         TypeManager.LookupType that would go through plenty of caches.
19724         This one goes directly to the type source.
19725
19726         In some places we did the Type.GetType followed by
19727         ModuleBuilder.GetType, but not in others, so this unifies the
19728         processing as well.
19729
19730         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
19731         statements now that we have namespace information.
19732
19733         * typemanager.cs (IsNamespace): New method, returns whether the
19734         string presented is a namespace or not.
19735
19736         (ComputeNamespaces): New public entry point, computes the list of
19737         available namespaces, using the GetNamespaces API call in Mono, or
19738         the slower version in MS.NET.   
19739
19740         Now before we start the semantic analysis phase, we have a
19741         complete list of namespaces including everything that the user has
19742         provided.
19743
19744         Deleted old code to cache namespaces in .nsc files.
19745
19746 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
19747
19748         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
19749         class/struct location definition Location for the implicit
19750         constructor location.
19751
19752         (Operator.Define): Use the location of the operator for the
19753         implicit Method definition.
19754
19755         (Constructor.Emit): use the constructor location for the implicit
19756         base initializer constructor.
19757
19758         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
19759         and the Expression class now contains two new methods:
19760
19761         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
19762         isolate type lookup from the rest of the resolution process.
19763
19764         Since we use Expressions to hold type definitions due to the way
19765         we parse the input we have historically overloaded Resolve to
19766         perform the Type lookups if a special flag is passed.  Now this is
19767         eliminated and two methods take their place. 
19768
19769         The differences in the two methods between xStep and xTerminal is
19770         that xStep is involved in our current lookup system that uses
19771         SimpleNames to compose a name, while xTerminal is used just to
19772         catch the case where the simplename lookup failed.
19773
19774 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
19775
19776         * expression.cs (ResolveMemberAccess): Remove redundant code.
19777         TypeExpr expressions are always born fully resolved.
19778
19779         * interface.cs (PopulateMethod): Do not lookup the types twice.
19780         We were doing it once during SemanticAnalysis and once during
19781         PopulateMethod.
19782
19783         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
19784         in local variable type definitions, were being returned as a
19785         SimpleName (we decomposed everything into a string), that is
19786         because primary_expression was being used instead of a type in the
19787         grammar (reduce/reduce conflicts).
19788
19789         The part that was wrong is that we converted the expression into a
19790         string (an oversimplification in one hand, compounded with primary
19791         expressions doing string concatenation).
19792
19793         So things like:
19794
19795         A.B.C [] x;
19796
19797         Would return "A.B.C[]" as a SimpleName.  This stopped things like
19798         using clauses from working on this particular context.  And a type
19799         was being matched directly against "A.B.C[]".
19800
19801         We now use the correct approach, and allow for ComposedCast to be
19802         part of the unary expression.  So the "A.B.C []" become a composed
19803         cast of "A.B.C" (as a nested group of MemberAccess with a
19804         SimpleName at the end) plus the rank composition "[]". 
19805
19806         Also fixes 35567
19807
19808 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
19811         for the access level checking.
19812
19813         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
19814         `TypeContainer container', because I kept getting confused when I
19815         was debugging this code.
19816
19817         * expression.cs (Indexers): Instead of tracking getters/setters,
19818         we now track them in parallel.  We create one arraylist less, but
19819         most importantly it is possible now for the LValue code to find a
19820         matching get for a set.
19821
19822         (IndexerAccess.DoResolveLValue): Update the code.
19823         GetIndexersForType has been modified already to extract all the
19824         indexers from a type.  The code assumed it did not.
19825
19826         Also make the code set the correct return type for the indexer.
19827         This was fixed a long time ago for properties, but was missing for
19828         indexers.  It used to be void_type.
19829
19830         (Binary.Emit): Test first for doubles instead of
19831         floats, as they are more common.
19832
19833         (Binary.EmitBranchable): Use the .un version of the branch opcodes
19834         when dealing with floats and the <=, >= operators.  This fixes bug
19835         #39314 
19836
19837         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
19838         to load the array value by emitting a load on the foreach variable
19839         type.  This was incorrect.  
19840
19841         We now emit the code to load an element using the the array
19842         variable type, and then we emit the conversion operator.
19843
19844         Fixed #40176
19845
19846 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
19847
19848         * attribute.cs: Avoid allocation of ArrayLists in the common case.
19849
19850 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
19853         test for protection before we test for signatures. 
19854
19855         (MethodSignature.ToString): implement.
19856
19857         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
19858         to the case where we reduced into a LongConstant.
19859
19860         * decl.cs (CheckAccessLevel): If the type is an array, we can not
19861         depend on whether the information is acurrate, because the
19862         Microsoft runtime will always claim that the array type is public,
19863         regardless of the real state.
19864
19865         If the type is a pointer, another problem happens: the type is
19866         reported as non-public in Microsoft.  
19867
19868         In both cases we have to call CheckAccessLevel recursively with
19869         the underlying type as the argument to be tested.
19870
19871 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
19872
19873         * assign.cs (Assign.Emit): If we are dealing with a compound
19874         assignment expression, we should use the code path that stores the
19875         intermediate result in a temporary value.  This fixes #40903.
19876
19877         *expression.cs (Indirection.ToString): Provide ToString method for
19878         debugging. 
19879
19880 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
19881
19882         * class.cs: Null out fields holding references to Block objects so
19883         they can be garbage collected.
19884
19885         * expression.cs (OverloadResolve): Remove unused local.
19886
19887 2003-04-07  Martin Baulig  <martin@ximian.com>
19888
19889         * codegen.cs (EmitContext.CurrentFile): New public field.
19890         (EmitContext.Mark): Use the CurrentFile to check whether the
19891         location is in the correct file.
19892         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
19893
19894 2003-04-07  Martin Baulig  <martin@ximian.com>
19895
19896         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
19897
19898         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
19899         location.  [FIXME: The location argument which gets passed to this
19900         method is sometimes wrong!]
19901
19902 2003-04-07  Nick Drochak <ndrochak@gol.com>
19903
19904         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
19905
19906 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
19907
19908         * expression.cs (Indirection.EmitAssign): We were using the
19909         temporary, but returning immediately instead of continuing the
19910         EmitAssing flow.
19911
19912 2003-04-06  Martin Baulig  <martin@ximian.com>
19913
19914         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
19915         if it's a nested child, but also deriving from the outer class.
19916         See test 190.cs.
19917
19918         * typemanager.cs (IsNestedChildOf): Make this work if it's a
19919         nested child, but also deriving from the outer class.  See
19920         test-190.cs.
19921         (FilterWithClosure): We may access private members of the outer
19922         class if we're a nested child and deriving from the outer class.
19923         (RealMemberLookup): Only set `closure_private_ok' if the
19924         `original_bf' contained BindingFlags.NonPublic.
19925
19926 2003-04-05  Martin Baulig  <martin@ximian.com>
19927
19928         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
19929
19930 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
19931
19932         * class.cs (Event.Define): Do not allow abstract events to have
19933         initializers. 
19934
19935 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
19936
19937         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
19938         block in event declarations.
19939
19940         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
19941         value type, get its address.
19942
19943         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
19944         leaving a class on the stack instead of a boolean value (int
19945         0/1).  Change the code so we compare against null, and then the
19946         result against zero.
19947
19948         * class.cs (TypeContainer.GetClassBases): We were checking for the
19949         parent class being sealed too late.
19950
19951         * expression.cs (Binary.Emit): For <= and >= when dealing with
19952         floating point values, use cgt.un and clt.un instead of cgt and
19953         clt alone.
19954
19955 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
19956
19957         * statement.cs: Apply the same optimization as MS: skip the 
19958         GetEnumerator returning an IEnumerator, and use the one returning a 
19959         CharEnumerator instead. This allows us to avoid the try-finally block 
19960         and the boxing.
19961
19962 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
19963
19964         * cs-parser.jay: Attributes cannot be applied to
19965                          namespaces. Fixes #40473
19966
19967 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19968
19969         * class.cs:
19970         (Add*): check if the name is valid using the full name for constants,
19971         fields, properties and events.
19972
19973 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
19974
19975         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
19976         char constants to be part of the enumeration.
19977
19978         * expression.cs (Conditional.DoResolve): Add support for operator
19979         true. Implements the missing functionality from 14.12
19980
19981         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
19982         operator true/false as required by the spec.
19983
19984         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
19985         implicit conversion to boolean.
19986
19987         * statement.cs (Statement.ResolveBoolean): A boolean expression is
19988         also one where the type implements `operator true'. 
19989
19990         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
19991         get an expression that will invoke operator true based on an
19992         expression.  
19993
19994         (GetConversionOperators): Removed the hack that called op_True
19995         here.  
19996
19997         (Expression.ResolveBoolean): Move this from Statement.
19998
19999 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * ecore.cs (FieldExpr): do not allow initialization of initonly
20002         fields on derived classes
20003
20004 2003-03-13  Martin Baulig  <martin@ximian.com>
20005
20006         * statement.cs (Block.Emit): Call ig.BeginScope() and
20007         ig.EndScope() when compiling with debugging info; call
20008         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20009
20010 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20011
20012         * expression.cs (Indexers): Do not construct immediately, allow
20013         for new members to be appended as we go.  Fixes 38143
20014
20015 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20016
20017         * expression.cs: save/restore context when resolving an unchecked
20018         expression.
20019
20020 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20021
20022         * cfold.cs: Catch division by zero in modulus operator during
20023         constant folding.
20024
20025 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * interface.cs (Interface.DefineMembers): Avoid defining members
20028         twice. 
20029
20030 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * driver.cs: handle the +/- options for -noconfig
20033
20034         * statement.cs (Unckeched.Resolve): Also track the state of
20035         unchecked in the Resolve phase.
20036
20037 2003-02-27  Martin Baulig  <martin@ximian.com>
20038
20039         * ecore.cs (Expression.MemberLookup): Don't create a
20040         MethodGroupExpr for something which is not a method.  Fixes #38291.
20041
20042 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20043
20044         * class.cs (MemberBase.CheckParameters): Also check that the type
20045         is unmanaged if it is a pointer.
20046
20047         * expression.cs (SizeOf.Resolve): Add location information.
20048
20049         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20050         a managed type is declared.
20051
20052         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20053         parameter modifiers as well.  Fixes bug 38606
20054
20055         * class.cs: Very sad.  Am backing out the speed up changes
20056         introduced by the ArrayList -> Array in the TypeContainer, as they
20057         were not actually that much faster, and introduced a bug (no error
20058         reports on duplicated methods).
20059
20060         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20061         source first, this will guarantee that we have a valid expression
20062         before calling in lower levels functions that will require a
20063         resolved object.  Then use this original_source in the
20064         target.ResolveLValue instead of the original source that was
20065         passed to us.
20066
20067         Another change.  Use target.Resolve instead of LValueResolve.
20068         Although we are resolving for LValues, we will let the Assign code
20069         take care of that (it will be called again from Resolve).  This
20070         basically allows code like this:
20071
20072         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20073         class Y { void A (X x) { x [0] += o; }
20074
20075         The problem was that the indexer was trying to resolve for
20076         set_Item (idx, object o) and never finding one.  The real set_Item
20077         was set_Item (idx, X).  By delaying the process we get the right
20078         semantics. 
20079
20080         Fixes bug 36505
20081
20082 2003-02-23  Martin Baulig  <martin@ximian.com>
20083
20084         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20085         while calling DoEmit ().
20086
20087         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20088         source files; if you use the #line directive inside a method, the
20089         compiler stops emitting line numbers for the debugger until it
20090         reaches the end of the method or another #line directive which
20091         restores the original file.
20092
20093 2003-02-23  Martin Baulig  <martin@ximian.com>
20094
20095         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20096
20097 2003-02-23  Martin Baulig  <martin@ximian.com>
20098
20099         * statement.cs (Block.AddChildVariableNames): We need to call this
20100         recursively, not just for our immediate children.
20101
20102 2003-02-23  Martin Baulig  <martin@ximian.com>
20103
20104         * class.cs (Event.Define): Always make the field private, like csc does.
20105
20106         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20107         actually work, fixes bug #37521.
20108
20109 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * delegate.cs: When creating the various temporary "Parameters"
20112         classes, make sure that we call the ComputeAndDefineParameterTypes
20113         on those new parameters (just like we do with the formal ones), to
20114         allow them to be resolved in the context of the DeclSpace.
20115
20116         This fixes the bug that Dick observed in Bugzilla #38530.
20117
20118 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20119
20120         * expression.cs (ResolveMemberAccess): When resolving a constant,
20121         do not attempt to pull a constant if the value was not able to
20122         generate a valid constant.
20123
20124         * const.cs (LookupConstantValue): Do not report more errors than required.
20125
20126 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20127
20128         * expression.cs: fixes bug #38328.
20129
20130 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * class.cs: Changed all the various members that can be part of a
20133         class from being an ArrayList to be an Array of the right type.
20134         During the DefineType type_list, interface_list, delegate_list and
20135         enum_list are turned into types, interfaces, delegates and enums
20136         arrays.  
20137
20138         And during the member population, indexer_list, event_list,
20139         constant_list, field_list, instance_constructor_list, method_list,
20140         operator_list and property_list are turned into their real arrays.
20141
20142         Although we could probably perform this operation earlier, for
20143         good error reporting we need to keep the lists and remove the
20144         lists for longer than required.
20145
20146         This optimization was triggered by Paolo profiling the compiler
20147         speed on the output of `gen-sample-program.pl' perl script. 
20148
20149         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20150         not crash in methods like MemberLookupFailed that use this field.  
20151
20152         This problem arises when the compiler fails to resolve a type
20153         during interface type definition for example.
20154
20155 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20158         inherit from System.Object, so we have to stop at null, not only
20159         when reaching System.Object.
20160
20161 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20162
20163         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20164         DeclaredOnly because the parent indexer might have had a different
20165         name, but did not loop until the top of the hierarchy was reached.
20166
20167         The problem this one fixes is 35492: when a class implemented an
20168         indexer from an interface, we were getting the interface method
20169         (which was abstract) and we were flagging an error (can not invoke
20170         abstract method).
20171
20172         This also keeps bug 33089 functioning, and test-148 functioning.
20173
20174         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20175         out if a method is special is to see if it is declared in a
20176         property or event, or whether it is one of the predefined operator
20177         names.   This should fix correctly #36804.
20178
20179 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20180
20181         The goal here is to remove the dependency on EmptyCast.Peel ().
20182         Killing it completely.
20183
20184         The problem is that currently in a number of places where
20185         constants are expected, we have to "probe" for an EmptyCast, and
20186         Peel, which is not the correct thing to do, as this will be
20187         repetitive and will likely lead to errors. 
20188
20189         The idea is to remove any EmptyCasts that are used in casts that
20190         can be reduced to constants, so we only have to cope with
20191         constants. 
20192
20193         This bug hunt was triggered by Bug 37363 and the desire to remove
20194         the duplicate pattern where we were "peeling" emptycasts to check
20195         whether they were constants.  Now constants will always be
20196         constants.
20197
20198         * ecore.cs: Use an enumconstant here instead of wrapping with
20199         EmptyCast.  
20200
20201         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20202         throwing me off.  By handling this we can get rid of a few hacks.
20203
20204         * statement.cs (Switch): Removed Peel() code.
20205
20206 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20207
20208         * class.cs: Location information for error 508
20209
20210         * expression.cs (New.DoResolve): Add a guard against double
20211         resolution of an expression.  
20212
20213         The New DoResolve might be called twice when initializing field
20214         expressions (see EmitFieldInitializers, the call to
20215         GetInitializerExpression will perform a resolve on the expression,
20216         and later the assign will trigger another resolution
20217
20218         This leads to bugs (#37014)
20219
20220         * delegate.cs: The signature for EndInvoke should contain any ref
20221         or out parameters as well.  We were not doing this in the past. 
20222
20223         * class.cs (Field.Define): Do not overwrite the type definition
20224         inside the `volatile' group.  Turns out that volatile enumerations
20225         were changing the type here to perform a validity test, which
20226         broke conversions. 
20227
20228 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20229
20230         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20231         and structs, we do not want to load the instance variable
20232
20233         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20234         enum_type has to be handled like an object reference (implicit
20235         conversions exists from this to object), but the regular IsClass
20236         and IsValueType tests will never return true for this one.
20237
20238         Also we use TypeManager.IsValueType instead of type.IsValueType,
20239         just for consistency with the rest of the code (this is only
20240         needed if we ever use the construct exposed by test-180.cs inside
20241         corlib, which we dont today).
20242
20243 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20244
20245         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20246         just InternalCall.
20247
20248 2003-02-09  Martin Baulig  <martin@ximian.com>
20249
20250         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20251         (Namespace.DefineNamespaces): New static public method; this is
20252         called when we're compiling with debugging to add all namespaces
20253         to the symbol file.
20254
20255         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20256         pass it to the Namespace's .ctor.
20257
20258         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20259         and MethodBase arguments; pass the namespace ID to the symwriter;
20260         pass the MethodBase instead of the token to the symwriter.
20261         (SymbolWriter.DefineNamespace): New method to add a namespace to
20262         the symbol file.
20263
20264 2003-02-09  Martin Baulig  <martin@ximian.com>
20265
20266         * symbolwriter.cs: New file.  This is a wrapper around
20267         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20268         methods here in near future.
20269
20270 2003-02-09  Martin Baulig  <martin@ximian.com>
20271
20272         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20273         ILGenerator.MarkSequencePoint() which are actually used by the
20274         symbol writer.
20275
20276 2003-02-09  Martin Baulig  <martin@ximian.com>
20277
20278         * location.cs (SourceFile): New public sealed class.  This
20279         contains the name and an index which is used in the location's token.
20280         (Location): Reserve an appropriate number of bits in the token for
20281         the source file instead of walking over that list, this gives us a
20282         really huge performance improvement when compiling with debugging.
20283
20284         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20285         `SourceFile' argument instead of a string.
20286         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20287         but don't parse/tokenize here, we need to generate the list of all
20288         source files before we do that.
20289         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20290         the files.
20291
20292         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
20293         instead of a string.
20294
20295         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
20296         of a string.
20297
20298 2003-02-09  Martin Baulig  <martin@ximian.com>
20299
20300         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
20301         filename on `#line default'.
20302
20303 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
20304
20305         * statement.cs: don't clear the pinned var when the fixed statement
20306         returns from the method (fixes bug#37752).
20307
20308 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
20309
20310         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
20311         to IsValueType.
20312
20313 2003-02-07  Martin Baulig  <martin@ximian.com>
20314
20315         * driver.cs: Removed the `--debug-args' command line argument.
20316
20317         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
20318         automatically by the AsssemblyBuilder.
20319         (CodeGen.InitializeSymbolWriter): We don't need to call any
20320         initialization function on the symbol writer anymore.  This method
20321         doesn't take any arguments.
20322
20323 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
20324
20325         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
20326         from referenced assemblies as well.
20327
20328 2003-02-02  Martin Baulig  <martin@ximian.com>
20329
20330         * class.cs (MethodData.Emit): Generate debugging info for external methods.
20331
20332 2003-02-02  Martin Baulig  <martin@ximian.com>
20333
20334         * class.cs (Constructor.Emit): Open the symbol writer before
20335         emitting the constructor initializer.
20336         (ConstructorInitializer.Emit): Call ec.Mark() to allow
20337         single-stepping through constructor initializers.
20338
20339 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
20340
20341         * class.cs: Handle error 549: do not allow virtual methods in
20342         sealed classes. 
20343
20344 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
20345
20346         * decl.cs: Check access levels when resolving types
20347
20348 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
20349
20350         * statement.cs: Add parameters and locals set in catch blocks that might 
20351         return to set vector
20352
20353 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
20354
20355         * class.cs (Operator): Set the SpecialName flags for operators.
20356
20357         * expression.cs (Invocation.DoResolve): Only block calls to
20358         accessors and operators on SpecialName methods.
20359
20360         (Cast.TryReduce): Handle conversions from char constants.
20361
20362
20363 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
20364
20365         * statement.cs: small memory and time optimization in FlowBranching.
20366
20367 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
20368
20369         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
20370         problem that the last fix but in the other sid (Set).
20371
20372         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
20373         access when there is no indexer in the hierarchy.
20374
20375 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
20376
20377         * class.cs: Combine some if statements.
20378
20379 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20380
20381         * driver.cs: fixed bug #37187.
20382
20383 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
20384
20385         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
20386         any indexer, it's needed to build a list with all the indexers in the
20387         hierarchy (AllGetters), else we have problems. Fixes #35653.
20388
20389 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
20390
20391         * class.cs (MethodData.Define): It is wrong for an interface
20392         implementation to be static in both cases: explicit and implicit.
20393         We were only handling this in one case.
20394
20395         Improve the if situation there to not have negations.
20396
20397         * class.cs (Field.Define): Turns out that we do not need to check
20398         the unsafe bit on field definition, only on usage.  Remove the test.
20399
20400 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20401
20402         * driver.cs: use assembly.Location instead of Codebase (the latest
20403         patch made mcs fail when using MS assemblies).
20404
20405 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
20406
20407         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
20408         get the path to *corlib.dll.
20409
20410 2003-01-21  Nick Drochak <ndrochak@gol.com>
20411
20412         * cs-tokenizer.cs:
20413         * pending.cs:
20414         * typemanager.cs: Remove compiler warnings
20415
20416 2003-01-20  Duncan Mak  <duncan@ximian.com>
20417
20418         * AssemblyInfo.cs: Bump the version number to 0.19.
20419
20420 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20421
20422         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
20423
20424 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
20425
20426         * class.cs (Constructor::Emit): Emit debugging info for constructors.
20427
20428 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * cs-parser.jay: Small fix: we were not comparing the constructor
20431         name correctly.   Thanks to Zoltan for the initial pointer.
20432
20433 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
20434
20435         * cs-tokenizer.cs: Set file name when specified with #line
20436
20437 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
20438
20439         * cs-parser.jay: Only perform the constructor checks here if we
20440         are named like the class;  This will help provider a better
20441         error.  The constructor path is taken when a type definition is
20442         not found, but most likely the user forgot to add the type, so
20443         report that rather than the constructor error.
20444
20445 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
20446
20447         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
20448         allocations.
20449
20450 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20451
20452         * cs-parser.jay: Add cleanup call.
20453
20454 2003-01-13  Duncan Mak  <duncan@ximian.com>
20455
20456         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
20457         consistent with other methods.
20458
20459 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
20460
20461         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
20462
20463 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
20464
20465         * attribute.cs: only set GuidAttr to true when we have a
20466         GuidAttribute.
20467
20468 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20469
20470         * ecore.cs:
20471         * expression.cs:
20472         * typemanager.cs: fixes to allow mcs compile corlib with the new
20473         Type.IsSubclassOf fix.
20474
20475 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * expression.cs (LocalVariableReference.DoResolve): Classify a
20478         constant as a value, not as a variable.   Also, set the type for
20479         the variable.
20480
20481         * cs-parser.jay (fixed_statement): take a type instead of a
20482         pointer_type, so we can produce a better error message later.
20483
20484         * statement.cs (Fixed.Resolve): Flag types that are not pointers
20485         as an error.  
20486
20487         (For.DoEmit): Make inifinite loops have a
20488         non-conditional branch back.
20489
20490         (Fixed.DoEmit): First populate the pinned variables, then emit the
20491         statement, then clear the variables.  Before I was emitting the
20492         code once for each fixed piece.
20493
20494
20495 2003-01-08  Martin Baulig  <martin@ximian.com>
20496
20497         * statement.cs (FlowBranching.MergeChild): A break in a
20498         SWITCH_SECTION does not leave a loop.  Fixes #36155.
20499
20500 2003-01-08  Martin Baulig  <martin@ximian.com>
20501
20502         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
20503         lives in the same number space than `param_map'.  Fixes #36154.
20504
20505 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * cs-parser.jay (constructor_declaration): Set the
20508         Constructor.ModFlags before probing for it.  This makes the
20509         compiler report 514, 515 and 132 (the code was there, but got
20510         broken). 
20511
20512         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
20513         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
20514         (GotoCase.Resolve): Set `Returns' to ALWAYS.
20515
20516 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
20517
20518         * enum.cs: create the enum static fields using the enum type.
20519
20520 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
20521
20522         * class.cs: don't try to create the ParamBuilder for the return
20523         type if it's not needed (and handle it breaking for the ms runtime
20524         anyway).
20525
20526 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
20527
20528         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
20529
20530 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
20531
20532         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
20533         the command.   This showed up while compiling the JANET source
20534         code, which used \r as its only newline separator.
20535
20536 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
20537
20538         * class.cs (Method.Define): If we are an operator (because it
20539         reuses our code), then set the SpecialName and HideBySig.  #36128
20540
20541 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
20544         exception, report error 120 `object reference required'.
20545
20546         * driver.cs: Add --pause option, used during to measure the size
20547         of the process as it goes with --timestamp.
20548
20549         * expression.cs (Invocation.DoResolve): Do not allow methods with
20550         SpecialName to be invoked.
20551
20552 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
20553
20554         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
20555         number before adding it.
20556
20557 2002-12-21  Ravi Pratap  <ravi@ximian.com>
20558
20559         * ecore.cs (StandardImplicitConversion): When in an unsafe
20560         context, we allow conversion between void * to any other pointer
20561         type. This fixes bug #35973.
20562
20563 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
20564
20565         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
20566         is not thrown when extensionless outputs are used 
20567
20568 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20569
20570         * rootcontext.cs: fixed compilation of corlib.
20571
20572 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * attribute.cs (Attributes.Contains): Add new method.
20575
20576         * class.cs (MethodCore.LabelParameters): if the parameter is an
20577         `out' parameter, check that no attribute `[In]' has been passed.
20578
20579         * enum.cs: Handle the `value__' name in an enumeration.
20580
20581 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
20582
20583         * decl.cs: Added special case to allow overrides on "protected
20584         internal" methods
20585
20586 2002-12-18  Ravi Pratap  <ravi@ximian.com>
20587
20588         * attribute.cs (Attributes.AddAttributeSection): Rename to this
20589         since it makes much more sense.
20590
20591         (Attributes.ctor): Don't require a Location parameter.
20592
20593         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
20594
20595         * attribute.cs (ApplyAttributes): Remove extra Location parameters
20596         since we already have that information per attribute.
20597
20598         * everywhere : make appropriate changes.
20599
20600         * class.cs (LabelParameters): Write the code which actually
20601         applies attributes to the return type. We can't do this on the MS
20602         .NET runtime so we flag a warning in the case an exception is
20603         thrown.
20604
20605 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * const.cs: Handle implicit null conversions here too.
20608
20609 2002-12-17  Ravi Pratap  <ravi@ximian.com>
20610
20611         * class.cs (MethodCore.LabelParameters): Remove the extra
20612         Type [] parameter since it is completely unnecessary. Instead
20613         pass in the method's attributes so that we can extract
20614         the "return" attribute.
20615
20616 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * cs-parser.jay (parse): Use Report.Error to flag errors instead
20619         of ignoring it and letting the compile continue.
20620
20621         * typemanager.cs (ChangeType): use an extra argument to return an
20622         error condition instead of throwing an exception.
20623
20624 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * expression.cs (Unary.TryReduce): mimic the code for the regular
20627         code path.  Perform an implicit cast in the cases where we can
20628         implicitly convert to one of the integral types, and then reduce
20629         based on that constant.   This fixes bug #35483.
20630
20631 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20632
20633         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
20634
20635 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20636
20637         * namespace.cs: fixed bug #35489.
20638
20639 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * class.cs: Remove some dead code.
20642
20643         * cs-parser.jay: Estimate the number of methods needed
20644         (RootContext.MethodCount);
20645
20646         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
20647         numbers instead of StringBuilders.
20648
20649         * support.cs (PtrHashtable): Add constructor with initial size;
20650         We can now reduce reallocations of the method table.
20651
20652 2002-12-10  Ravi Pratap  <ravi@ximian.com>
20653
20654         * attribute.cs (ApplyAttributes): Keep track of the emitted
20655         attributes on a per-target basis. This fixes bug #35413.
20656
20657 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
20658
20659         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
20660         default to the Windows 1252 encoding.
20661
20662         (UnixParseOption): Support version, thanks to Alp for the missing
20663         pointer. 
20664
20665         * AssemblyInfo.cs: Add nice assembly information.
20666
20667         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
20668         (bug 35169).
20669
20670         * cs-parser.jay: Allow a trailing comma before the close bracked
20671         in the attribute_section production.
20672
20673         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
20674         address of the instance was being taken, I will take this out,
20675         because we take the address of the object immediately here.
20676
20677 2002-12-09  Ravi Pratap  <ravi@ximian.com>
20678
20679         * typemanager.cs (AreMultipleAllowed): Take care of the most
20680         obvious case where attribute type is not in the current assembly -
20681         stupid me ;-)
20682
20683 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
20684
20685         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
20686         definitions, instead of doing that afterwards.  
20687
20688         Also we use a nice little hack, depending on the constructor, we
20689         know if we are a "composed" name or a simple name.  Hence, we
20690         avoid the IndexOf test, and we avoid 
20691
20692         * codegen.cs: Add code to assist in a bug reporter to track down
20693         the source of a compiler crash. 
20694
20695 2002-12-07  Ravi Pratap  <ravi@ximian.com>
20696
20697         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
20698         types have been emitted for a given element and flag an error
20699         if something which does not have AllowMultiple set is used more
20700         than once.
20701
20702         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
20703         attribute types and their corresponding AllowMultiple properties
20704
20705         (AreMultipleAllowed): Check the property for a given type.
20706
20707         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
20708         property in the case we have a TypeContainer.
20709
20710         (Attributes.AddAttribute): Detect duplicates and just skip on
20711         adding them. This trivial fix catches a pretty gross error in our
20712         attribute emission - global attributes were being emitted twice!
20713
20714         Bugzilla bug #33187 is now fixed.
20715
20716 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
20717
20718         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
20719         instead of pp_and).
20720
20721         * expression.cs (Binary.ResolveOperator): I can only use the
20722         Concat (string, string, string) and Concat (string, string,
20723         string, string) if the child is actually a concatenation of
20724         strings. 
20725
20726 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
20727
20728         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
20729         context where we need a 2-character lookahead.
20730
20731         * pending.cs (PendingImplementation): Rework so we can keep track
20732         of interface types all the time, and flag those which were
20733         implemented by parents as optional.
20734
20735 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
20736
20737         * expression.cs (Binary.ResolveOperator): Use
20738         String.Concat(string,string,string) or
20739         String.Concat(string,string,string,string) when possible. 
20740
20741         * typemanager: More helper methods.
20742
20743
20744 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
20745
20746         * pending.cs: remove the bogus return from GetMissingInterfaces()
20747         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
20748
20749 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20750
20751         * namespace.cs: avoid duplicated 'using xxx' being added to
20752         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
20753         when we get more than one 'using' statement for the same namespace.
20754         Report a CS0105 warning for it.
20755
20756 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * cs-tokenizer.cs (consume_identifier): use read directly, instead
20759         of calling getChar/putback, uses internal knowledge of it.    
20760
20761         (xtoken): Reorder tokenizer so most common patterns are checked
20762         first.  This reduces the compilation time in another 5% (from 8.11s
20763         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
20764
20765         The parsing time is 22% of the compilation in mcs, and from that
20766         64% is spent on the tokenization process.  
20767
20768         I tried using a binary search for keywords, but this is slower
20769         than the hashtable.  Another option would be to do a couple of
20770         things:
20771
20772                 * Not use a StringBuilder, instead use an array of chars,
20773                   with a set value.  Notice that this way we could catch
20774                   the 645 error without having to do it *afterwards*.
20775
20776                 * We could write a hand-parser to avoid the hashtable
20777                   compares altogether.
20778
20779         The identifier consumption process takes 37% of the tokenization
20780         time.  Another 15% is spent on is_number.  56% of the time spent
20781         on is_number is spent on Int64.Parse:
20782
20783                 * We could probably choose based on the string length to
20784                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
20785                   computations. 
20786
20787         Another 3% is spend on wrapping `xtoken' in the `token' function.
20788
20789         Handle 0xa0 as whitespace (#34752)
20790
20791 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
20792
20793         * typemanager.cs (IsCLRType): New routine to tell whether a type
20794         is one of the builtin types.  
20795
20796         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
20797         typecode in more places instead of doing pointer comparissions.
20798         We could leverage some knowledge about the way the typecodes are
20799         laid out.
20800
20801         New code to cache namespaces in assemblies, it is currently not
20802         invoked, to be used soon.
20803
20804         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
20805
20806         * expression.cs (Binary.ResolveOperator): specially handle
20807         strings, and do not perform user-defined operator overloading for
20808         built-in types.
20809
20810 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
20811
20812         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
20813         internalcall as it is a pretty simple operation;  Avoid whenever
20814         possible to call Char.IsLetter.
20815
20816         (consume_identifier): Cut by half the number of
20817         hashtable calls by merging the is_keyword and GetKeyword behavior.
20818
20819         Do not short-circuit, because if we do, we
20820         report errors (ie, #if false && true would produce an invalid
20821         directive error);
20822
20823
20824 2002-11-24  Martin Baulig  <martin@ximian.com>
20825
20826         * expression.cs (Cast.TryReduce): If we're in checked syntax,
20827         check constant ranges and report a CS0221.  Fixes #33186.
20828
20829 2002-11-24  Martin Baulig  <martin@ximian.com>
20830
20831         * cs-parser.jay: Make this work for uninitialized variable
20832         declarations in the `for' initializer.  Fixes #32416.
20833
20834 2002-11-24  Martin Baulig  <martin@ximian.com>
20835
20836         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
20837         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
20838
20839 2002-11-24  Martin Baulig  <martin@ximian.com>
20840
20841         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
20842         argument; if true, we also check for user-defined conversions.
20843         This is only needed if both arguments are of a user-defined type.
20844         Fixes #30443, added test-175.cs.
20845         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
20846
20847         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
20848
20849 2002-11-24  Martin Baulig  <martin@ximian.com>
20850
20851         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
20852         function to get the store opcode.
20853         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
20854         only emit the Ldelema if the store opcode is Stobj.  You must run
20855         both test-34 and test-167 to test this.  Fixes #34529.
20856
20857 2002-11-23  Martin Baulig  <martin@ximian.com>
20858
20859         * ecore.cs (Expression.MemberLookup): Added additional
20860         `qualifier_type' argument which is used when we're being called
20861         from MemberAccess.DoResolve() and null if we're called from a
20862         SimpleName lookup.
20863         (Expression.MemberLookupFailed): New method to report errors; this
20864         does the CS1540 check and reports the correct error message.
20865
20866         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
20867         argument for the CS1540 check and redone the way how we're dealing
20868         with private members.  See the comment in the source code for details.
20869         (FilterWithClosure): Reverted this back to revision 1.197; renamed
20870         `closure_start_type' to `closure_qualifier_type' and check whether
20871         it's not null.  It was not this filter being broken, it was just
20872         being called with the wrong arguments.
20873
20874         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
20875         and pass it the correct `qualifier_type'; this also does the error
20876         handling for us.
20877
20878 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
20879
20880         * expression.cs (Invocation.EmitParams): If the we are dealing
20881         with a non-built-in value type, load its address as well.
20882
20883         (ArrayCreation): Use a a pretty constant instead
20884         of the hardcoded value 2.   Use 6 instead of 2 for the number of
20885         static initializers.  
20886
20887         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
20888         because they are not really value types, just glorified integers. 
20889
20890         * driver.cs: Do not append .exe, the CSC compiler does not do it.
20891
20892         * ecore.cs: Remove redundant code for enumerations, make them use
20893         the same code path as everything else, fixes the casting issue
20894         with enumerations in Windows.Forms.
20895
20896         * attribute.cs: Do only cast to string if it is a string, the
20897         validation happens later.
20898
20899         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
20900         people upgrade their corlibs.
20901
20902         * ecore.cs: Oops, enumerations were not following the entire code path
20903
20904 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
20905
20906         * typemanager.cs (FilterWithClosure): Commented out the test for
20907         1540 in typemanager.cs, as it has problems when accessing
20908         protected methods from a parent class (see test-174.cs). 
20909
20910         * attribute.cs (Attribute.ValidateGuid): new method.
20911         (Attribute.Resolve): Use above.
20912
20913 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
20914
20915         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
20916
20917         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
20918         handling for enumerations, as we only needed the TypeContainer
20919         functionality to begin with (this is required for the fix below to
20920         work for enums that reference constants in a container class for
20921         example). 
20922
20923         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
20924
20925         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
20926         a valid TypeBuilder to perform lookups on.o
20927
20928         * class.cs (InheritableMemberSignatureCompare): Use true in the
20929         call to GetGetMethod and GetSetMethod, because we are comparing
20930         the signature, and we need to get the methods *even* if they are
20931         private. 
20932
20933         (PropertyBase.CheckBase): ditto.
20934
20935         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
20936         GotoCase.Resolve): Use Peel on EmpytCasts.
20937
20938         * ecore.cs (EmptyCast): drop child, add Peel method.
20939
20940 2002-11-17  Martin Baulig  <martin@ximian.com>
20941
20942         * ecore.cs (EmptyCast.Child): New public property.
20943
20944         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
20945         label resolved to an EmptyCast.  Fixes #34162.
20946         (GotoCase.Resolve): Likewise.
20947         (Block.EmitMeta): Likewise.
20948
20949 2002-11-17  Martin Baulig  <martin@ximian.com>
20950
20951         * expression.cs (Invocation.BetterConversion): Prefer int over
20952         uint; short over ushort; long over ulong for integer literals.
20953         Use ImplicitConversionExists instead of StandardConversionExists
20954         since we also need to check for user-defined implicit conversions.
20955         Fixes #34165.  Added test-173.cs.
20956
20957 2002-11-16  Martin Baulig  <martin@ximian.com>
20958
20959         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
20960         with the `true' and `false' literals.  Fixes #33151.
20961
20962 2002-11-16  Martin Baulig  <martin@ximian.com>
20963
20964         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
20965         October 22nd; don't do the cs1540 check for static members.
20966
20967         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
20968         now using our own filter here and doing the cs1540 check again.
20969
20970 2002-11-16  Martin Baulig  <martin@ximian.com>
20971
20972         * support.cs (InternalParameters): Don't crash if we don't have
20973         any fixed parameters.  Fixes #33532.
20974
20975 2002-11-16  Martin Baulig  <martin@ximian.com>
20976
20977         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
20978         when looking up static methods to make this work on Windows.
20979         Fixes #33773.
20980
20981 2002-11-16  Martin Baulig  <martin@ximian.com>
20982
20983         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
20984         a setter rather than using PropertyInfo.CanWrite.
20985
20986 2002-11-15  Nick Drochak  <ndrochak@gol.com>
20987
20988         * class.cs: Allow acces to block member by subclasses. Fixes build
20989         breaker.
20990
20991 2002-11-14  Martin Baulig  <martin@ximian.com>
20992
20993         * class.cs (Constructor.Emit): Added the extern/block check.
20994         Fixes bug #33678.
20995
20996 2002-11-14  Martin Baulig  <martin@ximian.com>
20997
20998         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
20999         iteration while looking for indexers, this is needed because the
21000         indexer may have a different name in our base classes.  Fixed the
21001         error reporting (no indexers at all, not get accessor, no
21002         overloaded match).  Fixes bug #33089.
21003         (IndexerAccess.DoResolveLValue): Likewise.
21004
21005 2002-11-14  Martin Baulig  <martin@ximian.com>
21006
21007         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21008         indexers.  Fixes the first part of bug #33089.
21009         (MethodSignature.InheritableMemberSignatureCompare): Added support
21010         for properties.
21011
21012 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21013
21014         * attribute.cs (Attribute.Resolve): Catch the
21015         NullReferenceException and report it since it isn't supposed to
21016         happen. 
21017
21018 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21019
21020         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21021         LogicalOr and LogicalAnd that can benefit from recursively
21022         handling EmitBranchable.  The code now should be nice for Paolo.
21023
21024 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21025
21026         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21027         the Type lookups, as we perform quite a number of lookups on
21028         non-Types.  This can be removed once we can deterministically tell
21029         whether we have a type or a namespace in advance.
21030
21031         But this might require special hacks from our corlib.
21032
21033         * TODO: updated.
21034
21035         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21036         and double which avoids a conversion from an integer to a double.
21037
21038         * expression.cs: tiny optimization, avoid calling IsConstant,
21039         because it effectively performs the lookup twice.
21040
21041 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21042
21043         But a bogus return here to keep the semantics of the old code
21044         until the Mono runtime is fixed.
21045
21046         * pending.cs (GetMissingInterfaces): New method used to remove all
21047         the interfaces that are already implemented by our parent
21048         classes from the list of pending methods. 
21049
21050         * interface.cs: Add checks for calls after ResolveTypeExpr.
21051
21052 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21053
21054         * class.cs (Class.Emit): Report warning 67: event not used if the
21055         warning level is beyond 3.
21056
21057         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21058         being a NullLiteral.
21059
21060         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21061         specifiers. 
21062
21063         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21064         path that might fail if a type can not be resolved.
21065
21066         * expression.cs (Binary.Emit): Emit unsigned versions of the
21067         operators. 
21068
21069         * driver.cs: use error 5.
21070
21071 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21072
21073         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21074
21075 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21076
21077         * cs-parser.jay (switch_section): A beautiful patch from Martin
21078         Baulig that fixed 33094.
21079
21080 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21081
21082         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21083         Check whether the base is abstract and report an error if so.
21084
21085         * expression.cs (IndexerAccess.DoResolveLValue,
21086         IndexerAccess.DoResolve): ditto. 
21087
21088         (Invocation.DoResolve): ditto.
21089
21090         (Invocation.FullMethodDesc): Improve the report string.
21091
21092         * statement.cs (Block): Eliminate IsVariableDefined as it is
21093         basically just a wrapper for GetVariableInfo.
21094
21095         * ecore.cs (SimpleName): Use new 
21096
21097         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21098         type, as we return the actual parameter ref/unref state on a
21099         different call.
21100
21101 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21102
21103         * support.cs: Return proper flags REF/OUT fixing the previous
21104         commit.  
21105
21106         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21107         not used to mean `ref' but `ref or out' in ParameterReference
21108
21109         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21110         full type signature instead of calling TypeManger.CSharpName
21111         ourselves. 
21112
21113         * support.cs (InternalParameters.ParameterDesc): Do not compare
21114         directly to the modflags, because REF/OUT will actually be bitsets
21115         if set. 
21116
21117         * delegate.cs (VerifyMethod): Check also the modifiers.
21118
21119         * cs-tokenizer.cs: Fix bug where floating point values with an
21120         exponent where a sign was missing was ignored.
21121
21122         * driver.cs: Allow multiple assemblies to be specified in a single
21123         /r: argument
21124
21125 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21126
21127         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21128         because identifiers after a parenthesis would end up in this kind
21129         of production, and we needed to desamiguate it for having casts
21130         like:
21131
21132                 (UserDefinedType *) xxx
21133
21134 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21137         we should set on the Bindingflags.NonPublic, but not turn on
21138         private_ok.  private_ok controls whether a Private member is
21139         returned (this is chekced on the filter routine), while the
21140         BindingFlags.NonPublic just controls whether private/protected
21141         will be allowed.   This fixes the problem part of the problem of
21142         private properties being allowed to be used in derived classes.
21143
21144         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21145         so we can call the children DoResolveLValue method (this will
21146         properly signal errors on lvalue assignments to base properties)
21147
21148         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21149         getter are null, and we have a property info, we know that this
21150         happened because the lookup failed, so we report an error 122 for
21151         protection level violation.
21152
21153         We also silently return if setter and getter are null in the
21154         resolve functions, this condition only happens if we have flagged
21155         the error before.  This is the other half of the problem. 
21156
21157         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21158         not have accessibility information, that is why we were returning
21159         true in the filter function in typemanager.cs.
21160
21161         To properly report 122 (property is inaccessible because of its
21162         protection level) correctly, we report this error in ResolveAccess
21163         by failing if both the setter and the getter are lacking (ie, the
21164         lookup failed). 
21165
21166         DoResolve and DoLResolve have been modified to check for both
21167         setter/getter being null and returning silently, the reason being
21168         that I did not want to put the knowledge about this error in upper
21169         layers, like:
21170
21171         int old = Report.Errors;
21172         x = new PropertyExpr (...);
21173         if (old != Report.Errors)
21174                 return null;
21175         else
21176                 return x;
21177
21178         So the property expr is returned, but it is invalid, so the error
21179         will be flagged during the resolve process. 
21180
21181         * class.cs: Remove InheritablePropertySignatureCompare from the
21182         class, as we no longer depend on the property signature to compute
21183         whether it is possible to implement a method or not.
21184
21185         The reason is that calling PropertyInfo.GetGetMethod will return
21186         null (in .NET, in Mono it works, and we should change this), in
21187         cases where the Get Method does not exist in that particular
21188         class.
21189
21190         So this code:
21191
21192         class X { public virtual int A { get { return 1; } } }
21193         class Y : X { }
21194         class Z : Y { public override int A { get { return 2; } } }
21195
21196         Would fail in Z because the parent (Y) would not have the property
21197         defined.  So we avoid this completely now (because the alternative
21198         fix was ugly and slow), and we now depend exclusively on the
21199         method names.
21200
21201         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21202         reference method, instead of using the property.
21203
21204         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21205         routines are gone now.
21206
21207         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21208         names, they were incorrectly named.
21209
21210         * cs-tokenizer.cs: Return are more gentle token on failure. 
21211
21212         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21213         had an out-of-sync index variable, which caused it to remove from
21214         the list of pending methods the wrong method sometimes.
21215
21216 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21219         CanWrite, because those refer to this particular instance of the
21220         property, and do not take into account the fact that we can
21221         override single members of a property.
21222
21223         Constructor requires an EmitContext.  The resolution process does
21224         not happen here, but we need to compute the accessors before,
21225         because the resolution does not always happen for properties.
21226
21227         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21228         subclass, before we did not update this flag, but we did update
21229         bindingflags. 
21230
21231         (GetAccessors): Drop this routine, as it did not work in the
21232         presence of partially overwritten set/get methods. 
21233
21234         Notice that this broke the cs1540 detection, but that will require
21235         more thinking. 
21236
21237 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21238
21239         * class.cs:
21240         * codegen.cs:
21241         * driver.cs: issue a warning instead of an error if we don't support
21242         debugging for the platform. Also ignore a couple of errors that may
21243         arise when trying to write the symbols. Undo my previous patch.
21244
21245 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21246
21247         * driver.cs: ignore /debug switch except for Unix platforms.
21248
21249 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21250
21251         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21252
21253 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21254
21255         * driver.cs: Do not make mcs-debug conditional, so we do not break
21256         builds that use it.
21257
21258         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21259         review this patch.  But basically after all the children variables
21260         have been merged, the value of "Breaks" was not being set to
21261         new_breaks for Switch blocks.  I think that it should be set after
21262         it has executed.  Currently I set this to the value of new_breaks,
21263         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21264         conservative, but I do not understand this code very well.
21265
21266         I did not break anything in the build, so that is good ;-)
21267
21268         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21269
21270 2002-10-20  Mark Crichton  <crichton@gimp.org>
21271
21272         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21273
21274 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21275
21276         * cfold.cs: Fixed compile blocker.
21277
21278 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21279
21280         * driver.cs: I was chekcing the key, not the file.
21281
21282 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21283
21284         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21285         message that we were generating - we just need to silently return
21286         a null.
21287
21288 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * class.cs (Event.Define): Change my previous commit, as this
21291         breaks the debugger.  This is a temporary hack, as it seems like
21292         the compiler is generating events incorrectly to begin with.
21293
21294         * expression.cs (Binary.ResolveOperator): Added support for 
21295         "U operator - (E x, E y)"
21296
21297         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
21298         y)".
21299
21300         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
21301         init-only variables, but this path did not take into account that
21302         there might be also instance readonly variables.  Correct this
21303         problem. 
21304
21305         This fixes bug 32253
21306
21307         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
21308         delegates as well.
21309
21310         * driver.cs: Change the extension for modules to `netmodule'
21311
21312         * cs-parser.jay: Improved slightly the location tracking for
21313         the debugger symbols.
21314
21315         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
21316         modifiers that were specified instead of the hardcoded value
21317         (FamAndAssem).  This was basically ignoring the static modifier,
21318         and others.  Fixes 32429.
21319
21320         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
21321         fixed a bug in the process (32476)
21322
21323         * expression.cs (ArrayAccess.EmitAssign): Patch from
21324         hwang_rob@yahoo.ca that fixes bug 31834.3
21325
21326 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
21327
21328         * driver.cs: Make the module extension .netmodule.
21329
21330 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * driver.cs: Report an error if the resource file is not found
21333         instead of crashing.
21334
21335         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
21336         false, like Emit does.
21337
21338 2002-10-16  Nick Drochak  <ndrochak@gol.com>
21339
21340         * typemanager.cs: Remove unused private member.  Also reported mcs
21341         bug to report this as a warning like csc.
21342
21343 2002-10-15  Martin Baulig  <martin@gnome.org>
21344
21345         * statement.cs (Statement.Emit): Made this a virtual method; emits
21346         the line number info and calls DoEmit().
21347         (Statement.DoEmit): New protected abstract method, formerly knows
21348         as Statement.Emit().
21349
21350         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
21351
21352 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
21355         have fixed a remaining problem: not every AddXXXX was adding a
21356         fully qualified name.  
21357
21358         Now everyone registers a fully qualified name in the DeclSpace as
21359         being defined instead of the partial name.  
21360
21361         Downsides: we are slower than we need to be due to the excess
21362         copies and the names being registered this way.  
21363
21364         The reason for this is that we currently depend (on the corlib
21365         bootstrap for instance) that types are fully qualified, because
21366         we dump all the types in the namespace, and we should really have
21367         types inserted into the proper namespace, so we can only store the
21368         basenames in the defined_names array.
21369
21370 2002-10-10  Martin Baulig  <martin@gnome.org>
21371
21372         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
21373         from bug #31834, see the bug report for a testcase which is
21374         miscompiled.
21375
21376 2002-10-10  Martin Baulig  <martin@gnome.org>
21377
21378         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
21379         flow analysis code for this.
21380
21381         * statement.cs (Do, While, For): Tell the flow analysis code about
21382         infinite loops.
21383         (FlowBranching.UsageVector): Added support for infinite loops.
21384         (Block.Resolve): Moved the dead code elimination here and use flow
21385         analysis to do it.
21386
21387 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
21388
21389         * class.cs (Field.Define): Catch cycles on struct type
21390         definitions. 
21391
21392         * typemanager.cs (IsUnmanagedtype): Do not recursively check
21393         fields if the fields are static.  We only need to check instance
21394         fields. 
21395
21396         * expression.cs (As.DoResolve): Test for reference type.
21397
21398         * statement.cs (Using.ResolveExpression): Use
21399         ConvertImplicitRequired, not ConvertImplicit which reports an
21400         error on failture
21401         (Using.ResolveLocalVariableDecls): ditto.
21402
21403         * expression.cs (Binary.ResolveOperator): Report errors in a few
21404         places where we had to.
21405
21406         * typemanager.cs (IsUnmanagedtype): Finish implementation.
21407
21408 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
21409
21410         * expression.cs: Use StoreFromPtr instead of extracting the type
21411         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
21412
21413         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
21414         an enumeration value to a System.Enum, but System.Enum is not a
21415         value type, but an class type, so we need to box.
21416
21417         (Expression.ConvertExplicit): One codepath could return
21418         errors but not flag them.  Fix this.  Fixes #31853
21419
21420         * parameter.cs (Resolve): Do not allow void as a parameter type.
21421
21422 2002-10-06  Martin Baulig  <martin@gnome.org>
21423
21424         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
21425         if it's a class type and not a struct.  Fixes #31815.
21426
21427 2002-10-06  Martin Baulig  <martin@gnome.org>
21428
21429         * statement.cs: Reworked the flow analysis code a bit to make it
21430         usable for dead code elimination.
21431
21432 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21433
21434         * cs-parser.jay: allow empty source files. Fixes bug #31781.
21435
21436 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21437
21438         * expression.cs (ComposedCast.DoResolveType): A quick workaround
21439         to fix the test 165, will investigate deeper.
21440
21441 2002-10-04  Martin Baulig  <martin@gnome.org>
21442
21443         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
21444         finally blocks actually work.
21445         (Try.Resolve): We don't need to create a sibling for `finally' if
21446         there is no finally block.
21447
21448 2002-10-04  Martin Baulig  <martin@gnome.org>
21449
21450         * class.cs (Constructor.Define): The default accessibility for a
21451         non-default constructor is private, not public.
21452
21453 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
21454
21455         * class.cs (Constructor): Make AllowedModifiers public, add
21456         EXTERN.
21457
21458         * cs-parser.jay: Perform the modifiers test here, as the
21459         constructor for the Constructor class usually receives a zero
21460         because of the way we create it (first we create, later we
21461         customize, and we were never checking the modifiers).
21462
21463         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
21464         is a version of LookupTypeReflection that includes the type-name
21465         cache.  This can be used as a fast path for functions that know
21466         the fully qualified name and are only calling into *.GetType() to
21467         obtain a composed type.
21468
21469         This is also used by TypeManager.LookupType during its type
21470         composition.
21471
21472         (LookupType): We now also track the real type name, as sometimes
21473         we can get a quey for the real type name from things like
21474         ComposedCast.  This fixes bug 31422.
21475
21476         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
21477         complete type fullname, it does not have to go through the type
21478         resolution system to obtain the composed version of the type (for
21479         obtaining arrays or pointers).
21480
21481         (Conditional.Emit): Use the EmitBoolExpression to
21482         generate nicer code, as requested by Paolo.
21483
21484         (ArrayCreation.CheckIndices): Use the patch from
21485         hwang_rob@yahoo.ca to validate the array initializers. 
21486
21487 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
21488
21489         * class.cs (ConstructorInitializer.Emit): simplify code by using
21490         Invocation.EmitCall, and at the same time, fix the bugs in calling
21491         parent constructors that took variable arguments. 
21492
21493         * ecore.cs (Expression.ConvertNumericExplicit,
21494         Expression.ImplicitNumericConversion): Remove the code that
21495         manually wrapped decimal (InternalTypeConstructor call is now gone
21496         as well).
21497
21498         * expression.cs (Cast.TryReduce): Also handle decimal types when
21499         trying to perform a constant fold on the type.
21500
21501         * typemanager.cs (IsUnmanagedtype): Partially implemented.
21502
21503         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
21504         that only turned off an error report, and did nothing else. 
21505
21506 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * driver.cs: Handle and ignore /fullpaths
21509
21510 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
21511
21512         * expression.cs (Binary.ResolveOperator): Catch the case where
21513         DoNumericPromotions returns true, 
21514
21515         (Binary.DoNumericPromotions): Simplify the code, and the tests.
21516
21517 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
21518
21519         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
21520         report error 70.
21521
21522 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
21523
21524         * ecore.cs (ConvertNumericExplicit): It is not enough that the
21525         conversion exists, but it is also required that the conversion be
21526         performed.  This manifested in "(Type64Enum) 2".  
21527
21528         * class.cs (TypeManager.AddMethod): The fix is not to change
21529         AddEnum, because that one was using a fully qualified name (every
21530         DeclSpace derivative does), but to change the AddMethod routine
21531         that was using an un-namespaced name.  This now correctly reports
21532         the duplicated name.
21533
21534         Revert patch until I can properly fix it.  The issue
21535         is that we have a shared Type space across all namespaces
21536         currently, which is wrong.
21537
21538         Options include making the Namespace a DeclSpace, and merge
21539         current_namespace/current_container in the parser.
21540
21541 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
21542
21543         * cs-parser.jay: Improve error reporting when we get a different
21544         kind of expression in local_variable_type and
21545         local_variable_pointer_type. 
21546
21547         Propagate this to avoid missleading errors being reported.
21548
21549         * ecore.cs (ImplicitReferenceConversion): treat
21550         TypeManager.value_type as a target just like object_type.   As
21551         code like this:
21552
21553         ValueType v = 1;
21554
21555         Is valid, and needs to result in the int 1 being boxed before it
21556         is assigned to the value type v.
21557
21558         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
21559         to validate the enumeration name.
21560
21561         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
21562         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
21563         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
21564
21565         * ecore.cs (TryImplicitIntConversion): When doing an
21566         implicit-enumeration-conversion, check if the type is 64-bits and
21567         perform a conversion before passing to EnumConstant.
21568
21569 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
21570
21571         * decl.cs (Error_AmbiguousTypeReference); New routine used to
21572         report ambiguous type references.  Unlike the MS version, we
21573         report what the ambiguity is.   Innovation at work ;-)
21574
21575         (DeclSpace.FindType): Require a location argument to
21576         display when we display an ambiguous error.
21577
21578         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
21579
21580         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
21581
21582         * expression.cs (EmitDynamicInitializers): Apply patch from
21583         hwang_rob@yahoo.ca that fixes the order in which we emit our
21584         initializers. 
21585
21586 2002-09-21  Martin Baulig  <martin@gnome.org>
21587
21588         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
21589         delegate takes no arguments.
21590
21591 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
21592
21593         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
21594         from integers.
21595
21596         * expression.cs: Extract the underlying type.
21597
21598         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
21599
21600         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
21601
21602 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * class.cs (TypeContainer.DefineType): We can not use the nice
21605         PackingSize with the size set to 1 DefineType method, because it
21606         will not allow us to define the interfaces that the struct
21607         implements.
21608
21609         This completes the fixing of bug 27287
21610
21611         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
21612         means also structs.  This fixes part of the problem. 
21613         (Expresion.ImplicitReferenceConversionExists): ditto.
21614
21615         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
21616         error if there were no errors reported during the type lookup
21617         process, to avoid duplicates or redundant errors.  Without this
21618         you would get an ambiguous errors plus a type not found.  We have
21619         beaten the user enough with the first error.  
21620
21621         (DeclSparce.FindType): Emit a warning if we have an ambiguous
21622         reference. 
21623
21624         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
21625         during the resolution process, stop the lookup, this avoids
21626         repeated error reports (same error twice).
21627
21628         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
21629
21630         * typemanager.cs (LookupType): Redo the type lookup code to match
21631         the needs of System.Reflection.  
21632
21633         The issue is that System.Reflection requires references to nested
21634         types to begin with a "+" sign instead of a dot.  So toplevel
21635         types look like: "NameSpace.TopLevelClass", and nested ones look
21636         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
21637         levels. 
21638
21639 2002-09-19  Martin Baulig  <martin@gnome.org>
21640
21641         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
21642         says that a method always returns or always throws an exception,
21643         don't report the CS0161.
21644
21645         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
21646         set `Returns = new_returns'.
21647
21648 2002-09-19  Martin Baulig  <martin@gnome.org>
21649
21650         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
21651         to an enum constant, check for a CS0176.
21652
21653 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * class.cs (TypeContainer.CheckPairedOperators): Now we check
21656         for operators that must be in pairs and report errors.
21657
21658         * ecore.cs (SimpleName.DoResolveType): During the initial type
21659         resolution process, when we define types recursively, we must
21660         check first for types in our current scope before we perform
21661         lookups in the enclosing scopes.
21662
21663         * expression.cs (MakeByteBlob): Handle Decimal blobs.
21664
21665         (Invocation.VerifyArgumentsCompat): Call
21666         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
21667         I thought we were supposed to always call this, but there are a
21668         few places in the code where we dont do it.
21669
21670 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
21671
21672         * driver.cs: Add support in -linkres and -resource to specify the
21673         name of the identifier.
21674
21675 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21676
21677         * ecore.cs (StandardConversionExists): Sync with the conversion
21678         code: allow anything-* to void* conversions.
21679
21680         (FindMostSpecificSource): Use an Expression argument
21681         instead of a Type, because we might be handed over a Literal which
21682         gets a few more implicit conversions that plain types do not.  So
21683         this information was being lost.
21684
21685         Also, we drop the temporary type-holder expression when not
21686         required.
21687
21688 2002-09-17  Martin Baulig  <martin@gnome.org>
21689
21690         * class.cs (PropertyBase.CheckBase): Don't check the base class if
21691         this is an explicit interface implementation.
21692
21693 2002-09-17  Martin Baulig  <martin@gnome.org>
21694
21695         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
21696         different `IndexerName' attributes.
21697
21698         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
21699         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
21700         virtual CommonResolve().
21701
21702 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
21703
21704         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
21705         and convert that to the UnderlyingType.
21706
21707         * statement.cs (Foreach.Resolve): Indexers are just like variables
21708         or PropertyAccesses.
21709
21710         * cs-tokenizer.cs (consume_string): Track line numbers and columns
21711         inside quoted strings, we were not doing this before.
21712
21713 2002-09-16  Martin Baulig  <martin@gnome.org>
21714
21715         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
21716         resolve it.  This is needed for the definite assignment check of the
21717         instance expression, fixes bug #29846.
21718         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
21719
21720 2002-09-16  Nick Drochak  <ndrochak@gol.com>
21721
21722         * parameter.cs: Fix compile error.  Cannot reference static member
21723         from an instance object.  Is this an mcs bug?
21724
21725 2002-09-14  Martin Baulig  <martin@gnome.org>
21726
21727         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
21728         multiple times.  Fixes bug #30295, added test-166.cs.
21729
21730 2002-09-14  Martin Baulig  <martin@gnome.org>
21731
21732         * statement.cs (Block.Emit): Don't emit unreachable code.
21733         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
21734         `break' statements.
21735         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
21736
21737 2002-09-14  Martin Baulig  <martin@gnome.org>
21738
21739         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
21740         is set.
21741
21742 2002-09-14  Martin Baulig  <martin@gnome.org>
21743
21744         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
21745         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
21746         be false on the ms runtime.
21747
21748 2002-09-13  Martin Baulig  <martin@gnome.org>
21749
21750         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
21751         the CS0038 error message.
21752
21753 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
21754
21755         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
21756         constant inside, return it.
21757
21758 2002-09-12  Martin Baulig  <martin@gnome.org>
21759
21760         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
21761         implicit conversion can be done between enum types.
21762
21763         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
21764         check whether an implicit conversion to the current enum's UnderlyingType
21765         exists and report an error if not.
21766
21767         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
21768         without debugging support.
21769
21770         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
21771         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
21772
21773 2002-09-12  Martin Baulig  <martin@gnome.org>
21774
21775         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
21776
21777         * ecore.cs (IMemberExpr.DeclaringType): New property.
21778         (SimpleName.SimpleNameResolve): Check whether we're accessing a
21779         nonstatic member of an outer type (CS0038).
21780
21781 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
21782
21783         * driver.cs: Activate the using-error detector at warning level
21784         4 (at least for MS-compatible APIs).
21785
21786         * namespace.cs (VerifyUsing): Small buglett fix.
21787
21788         * pending.cs (PendingImplementation): pass the container pointer. 
21789
21790         * interface.cs (GetMethods): Allow for recursive definition.  Long
21791         term, I would like to move every type to support recursive
21792         definitions, not the current ordering mechanism that we have right
21793         now.
21794
21795         The situation is this: Attributes are handled before interfaces,
21796         so we can apply attributes to interfaces.  But some attributes
21797         implement interfaces, we will now handle the simple cases
21798         (recursive definitions will just get an error).  
21799
21800         * parameter.cs: Only invalidate types at the end if we fail to
21801         lookup all types.  
21802
21803 2002-09-09  Martin Baulig  <martin@gnome.org>
21804
21805         * ecore.cs (PropertyExpr.Emit): Also check for
21806         TypeManager.system_int_array_get_length so this'll also work when
21807         compiling corlib.  Fixes #30003.
21808
21809 2002-09-09  Martin Baulig  <martin@gnome.org>
21810
21811         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
21812         and throw an exception if we can't get the type's size.  Fixed #30040,
21813         added test-165.cs.
21814
21815 2002-09-09  Martin Baulig  <martin@gnome.org>
21816
21817         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
21818
21819         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
21820         context.  Fixes bug #30027.
21821
21822         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
21823         virtual functions.  Fixes bug #30043, added test-164.cs.
21824
21825 2002-09-08  Ravi Pratap  <ravi@ximian.com>
21826
21827         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
21828
21829 2002-09-08  Nick Drochak  <ndrochak@gol.com>
21830
21831         * driver.cs: Use an object to get the windows codepage since it's not a
21832         static property.
21833
21834 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * statement.cs (For.Emit): for infinite loops (test == null)
21837         return whether there is a break inside, not always "true".
21838
21839         * namespace.cs (UsingEntry): New struct to hold the name of the
21840         using definition, the location where it is defined, and whether it
21841         has been used in a successful type lookup.
21842
21843         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
21844         strings.
21845
21846         * decl.cs: ditto.
21847
21848 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21849
21850         * attribute.cs : Fix incorrect code which relied on catching
21851         a NullReferenceException to detect a null being passed in
21852         where an object was expected.
21853
21854 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
21855
21856         * statement.cs (Try): flag the catch variable as assigned
21857
21858         * expression.cs (Cast): Simplified by using ResolveType instead of
21859         manually resolving.
21860
21861         * statement.cs (Catch): Fix bug by using ResolveType.
21862
21863 2002-09-06  Ravi Pratap  <ravi@ximian.com>
21864
21865         * expression.cs (BetterConversion): Special case for when we have
21866         a NullLiteral as the argument and we have to choose between string
21867         and object types - we choose string the way csc does.
21868
21869         * attribute.cs (Attribute.Resolve): Catch the
21870         NullReferenceException and report error #182 since the Mono
21871         runtime no more has the bug and having this exception raised means
21872         we tried to select a constructor which takes an object and is
21873         passed a null.
21874
21875 2002-09-05  Ravi Pratap  <ravi@ximian.com>
21876
21877         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
21878         message (1502, 1503) when we can't locate a method after overload
21879         resolution. This is much more informative and closes the bug
21880         Miguel reported.
21881
21882         * interface.cs (PopulateMethod): Return if there are no argument
21883         types. Fixes a NullReferenceException bug.
21884
21885         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
21886         expressions too. Previously we were checking only in one place for
21887         positional arguments leaving out named arguments.
21888
21889         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
21890         type to the enum type is not allowed. Remove code corresponding to
21891         that.
21892
21893         (ConvertNumericExplicit): Allow explicit conversions from
21894         the underlying type to enum type. This precisely follows the spec
21895         and closes a bug filed by Gonzalo.
21896
21897 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21898
21899         * compiler.csproj:
21900         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
21901
21902 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
21905         it was important that we stored the right value after the
21906         reduction in `converted'.
21907
21908 2002-09-04  Martin Baulig  <martin@gnome.org>
21909
21910         * location.cs (Location.SymbolDocument): Use full pathnames for the
21911         source files.
21912
21913 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
21914
21915         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
21916         of the expression resolve mechanism, because that will catch the
21917         SimpleName error failures.
21918
21919         (Conditional): If we can not resolve the
21920         expression, return, do not crash.
21921
21922 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21923
21924         * cs-tokenizer.cs:
21925         (location): display token name instead of its number.
21926
21927 2002-08-28  Martin Baulig  <martin@gnome.org>
21928
21929         * expression.cs (Binary.ResolveOperator): Don't silently return
21930         but return an error if an operator cannot be applied between two
21931         enum types.
21932
21933 2002-08-28  Martin Baulig  <martin@gnome.org>
21934
21935         * class.cs (Constructor.Define): Set the permission attributes
21936         correctly instead of making all constructors public.
21937
21938 2002-08-28  Martin Baulig  <martin@gnome.org>
21939
21940         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
21941         for private members before reporting a CS0103; if we find anything,
21942         it's a CS0122.
21943
21944 2002-08-28  Martin Baulig  <martin@gnome.org>
21945
21946         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
21947         to check whether `closure_start_type == closure_invocation_type',
21948         we also need to check whether `m.DeclaringType == closure_invocation_type'
21949         before bypassing the permission checks.  We might be accessing
21950         protected/private members from the base class.
21951         (TypeManager.RealMemberLookup): Only set private_ok if private
21952         members were requested via BindingFlags.NonPublic.
21953
21954         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
21955
21956         * expression.cs (MemberAccess.ResolveMemberAccess): Set
21957         MethodGroupExpr.IsExplicitImpl if appropriate.
21958         (Invocation.DoResolve): Don't report the CS0120 for explicit
21959         interface implementations.
21960
21961 2002-08-27  Martin Baulig  <martin@gnome.org>
21962
21963         * expression.cs (Invocation.DoResolve): If this is a static
21964         method and we don't have an InstanceExpression, we must report
21965         a CS0120.
21966
21967 2002-08-25  Martin Baulig  <martin@gnome.org>
21968
21969         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
21970         `==' between a valuetype and an object.
21971
21972 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * ecore.cs (TypeExpr): Provide a ToString method.
21975
21976 2002-08-24  Martin Baulig  <martin@gnome.org>
21977
21978         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
21979         now called proggie.dbg and it's a binary file.
21980
21981 2002-08-23  Martin Baulig  <martin@gnome.org>
21982
21983         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
21984
21985 2002-08-23  Martin Baulig  <martin@gnome.org>
21986
21987         * struct.cs (MyStructInfo.ctor): Make this work with empty
21988         structs; it's not allowed to use foreach() on null.
21989
21990 2002-08-23  Martin Baulig  <martin@gnome.org>
21991
21992         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
21993         writer the full pathname of the generated assembly.
21994
21995 2002-08-23  Martin Baulig  <martin@gnome.org>
21996
21997         * statements.cs (FlowBranching.UsageVector.MergeChildren):
21998         A `finally' block never returns or breaks; improved handling of
21999         unreachable code.
22000
22001 2002-08-23  Martin Baulig  <martin@gnome.org>
22002
22003         * statement.cs (Throw.Resolve): Allow `throw null'.
22004
22005 2002-08-23  Martin Baulig  <martin@gnome.org>
22006
22007         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22008         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22009         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22010         MemberLookup would return a wrong event if this is an explicit
22011         interface implementation and the class has an event with the same
22012         name.
22013
22014 2002-08-23  Martin Baulig  <martin@gnome.org>
22015
22016         * statement.cs (Block.AddChildVariableNames): New public method.
22017         (Block.AddChildVariableName): Likewise.
22018         (Block.IsVariableNameUsedInChildBlock): Likewise.
22019         (Block.AddVariable): Check whether a variable name has already
22020         been used in a child block.
22021
22022         * cs-parser.jay (declare_local_variables): Mark all variable names
22023         from the current block as being used in a child block in the
22024         implicit block.
22025
22026 2002-08-23  Martin Baulig  <martin@gnome.org>
22027
22028         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22029         find the symbol writer.
22030
22031         * driver.cs: csc also allows the arguments to /define being
22032         separated by commas, not only by semicolons.
22033
22034 2002-08-23  Martin Baulig  <martin@gnome.org>
22035
22036         * interface.cs (Interface.GetMembers): Added static check for events.
22037
22038 2002-08-15  Martin Baulig  <martin@gnome.org>
22039
22040         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22041         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22042
22043         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22044         why the MethodData.EmitDestructor() change was necessary.
22045
22046 2002-08-20  Martin Baulig  <martin@gnome.org>
22047
22048         * class.cs (TypeContainer.FindMembers): Added static check for events.
22049
22050         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22051
22052         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22053         use Type.GetEvents(), not Type.FindMembers().
22054
22055 2002-08-20  Martin Baulig  <martin@gnome.org>
22056
22057         * decl.cs (MemberCache): Added a special method cache which will
22058         be used for method-only searched.  This ensures that a method
22059         search will return a MethodInfo with the correct ReflectedType for
22060         inherited methods.      
22061
22062 2002-08-20  Martin Baulig  <martin@gnome.org>
22063
22064         * decl.cs (DeclSpace.FindMembers): Made this public.
22065
22066 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22067
22068         * delegate.cs: fixed build on windows.
22069         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22070
22071 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22072
22073         * ecore.cs (StandardConversionExists): Return a false
22074         if we are trying to convert the void type to anything else
22075         since that is not allowed.
22076
22077         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22078         we flag error 70 in the event an event is trying to be accessed
22079         directly from outside the declaring type.
22080
22081 2002-08-20  Martin Baulig  <martin@gnome.org>
22082
22083         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22084         MemberCache from typemanager.cs to decl.cs.
22085
22086 2002-08-19  Martin Baulig  <martin@gnome.org>
22087
22088         * class.cs (TypeContainer): Implement IMemberContainer.
22089         (TypeContainer.DefineMembers): Create the MemberCache.
22090         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22091         return public members if BindingFlags.Public was given, check
22092         whether members are static.
22093
22094 2002-08-16  Martin Baulig  <martin@gnome.org>
22095
22096         * decl.cs (DeclSpace.Define): Splitted this in Define and
22097         DefineMembers.  DefineMembers is called first and initializes the
22098         MemberCache.
22099
22100         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22101         DefineMembers() on all our DeclSpaces.
22102
22103         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22104         but call DefineMembers() on all nested interfaces.  We call their
22105         Define() in our new Define() function.
22106
22107         * interface.cs (Interface): Implement IMemberContainer.
22108         (Interface.Define): Moved all code except the attribute stuf to
22109         DefineMembers().
22110         (Interface.DefineMembers): Initialize the member cache.
22111
22112         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22113         need this anymore since we can use MemberCache.FindMembers directly.
22114
22115 2002-08-19  Martin Baulig  <martin@gnome.org>
22116
22117         * typemanager.cs (MemberCache): When creating the cache for an
22118         interface type, add all inherited members.
22119         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22120         to `out bool used_cache' and documented it.
22121         (TypeManager.MemberLookup): If we already used the cache in the first
22122         iteration, we don't need to do the interfaces check.
22123
22124 2002-08-19  Martin Baulig  <martin@gnome.org>
22125
22126         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22127         here from IMemberFinder and don't implement this interface anymore.
22128         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22129
22130         * typemanager.cs (IMemberFinder): This interface is now only used by
22131         classes which actually support the member cache.
22132         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22133         since we only put DeclSpaces into this Hashtable.
22134         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22135         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22136
22137 2002-08-16  Martin Baulig  <martin@gnome.org>
22138
22139         * typemanager.cs (ICachingMemberFinder): Removed.
22140         (IMemberFinder.MemberCache): New property.
22141         (TypeManager.FindMembers): Merged this with RealFindMembers().
22142         This function will never be called from TypeManager.MemberLookup()
22143         so we can't use the cache here, just the IMemberFinder.
22144         (TypeManager.MemberLookup_FindMembers): Check whether the
22145         IMemberFinder has a MemberCache and call the cache's FindMembers
22146         function.
22147         (MemberCache): Rewrote larger parts of this yet another time and
22148         cleaned it up a bit.
22149
22150 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22151
22152         * driver.cs (LoadArgs): Support quoting.
22153
22154         (Usage): Show the CSC-like command line arguments.
22155
22156         Improved a few error messages.
22157
22158 2002-08-15  Martin Baulig  <martin@gnome.org>
22159
22160         * typemanager.cs (IMemberContainer.Type): New property.
22161         (IMemberContainer.IsInterface): New property.
22162
22163         The following changes are conditional to BROKEN_RUNTIME, which is
22164         defined at the top of the file.
22165
22166         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22167         class'es members, but add all members from TypeHandle.ObjectType
22168         if we're an interface.
22169         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22170         is the current type.
22171         (MemberCache.CacheEntry.Container): Removed this field.
22172         (TypeHandle.GetMembers): Include inherited members.
22173
22174 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22175
22176         * typemanager.cs: fixed compilation and added a comment on a field that
22177         is never used.
22178
22179 2002-08-15  Martin Baulig  <martin@gnome.org>
22180
22181         * class.cs (ConstructorInitializer.Resolve): In the
22182         Expression.MemberLookup call, use the queried_type as
22183         invocation_type.
22184
22185         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22186         declared' attribute, it's always true.
22187         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22188         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22189         temporary wrapper for FindMembers which tells MemberLookup whether
22190         members from the base classes are included in the return value.
22191         This will go away soon.
22192         (TypeManager.MemberLookup): Use this temporary hack here; once the
22193         new MemberCache is completed, we don't need to do the DeclaredOnly
22194         looping here anymore since the MemberCache will take care of this.
22195         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22196         (MemberCache): When creating the MemberCache for a class, get
22197         members from the current class and all its base classes.
22198         (MemberCache.CacheEntry.Container): New field.  This is a
22199         temporary hack until the Mono runtime is fixed to distinguish
22200         between ReflectedType and DeclaringType.  It allows us to use MCS
22201         with both the MS runtime and the unfixed Mono runtime without
22202         problems and without accecting performance.
22203         (MemberCache.SearchMembers): The DeclaredOnly looping from
22204         TypeManager.MemberLookup is now done here.      
22205
22206 2002-08-14  Martin Baulig  <martin@gnome.org>
22207
22208         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22209         Type.GetFields on dynamic types but get the fields from the
22210         corresponding TypeContainer.
22211         (MyStructInfo.GetStructInfo): Added check for enum types.
22212
22213         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22214         (MemberList.SyncRoot): Implemented.
22215         (TypeManager.FilterWithClosure): No need to check permissions if
22216         closure_start_type == closure_invocation_type, don't crash if
22217         closure_invocation_type is null.
22218
22219 2002-08-13  Martin Baulig  <martin@gnome.org>
22220
22221         Rewrote TypeContainer.FindMembers to use a member cache.  This
22222         gives us a speed increase of about 35% for the self-hosting MCS
22223         build and of about 15-20% for the class libs (both on GNU/Linux).
22224
22225         * report.cs (Timer): New class to get enhanced profiling.  This
22226         whole class is "TIMER" conditional since it remarkably slows down
22227         compilation speed.
22228
22229         * class.cs (MemberList): New class.  This is an IList wrapper
22230         which we're now using instead of passing MemberInfo[]'s around to
22231         avoid copying this array unnecessarily.
22232         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22233         (ICachingMemberFinder, IMemberContainer): New interface.
22234         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22235         has already been checked, otherwise use it for the name comparision.
22236         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22237         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22238         if possible.  Returns a MemberList, not a MemberInfo [].
22239         (TypeHandle): New class, implements IMemberContainer.  We create
22240         one instance of this class per type, it contains a MemberCache
22241         which is used to do the member lookups.
22242         (MemberCache): New class.  Each instance of this class contains
22243         all members of a type and a name-based hash table.
22244         (MemberCache.FindMembers): This is our new member lookup
22245         function.  First, it looks up all members of the requested name in
22246         the hash table.  Then, it walks this list and sorts out all
22247         applicable members and returns them.
22248
22249 2002-08-13  Martin Baulig  <martin@gnome.org>
22250
22251         In addition to a nice code cleanup, this gives us a performance
22252         increase of about 1.4% on GNU/Linux - not much, but it's already
22253         half a second for the self-hosting MCS compilation.
22254
22255         * typemanager.cs (IMemberFinder): New interface.  It is used by
22256         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22257         Enum, Delegate or Interface.
22258         (TypeManager.finder_to_member_finder): New PtrHashtable.
22259         (TypeManager.finder_to_container): Removed.
22260         (TypeManager.finder_to_delegate): Removed.
22261         (TypeManager.finder_to_interface): Removed.
22262         (TypeManager.finder_to_enum): Removed.
22263
22264         * interface.cs (Interface): Implement IMemberFinder.
22265
22266         * delegate.cs (Delegate): Implement IMemberFinder.
22267
22268         * enum.cs (Enum): Implement IMemberFinder.
22269
22270         * class.cs (TypeContainer): Implement IMemberFinder.
22271
22272 2002-08-12  Martin Baulig  <martin@gnome.org>
22273
22274         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22275
22276 2002-08-12  Martin Baulig  <martin@gnome.org>
22277
22278         * ecore.cs (ITypeExpression): New interface for expressions which
22279         resolve to a type.
22280         (TypeExpression): Renamed to TypeLookupExpression.
22281         (Expression.DoResolve): If we're doing a types-only lookup, the
22282         expression must implement the ITypeExpression interface and we
22283         call DoResolveType() on it.
22284         (SimpleName): Implement the new ITypeExpression interface.
22285         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22286         hack, the situation that we're only looking up types can't happen
22287         anymore when this method is called.  Moved the type lookup code to
22288         DoResolveType() and call it.
22289         (SimpleName.DoResolveType): This ITypeExpression interface method
22290         is now doing the types-only lookup.
22291         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
22292         (ResolveFlags): Added MaskExprClass.
22293
22294         * expression.cs (MemberAccess): Implement the ITypeExpression
22295         interface.
22296         (MemberAccess.DoResolve): Added support for a types-only lookup
22297         when we're called via ITypeExpression.DoResolveType().
22298         (ComposedCast): Implement the ITypeExpression interface.
22299
22300         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
22301         Expression.Resolve() with ResolveFlags.Type instead.
22302
22303 2002-08-12  Martin Baulig  <martin@gnome.org>
22304
22305         * interface.cs (Interface.Define): Apply attributes.
22306
22307         * attribute.cs (Attribute.ApplyAttributes): Added support for
22308         interface attributes.
22309
22310 2002-08-11  Martin Baulig  <martin@gnome.org>
22311
22312         * statement.cs (Block.Emit): Only check the "this" variable if we
22313         do not always throw an exception.
22314
22315         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
22316         whether the property has a set accessor.
22317
22318 2002-08-11  Martin Baulig  <martin@gnome.org>
22319
22320         Added control flow analysis support for structs.
22321
22322         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
22323         with control flow analysis turned off.
22324         (IVariable): New interface.
22325         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
22326         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
22327         (FieldExpr.DoResolve): Resolve the instance expression with flow
22328         analysis turned off and do the definite assignment check after the
22329         resolving when we know what the expression will resolve to.
22330
22331         * expression.cs (LocalVariableReference, ParameterReference):
22332         Implement the new IVariable interface, only call the flow analysis
22333         code if ec.DoFlowAnalysis is true.
22334         (This): Added constructor which takes a Block argument.  Implement
22335         the new IVariable interface.
22336         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
22337         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
22338         This does the definite assignment checks for struct members.
22339
22340         * class.cs (Constructor.Emit): If this is a non-static `struct'
22341         constructor which doesn't have any initializer, call
22342         Block.AddThisVariable() to tell the flow analysis code that all
22343         struct elements must be initialized before control returns from
22344         the constructor.
22345
22346         * statement.cs (MyStructInfo): New public class.
22347         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
22348         argument to this indexer.  If non-zero, check an individual struct
22349         member, not the whole struct.
22350         (FlowBranching.CheckOutParameters): Check struct members.
22351         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
22352         overloaded versions of these methods which take an additional
22353         `int field_idx' argument to check struct members.
22354         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
22355         overloaded versions of these methods which take an additional
22356         `string field_name' argument to check struct member.s
22357         (VariableInfo): Implement the IVariable interface.
22358         (VariableInfo.StructInfo): New public property.  Returns the
22359         MyStructInfo instance of the variable if it's a struct or null.
22360         (Block.AddThisVariable): New public method.  This is called from
22361         Constructor.Emit() for non-static `struct' constructor which do
22362         not have any initializer.  It creates a special variable for the
22363         "this" instance variable which will be checked by the flow
22364         analysis code to ensure that all of the struct's fields are
22365         initialized before control returns from the constructor.
22366         (UsageVector): Added support for struct members.  If a
22367         variable/parameter is a struct with N members, we reserve a slot
22368         in the usage vector for each member.  A struct is considered fully
22369         initialized if either the struct itself (slot 0) or all its
22370         members are initialized.
22371
22372 2002-08-08  Martin Baulig  <martin@gnome.org>
22373
22374         * driver.cs (Driver.MainDriver): Only report an error CS5001
22375         if there were no compilation errors.
22376
22377         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
22378         `UnsafeContext' property to determine whether the parent is in
22379         unsafe context rather than checking the parent's ModFlags:
22380         classes nested in an unsafe class are unsafe as well.
22381
22382 2002-08-08  Martin Baulig  <martin@gnome.org>
22383
22384         * statement.cs (UsageVector.MergeChildren): Distinguish between
22385         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
22386         we return.  Added test17() and test18() to test-154.cs.
22387
22388 2002-08-08  Martin Baulig  <martin@gnome.org>
22389
22390         * typemanager.cs (TypeManager.FilterWithClosure): If we have
22391         Family access, make sure the invoking type isn't a subclass of the
22392         queried type (that'd be a CS1540).
22393
22394         * ecore.cs (Expression.MemberLookup): Added overloaded version of
22395         this method which takes an additional `Type invocation_type'.
22396
22397         * expression.cs (BaseAccess.DoResolve): Use the base type as
22398         invocation and query type.
22399         (MemberAccess.DoResolve): If the lookup failed and we're about to
22400         report a CS0122, try a lookup with the ec.ContainerType - if this
22401         succeeds, we must report a CS1540.
22402
22403 2002-08-08  Martin Baulig  <martin@gnome.org>
22404
22405         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
22406         (MethodGroupExpr): Implement the IMemberExpr interface.
22407
22408         * expression (MemberAccess.ResolveMemberAccess): No need to have
22409         any special code for MethodGroupExprs anymore, they're now
22410         IMemberExprs.   
22411
22412 2002-08-08  Martin Baulig  <martin@gnome.org>
22413
22414         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
22415         Family, FamANDAssem and FamORAssem permissions.
22416         (TypeManager.IsSubclassOrNestedChildOf): New public method.
22417
22418 2002-08-08  Martin Baulig  <martin@gnome.org>
22419
22420         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
22421         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
22422         or loop block.
22423
22424 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
22425
22426         * driver.cs: implemented /resource option to embed managed resources.
22427
22428 2002-08-07  Martin Baulig  <martin@gnome.org>
22429
22430         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
22431         (FieldBase.HasFieldInitializer): New public property.
22432         (FieldBase.GetInitializerExpression): New public method.  Resolves and
22433         returns the field initializer and makes sure it is only resolved once.
22434         (TypeContainer.EmitFieldInitializers): Call
22435         FieldBase.GetInitializerExpression to get the initializer, this ensures
22436         that it isn't resolved multiple times.
22437
22438         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
22439         the resolving process (SimpleName/MemberLookup) that we're currently
22440         emitting a field initializer (which must not access any instance members,
22441         this is an error CS0236).
22442
22443         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
22444         argument, if the `IsFieldInitializer' flag is set, we must report and
22445         error CS0236 and not an error CS0120.   
22446
22447 2002-08-07  Martin Baulig  <martin@gnome.org>
22448
22449         * ecore.cs (IMemberExpr): New public interface.
22450         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
22451         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
22452         if the expression is an IMemberExpr.
22453
22454         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
22455         to be null, implicitly default to `this' if we're non-static in
22456         this case.  Simplified the code a lot by using the new IMemberExpr
22457         interface.  Also fixed bug #28176 here.
22458
22459 2002-08-06  Martin Baulig  <martin@gnome.org>
22460
22461         * cs-parser.jay (SimpleLookup): Removed.  We need to create
22462         ParameterReferences during semantic analysis so that we can do a
22463         type-only search when resolving Cast, TypeOf and SizeOf.
22464         (block): Pass the `current_local_parameters' to the Block's
22465         constructor.
22466
22467         * class.cs (ConstructorInitializer): Added `Parameters parameters'
22468         argument to the constructor.
22469         (ConstructorInitializer.Resolve): Create a temporary implicit
22470         block with the parameters.
22471
22472         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
22473         references here if we aren't doing a type-only search.
22474
22475         * statement.cs (Block): Added constructor which takes a
22476         `Parameters parameters' argument.
22477         (Block.Parameters): New public property.
22478
22479         * support.cs (InternalParameters.Parameters): Renamed `parameters'
22480         to `Parameters' and made it public readonly.
22481
22482 2002-08-06  Martin Baulig  <martin@gnome.org>
22483
22484         * ecore.cs (Expression.Warning): Made this public as well.
22485
22486         * report.cs (Report.Debug): Print the contents of collections.
22487
22488 2002-08-06  Martin Baulig  <martin@gnome.org>
22489
22490         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
22491         used to tell Resolve() which kinds of expressions it may return.
22492         (Expression.Resolve): Added overloaded version of this method which
22493         takes a `ResolveFlags flags' argument.  This can be used to tell
22494         Resolve() which kinds of expressions it may return.  Reports a
22495         CS0118 on error.
22496         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
22497         ResolveFlags.SimpleName.
22498         (Expression.Error118): Added overloaded version of this method which
22499         takes a `ResolveFlags flags' argument.  It uses the flags to determine
22500         which kinds of expressions are allowed.
22501
22502         * expression.cs (Argument.ResolveMethodGroup): New public method.
22503         Resolves an argument, but allows a MethodGroup to be returned.
22504         This is used when invoking a delegate.
22505
22506         * TODO: Updated a bit.
22507
22508 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22509
22510         Fixed compilation with csc.
22511
22512         * ecore.cs: Expression.Error made public. Is this correct? Should
22513         Warning be made public too?
22514
22515         * expression.cs: use ea.Location instead of ea.loc.
22516         [FIXME:  Filed as bug #28607: MCS must report these errors.]
22517
22518 2002-08-06  Martin Baulig  <martin@gnome.org>
22519
22520         * ecore.cs (Expression.loc): Moved the location here instead of
22521         duplicating it in all derived classes.
22522         (Expression.Location): New public property.
22523         (Expression.Error, Expression.Warning): Made them non-static and
22524         removed the location argument.
22525         (Expression.Warning): Added overloaded version which takes an
22526         `int level' argument.
22527         (Expression.Error118): Make this non-static and removed the
22528         expression and location arguments.
22529         (TypeExpr): Added location argument to the constructor.
22530
22531         * expression.cs (StaticCallExpr): Added location argument to
22532         the constructor.
22533         (Indirection, PointerArithmetic): Likewise.
22534         (CheckedExpr, UnCheckedExpr): Likewise.
22535         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
22536         (StringPtr): Likewise.
22537
22538
22539 2002-08-05  Martin Baulig  <martin@gnome.org>
22540
22541         * expression.cs (BaseAccess.DoResolve): Actually report errors.
22542
22543         * assign.cs (Assign.DoResolve): Check whether the source
22544         expression is a value or variable.
22545
22546         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
22547         while resolving the corresponding blocks.
22548
22549         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
22550         an error, don't silently return null.
22551
22552         * statement.cs (Block.AddVariable): Do the error reporting here
22553         and distinguish between CS0128 and CS0136.
22554         (Block.DoResolve): Report all unused labels (warning CS0164).
22555         (LabeledStatement): Pass the location to the constructor.
22556         (LabeledStatement.HasBeenReferenced): New property.
22557         (LabeledStatement.Resolve): Set it to true here.
22558
22559         * statement.cs (Return.Emit): Return success even after reporting
22560         a type mismatch error (CS0126 or CS0127), this is what csc does and
22561         it avoids confusing the users with any consecutive errors.
22562
22563 2002-08-05  Martin Baulig  <martin@gnome.org>
22564
22565         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
22566
22567         * const.cs (Const.LookupConstantValue): Catch circular definitions.
22568
22569         * expression.cs (MemberAccess.DoResolve): Silently return if an
22570         error has already been reported.
22571
22572         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
22573         error has already been reported.
22574
22575 2002-08-05  Martin Baulig  <martin@gnome.org>
22576
22577         * statement.cs (UsageVector): Only initialize the `parameters'
22578         vector if we actually have any "out" parameters.
22579
22580 2002-08-05  Martin Baulig  <martin@gnome.org>
22581
22582         * expression.cs (Binary.ResolveOperator): When combining delegates,
22583         they must have the same type.
22584
22585 2002-08-05  Martin Baulig  <martin@gnome.org>
22586
22587         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
22588         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
22589         work with the ms runtime and we also don't need it: if we're a
22590         PropertyBuilder and not in the `indexer_arguments' hash, then we
22591         are a property and not an indexer.
22592
22593         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
22594         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
22595         since the latter one doesn't work with the ms runtime.
22596
22597 2002-08-03  Martin Baulig  <martin@gnome.org>
22598
22599         Fixed bugs #27998 and #22735.
22600
22601         * class.cs (Method.IsOperator): New public field.
22602         (Method.CheckBase): Report CS0111 if there's already a method
22603         with the same parameters in the current class.  Report CS0508 when
22604         attempting to change the return type of an inherited method.
22605         (MethodData.Emit): Report CS0179 if a method doesn't have a body
22606         and it's not marked abstract or extern.
22607         (PropertyBase): New abstract base class for Property and Indexer.
22608         (PropertyBase.CheckBase): Moved here from Property and made it work
22609         for indexers.
22610         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
22611         the same so we can reuse it there.
22612         (Property, Indexer): Derive from PropertyBase.
22613         (MethodSignature.inheritable_property_signature_filter): New delegate
22614         to find properties and indexers.
22615
22616         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
22617         argument and improved error reporting.
22618
22619         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
22620         EmptyReadOnlyParameters and made it a property.
22621
22622         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
22623         version of this method which takes a `PropertyInfo indexer'.
22624         (TypeManager.RegisterIndexer): New method.
22625
22626         * class.cs: Added myself as author of this file :-)
22627
22628 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22629
22630         * class.cs: fixed compilation on windoze.
22631
22632 2002-08-03  Martin Baulig  <martin@gnome.org>
22633
22634         * interface.cs (Interface.GetInterfaceBases): Check whether all
22635         base interfaces are at least as accessible than the current one.
22636
22637         * class.cs (TypeContainer.GetClassBases): Check whether base types
22638         are at least as accessible than the current type.
22639         (TypeContainer.AsAccessible): Implemented and made non-static.
22640         (MemberBase.CheckParameters): Report errors if the accessibility
22641         checks fail.
22642
22643         * delegate.cs (Delegate.Delegate): The default visibility is
22644         internal for top-level types and private for nested types.
22645         (Delegate.Define): Report errors if the accessibility checks fail.
22646
22647         * enum.cs (Enum.Enum): The default visibility is internal for
22648         top-level types and private for nested types.
22649         (Enum.DefineType): Compute the correct visibility.
22650
22651         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
22652         function which takes a `bool is_toplevel' instead of a TypeContainer.
22653
22654         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
22655         builtin type.
22656
22657 2002-08-02  Martin Baulig  <martin@gnome.org>
22658
22659         * expression.cs (LocalVariableReferenc): Added constructor which
22660         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
22661         (LocalVariableReference.IsReadOnly): New property.
22662         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
22663         variable is readonly, use our own readonly flag to do this; you can
22664         use the new constructor to get a writable reference to a read-only
22665         variable.
22666
22667         * cs-parser.jay (foreach_statement, using_statement): Get a writable
22668         reference to the local variable.
22669
22670 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
22671
22672         * rootcontext.cs (ResolveCore): Also include System.Exception
22673
22674         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
22675         we reach an EmptyStatement.
22676
22677         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
22678         is also fine.
22679
22680         * expression.cs (Binary.ResolveOperator): Check error result in
22681         two places.
22682
22683         use brtrue/brfalse directly and avoid compares to null.
22684
22685 2002-08-02  Martin Baulig  <martin@gnome.org>
22686
22687         * class.cs (TypeContainer.Define): Define all nested interfaces here.
22688         Fixes bug #28407, added test-155.cs.
22689
22690 2002-08-01  Martin Baulig  <martin@gnome.org>
22691
22692         * class.cs (Event.EmitDefaultMethod): Make this work with static
22693         events.  Fixes #28311, added verify-3.cs.
22694
22695 2002-08-01  Martin Baulig  <martin@gnome.org>
22696
22697         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
22698         `is_disposable' fields.
22699         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
22700         `hm.is_disposable' if we're using the collection pattern.
22701         (Foreach.EmitCollectionForeach): Use the correct type for the
22702         enumerator's local variable, only emit the try/finally block if
22703         necessary (fixes #27713).
22704
22705 2002-08-01  Martin Baulig  <martin@gnome.org>
22706
22707         * ecore.cs (Expression.report118): Renamed to Error118 and made
22708         it public static.
22709
22710         * statement.cs (Throw.Resolve): Check whether the expression is of
22711         the correct type (CS0118) and whether the type derives from
22712         System.Exception (CS0155).
22713         (Catch.Resolve): New method.  Do the type lookup here and check
22714         whether it derives from System.Exception (CS0155).
22715         (Catch.CatchType, Catch.IsGeneral): New public properties.
22716
22717         * typemanager.cs (TypeManager.exception_type): Added.
22718
22719 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
22720
22721         * driver.cs: Updated About function.
22722
22723 2002-07-31  Martin Baulig  <martin@gnome.org>
22724
22725         Implemented Control Flow Analysis.
22726
22727         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
22728         (EmitContext.CurrentBranching): Added.
22729         (EmitContext.StartFlowBranching): Added.
22730         (EmitContext.EndFlowBranching): Added.
22731         (EmitContext.KillFlowBranching): Added.
22732         (EmitContext.IsVariableAssigned): Added.
22733         (EmitContext.SetVariableAssigned): Added.
22734         (EmitContext.IsParameterAssigned): Added.
22735         (EmitContext.SetParameterAssigned): Added.
22736         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
22737         Added control flow analysis stuff here.
22738
22739         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
22740         resolve the expression as lvalue.
22741         (LocalVariableReference.DoResolve): Check whether the variable has
22742         already been assigned.
22743         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
22744         the parameter as assigned here.
22745         (ParameterReference.DoResolve): Check whether the parameter has already
22746         been assigned.
22747         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
22748         expression as lvalue.
22749
22750         * statement.cs (FlowBranching): New class for the flow analysis code.
22751         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
22752         (LabeledStatement.IsDefined): New public property.
22753         (LabeledStatement.AddUsageVector): New public method to tell flow
22754         analyis that the label may be reached via a forward jump.
22755         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
22756         flow analysis.
22757         (VariableInfo.Number): New public field.  This is used by flow analysis
22758         to number all locals of a block.
22759         (Block.CountVariables): New public property.  This is the number of
22760         local variables in this block (including the locals from all parent
22761         blocks).
22762         (Block.EmitMeta): Number all the variables.
22763
22764         * statement.cs: Added flow analysis support to all classes.
22765
22766 2002-07-31  Martin Baulig  <martin@gnome.org>
22767
22768         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
22769         To get debugging messages, compile mcs with /define:MCS_DEBUG and
22770         then use this argument.
22771
22772         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
22773
22774         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
22775         use this to specify /define options.
22776
22777 2002-07-29  Martin Baulig  <martin@gnome.org>
22778
22779         * statement.cs (Fixed): Moved all code that does variable lookups
22780         and resolvings from Emit to Resolve.
22781
22782         * statement.cs (For): Moved all code that does variable lookups
22783         and resolvings from Emit to Resolve.
22784
22785         * statement.cs (Using): Moved all code that does variable lookups
22786         and resolvings from Emit to Resolve.
22787
22788 2002-07-29  Martin Baulig  <martin@gnome.org>
22789
22790         * attribute.cs (Attribute.Resolve): Explicitly catch a
22791         System.NullReferenceException when creating the
22792         CustromAttributeBuilder and report a different warning message.
22793
22794 2002-07-29  Martin Baulig  <martin@gnome.org>
22795
22796         * support.cs (ParameterData.ParameterName): Added method to
22797         get the name of a parameter.
22798
22799         * typemanager.cs (TypeManager.IsValueType): New public method.
22800
22801 2002-07-29  Martin Baulig  <martin@gnome.org>
22802
22803         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
22804         is a flag which specifies that it's either ref or out.
22805         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
22806         the out parameter to `out Parameter.Modifier mod', also set the
22807         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
22808
22809         * support.cs (InternalParameters.ParameterModifier): Distinguish
22810         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22811         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22812
22813         * expression.cs (Argument.GetParameterModifier): Distinguish
22814         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
22815         Parameter.Modifier.ISBYREF flag if it's either ref or out.
22816
22817 2002-07-29  Martin Baulig  <martin@gnome.org>
22818
22819         * expression.cs (ParameterReference.ParameterReference): Added
22820         `Location loc' argument to the constructor.
22821
22822         * cs-parser.jay: Pass location to ParameterReference.
22823
22824 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
22825
22826         * statement.cs (Try): Initialize the location.
22827
22828         * cs-parser.jay: pass location to Try.
22829
22830         * expression.cs (Unary.Reduce): Change the prototype to return
22831         whether a constant fold could be performed or not.  The result is
22832         returned in an out parameters.  In the case of Indirection and
22833         AddressOf, we want to perform the full tests.
22834
22835 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
22836
22837         * statement.cs (Statement.Emit): Flag dead code.
22838
22839 2002-07-27  Andrew Birkett  <andy@nobugs.org>
22840
22841         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
22842
22843 2002-07-27  Martin Baulig  <martin@gnome.org>
22844
22845         * class.cs (MethodData.Define): Put back call to
22846         TypeManager.AddMethod(), accidentally commented this out.
22847
22848         * report.cs (Debug): New public method to print debugging information,
22849         this is `[Conditional ("DEBUG")]'.
22850
22851 2002-07-26  Martin Baulig  <martin@gnome.org>
22852
22853         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
22854         (switch_statement): Push the current_block to the switch_stack and
22855         pop it again when we're done with the switch.
22856         (switch_section): The new block is a child of the current_block.
22857         Fixes bug #24007, added test-152.cs.
22858
22859 2002-07-27  Martin Baulig  <martin@gnome.org>
22860
22861         * expression.cs (Invocation.EmitArguments): When calling a varargs
22862         function with only its fixed arguments, we need to pass an empty
22863         array.
22864
22865 2002-07-27  Martin Baulig  <martin@gnome.org>
22866
22867         Mono 0.13 has been released.
22868
22869 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
22870
22871         * driver.cs: Rename --resource to --linkres, because that is what
22872         we do currently, we dont support --resource yet.
22873
22874         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
22875
22876 2002-07-25  Martin Baulig  <martin@gnome.org>
22877
22878         * class.cs (MethodData): New public class.  This is a `method builder'
22879         class for a method or one accessor of a Property/Indexer/Event.
22880         (MethodData.GetMethodFlags): Moved here from MemberBase.
22881         (MethodData.ApplyAttributes): Likewise.
22882         (MethodData.ApplyObsoleteAttribute): Likewise.
22883         (MethodData.ApplyConditionalAttribute): Likewise.
22884         (MethodData.ApplyDllImportAttribute): Likewise.
22885         (MethodData.CheckAbstractAndExternal): Likewise.
22886         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
22887         (MethodData.Emit): Formerly known as Method.Emit().
22888         (MemberBase): Moved everything which was specific to a single
22889         accessor/method to MethodData.
22890         (Method): Create a new MethodData and call Define() and Emit() on it.
22891         (Property, Indexer, Event): Create a new MethodData objects for each
22892         accessor and call Define() and Emit() on them.
22893
22894 2002-07-25  Martin Baulig  <martin@gnome.org>
22895
22896         Made MethodCore derive from MemberBase to reuse the code from there.
22897         MemberBase now also checks for attributes.
22898
22899         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
22900         (MemberBase.GetMethodFlags): Moved here from class Method and marked
22901         as virtual.
22902         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
22903         `CallingConventions cc' and `Attributes opt_attrs' arguments.
22904         (MemberBase.ApplyAttributes): New virtual method; applies the
22905         attributes to a method or accessor.
22906         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
22907         (MemberBase.ApplyConditionalAttribute): Likewise.
22908         (MemberBase.ApplyDllImportAttribute): Likewise.
22909         (MemberBase.CheckAbstractAndExternal): Likewise.
22910         (MethodCore.ParameterTypes): This is now a property instead of a
22911         method, it's initialized from DoDefineParameters().
22912         (MethodCore.ParameterInfo): Removed the set accessor.
22913         (MethodCore.DoDefineParameters): New protected virtual method to
22914         initialize ParameterTypes and ParameterInfo.
22915         (Method.GetReturnType): We can now simply return the MemberType.
22916         (Method.GetMethodFlags): Override the MemberBase version and add
22917         the conditional flags.
22918         (Method.CheckBase): Moved some code from Define() here, call
22919         DoDefineParameters() here.
22920         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
22921         here to avoid some larger code duplication.
22922         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
22923         ensure that abstract and external accessors don't declare a body.
22924
22925         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
22926         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
22927         lookup in the attribute's parent classes, so we need to abort as soon
22928         as we found the first match.
22929         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
22930         the attribute has no arguments.
22931
22932         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
22933         of a Method.
22934
22935 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22936
22937         * cs-parser.jay: reverted previous patch.
22938
22939 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22940
22941         * cs-parser.jay: fixed bug #22119.
22942
22943 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22944
22945         * attribute.cs: fixed compilation. The error was:
22946         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
22947         be assigned to before control leaves the current method."
22948         [FIXME:  Filed as bug #28186: MCS must report this error.]
22949
22950 2002-07-25  Martin Baulig  <martin@gnome.org>
22951
22952         * attribute.cs (Attribute.Conditional_GetConditionName): New static
22953         method to pull the condition name ouf of a Conditional attribute.
22954         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
22955         the obsolete message and error flag out of an Obsolete attribute.
22956
22957         * class.cs (Method.GetMethodFlags): New public method to get the
22958         TypeManager.MethodFlags for this method.
22959         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
22960         private methods.
22961         (Method.Define): Get and apply the Obsolete and Conditional attributes;
22962         if we're overriding a virtual function, set the new private variable
22963         `parent_method'; call the new TypeManager.AddMethod().
22964
22965         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
22966         the MethodBuilder and the Method in a PtrHashtable.
22967         (TypeManager.builder_to_method): Added for this purpose.
22968         (TypeManager.MethodFlags): Added IsObsoleteError.
22969         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
22970         Obsolete and Conditional arguments in MethodBuilders.  If we discover
22971         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
22972         the message from the attribute.
22973
22974 2002-07-24  Martin Baulig  <martin@gnome.org>
22975
22976         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
22977         preprocessor directives, ensure that the argument to #define/#undef is
22978         exactly one identifier and that it's actually an identifier.
22979
22980         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
22981         did not work ....
22982
22983 2002-07-24  Martin Baulig  <martin@gnome.org>
22984
22985         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
22986         initialize it to TypeManager.object_type in the constructor.
22987         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
22988         of the `hm.get_current' method if we're using the collection pattern.
22989         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
22990         for the explicit conversion to make it work when we're using the collection
22991         pattern and the `Current' property has a different return type than `object'.
22992         Fixes #27713.
22993
22994 2002-07-24  Martin Baulig  <martin@gnome.org>
22995
22996         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
22997         does not match, but don't report any errors.  This method is called in
22998         order for all methods in a MethodGroupExpr until a matching method is
22999         found, so we don't want to bail out if the first method doesn't match.
23000         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23001         matches, report the 123.  Fixes #28070.
23002
23003 2002-07-24  Martin Baulig  <martin@gnome.org>
23004
23005         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23006         TypeManager.TypeToCoreType() to the top of the method so the
23007         following equality checks will work.  Fixes #28107.
23008
23009 2002-07-24  Martin Baulig  <martin@gnome.org>
23010
23011         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23012         operand is of type uint, and the other operand is of type sbyte,
23013         short or int, the operands are converted to type long." -
23014         Actually do what this comment already told us.  Fixes bug #28106,
23015         added test-150.cs.
23016
23017 2002-07-24  Martin Baulig  <martin@gnome.org>
23018
23019         * class.cs (MethodBase): New abstract class.  This is now a base
23020         class for Property, Indexer and Event to avoid some code duplication
23021         in their Define() and DefineMethods() methods.
23022         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23023         generic methods for Define() and DefineMethods().
23024         (FieldBase): Derive from MemberBase, not MemberCore.
23025         (Property): Derive from MemberBase, not MemberCore.
23026         (Property.DefineMethod): Moved all the code from this method to the
23027         new MethodBase.DefineAccessor(), just call it with appropriate
23028         argumetnts.
23029         (Property.Define): Call the new Property.DoDefine(), this does some
23030         sanity checks and we don't need to duplicate the code everywhere.
23031         (Event): Derive from MemberBase, not MemberCore.
23032         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23033         accessors, this will also make them work with interface events.
23034         (Indexer): Derive from MemberBase, not MemberCore.
23035         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23036         (Indexer.Define): Use the new MethodBase functions.
23037
23038         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23039         argument to the constructor.
23040         (Interface.FindMembers): Added support for interface events.
23041         (Interface.PopluateEvent): Implemented.
23042
23043         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23044
23045 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23046
23047         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23048         but this is required to check for a method name being the same as
23049         the containing class.  
23050
23051         Handle this now.
23052
23053 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23054
23055         * interface.cs: initialize variable.
23056
23057 2002-07-23  Martin Baulig  <martin@gnome.org>
23058
23059         Implemented the IndexerName attribute in interfaces.
23060
23061         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23062         name if this is an explicit interface implementation.
23063         (Indexer.InterfaceIndexerName): New public variable.  If we're
23064         implementing an interface indexer, this is the IndexerName in that
23065         interface.  Otherwise, it's the IndexerName.
23066         (Indexer.DefineMethod): If we're implementing interface indexer,
23067         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23068         and Pending.ImplementIndexer methods.
23069         (Indexer.Define): Also define the PropertyBuilder if we're
23070         implementing an interface indexer and this is neither an explicit
23071         interface implementation nor do the IndexerName match the one in
23072         the interface.
23073
23074         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23075         If a method is defined here, then we always need to create a proxy
23076         for it.  This is used when implementing interface indexers.
23077         (Pending.IsInterfaceIndexer): New public method.
23078         (Pending.ImplementIndexer): New public method.
23079         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23080         This is used when implementing interface indexers to define a proxy
23081         if necessary.
23082         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23083         define a proxy if necessary.
23084
23085         * interface.cs (Interface.IndexerName): New public variable.
23086         (Interface.PopulateIndexer): Set the IndexerName.
23087         (Interface.DefineIndexers): New private method.  Populate all the
23088         indexers and make sure their IndexerNames match.
23089
23090         * typemanager.cs (IndexerPropertyName): Added support for interface
23091         indexers.
23092
23093 2002-07-22  Martin Baulig  <martin@gnome.org>
23094
23095         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23096         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23097         ret if HasReturnLabel.
23098         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23099         variables.
23100
23101         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23102         and set the ec.LoopBeginTryCatchLevel.
23103         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23104         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23105         the current ec.TryCatchLevel, the branch goes out of an exception
23106         block.  In this case, we need to use Leave and not Br.
23107
23108 2002-07-22  Martin Baulig  <martin@gnome.org>
23109
23110         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23111         block unless the block does not always return or it is contained in
23112         another try { ... } catch { ... } block.  Fixes bug #26506.
23113         Added verify-1.cs to the test suite.
23114
23115 2002-07-22  Martin Baulig  <martin@gnome.org>
23116
23117         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23118         then we do not always return.  Fixes bug #24985.
23119
23120 2002-07-22  Martin Baulig  <martin@gnome.org>
23121
23122         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23123         lookup on a per-class level; ie. walk up the class hierarchy until we
23124         found at least one applicable method, then choose the best among them.
23125         Fixes bug #24463 and test-29.cs.
23126
23127 2002-07-22  Martin Baulig  <martin@gnome.org>
23128
23129         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23130         return types of the methods.  The return type is not part of the
23131         signature and we must not check it to make the `new' modifier work.
23132         Fixes bug #27999, also added test-147.cs.
23133         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23134
23135         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23136         on the method's return type.
23137
23138 2002-07-21  Martin Baulig  <martin@gnome.org>
23139
23140         * assign.cs: Make this work if the rightmost source is a constant and
23141         we need to do an implicit type conversion.  Also adding a few more tests
23142         to test-38.cs which should have caught this.
23143
23144         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23145         target in the makefile for this.  The makefile.gnu is primarily intended
23146         for end-users who don't want to debug the compiler.
23147
23148 2002-07-21  Martin Baulig  <martin@gnome.org>
23149
23150         * assign.cs: Improved the Assign class so it can now handle embedded
23151         assignments (X = Y = Z = something).  As a side-effect this'll now also
23152         consume less local variables.  test-38.cs now passes with MCS, added
23153         a few new test cases to that test.
23154
23155 2002-07-20  Martin Baulig  <martin@gnome.org>
23156
23157         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23158         instructions.  Fixes bug #27977, also added test-146.cs.
23159
23160 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23161
23162         * cs-tokenizer.cs: fixed getHex ().
23163
23164 2002-07-19  Martin Baulig  <martin@gnome.org>
23165
23166         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23167         not Type.GetType() to lookup the array type.  This is needed when
23168         we're constructing an array of a user-defined type.
23169         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23170         single-dimensional arrays, but also for single-dimensial arrays of
23171         type decimal.
23172
23173 2002-07-19  Martin Baulig  <martin@gnome.org>
23174
23175         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23176         this function is called, it's not allowed to share LocalBuilders
23177         among ILGenerators.
23178
23179 2002-07-19  Martin Baulig  <martin@gnome.org>
23180
23181         * expression.cs (Argument.Resolve): Report an error 118 when trying
23182         to pass a type as argument.
23183
23184 2002-07-18  Martin Baulig  <martin@gnome.org>
23185
23186         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23187         Conv_R_Un for the signed `long' type.
23188
23189 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23190
23191         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23192         `expr' for the temporary result, as that will fail if we do
23193         multiple resolves on the same expression.
23194
23195 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23196
23197         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23198         ec.TypeContainer for looking up aliases. 
23199
23200         * class.cs (TypeContainer): Remove LookupAlias from here.
23201
23202         * decl.cs (DeclSpace); Move here.
23203
23204 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23205
23206         * class.cs (FindMembers): Only call filter if the constructor
23207         bulider is not null.
23208
23209         Also handle delegates in `NestedTypes' now.  Now we will perform
23210         type lookups using the standard resolution process.  This also
23211         fixes a bug.
23212
23213         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23214         This uses Expressions (the limited kind that can be parsed by the
23215         tree) instead of strings.
23216
23217         * expression.cs (ComposedCast.ToString): Implement, used to flag
23218         errors since now we have to render expressions.
23219
23220         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23221         FormArrayType. 
23222
23223         * ecore.cs (SimpleName.ToString): ditto.
23224
23225         * cs-parser.jay: Instead of using strings to assemble types, use
23226         Expressions to assemble the type (using SimpleName, ComposedCast,
23227         MemberAccess).  This should fix the type lookups in declarations,
23228         because we were using a different code path for this.
23229
23230         * statement.cs (Block.Resolve): Continue processing statements
23231         even when there is an error.
23232
23233 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23234
23235         * class.cs (Event.Define): Also remove the `remove' method from
23236         the list of pending items.
23237
23238         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23239         generate more compact code. 
23240
23241 2002-07-17  Martin Baulig  <martin@gnome.org>
23242
23243         * const.cs (Const.LookupConstantValue): Add support for constant
23244         `unchecked' and `checked' expressions.
23245         Also adding test case test-140.cs for this.
23246
23247 2002-07-17  Martin Baulig  <martin@gnome.org>
23248
23249         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23250         check whether mi.ReturnType implements the IEnumerator interface; the
23251         `==' and the IsAssignableFrom() will fail in this situation.
23252
23253 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23254
23255         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23256         here too.
23257
23258 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23259
23260         * expression.cs: fixed bug #27811.
23261
23262 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23263
23264         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23265         Molaro: when we are a ref, the value already contains a pointer
23266         value, do not take the address of it.
23267
23268 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23269         * removed mb-parser.jay and mb-tokenizer.cs
23270
23271 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23272
23273         * expression.cs: check against the building corlib void type.
23274
23275 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23276
23277         * ecore.cs: fix for valuetype static readonly fields: when 
23278         initializing them, we need their address, not the address of a copy.
23279
23280 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23281
23282         * typemanager.cs: register also enum_type in corlib.
23283
23284 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23285
23286         * class.cs: allow calling this (but not base) initializers in structs.
23287
23288 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23289
23290         * ecore.cs: make sure we compare against the building base types
23291         in GetTypeSize ().
23292
23293 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
23294
23295         * typemanager.cs: fix TypeToCoreType() to handle void and object
23296         (corlib gets no more typerefs after this change).
23297
23298 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
23299
23300         * expression.cs (ArrayCreation.EmitArrayArguments): use
23301         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
23302
23303         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
23304         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
23305         array indexes, the runtime actually forbids them.
23306
23307         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
23308         for array arguments here.
23309
23310         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
23311         instead of the default for ValueTypes.
23312
23313         (New.DoEmit): Use IsValueType instead of
23314         IsSubclassOf (value_type)
23315         (New.DoResolve): ditto.
23316         (Invocation.EmitCall): ditto.
23317
23318         * assign.cs (Assign): ditto.
23319
23320         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
23321         Statements *are* currently doing part of their resolution during
23322         Emit.  
23323
23324         Expressions do always resolve during resolve, but statements are
23325         only required to propagate resolution to their children.
23326
23327 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
23328
23329         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
23330
23331         (LoadAssembly): Do not add the dll if it is already specified
23332
23333         (MainDriver): Add the System directory to the link path at the end,
23334         after all the other -L arguments. 
23335
23336         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
23337         wrong opcode for loading bytes and bools (ldelem.i1 instead of
23338         ldelem.u1) and using the opposite for sbytes.
23339
23340         This fixes Digger, and we can finally run it.
23341
23342         * driver.cs (UnixParseOption): Move the option parsing here.  
23343         (CSCParseOption): Implement CSC-like parsing of options.
23344
23345         We now support both modes of operation, the old Unix way, and the
23346         new CSC-like way.  This should help those who wanted to make cross
23347         platform makefiles.
23348
23349         The only thing broken is that /r:, /reference: and /lib: are not
23350         implemented, because I want to make those have the same semantics
23351         as the CSC compiler has, and kill once and for all the confussion
23352         around this.   Will be doing this tomorrow.
23353
23354         * statement.cs (Unsafe.Resolve): The state is checked during
23355         resolve, not emit, so we have to set the flags for IsUnsfe here.
23356
23357 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23358
23359         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
23360         not catch the Error_ObjectRefRequired in SimpleName (as it is
23361         possible to have a class/instance variable name that later gets
23362         deambiguated), we have to check this here.      
23363
23364 2002-07-10  Ravi Pratap  <ravi@ximian.com>
23365
23366         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
23367         make static and put into Expression.
23368
23369         (Event.Define): Register the private field of the event with the 
23370         TypeManager so that GetFieldFromEvent can get at it.
23371
23372         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
23373         keep track of the private field associated with an event which
23374         has no accessors.
23375
23376         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
23377         private field.
23378
23379         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
23380
23381 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
23382
23383         * expression.cs (Binary.EmitBranchable): this routine emits the
23384         Binary expression in a branchable context.  This basically means:
23385         we need to branch somewhere, not just get the value on the stack.
23386
23387         This works together with Statement.EmitBoolExpression.
23388
23389         * statement.cs (Statement.EmitBoolExpression): Use
23390         EmitBranchable. 
23391
23392 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
23393
23394         * statement.cs (For): Reduce the number of jumps in loops.
23395
23396         (For): Implement loop inversion for the For statement.
23397
23398         (Break): We can be breaking out of a Try/Catch controlled section
23399         (foreach might have an implicit try/catch clause), so we need to
23400         use Leave instead of Br.
23401
23402         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
23403         now).  If the instace expression supports IMemoryLocation, we use
23404         the AddressOf method from the IMemoryLocation to extract the
23405         address instead of emitting the instance.
23406
23407         This showed up with `This', as we were emitting the instance
23408         always (Emit) instead of the Address of This.  Particularly
23409         interesting when This is a value type, as we dont want the Emit
23410         effect (which was to load the object).
23411
23412 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
23413
23414         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
23415
23416         * statement.cs (Checked): Set the CheckedState during the resolve
23417         process too, as the ConvCast operations track the checked state on
23418         the resolve process, and not emit.
23419
23420         * cs-parser.jay (namespace_member_declaration): Flag that we have
23421         found a declaration when we do.  This is used to flag error 1529
23422
23423         * driver.cs: Report ok when we display the help only.
23424
23425 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
23426
23427         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
23428
23429 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
23430
23431         * cs-tokenizer.cs (define): We also have to track locally the
23432         defines.  AllDefines is just used for the Conditional Attribute,
23433         but we also need the local defines for the current source code. 
23434
23435 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
23436
23437         * statement.cs (While, For, Do): These loops can exit through a
23438         Break statement, use this information to tell whether the
23439         statement is the last piece of code.
23440
23441         (Break): Flag that we break.
23442
23443         * codegen.cs (EmitContexts): New `Breaks' state variable.
23444
23445 2002-07-03  Martin Baulig  <martin@gnome.org>
23446
23447         * class.cs (TypeContainer.MethodModifiersValid): Allow override
23448         modifiers in method declarations in structs.  Otherwise, you won't
23449         be able to override things like Object.Equals().
23450
23451 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23452
23453         * class.cs (Method, Property, Indexer): Do not allow the public
23454         modifier to be used in explicit interface implementations.
23455
23456         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
23457         override modifiers in method declarations in structs
23458
23459 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
23460
23461         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
23462         integer or real overflow, report an error
23463
23464 2002-07-02  Martin Baulig  <martin@gnome.org>
23465
23466         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
23467         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
23468         to tell the runtime about our newly created System.Object and
23469         System.ValueType types.
23470
23471 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
23472
23473         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
23474         struct instead of Ldarg/Starg.
23475
23476 2002-07-02  Martin Baulig  <martin@gnome.org>
23477
23478         * expression.cs (Indirection.Indirection): Call
23479         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
23480
23481 2002-07-02  Martin Baulig  <martin@gnome.org>
23482
23483         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
23484         ValueType, call TypeManager.TypeToCoreType() on it.
23485         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
23486         the OpCodes.Newarr argument.
23487
23488 2002-07-02  Martin Baulig  <martin@gnome.org>
23489
23490         * expression.cs (Invocation.EmitCall): When compiling corlib,
23491         replace all calls to the system's System.Array type to calls to
23492         the newly created one.
23493
23494         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
23495         System.Array methods.
23496         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
23497         from the system's System.Array type which must be replaced.
23498
23499 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
23500
23501         * typemanager.cs: load unverifiable_code_ctor so we can build
23502         corlib using the correct type. Avoid using GetTypeCode() with
23503         TypeBuilders.
23504         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
23505         TypeManager.object_type to allow building corlib.
23506
23507 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
23508
23509         * ecore.cs: handle System.Enum separately in LoadFromPtr().
23510
23511 2002-07-01  Martin Baulig  <martin@gnome.org>
23512
23513         * class.cs: Make the last change actually work, we need to check
23514         whether `ifaces != null' to avoid a crash.
23515
23516 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23517
23518         * class.cs: when we build structs without fields that implement
23519         interfaces, we need to add the interfaces separately, since there is
23520         no API to both set the size and add the interfaces at type creation
23521         time.
23522
23523 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23524
23525         * expression.cs: the dimension arguments to the array constructors
23526         need to be converted if they are a long.
23527
23528 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
23529
23530         * class.cs: don't emit ldarg.0 if there is no parent constructor
23531         (fixes showstopper for corlib).
23532
23533 2002-06-29  Martin Baulig  <martin@gnome.org>
23534
23535         MCS now compiles corlib on GNU/Linux :-)
23536
23537         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
23538         ie. check for MethodImplOptions.InternalCall.
23539
23540         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
23541         and TypeManager.attribute_type are null, so we must explicitly check
23542         whether parent is not null to find out whether it's an attribute type.
23543         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
23544         and SetBuilder, not only if the property is neither abstract nor external.
23545         This is necessary to set the MethodImplOptions on the accessor methods.
23546         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
23547         SetBuilder, see Property.Emit().
23548
23549         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
23550         populate "System.Object", "System.ValueType" and "System.Attribute" since
23551         they've already been populated from BootCorlib_PopulateCoreTypes().
23552
23553 2002-06-29  Martin Baulig  <martin@gnome.org>
23554
23555         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
23556         is the NullLiteral, we also need to make sure that target_type is not
23557         an enum type.   
23558
23559 2002-06-29  Martin Baulig  <martin@gnome.org>
23560
23561         * rootcontext.cs (RootContext.ResolveCore): We must initialize
23562         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
23563         before calling BootstrapCorlib_ResolveDelegate ().
23564
23565 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23566
23567         * statement.cs: fixed build-breaker. All tests passed ok.
23568
23569 2002-06-27  Martin Baulig  <martin@gnome.org>
23570
23571         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
23572         for System.Decimal when compiling corlib.
23573
23574 2002-06-27  Martin Baulig  <martin@gnome.org>
23575
23576         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
23577         switch blocks which contain nothing but a default clause.
23578
23579 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
23580
23581        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
23582
23583 2002-06-27  Martin Baulig  <martin@gnome.org>
23584
23585         * ecore.cs (PropertyExpr.PropertyExpr): Call
23586         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
23587
23588         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
23589         is already a TypeBuilder.
23590
23591 2002-06-27  Martin Baulig  <martin@gnome.org>
23592
23593         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
23594         `target_type == TypeManager.array_type', not IsAssignableFrom() in
23595         the "from an array-type to System.Array" case.  This makes it work
23596         when compiling corlib.
23597
23598 2002-06-27  Martin Baulig  <martin@gnome.org>
23599
23600         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
23601         non-static PropertyExpr, set its InstanceExpression.  This makes
23602         the `ICollection.Count' property work in System/Array.cs.
23603
23604 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
23605
23606         * driver.cs: Made error handling more consistent.  Errors now
23607         tracked by Report class, so many methods which used to return int
23608         now return void.  Main() now prints success/failure and 
23609         errors/warnings message.
23610
23611         Renamed '--probe' compiler argument to '--expect-error'.  Removed
23612         the magic number return values (123 and 124).  Now, if the
23613         expected error occurs, the compiler exits with success (exit value
23614         0).  If the compilation completes without seeing that particular
23615         error, the compiler exits with failure (exit value 1).  The
23616         makefile in mcs/errors has been changed to handle the new behaviour.
23617
23618         * report.cs: Made 'expected error' number a property and renamed
23619         it from 'Probe' to 'ExpectedError'.
23620
23621         * genericparser.cs: Removed error handling support, since it is
23622         now all done by Report class.
23623
23624         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
23625         class, so parse() no longer returns an int.
23626
23627         * namespace.cs: Use Report.Error instead of GenericParser.error
23628
23629 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
23630
23631         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
23632         TypeContainer.AddOperator): At the front of the list put the
23633         explicit implementations, so they get resolved/defined first. 
23634
23635 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
23636
23637         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
23638         interface type is implemented by this TypeContainer.  Used during
23639         explicit interface implementation.
23640
23641         (Property.Define, Indexer.Define, Method.Define): Validate that
23642         the given interface in the explicit implementation is one of the
23643         base classes for the containing type.
23644
23645         Also if we are explicitly implementing an interface, but there is
23646         no match in the pending implementation table, report an error.
23647
23648         (Property.Define): Only define the property if we are
23649         not explicitly implementing a property from an interface.  Use the
23650         correct name also for those properties (the same CSC uses,
23651         although that is really not needed).
23652
23653         (Property.Emit): Do not emit attributes for explicitly implemented
23654         properties, as there is no TypeBuilder.
23655
23656         (Indexer.Emit): ditto.
23657
23658         Hiding then means that we do not really *implement* a pending
23659         implementation, which makes code fail.
23660
23661 2002-06-22  Martin Baulig  <martin@gnome.org>
23662
23663         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
23664         the return value of Object.GetType().  [FIXME: we need to do this whenever
23665         we get a type back from the reflection library].
23666
23667 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
23668
23669         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
23670
23671 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
23672
23673         * attribute.cs: Return null if we can not look up the type.
23674
23675         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
23676         the interface types found.
23677
23678         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
23679         interface types found.
23680
23681         * typemanager.cs (GetInterfaces): Make this routine returns alll
23682         the interfaces and work around the lame differences between
23683         System.Type and System.Reflection.Emit.TypeBuilder in the results
23684         result for GetInterfaces.
23685
23686         (ExpandInterfaces): Given an array of interface types, expand and
23687         eliminate repeated ocurrences of an interface.  This expands in
23688         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
23689         be IA, IB, IC.
23690
23691 2002-06-21  Martin Baulig  <martin@gnome.org>
23692
23693         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
23694         on System.Enum.
23695
23696 2002-06-21  Martin Baulig  <martin@gnome.org>
23697
23698         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
23699         and called with one of the core types, return the corresponding typebuilder for
23700         that type.
23701
23702         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
23703         element type.
23704
23705 2002-06-21  Martin Baulig  <martin@gnome.org>
23706
23707         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
23708         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
23709         (Expression.ConvertReferenceExplicit): Likewise.
23710
23711         * expression.cs (ElementAccess.DoResolve): Likewise.
23712         (ElementAccess.DoResolveLValue): Likewise.
23713
23714 2002-06-10  Martin Baulig  <martin@gnome.org>
23715
23716         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
23717         add the "value" parameter to the parameter list.
23718
23719         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
23720         to our caller.
23721
23722 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
23723
23724         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
23725         the argument to an int, uint, long or ulong, per the spec.  Also
23726         catch negative constants in array creation.
23727
23728 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
23729
23730         * class.cs: do not allow the same interface to appear twice in
23731         the definition list.
23732
23733 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
23734
23735         * ecore.cs: don't use ldlen with System.Array.
23736
23737 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
23738
23739         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
23740
23741 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
23742
23743         * modifiers.cs: produce correct field attributes for protected
23744         internal. Easy fix so miguel can work on ther harder stuff:-)
23745
23746 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
23747
23748         * pending.cs: New file.  Move the code from class.cs here.
23749         Support clearning the pending flag for all methods (when not doing
23750         explicit interface implementation).
23751
23752 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
23753
23754         * rootcontext.cs: added a couple more types needed to bootstrap.
23755
23756 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
23757
23758         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
23759         constructor in the type, instead of any constructor in the type
23760         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
23761         a bug in the Mono runtime when applying the params attribute). 
23762
23763 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
23764         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
23765
23766 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
23767
23768         * expression.cs (Unary.ResolveOperator): Use TypeManager
23769         to resolve the type.
23770
23771 2002-06-13  Ravi Pratap  <ravi@ximian.com>
23772
23773         * cs-parser.jay (enum_member_declaration): Pass in the attributes
23774         attached.
23775
23776         * enum.cs (AddEnumMember): Add support to store the attributes associated 
23777         with each member too.
23778
23779         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
23780         field builders too - this takes care of the enum member case.
23781
23782 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
23783
23784         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
23785         address-of operator on both value types and pointers.
23786
23787 2002-06-10  Martin Baulig  <martin@gnome.org>
23788
23789         * interface.cs (Interface.PopulateIndexer): Add the indexer's
23790         PropertyBuilder to the `property_builders' list.
23791
23792         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
23793         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
23794         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
23795         find any indexers which are inherited from an interface.
23796
23797 2002-06-09  Martin Baulig  <martin@gnome.org>
23798
23799         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
23800         the same type as the constant if necessary.  There's also a test-130.cs
23801         for this.
23802
23803         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
23804
23805         * typemanager.cs (TypeManager.ChangeType): Previously known as
23806         Enum.ChangeEnumType().
23807
23808 2002-06-09  Martin Baulig  <martin@gnome.org>
23809
23810         * expression.cs (Cast.TryReduce): Added support for consts.
23811
23812 2002-06-08  Ravi Pratap  <ravi@ximian.com>
23813
23814         * class.cs (Accessor): Hold attributes information so we can pass
23815         it along.
23816
23817         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
23818         Modify to pass in attributes attached to the methods.
23819
23820         (add_accessor_declaration, remove_accessor_declaration): Ditto.
23821
23822         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
23823         to handle the Accessor kind :-)
23824
23825         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
23826
23827 2002-06-08  Martin Baulig  <martin@gnome.org>
23828
23829         * expression.cs (Unary.TryReduceNegative): Added support for
23830         ULongConstants.
23831
23832 2002-06-08  Martin Baulig  <martin@gnome.org>
23833
23834         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
23835         name can't be found in the `defined_names' - the caller will do a
23836         MemberLookup in this case and thus find methods in System.Enum
23837         such as Enum.IsDefined().
23838
23839 2002-06-08  Martin Baulig  <martin@gnome.org>
23840
23841         * enum.cs (Enum.ChangeEnumType): This is a custom version of
23842         Convert.ChangeType() which works with TypeBuilder created types.
23843         (Enum.LookupEnumValue, Enum.Define): Use it here.
23844
23845         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
23846         `TypeBuilder.BaseType != null' check.
23847         (TypeContainer.FindMembers): Only lookup parent members if we
23848         actually have a parent.
23849         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
23850         (ConstructorInitializer.Resolve): Likewise.
23851
23852         * interface.cs (Interface.FindMembers): Added
23853         `TypeBuilder.BaseType != null' check.
23854
23855         * rootcontext.cs (RootContext.ResolveCore): Added
23856         "System.Runtime.CompilerServices.IndexerNameAttribute" to
23857         classes_second_stage.
23858
23859         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
23860         debug_type and trace_type when compiling with --nostdlib.       
23861
23862 2002-06-07  Martin Baulig  <martin@gnome.org>
23863
23864         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
23865         (AddField): Set it to true when adding a non-static field.
23866         (DefineType): Use `have_nonstatic_fields' to find out whether we
23867         have non-static fields, not `Fields != null'.
23868
23869 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
23870
23871         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
23872         dereferencing a null on the static-field code path)
23873
23874 2002-05-30  Martin Baulig  <martin@gnome.org>
23875
23876         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
23877         to take command line arguments.  Use reflection to call the new
23878         custom `Initialize' function on the symbol writer and pass it the
23879         command line arguments.
23880
23881         * driver.cs (--debug-args): New command line argument to pass command
23882         line arguments to the symbol writer.
23883
23884 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
23885
23886         * assign.cs (DoResolve): Forgot to do the implicit conversion to
23887         the target type for indexers and properties.  Thanks to Joe for
23888         catching this.
23889
23890 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
23891
23892         * typemanager.cs (MethodFlags): returns the method flags
23893         (Obsolete/ShouldIgnore) that control warning emission and whether
23894         the invocation should be made, or ignored. 
23895
23896         * expression.cs (Invocation.Emit): Remove previous hack, we should
23897         not do this on matching a base type, we should do this based on an attribute
23898
23899         Only emit calls to System.Diagnostics.Debug and
23900         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
23901         on the command line.
23902
23903         * rootcontext.cs: Global settings for tracing and debugging.
23904
23905         * cs-tokenizer.cs (define): New utility function to track
23906         defines.   Set the global settings for TRACE and DEBUG if found.
23907
23908 2002-05-25  Ravi Pratap  <ravi@ximian.com>
23909
23910         * interface.cs (Populate*): Pass in the TypeContainer as well as
23911         the DeclSpace as parameters so that we can create EmitContexts and
23912         then use that to apply attributes etc.
23913
23914         (PopulateMethod, PopulateEvent, PopulateProperty)
23915         (PopulateIndexer): Apply attributes everywhere.
23916
23917         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
23918         etc.
23919
23920         (ApplyAttributes): Update accordingly.
23921
23922         We now apply interface attributes for all members too.
23923
23924 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
23925
23926         * class.cs (Indexer.Define); Correctly check if we are explicit
23927         implementation (instead of checking the Name for a ".", we
23928         directly look up if the InterfaceType was specified).
23929
23930         Delay the creation of the PropertyBuilder.
23931
23932         Only create the PropertyBuilder if we are not an explicit
23933         interface implementation.   This means that explicit interface
23934         implementation members do not participate in regular function
23935         lookups, and hence fixes another major ambiguity problem in
23936         overload resolution (that was the visible effect).
23937
23938         (DefineMethod): Return whether we are doing an interface
23939         implementation. 
23940
23941         * typemanager.cs: Temporary hack until we get attributes in
23942         interfaces (Ravi is working on that) and we get IndexerName
23943         support in interfaces.
23944
23945         * interface.cs: Register the indexers as properties.
23946
23947         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
23948         warning, I have verified that this is a bug in the .NET runtime
23949         (JavaScript suffers of the same problem).
23950
23951         * typemanager.cs (MemberLookup): When looking up members for
23952         interfaces, the parent of an interface is the implicit
23953         System.Object (so we succeed in searches of Object methods in an
23954         interface method invocation.  Example:  IEnumerable x;  x.ToString
23955         ()) 
23956
23957 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
23958
23959         * class.cs (Event): Events should also register if they do
23960         implement the methods that an interface requires.
23961
23962         * typemanager.cs (MemberLookup); use the new GetInterfaces
23963         method. 
23964
23965         (GetInterfaces): The code used to lookup interfaces for a type is
23966         used in more than one place, factor it here. 
23967
23968         * driver.cs: Track the errors at the bottom of the file, we kept
23969         on going.
23970
23971         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
23972         instance if the method we are calling is static!
23973
23974 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
23975
23976         * attribute.cs (ApplyAttributes): Make this function filter out
23977         the IndexerName attribute (as that attribute in reality is never
23978         applied) and return the string constant for the IndexerName
23979         attribute. 
23980
23981         * class.cs (TypeContainer.Emit): Validate that all the indexers
23982         have the same IndexerName attribute, and if so, set the
23983         DefaultName attribute on the class. 
23984
23985         * typemanager.cs: The return value might contain other stuff (not
23986         only methods).  For instance, consider a method with an "Item"
23987         property and an Item method.
23988
23989         * class.cs: If there is a problem with the parameter types,
23990         return. 
23991
23992 2002-05-24  Ravi Pratap  <ravi@ximian.com>
23993
23994         * ecore.cs (ImplicitConversionExists): Wrapper function which also
23995         looks at user defined conversion after making a call to 
23996         StandardConversionExists - we need this for overload resolution.
23997
23998         * expression.cs : Update accordingly the various method calls.
23999
24000         This fixes 2 bugs filed against implicit user defined conversions 
24001
24002 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24003
24004         * statement.cs: Track the result of the assignment.
24005
24006 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * expression.cs (MemberAccess): Improved error reporting for
24009         inaccessible members.
24010
24011 2002-05-22  Martin Baulig  <martin@gnome.org>
24012
24013         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24014         itself with debugging support.
24015
24016 2002-05-22  Martin Baulig  <martin@gnome.org>
24017
24018         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24019         Removed, this isn't needed anymore.
24020
24021 2002-05-20  Martin Baulig  <martin@gnome.org>
24022
24023         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24024         be underlying type for an enum.
24025
24026 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24027
24028         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24029         that splits out the loading of just the core types.
24030
24031         * rootcontext.cs (ResolveCore): Split the struct resolution in
24032         two, so we can load the enumeration underlying types before any
24033         enums are used.
24034
24035         * expression.cs (Is): Bandaid until we fix properly Switch (see
24036         bug #24985 for details).
24037
24038         * typemanager.cs (ImplementsInterface): The hashtable will contain
24039         a null if there are no interfaces implemented.
24040
24041 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24042
24043         * cs-parser.jay (indexer_declarator): It is fine to have array
24044         parameters
24045
24046 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24047
24048         * typemanager.cs: (RegisterBuilder): New function used to register
24049         TypeBuilders that implement interfaces.  Since
24050         TypeBuilder.GetInterfaces (as usual) does not work with lame
24051         Reflection.Emit. 
24052         (AddUserType): register interfaces.
24053
24054         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24055         dealing with TypeBuilder.  Also, arrays are showing up as
24056         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24057         methods can not be invoked on them!
24058
24059         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24060         (ImplicitReferenceConversionExists): Split out from
24061         StandardConversionExists. 
24062
24063         * expression.cs (As): We were only implementing one of the three
24064         cases for the as operator.  We now implement them all.
24065         (Is): Implement the various other cases for Is as well.
24066
24067         * typemanager.cs (CACHE): New define used to control if we want or
24068         not the FindMembers cache.  Seems to have a negative impact on
24069         performance currently
24070
24071         (MemberLookup): Nested types have full acess to
24072         enclosing type members
24073
24074         Remove code that coped with instance/static returns for events, we
24075         now catch this in RealFindMembers.
24076
24077         (RealFindMembers): only perform static lookup if the instance
24078         lookup did not return a type or an event.  
24079
24080 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24081
24082         * assign.cs (CompoundAssign): We pass more semantic information
24083         now to Compound Assignments than we did before: now we have all
24084         the information at hand, and now we resolve the target *before* we
24085         do the expression expansion, which allows the "CacheValue" method
24086         to have the effect we intended (before, a [x] += 1 would generate
24087         two differen ArrayAccess expressions from the ElementAccess,
24088         during the resolution process).
24089
24090         (CompoundAssign.DoResolve): Resolve target and original_source here.
24091
24092 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24093
24094         * expression.cs (ArrayAccess): dropped debugging information. 
24095
24096         * typemanager.cs: Small bug fix: I was always returning i_members,
24097         instead of one of i_members or s_members (depending on which had
24098         the content).
24099
24100         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24101         method is invoked before any code generation takes place, and it
24102         is a mechanism to inform that the expression will be invoked more
24103         than once, and that the method should use temporary values to
24104         avoid having side effects
24105
24106         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24107
24108         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24109         implementation.
24110
24111         * expression.cs (Indirection, ArrayAccess): Add support for
24112         CacheTemporaries in these two bad boys. 
24113
24114         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24115         ldobj or ldind_ref.  
24116         (StoreFromPtr): Handle stobj as well.
24117
24118         * expression.cs (UnaryMutator): Share more code.
24119
24120         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24121         down: I was not tracking the Filter function as well, which
24122         was affecting the results of the cache.
24123
24124 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24125
24126         * attribute.cs: Remove the hack to handle the CharSet property on
24127         StructLayouts. 
24128
24129 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24130
24131         * attribute.cs (DoResolve): More uglyness, we now only try to
24132         resolve the attribute partially, to extract the CharSet
24133         information (only if we are a StructLayout attribute).  Otherwise 
24134
24135         (GetExtraTypeInfo): Add some code to conditionally kill in the
24136         future this.   I am more and more convinced that the .NET
24137         framework has special code to handle the attribute setting on
24138         certain elements.
24139
24140         * expression.cs (IsParamsMethodApplicable): Revert my previous
24141         foreach change here, it was wrong.
24142
24143 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24144
24145         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24146         (pp_expr): do not abort on unknown input, just return.
24147         (eval): abort if there are pending chars.
24148
24149         * attribute.cs (Attribute.Resolve): Positional parameters are
24150         optional.  Deal with that case.
24151
24152         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24153         the Ansi/Unicode/Auto information for the type.
24154
24155         (TypeContainer.DefineType): instantiate the EmitContext here, as
24156         we will be using it during the type definition (to resolve
24157         attributes) and during the emit phase.
24158
24159         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24160         to pull type information out of the attributes
24161
24162         (Attribute.Resolve): track the constructor builder, and allow for
24163         multiple invocations (structs and classes will use this).
24164
24165         * ecore.cs (MemberLookupFinal): new version with all the
24166         parameters customizable.
24167
24168         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24169         constructors.  Return if the result value is null (as the error
24170         would have been flagged already by MemberLookupFinal)
24171
24172         Do not allow instances of abstract classes or interfaces to be
24173         created.
24174
24175         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24176         We have to compare the assembly property here when dealing with
24177         FamANDAssem and Assembly access modifiers, because we might be
24178         creating an assembly from *modules* (that means that we are not
24179         getting TypeBuilders for types defined in other modules that are
24180         part of this assembly).
24181
24182         (Method.Emit): If the method is marked abstract and has a body,
24183         emit an error. 
24184
24185         (TypeContainer.DefineMembers): If both the defined member and the
24186         parent name match are methods, then do not emit any warnings: let
24187         the Method.Define routine take care of flagging warnings.  But if
24188         there is a mismatch (method overrides something else, or method is
24189         overriwritten by something, then emit warning).
24190
24191         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24192         set to null, this means `do not check for the return type on the
24193         signature'. 
24194
24195         (Method.Define): set the return type for the method signature to
24196         null, so that we get methods with the same name and parameters and
24197         different return types.  This is used to flag warning 114 (you are
24198         hiding a method, and you probably want to use the new/override
24199         keywords instead).
24200
24201         * typemanager.cs (MemberLookup): Implemented proper access
24202         control, closing a long standing set of bug reports.  The problem
24203         was that the Framework only has two bits: Public and NonPublic,
24204         and NonPublic includes private and protected methods, but we need
24205         to enforce the FamANDAssem, FamOrAssem and Family. 
24206
24207 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24208
24209         * statement.cs (GotoCase): Return true: Ammounts to giving up
24210         knowledge on whether we return or not, and letting the other case
24211         be responsible for it.
24212
24213 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * driver.cs: Do not load directories for each file processed, only
24216         do it if there is a pattern.
24217
24218         * ecore.cs: Report readonly assigns here as well, as we might have
24219         been resolved only by MemberAccess.
24220
24221         (SimpleName.SimpleNameResolve): Also be useful for LValue
24222         resolution.   We need this to propagate assign to local readonly variables
24223
24224         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24225         do not want to reuse potential criteria memory.
24226
24227         * class.cs (MyEventBuilder): Set reflected_type;
24228
24229         * ecore.cs (Constantify): Added support for constifying bools.
24230
24231         (RootContext.LookupType): Added a cache for values looked up in
24232         the declaration space.
24233
24234         * typemanager.cs (FindMembers): Now is a front-end to
24235         RealFindMembers, and provides a two-level hashtable-based cache to
24236         the request.  
24237
24238         15% performance improvement: from 22.5 to 19.2 seconds.
24239
24240         * expression.cs (IsParamsMethodApplicable): use foreach.
24241         (Invocation.DoResolve): ditto.
24242         (New.DoResolve): ditto.
24243         (ArrayCreation.DoResolve): ditto.
24244
24245         * ecore.cs (FindMostEncompassingType): use foreach.
24246
24247         * delegate.cs (NewDelegate.DoResolve): Use foreach
24248
24249         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24250         (RemoveMethods): use foreach.
24251
24252         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24253         nested foreach statements instead of for, and also break out of
24254         the inner loop once a match is found.
24255
24256         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24257
24258 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24259
24260         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24261         we actually unwrap the expression to allow for extra information
24262         to be extracted. 
24263
24264         * expression.cs: Use Shr_Un on unsigned operations. 
24265
24266 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24267
24268         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24269         applicable operators was not being considered correctly. This closes
24270         the bug Miguel reported.
24271
24272 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24273
24274         * attribute.cs: check that the type derives from System.Attribute
24275         and report the correct error in that case (moved the duplicate code to
24276         its own method, too).
24277
24278 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24279
24280         * attribute.cs: lookup attribute type name as the spec says: first the
24281         bare attribute name and then name + "Attribute" (nant compiles with
24282         mcs after this fix).
24283
24284 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24285
24286         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24287         Because of the way we parse things, we should try to see if a
24288         UIntConstant can fit in an integer.
24289
24290 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24291
24292         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
24293         when we are in an explicit context.
24294
24295         (ConvertReferenceExplicit): When converting from Iface type S to Class
24296         T make sure the rules are implemented as an OR.
24297
24298         * parameter.cs (ParameterType): Make it a property for now although the
24299         purpose really isn't anything immediate.
24300
24301         * expression.cs (Is*Applicable): Do better checking on the parameter type
24302         of a ref/out parameter. The ones from the system assemblies are already 
24303         marked with the correct type so we don't need to do any correction.
24304
24305         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
24306         the object type is standard too so include that.
24307
24308 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24309
24310         * ecore.cs (StandardConversionExists): Augment with missing code:
24311         deal with IntConstant, LongConstants and Enumerations.
24312
24313         * assign.cs: Report the error, instead of failing silently
24314
24315         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
24316         typecontainer that they are declared, because the
24317         typecontainer/namespace will have the list of using clauses that
24318         need to be applied.
24319
24320         Assembly Attributes were escaping the normal registration
24321         mechanism. 
24322
24323         (EmitCode): Apply attributes within an EmitContext that represents
24324         the container they were declared on.
24325
24326         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
24327
24328 2002-05-06  Ravi Pratap  <ravi@ximian.com>
24329
24330         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
24331         Revamp completely - make much cleaner as we now operate only
24332         on a set of Types.
24333
24334         (FindMostSpecificSource, FindMostSpecificTarget): New methods
24335         to implement the logic detailed in the spec more correctly.
24336
24337         (UserDefinedConversion): Update accordingly.
24338
24339 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24340
24341         * statement.cs: Return flow analysis information up.
24342
24343         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
24344         and the default.
24345
24346         (token): Do not consume an extra character before calling
24347         decimal_digits.
24348
24349 2002-05-06  Piers Haken <piersh@friskit.com>
24350
24351         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
24352
24353 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
24354
24355         * class.cs (Constructor.Emit): Set the IsStatic flag in the
24356         EmitContext during the instance constructor initializer
24357         resolution, to stop access to instance variables.
24358
24359         This is mandated by the spec, last paragraph of the `constructor
24360         initializers' section. 
24361
24362 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
24363
24364         * cs-parser.jay, class.cs (Accessor): new class used to represent
24365         an accessor (get or set).  In the past we used `null' to represent
24366         a missing accessor.  But this is ambiguous because there was no
24367         way to tell in abstract indexers/properties if one of them was
24368         specified.
24369
24370         Now there is a way of addressing that.
24371
24372         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
24373         instead of FindMembers.
24374
24375         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
24376         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
24377
24378         * attribute.cs: Treat indexers and properties as the same in terms
24379         of applying attributes
24380
24381         * ecore.cs (FindMostEncompassedType): Use statically initialized
24382         EmptyExpressions()s like we do elsewhere to avoid creating useless
24383         objects (and we take this out of the tight loop).
24384
24385         (GetConversionOperators): Move the code to extract the actual
24386         operators to a separate routine to clean things up.
24387
24388 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
24389
24390         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
24391         events are always registered FieldBuilders.
24392
24393         * class.cs (FieldBase): New class shared by Fields 
24394
24395         * delegate.cs: If we are a toplevel delegate, use our full name.
24396         If we are a nested delegate, then only use our tail name.
24397
24398 2002-05-02  Ravi Pratap  <ravi@ximian.com>
24399
24400         * expression.cs (IsApplicable): Ensure that we add the "&" to
24401         ref/out types before comparing it with the type of the argument.
24402
24403         (IsParamsMethodApplicable): Ditto.
24404
24405         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
24406         silly me ;-)
24407
24408         * delegate.cs : Handle the case when we have more than one applicable
24409         method. Flag an error only when we finish checking all.
24410
24411 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
24412
24413         * expression.cs: Add support for boolean static initializers.
24414
24415 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
24416
24417         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
24418
24419         * parameter.cs (ComputeParameterTypes,
24420         ComputeAndDefineParameterTypes): Better error handling: now we
24421         clear the `types' cache if we fail during any of the type lookups.
24422         We also return the status code correctly to our caller
24423
24424         * delegate.cs: If we fail to define a delegate, abort the extra
24425         steps. 
24426
24427         * expression.cs (Binary.ResolveOperator): for
24428         operator==(object,object) and operator !=(object, object) we also
24429         have to verify that there is an implicit conversion from one to
24430         the other.
24431
24432         (ArrayAccess.DoResolve): Array Access can operate on
24433         non-variables. 
24434
24435 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
24436
24437         * assign.cs (CompoundAssign): A new class used as a "flag" that
24438         the assignment actually is happening as part of a compound
24439         assignment operator.
24440
24441         During compound assignment, a few new rules exist to enable things
24442         like:
24443
24444         byte b |= 1 + 2
24445
24446         From the spec:
24447
24448         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
24449         to the type of x) if y is implicitly convertible to the type of x,
24450         and the operator is a builtin operator and the return type of the
24451         operator is explicitly convertible to the type of x. 
24452
24453         * rootcontext.cs: Reset warning level to 2.  4 catches various
24454         "interesting" features in mcs, we must clean this up at some
24455         point, but currently am trying to kill other bugs ;-)
24456
24457         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
24458         in container classes as well.  
24459
24460         * expression.cs (Binary.ResolveOperator): Handle string case
24461         before anything else (as operator overloading does emit an error
24462         before doing anything else).
24463
24464         This code could go away when we move to a table driven model, but
24465         i could not come up with a good plan last night.
24466
24467 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
24468
24469         * typemanager.cs (CSharpName): reimplementation using regex.
24470         * class.cs: added null check for fields in Emit
24471         * rootcontext.cs: set warninglevel to 4
24472
24473 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
24474
24475         * typemanager.cs (CSharpName): reimplemented with Lupus
24476         suggestion.
24477
24478 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
24479
24480         * statement.cs (If): correclty implement Resolve, because we were
24481         not catching sem errors in there.  The same process is needed
24482         everywhere else. 
24483         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
24484
24485
24486         (Statement.Warning_DeadCodeFound): Factorize code.
24487         (While): Report dead code here too.
24488
24489         (Statement): Added Resolve virtual method to allow
24490         for resolution split from the emit code.
24491
24492 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * statement.cs (EmitBoolExpression): No longer try to resolve the
24495         expression here.    
24496         (MakeBoolean): New utility function that resolve, implicitly
24497         converts to boolean and tags the expression. 
24498
24499
24500         (If, Do): Implement dead code elimination.
24501         (While): Implement loop inversion
24502
24503         (Do, While, For, If): Resolve the expression prior to calling our
24504         code generation.
24505
24506 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
24507
24508         * class.cs:
24509           - added method Report28 (warning: program has more than one entry point)
24510           - added method IsEntryPoint, implements paragraph 10.1 of the spec
24511           - modified method Method.Define, the part at the end of the method
24512
24513         * rootcontext.cs: added static public Location EntryPointLocation;
24514           
24515         * ../errors/cs0028.cs : Add test case for the above warning.              
24516
24517         * typemanager.cs:
24518           - modified method CSharpName to allow arrays of primitive type to
24519             be printed nicely (e.g. instead of System.Int32[][] it now prints
24520             int[][])
24521           - added method CSharpSignature: returns the signature of a method
24522             in string format to be used in reporting errors, warnings, etc.
24523
24524         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
24525         with String.Empty.
24526
24527 2002-04-26  Ravi Pratap  <ravi@ximian.com>
24528
24529         * delegate.cs (Define): Fix extremely silly bug where I was
24530         setting the type of the 'object' parameter of the BeginInvoke
24531         method to System.IAsyncResult instead of System.Object ;-)
24532
24533 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
24534
24535         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
24536         here. 
24537
24538         (Constructor.Emit): return if we fail to initialize the
24539         constructor.  Another door closed!  
24540
24541         * expression.cs (New.DoResolve): Improve error message (from -6 to
24542         1501).  Use DeclaredOnly lookup to find the exact constructor.
24543
24544         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
24545         loop.  This is useful.
24546
24547         * cs-parser.jay: Adjust the default parameters so that destructors
24548         have the proper signature.
24549
24550 2002-04-26  Martin Baulig  <martin@gnome.org>
24551
24552         * driver.cs (LoadAssembly): If `assembly' contains any characters
24553         which are only valid in path names and not in assembly names
24554         (currently slash, backslash and point), use Assembly.LoadFrom ()
24555         instead of Assembly.Load () on the `assembly' (before iteration
24556         over the link_paths).
24557
24558 2002-04-26  Martin Baulig  <martin@gnome.org>
24559
24560         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
24561
24562 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
24563
24564         * class.cs (Property): use the new typemanager.MemberLookup
24565
24566         (TypeContainer.MemberLookup): Implement using the
24567         TypeManager.MemberLookup now. 
24568
24569         * typemanager.cs: Make MemberLookup a function of the TypeManager,
24570         and return MemberInfos, so that these can be used without an
24571         EmitContext (what we had before).
24572
24573 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
24574
24575         * expression.cs: Fix the case where the argument to params if the
24576         type of the params.  I omitted handling this before.   Fixed
24577
24578 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24579
24580         * driver.cs: Call BootCorlib_PopulateCoreType
24581
24582         * class.cs (Property.CheckBase): Check for properties only, not
24583         for all members. 
24584
24585         * interface.cs: Temporary hack: try/catch around the
24586         CustomAttributeBuilder, because I am getting an exception that I
24587         do not understand.
24588
24589         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
24590         types whose definitions are required to be there (attributes are
24591         defined before standard types).
24592
24593         Compute definitions as we boot the various types, as they are used
24594         immediately (value_type class will need object_type, but if we do
24595         not initialize object_type, we will pass a null, which will let
24596         the runtime pick the System.Object from the existing corlib, which
24597         is not what we want).
24598
24599 2002-04-22  Patrik Torstensson <totte@labs2.com>
24600
24601         * cs-tokenizer.cs: fixed a number of trim() issues.
24602
24603 2002-04-22  Ravi Pratap  <ravi@ximian.com>
24604
24605         * expression.cs (Argument.Type): Ensure that we return the correct
24606         type when we have out or ref parameters [in which case we 
24607         append a "&"].
24608
24609 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
24610
24611         * class.cs (Property, Indexer): Allow extern modifier in there. 
24612
24613         * typemanager.cs (InitBaseTypes): Initializes object_type and
24614         value_type, since those will be used early on during the bootstrap
24615         process to compile corlib.
24616
24617         (InitCoreTypes): Move code from here to InitBaseTypes.
24618
24619 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
24620
24621         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
24622         single-dimension arrays as using the ldlen opcode.  
24623
24624         Daniel Lewis discovered this optimization.  
24625
24626         * typemanager.cs: Add signature for System.Array::get_Length
24627
24628 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24629
24630         * statement.cs: report the error when the foreach does not apply to an
24631         array nor a collection.
24632
24633 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
24634
24635         * expression.cs: Add implicit conversions to the operator ~.
24636
24637         * constant.cs (DecimalConstant.Emit): Emit decimal value.
24638
24639         * typemanager.cs: Locate the decimal constructor.
24640
24641 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24642
24643         * attribute.cs: use the new property of TypeOf.
24644         * expression.cs: added 'get' property around typearg.
24645
24646         These changes fix a build breaker reported by NickD. Is this the
24647         correct way to fix?  If not, please, revert my changes and make it
24648         work :-).
24649
24650 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * attribute.cs: Add support for typeof in attribute invocations.
24653         I am not sure that this is right though.
24654
24655 2002-04-14  Duncan Mak  <duncan@ximian.com>
24656
24657         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
24658         Binary.Operator.Division case.
24659
24660 2002-04-13  Ravi Pratap  <ravi@ximian.com>
24661
24662         * class.cs (DefineType): Ensure that we do a proper check on
24663         attribute types and also register it with the TypeManager.
24664
24665         (TypeContainer.Targets): The default for attribute types is
24666         AttributeTargets.All.
24667
24668         * attribute.cs (ApplyAttributes): Registering the attribute type
24669         is done elsewhere, not when we discover we have a Usage attribute.
24670
24671 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24672
24673         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
24674         and get rid of is_delegate parameter.
24675
24676         * everywhere : update.
24677
24678 2002-04-12  Ravi Pratap  <ravi@ximian.com>
24679
24680         * cs-parser.jay (compilation_unit): Revamp completely to use
24681         some new ideas that I got from Rhys' grammar to solve the problems
24682         with assembly level attributes.
24683
24684         (outer_declaration): New grammar production.
24685
24686         (attribute_sections): Add.
24687
24688         (opt_attributes): Base on attribute_sections
24689
24690         (namespace_declaration): Allow opt_attributes to tackle the case
24691         when we have assembly level attributes - we are clever in this
24692         regard now ;-)
24693
24694         * attribute.cs (ApplyAttributes): Do not worry about assembly 
24695         attributes in the non-global context.
24696
24697         * rootcontext.cs (AddGlobalAttributes): Go back to using this
24698         instead of SetGlobalAttributes.
24699
24700         * class.cs, rootcontext.cs : Ensure we define and generate 
24701         attribute types before anything else.
24702
24703         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
24704         and flag the new error -20 for the case when the attribute type
24705         does not have valid targets specified. csc does not catch this.
24706
24707         * ../errors/errors.txt : update for error # -20
24708
24709 2002-04-11  Ravi Pratap  <ravi@ximian.com>
24710
24711         * support.cs (InternalParameters.ParameterModifier): Do some null
24712         checking and return sane values.
24713
24714         * class.cs (Method.Define): If we are a PInvoke method, ensure
24715         that we are static and extern. Report error # 601
24716
24717         * ../errors/cs0601.cs : Add test case for the above error.
24718
24719 2002-04-07  Ravi Pratap  <ravi@ximian.com>
24720
24721         * rootcontext.cs (attribute_types): We need to keep type of
24722         all attribute types separately and emit code for them first.
24723
24724         (RegisterAttribute) : Implement.
24725
24726         * class.cs (DefineType): Check if the current Type is a custom
24727         attribute type and register it accordingly.
24728
24729         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
24730         adding the first attribute twice and rename to
24731
24732         (SetGlobalAttributes): this.
24733
24734         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
24735         lookups.
24736
24737         * attribute.cs (ApplyAttributes): Take an additional argument telling us
24738         if we are processing global arguments. Hmm, I am unsure of this.
24739
24740 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24741
24742         * expression.cs: added static array of strings to avoid calling
24743         Enum.ToString () for Operator in Binary. Significant recover of
24744         performance.
24745
24746 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
24747
24748         * class.cs (FindMembers): Allow the Builders of the various
24749         members to be null.  If they are skip them.  This only happens
24750         during the PInvoke declaration.
24751
24752 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
24753
24754         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
24755         failure, so we do not keep going afterwards.
24756
24757         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
24758         wanted to pass `false' as the `is_delegate' argument.  If this is
24759         the case, why not use delegate_type == null to mean `is_delegate =
24760         false' and anything else as is_delegate = true.
24761
24762 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
24763
24764         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
24765         code for the section, not the beginning of the tests.
24766
24767 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
24768
24769         * cfold.cs: Handle operator + (Enum x, Underlying x) 
24770
24771         * expression.cs (Binary): same.  Warn about errors where we have
24772         Enum/Enum in operator + as well.
24773
24774 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
24775
24776         * statement.cs:
24777                 - added support for switch(bool)
24778                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
24779                 - add TableSwitchEmit() to handle table-based switch statements
24780
24781 2002-04-05  Ravi Pratap  <ravi@ximian.com>
24782
24783         * expression.cs (Invocation.OverloadResolve): Factor out code which
24784         does parameter compatibility checking with arguments so that we can 
24785         re-use the code even from Delegate.VerifyApplicability
24786
24787         (VerifyArgumentsCompat): Move above code here.
24788
24789         * delegate.cs (VerifyApplicability): Get rid of duplicate code
24790         and instead make a call to the above method.
24791
24792 2002-03-31  Ravi Pratap  <ravi@ximian.com>
24793
24794         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
24795         We use it to keep track of classes which are attribute types.
24796
24797 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
24798
24799         * delegate.cs (Delegate.Define): Correctly define the types in the
24800         presence of fixed and array parameters.
24801
24802         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
24803         doing FindMembers.
24804
24805         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
24806         include NonPublic after the first iteration.
24807
24808         * class.cs (Indexer.CheckBase): Only check if both parents are
24809         non-null. 
24810
24811         * cs-parser.jay (accessor_body): If empty, set to null.
24812
24813         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
24814         same code path here to resolve constants names that we did have in
24815         MemberAccess.DoResolve.  There is too much code duplicated here.
24816
24817 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
24818
24819         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
24820
24821         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
24822         to MakeUnionSet.
24823
24824         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
24825         tokens, numbers and strings.
24826
24827         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
24828         parenthesis.
24829
24830         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
24831         asyncronous parameters and the regular parameters.  
24832
24833         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
24834         specify the target directory.
24835
24836         * expression.cs: (This.DoResolve): Simplify
24837         (As.Emit): Optimize, do not generate IsInst if the expression is
24838         always of the given type.
24839
24840         (Is.DoResolve): Bug fix, we were reporting both always/never for
24841         the is expression.
24842
24843         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
24844         creating too many unnecessary arrays.
24845
24846 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
24847
24848         * class.cs (EmitFieldInitializer): Use Assign expression to assign
24849         fields instead of rolling our own initializer.   Takes care of all
24850         implicit conversions, and drops unnecessary static checks/argument.
24851
24852 2002-03-31  Dick Porter  <dick@ximian.com>
24853
24854         * driver.cs: use the GetDirectories() return values properly, and
24855         use "/" as path separator.
24856
24857 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
24858
24859         * expression.cs (Unary): Optimize - - expr into expr.
24860         (Binary): Optimize a + (-b) into a -b.
24861
24862         * codegen.cs (CodeGen): Made all methods static.
24863
24864 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
24865
24866         * rootcontext.cs: 
24867
24868         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
24869         TypeBuilder property.
24870
24871         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
24872         instead. 
24873
24874         * tree.cs: Removed the various RecordXXXX, and replaced with a
24875         single RecordDecl.  Removed all the accessor methods, and just
24876         left a single access point Type 
24877
24878         * enum.cs: Rename DefineEnum to DefineType.
24879
24880         * decl.cs: New abstract method `DefineType' used to unify the
24881         Defines for Enumerations, Interfaces, TypeContainers and
24882         Delegates.
24883
24884         (FindType): Moved LookupInterfaceOrClass here.  Moved the
24885         LookupBaseClasses method that used to live in class.cs and
24886         interface.cs here, and renamed to FindType.
24887
24888         * delegate.cs: Implement DefineType.  Take advantage of the
24889         refactored pattern for locating the parent builder without taking
24890         the parent_builder argument (which we know does not work if we are
24891         nested, and triggering a toplevel definition).
24892
24893 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24894
24895         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
24896         accessibility of a member has changed during override and report
24897         an error if so.
24898
24899         * class.cs (Method.Define, Property.Define): Only complain on
24900         overrides if the method is private, any other accessibility is
24901         fine (and since we just checked the permission is the same, we are
24902         good to go).
24903
24904         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
24905         and elif are processed always.  The other pre-processing
24906         directives are only processed if we are "taking" the path
24907
24908 2002-03-29  Martin Baulig  <martin@gnome.org>
24909
24910         * class.cs (Method.Emit): Only emit symbolic debugging info if the
24911         current location is not Null.
24912
24913         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
24914         a separate method so we can profile it.
24915
24916         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
24917         `span.Seconds' are just seconds, but no minutes or hours.
24918         (MainDriver): Profile the CodeGen.SaveSymbols calls.
24919
24920 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24921
24922         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
24923         Remove the gratuitous set of Final:
24924
24925                                 // If an interface implementation, then we can set Final.
24926                                 if (((flags & MethodAttributes.Abstract) == 0) &&
24927                                     implementing.DeclaringType.IsInterface)
24928                                         flags |= MethodAttributes.Final;
24929
24930         I do not know what I was smoking when I used that.
24931
24932
24933         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
24934         step into fixing the name resolution issues for delegates and
24935         unifying the toplevel name resolution.
24936
24937 2002-03-28  Martin Baulig  <martin@gnome.org>
24938
24939         * class.cs (Method.Emit): If we have a symbol writer, call its
24940         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
24941         tell it about the current method.
24942
24943         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
24944         writer that we're going to emit the first byte of IL code for a new
24945         statement (a new source line).
24946         (EmitContext.EmitTopBlock): If we have a symbol writer, call
24947         EmitContext.Mark() before emitting any code.
24948
24949         * location.cs (SymbolDocument): Return null when we're Null.
24950
24951         * statement.cs (Statement): Moved the `Location loc' variable here.
24952         (Statement.EmitBoolExpression): If we have a symbol writer, call
24953         ec.Mark() before emitting any code to tell it that we're at the
24954         beginning of a new statement.
24955         (StatementExpression): Added `Location' argument to the constructor.
24956         (Block): Added public readonly variable `StartLocation' and public
24957         variable `EndLocation'.  The latter is to be set using SetEndLocation().
24958         (Block): Added constructor which takes a start and end location.
24959         (Block.SetEndLocation): New method. This sets the end location.
24960         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
24961         local variables we create.
24962         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
24963         each statement and do also mark the begin and end of the block.
24964
24965         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
24966         tell it the current lexer.Location, use Location.Null for the end of the
24967         block.
24968         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
24969         current block, set its end location using SetEndLocation().
24970         (statement_expression): StatementExpression constructor now takes the
24971         lexer.Location as additional argument.
24972         (for_statement, declare_local_variables): Likewise.
24973         (declare_local_variables): When creating a new implicit block, use the
24974         new Block constructor and pass it the lexer.Location.
24975
24976 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
24977
24978         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
24979         members also on the parent interfaces recursively.
24980
24981 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
24982
24983         * report.cs: Use new formats, since Gonzalo finished the missing
24984         bits. 
24985
24986         * expression.cs (Binary.ResolveOperator): added missing operator|
24987         operator& and operator^ for bool/bool.
24988
24989         * cs-parser.jay: CheckDef now takes a Location argument that is
24990         used to report errors more precisly (instead of reporting the end
24991         of a definition, we try to track something which is a lot closer
24992         to the source of the problem).
24993
24994         * cs-tokenizer.cs: Track global token use, so we can properly flag
24995         the use of #define/#undef after the first token has been seen.
24996
24997         Also, rename the reportXXXX to Error_DescriptiveName
24998
24999         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25000         TypeContainer, so that Enum and Interface can use this too.
25001
25002         * class.cs (TypeContainer.LookupInterfaceOrClass,
25003         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25004         `builder' argument.  Typically this was used to pass the parent
25005         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25006         the definition).  
25007
25008         The problem is that a nested class could trigger the definition of
25009         a toplevel class, and the builder would be obviously wrong in that
25010         case. 
25011
25012         So we drop this argument, and we compute dynamically the
25013         TypeBuilder/ModuleBuilder (the correct information was available
25014         to us anyways from DeclSpace.Parent)
25015
25016         * interface.cs (Interface.DefineInterface): Drop builder
25017         parameter cleanup like class.cs
25018
25019         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25020         like class.cs
25021
25022         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25023         values. 
25024
25025         (Try.Emit): Propagate the returns value from the statement.
25026
25027         (Return.Emit): Even if we are leavning 
25028
25029         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25030
25031         * modifiers.cs: Fix the computation of MethodAttributes flags.
25032
25033 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25034
25035         * driver.cs: allow compilation of files that start with '/'.
25036         Add a default case when checking the argument of --target.
25037
25038 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25039
25040         * interface.cs: Implement the same search algorithm for types in
25041         the interface code.
25042
25043         * delegate.cs: Do not allow multiple definition.
25044
25045         * Recovered ChangeLog that got accidentally amputated
25046
25047         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25048
25049         * rootcontext.cs: Load manually enum to allow core classes to
25050         contain enumerations.
25051
25052         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25053         Update to new static methods in TypeManager.
25054
25055         * typemanager.cs (GetMethod, GetConstructor): Use our
25056         implementation of FindMembers to find the members, since during
25057         corlib compilation, the types are TypeBuilders and GetMethod and
25058         GetConstructor do not work.
25059
25060         Make all methods in TypeManager static.
25061
25062         (InitCodeHelpers): Split the functionality from
25063         the InitCodeTypes function.
25064
25065         * driver.cs: Call InitCodeHelpers after we have populated the
25066         types. 
25067
25068         * cs-parser.jay (delegate_declaration): we did not used to compute
25069         the delegate name correctly for void delegates.
25070
25071 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25072
25073         * rootcontext.cs (RootContext): Init the interface_resolve_order
25074         and type_container_resolve_order always.
25075
25076         (ResolveCore, BootstrapCorlib_ResolveClass,
25077         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25078         compiler when compiling with --nostdlib
25079
25080         * class.cs (TypeContainer.DefineType): Check that our parent is
25081         not null.  This test is most important when we are bootstraping
25082         the core types.
25083
25084         * codegen.cs: Split out the symbol writing code.
25085
25086 2002-03-25  Martin Baulig  <martin@gnome.org>
25087
25088         * driver.cs (-g): Made -g an alias for --debug.
25089
25090 2002-03-24  Martin Baulig  <martin@gnome.org>
25091
25092         * codegen.cs (SymbolWriter): New public variable. Returns the
25093         current symbol writer.
25094         (CodeGen): Added `bool want_debugging_support' argument to the
25095          constructor. If true, tell the ModuleBuild that we want debugging
25096         support and ask it for the ISymbolWriter.
25097         (Save): If we have a symbol writer, call it's Close() method after
25098         saving the assembly.
25099
25100         * driver.c (--debug): New command line argument to create a
25101         debugger information file.
25102
25103         * location.cs (SymbolDocument): New public property. Returns an
25104         ISymbolDocumentWriter object for the current source file or null
25105         if we don't have a symbol writer.
25106
25107 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25108
25109         * driver.cs (LoadAssembly): Correctly return when all the paths
25110         have been tried and not before.
25111
25112         * statement.cs (Switch.Emit): return the actual coverage for this
25113         statement (returns/not-returns)
25114
25115         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25116         switch of the statement if we are the last switch section.  That
25117         kills two problems: try/catch problems (we used to emit an empty
25118         nop at the end) and switch statements where all branches would
25119         return. 
25120
25121 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * driver.cs: Add default assemblies (the equivalent to the
25124         Microsoft CSC.RSP file)
25125
25126         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25127         also update tokens_seen and set it to false.
25128
25129         * driver.cs: Implement --recurse for Mike.
25130
25131         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25132         correctly splitting out the paths.
25133
25134 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25135
25136         * interface.cs (Interface.PopulateProperty): Instead of using
25137         `parent' as the declaration space for the set parameters, use
25138         `this' 
25139
25140         * support.cs (InternalParameters): InternalParameters constructor
25141         takes a DeclSpace instead of a TypeContainer.
25142
25143         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25144         types are being initialized, load the address of it before calling
25145         the function.  
25146
25147         (New): Provide a mechanism to disable the generation of local
25148         value type temporaries when the caller will be providing us with
25149         an address to store it.
25150
25151         (ArrayCreation.EmitDynamicInitializers): Use it.
25152
25153 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25154
25155         * expression.cs (Invocation.EmitArguments): Only probe for array
25156         property if there is more than one argument.  Sorry about that.
25157
25158         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25159         empty param arrays.
25160
25161         * class.cs (Method.LabelParameters): Fix incorrect code path that
25162         prevented the `ParamArrayAttribute' from being applied to the
25163         params attribute.
25164
25165 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25166
25167         * support.cs (ReflectionParameters): Correctly compute whether the
25168         last argument is a params array.  Fixes the problem with
25169         string.Split ('a')
25170
25171         * typemanager.cs: Make the assemblies array always be non-null
25172         (empty, but non-null)
25173
25174         * tree.cs (RecordDecl): New function that abstracts the recording
25175         of names.  This reports error 101, and provides a pointer to the
25176         previous declaration.  Fixes a crash in the compiler.
25177
25178         * cs-parser.jay (constructor_declaration): Update to new grammar,
25179         and provide a constructor_body that can be empty.
25180
25181 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25182
25183         * driver.cs: Add support for --resources.
25184
25185         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25186         Make all types for the various array helper methods be integer.
25187
25188         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25189         CheckState to ConvCast.
25190
25191         (ConvCast): Now it takes a `checked' state argument, to avoid
25192         depending on the emit context for the conversion, and just using
25193         the resolve time setting.
25194
25195         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25196         instead of Invocation.EmitArguments.  We do not emit the original
25197         arguments, instead we emit those which have been converted to
25198         unsigned int expressions.
25199
25200         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25201
25202         * codegen.cs: ditto.
25203
25204         * expression.cs (LocalVariableReference): Drop the use of the
25205         Store function that depended on the variable index.
25206
25207         * statement.cs (VariableInfo): Drop the `Idx' property from this
25208         class, as this is not taking into account the indexes for
25209         temporaries tat we generate during the execution, getting the
25210         indexes wrong.
25211
25212         * class.cs: First emit class initializers, then call the parent
25213         constructor. 
25214
25215         * expression.cs (Binary): Fix opcode emision.
25216         (UnaryMutator.EmitCode): Support checked code generation
25217
25218         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25219         matches for events for both the Static and Instance scans,
25220         pointing to the same element.   Fix that.
25221
25222 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25223
25224         * rootcontext.cs (ResolveTree): Always set the
25225         interface_resolve_order, because nested interfaces will be calling
25226         into us.
25227
25228         * class.cs (GetInterfaceOrClass): Track the same resolution
25229         process used by TypeManager.LookupType.  This fixes the nested
25230         type lookups in class declarations (separate path from
25231         LookupType). 
25232
25233         (TypeContainer.DefineType): Also define nested interfaces.
25234         (TypeContainer.RegisterOrder): New public function used to
25235         register the order in which child interfaces need to be closed.
25236
25237         Nested interfaces need to be closed after their parents have been
25238         created. 
25239
25240         * interface.cs (InterfaceAttr): Put all the logic for computing
25241         the interface attribute here. 
25242
25243         (DefineInterface): Register our interface order with the
25244         RootContext or with the TypeContainer depending on the case.
25245
25246 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25247
25248         * cs-parser.jay: rework foreach statement to work with the new
25249         changes to the policy on SimpleNames.
25250
25251         * report.cs: support Stacktrace on warnings as well.
25252
25253         * makefile: drop --unsafe and /unsafe from the compile.
25254
25255 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25256
25257         * ecore.cs (StandardConversionExists): Modify to take an Expression
25258         as the first parameter. Ensure we do null -> reference type conversion
25259         checking.
25260
25261         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25262         temporary Expression objects.
25263
25264 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25265
25266         * interface.cs: workaround bug in method overloading resolution
25267         (there is already a bugzilla bug for it).
25268
25269 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25270
25271         We could also solve this problem by having a separate path for
25272         performing type lookups, instead of DoResolve, we could have a
25273         ResolveType entry point, and only participating pieces of the
25274         production (simplename, deref, array) would implement this. 
25275
25276         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25277         signal SimpleName to only resolve type names and not attempt to
25278         resolve anything else.
25279
25280         * expression.cs (Cast): Set the flag.
25281
25282         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25283
25284         * class.cs: Only report 108 if there is no `new' modifier.
25285
25286         * cs-parser.jay: rework foreach statement to work with the new
25287         changes to the policy on SimpleNames.
25288
25289         * report.cs: support Stacktrace on warnings as well.
25290
25291         * makefile: drop --unsafe and /unsafe from the compile.
25292
25293 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
25294
25295         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25296         lookups here, instead of doing that at parse time.  This means
25297         that our grammar will not introduce `LocalVariableReferences' as
25298         expressions at this point.  That solves the problem of code like
25299         this:
25300
25301         class X {
25302            static void Main ()
25303            { int X = 1;
25304             { X x = null }}}
25305
25306         This is only half the fix.  The full fix requires parameters to
25307         also be handled in this way.
25308
25309         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
25310         makes the use more obvious of the DeclSpace.  The
25311         ec.TypeContainer.TypeBuilder is now only used to pull the
25312         TypeBuilder for it.
25313
25314         My theory is that I can get rid of the TypeBuilder completely from
25315         the EmitContext, and have typecasts where it is used (from
25316         DeclSpace to where it matters).  
25317
25318         The only pending problem is that the code that implements Aliases
25319         is on TypeContainer, and probably should go in DeclSpace.
25320
25321         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
25322         lookups here, instead of doing that at parse time.  This means
25323         that our grammar will not introduce `LocalVariableReferences' as
25324         expressions at this point.  That solves the problem of code like
25325         this:
25326
25327         class X {
25328            static void Main ()
25329            { int X = 1;
25330             { X x = null }}}
25331
25332         This is only half the fix.  The full fix requires parameters to
25333         also be handled in this way.
25334
25335         * class.cs (Property.DefineMethod): When implementing an interface
25336         method, set newslot, when implementing an abstract method, do not
25337         set the flag (before we tried never setting it, or always setting
25338         it, which is the difference).
25339         (Indexer.DefineMethod): same.
25340         (Method.DefineMethod): same.
25341
25342         * ecore.cs: Only set the status used flag if we get back a Field.
25343
25344         * attribute.cs: Temporary hack, so Paolo can keep working.
25345
25346 2002-03-08  Ravi Pratap  <ravi@ximian.com>
25347
25348         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
25349         the unmanaged type in the case we have a MarshalAs attribute.
25350
25351         (Resolve): Handle the case when we are parsing the special MarshalAs
25352         attribute [we need to store the unmanaged type to use later]
25353
25354         * typemanager.cs (marshal_as_attr_type): Built in type for the 
25355         MarshalAs Attribute.
25356
25357         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
25358         on parameters and accordingly set the marshalling info.
25359
25360 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
25361
25362         * class.cs: Optimizing slightly by removing redundant code after
25363         we switched to the `NoTypes' return value.
25364         (Property.DefineMethod): use NoTypes here too.
25365
25366         This fixes the bug I introduced in my last batch of changes.
25367
25368 2002-03-05  Ravi Pratap  <ravi@ximian.com>
25369
25370         * tree.cs (RecordEnum): Add. We now keep track of enums too.
25371
25372         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
25373         Enums since those are types too. 
25374
25375         * cs-parser.jay (enum_declaration): Record enums as we parse them.
25376
25377         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
25378         thanks to a call during the lookup process.
25379
25380 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
25381
25382         * statement.cs (Foreach): Lots of work to accomodate a particular
25383         kind of foreach statement that I had not kept in mind.  It is
25384         possible to have foreachs on classes that provide a GetEnumerator
25385         method that return objects that implement the "pattern" for using
25386         a foreach, there is no need to support GetEnumerator
25387         specifically. 
25388
25389         This is needed to compile nant.
25390
25391         * decl.cs: Only report 114 if the member is not `Finalize' and if
25392         the warning level is at least 2.
25393
25394         * class.cs: Moved the compare function from Method to
25395         MethodSignature. 
25396
25397         (MethodSignature.InheritableMemberSignatureCompare): Add new
25398         filter function that is used to extract inheritable methods from a
25399         class. 
25400
25401         (Method.Define): Use the new `inheritable_method_signature_filter'
25402         delegate
25403
25404         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
25405         command. 
25406
25407 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
25408
25409         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
25410
25411         * cs-parser.jay: Add opt_semicolon to the interface declaration.
25412
25413         * expression.cs: Pass location information to
25414         ConvertImplicitStandard. 
25415
25416         * class.cs: Added debugging code to track return values from
25417         interfaces. 
25418
25419 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
25420
25421         * expression.cs (Is.DoResolve): If either side of the `is' is an
25422         interface, do not flag the warning.
25423
25424         * ecore.cs (ImplicitReferenceConversion): We need a separate test
25425         for interfaces
25426
25427         * report.cs: Allow for --fatal to be used with --probe.
25428
25429         * typemanager.cs (NoTypes): Move the definition for the empty Type
25430         array here. 
25431
25432         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
25433         properties. 
25434         (TypeContainer.DefineProxy): New function used to proxy to parent
25435         implementations when implementing interfaces.
25436         (TypeContainer.ParentImplements): used to lookup if our parent
25437         implements a public function that is required by an interface.
25438         (TypeContainer.VerifyPendingMethods): Hook this up.
25439
25440         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
25441         `modules' and `assemblies' arraylists into arrays.  We only grow
25442         these are the very early start up of the program, so this improves
25443         the speedof LookupType (nicely measured).
25444
25445         * expression.cs (MakeByteBlob): Replaced unsafe code with
25446         BitConverter, as suggested by Paolo.
25447
25448         * cfold.cs (ConstantFold.Binary): Special case: perform constant
25449         folding of string concatenation, but if either side is a string,
25450         and the other is not, then return null, and let the runtime use
25451         the concatenation on the string plus the object (using
25452         `Object.ToString'). 
25453
25454 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
25455
25456         Constant Folding has been implemented now.
25457
25458         * expression.cs (Unary.Reduce): Do not throw an exception, catch
25459         the error instead on types that are not supported in one's
25460         complement. 
25461
25462         * constant.cs (Constant and all children): New set of functions to
25463         perform implict and explicit conversions.
25464
25465         * ecore.cs (EnumConstant): Implement the new functions to perform
25466         conversion by proxying to the child expression.
25467
25468         * codegen.cs: (ConstantCheckState): Constant evaluation has its
25469         own separate setting that can not be turned off from the command
25470         line using --unchecked or --checked and is only controlled using
25471         the checked/unchecked statements and expressions.  This setting is
25472         used by the constant folder to flag errors.
25473
25474         * expression.cs (CheckedExpr, UncheckedExpr): Set the
25475         ConstantCheckState as well.   
25476
25477         During Resolve, they also have to flag the state, because the
25478         constant folder runs completely in the Resolve phase.
25479
25480         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
25481         well.
25482
25483 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25484
25485         * cfold.cs: New file, this file contains the constant folder.
25486
25487         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
25488         argument to track whether we are using the resulting address to
25489         load or store a value and provide better error messages. 
25490
25491         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
25492         new AddressOf arguments.
25493
25494         * statement.cs (Foreach.EmitCollectionForeach): Update
25495
25496         * expression.cs (Argument.Emit): Call AddressOf with proper
25497         arguments to track usage.
25498
25499         (New.DoEmit): Call AddressOf with new arguments.
25500
25501         (Unary.Emit): Adjust AddressOf call.
25502
25503 2002-03-01  Ravi Pratap  <ravi@ximian.com>
25504
25505         * cs-parser.jay (member_access): Change the case for pre-defined types
25506         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
25507         this suggestion.
25508
25509         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
25510         a method body.
25511
25512         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
25513         essentially like methods and apply attributes like MethodImplOptions to them too.
25514
25515         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
25516         not being null.
25517
25518         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
25519         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
25520         is the DeclSpace.
25521
25522         * Update code everywhere accordingly.
25523
25524         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
25525
25526         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
25527
25528 2002-02-28  Ravi Pratap  <ravi@ximian.com>
25529
25530         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
25531         try performing lookups against those instead of jumping straight into using
25532         the 'using' clauses.
25533
25534         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
25535
25536         (LookupType): Perform lookups in implicit parents too.
25537
25538         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
25539         sequence as RootContext.LookupType. 
25540
25541         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
25542         the various cases of namespace lookups into this method.
25543
25544 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
25545
25546         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
25547         in positional arguments)
25548
25549         * class.cs (Operator): Update the AllowedModifiers to contain
25550         extern. 
25551
25552         * cs-parser.jay: Update operator declaration to allow for the
25553         operator body to be empty.
25554
25555         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
25556         values. 
25557
25558 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
25559
25560         * class.cs (Method.Emit): Label parameters.
25561
25562         * driver.cs: Return 1 or 0 as the program exit code.
25563
25564 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
25565
25566         * expression.cs: Special case the `null' object when trying to
25567         auto-compute the type, as anything can be explicitly converted to
25568         that. 
25569
25570         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
25571         spotting this Paolo.
25572
25573         (Expression.ImplicitNumericConversion): Perform comparissions of
25574         the type using the underlying type in the case of an enumeration
25575         rather than using the enumeration type for the compare.
25576
25577         Cope with the underlying == type case, which is not possible to
25578         catch before. 
25579
25580         (Expression.ConvertNumericExplicit): Perform comparissions of
25581         the type using the underlying type in the case of an enumeration
25582         rather than using the enumeration type for the compare.
25583
25584         * driver.cs: If the user does not supply an extension, assume .exe
25585
25586         * cs-parser.jay (if_statement): Rewrote so that we can track the
25587         location for the if statement.
25588
25589         * expression.cs (Binary.ConstantFold): Only concat strings when
25590         the operation is "+", not everything ;-)
25591
25592         * statement.cs (Statement.EmitBoolExpression): Take a location
25593         argument. 
25594         (If, While, Do): Track location.
25595
25596         * expression.cs (Binary.ResolveOperator): In the object + string
25597         case, I was missing a call to ConvertImplicit
25598
25599 2002-02-25  Ravi Pratap  <ravi@ximian.com>
25600
25601         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
25602         Location arguments. Ensure we use RootContext.LookupType to do our work
25603         and not try to do a direct Type.GetType and ModuleBuilder.GetType
25604
25605         * interface.cs (PopulateMethod): Handle the type of the parameter being
25606         null gracefully.
25607
25608         * expression.cs (Invocation.BetterFunction): Handle the case when we 
25609         have a params method with no fixed arguments and a call is made with no
25610         arguments.
25611
25612 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
25613
25614         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
25615         the verbatim-string-literal
25616
25617         * support.cs (InternalParameters.ParameterModifier): handle null
25618         fixed parameters.
25619         (InternalParameters.ParameterType): ditto.
25620
25621         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
25622         duplicating the name of the variable parameter.
25623         (GetParameterByName): Fix bug where we were not looking up array
25624         paramters if they were the only present (thanks Paolo!).
25625         (GetParameterInfo): We only have an empty set of types if both
25626         fixed and array are set to null.
25627         (GetParameterInfo-idx): Handle FixedParameter == null
25628
25629         * cs-parser.jay: Handle the case where there is no catch
25630         statements (missing null test).
25631
25632 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
25633
25634         * driver.cs (MainDriver): Be conservative on our command line
25635         handling.
25636
25637         Catch DirectoryNotFoundException when calling GetFiles.
25638
25639         (SplitPathAndPattern): Used to split the input specification into
25640         a path and a pattern that we can feed to Directory.GetFiles.
25641
25642 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
25643
25644         * statement.cs (Fixed): Implement the last case of the Fixed
25645         statement (string handling).
25646
25647         * expression.cs (StringPtr): New class used to return a char * to
25648         a string;  Used by the Fixed statement.
25649
25650         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
25651
25652         * expression.cs (Binary.ResolveOperator): Remove redundant
25653         MemberLookup pn parent type.
25654         Optimize union call, we do not need a union if the types are the same.
25655         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
25656         type.
25657
25658         Specialize the use of MemberLookup everywhere, instead of using
25659         the default settings. 
25660
25661         (StackAlloc): Implement stackalloc keyword.
25662
25663         * cs-parser.jay: Add rule to parse stackalloc.
25664
25665         * driver.cs: Handle /h, /help, /?
25666
25667         * expression.cs (MakeByteBlob): Removed the hacks we had in place
25668         before we supported unsafe code.
25669
25670         * makefile: add --unsafe to the self compilation of mcs.
25671
25672 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
25673
25674         * expression.cs (PointerArithmetic): New class that is used to
25675         perform pointer arithmetic.
25676         (Binary.Resolve): Handle pointer arithmetic
25677         Handle pointer comparission.
25678         (ArrayPtr): Utility expression class that is used to take the
25679         address of an array.
25680
25681         (ElementAccess): Implement array access for pointers
25682
25683         * statement.cs (Fixed): Implement fixed statement for arrays, we
25684         are missing one more case before we are done.
25685
25686         * expression.cs (Indirection): Implement EmitAssign and set the
25687         ExprClass to Variable.  This allows pointer dereferences to be
25688         treated as variables, and to have values assigned to them.
25689
25690         * ecore.cs (Expression.StoreFromPtr): New utility function to
25691         store values dereferencing.
25692
25693 2002-02-20  Ravi Pratap  <ravi@ximian.com>
25694
25695         * expression.cs (Binary.ResolveOperator): Ensure that we are
25696         not trying to operate on a void type - this fixes the reported
25697         bug.
25698
25699         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
25700         the parent implementation is sealed.
25701
25702         * ../errors/cs0239.cs : Add.
25703
25704         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
25705
25706         * typemanager.cs (unverifiable_code_type): Corresponds to 
25707         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
25708         which have unsafe code in them.
25709
25710         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
25711         unsafe context.
25712
25713 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
25714
25715         * cs-tokenizer.cs: Add support for @"litreal strings"
25716
25717         Make tokenizer accept pre-processor directives
25718         on any column (remove the old C-like limitation). 
25719
25720         * rootcontext.cs (EmitCode): Emit any global attributes.
25721         (AddGlobalAttributes): Used to keep track of assembly attributes. 
25722
25723         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
25724
25725         * cs-parser.jay: Add support for global attributes.  
25726
25727 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
25728
25729         * expression.cs (Indirection): New helper class.  Unary will
25730         create Indirection classes to be able to implement the
25731         IMemoryLocation interface on it.
25732
25733 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
25734
25735         * cs-parser.jay (fixed_statement): reference the right statement.
25736
25737         * statement.cs (Fixed.Emit): Finish implementing the fixed
25738         statement for the &x case.
25739
25740 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
25741
25742         * class.cs (Property.Define, Method.Define): Remove newslot when
25743         `implementing'.  
25744
25745         * modifiers.cs: My use of NewSlot when `Abstract' was set was
25746         wrong.  NewSlot should only be used if the `new' keyword is present.
25747
25748         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
25749         locating our system dir.  Sorry about this.
25750
25751 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25752
25753         * driver.cs (GetSystemDir): Compute correctly the location of our
25754         system assemblies.  I was using the compiler directory instead of
25755         the library directory.
25756
25757 2002-02-13  Ravi Pratap  <ravi@ximian.com>
25758
25759         * expression.cs (BetterFunction): Put back in what Miguel commented out
25760         since it is the correct fix. The problem is elsewhere ;-)
25761
25762         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
25763         parameters of the parms method are themselves compatible or not !
25764
25765         (StandardConversionExists): Fix very dangerous bug where we were forgetting
25766         to check that a class implements an interface before saying that an implicit
25767         conversion was allowed. Use ImplementsInterface to do the checking.
25768
25769 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
25770
25771         * class.cs (Method.Define): Track whether we are an explicit
25772         implementation or not.  And only call DefineMethodOverride if we
25773         are an explicit implementation.
25774
25775         (Property.DefineMethod): Ditto.
25776
25777 2002-02-11  Ravi Pratap  <ravi@ximian.com>
25778
25779         * expression.cs (BetterFunction): Catch hideous bug which was
25780          preventing us from detecting ambiguous calls due to implicit casts i.e
25781         cs0121.
25782
25783 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
25784
25785         * support.cs (Pair): Remove un-needed method.  I figured why I was
25786         getting the error in cs-parser.jay, the variable in a foreach loop
25787         is readonly, and the compiler does not really treat this as a variable.
25788
25789         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
25790         instead of EQUALS in grammar.  
25791
25792         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
25793
25794         * expression.cs (Unary.DoResolve): Check whether the argument is
25795         managed or not.
25796
25797 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
25798
25799         * support.cs: Api for Pair to set a value.  Despite the fact that
25800         the variables are public the MS C# compiler refuses to compile
25801         code that accesses the field if the variable is part of a foreach
25802         statement. 
25803
25804         * statement.cs (Fixed): Begin implementation of the fixed
25805         statement.
25806
25807         (Block.AddVariable): Return the VariableInfo on success and null
25808         on failure instead of true/false. 
25809
25810         * cs-parser.jay (foreach): Catch errors on variables already
25811         defined (we were ignoring this value before) and properly unwind
25812         the block hierarchy
25813
25814         (fixed_statement): grammar for the fixed statement.
25815
25816 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
25817
25818         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
25819         pointer types to be incretemented.
25820
25821         (SizeOf): Implement.
25822
25823         * cs-parser.jay (pointer_member_access): Implement
25824         expr->IDENTIFIER production.
25825
25826         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
25827         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
25828         on safe contexts.
25829
25830         (Unary): Implement indirection.
25831
25832         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
25833         use in non-unsafe context).
25834
25835         (SimpleName.DoResolve): Check for pointers in field access on safe
25836         contexts. 
25837
25838         (Expression.LoadFromPtr): Factor the load-indirect code in this
25839         function.  This was duplicated in UnboxCast and ParameterReference
25840
25841 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
25842
25843         * expression.cs (ComposedCast): report an error if a pointer cast
25844         is used in a safe region.
25845
25846         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
25847         pointer type casts in unsafe context.
25848
25849         * codegen.cs (EmitContext): Set up IsUnsafe.
25850
25851         * cs-parser.jay (non_expression_type): Add productions for pointer
25852         casts. 
25853
25854         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
25855         code.  We should not use force into static mode if the method is
25856         not virtual.  Fixes bug in MIS
25857
25858         * statement.cs (Do.Emit, While.Emit, For.Emit,
25859         Statement.EmitBoolExpression): Add support to Do and While to
25860         propagate infinite loop as `I do return' semantics.
25861
25862         Improve the For case to also test for boolean constants.
25863
25864         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
25865         to the list of attributes we can add.
25866
25867         Remove `EmitContext' argument.
25868
25869         * class.cs (Method.Define): Apply parameter attributes.
25870         (Constructor.Define): Apply parameter attributes.
25871         (MethodCore.LabelParameters): Move here the core of labeling
25872         parameters. 
25873
25874         * support.cs (ReflectionParameters.ParameterModifier,
25875         InternalParameters.ParameterModifier): Use IsByRef on the type and
25876         only return the OUT bit for these parameters instead of in/out/ref
25877         flags.
25878
25879         This is because I miss-understood things.  The ParameterInfo.IsIn
25880         and IsOut represent whether the parameter has the [In] and [Out]
25881         attributes set.  
25882
25883 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
25884
25885         * ecore.cs (FieldExpr.Emit): Release temporaries.
25886
25887         * assign.cs (LocalTemporary.Release): new function.
25888
25889         * codegen.cs (EmitContext.GetTemporaryStorage,
25890         EmitContext.FreeTemporaryStorage): Rework the way we deal with
25891         temporary storage.  Now we can "put back" localbuilders when we
25892         are done with them
25893
25894 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
25895
25896         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
25897         need to make a copy of the variable to generate verifiable code.
25898
25899 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
25900
25901         * driver.cs: Compute dynamically the system directory.
25902
25903         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
25904         Slower, but more generally useful.  Used by the abstract
25905         registering implementation. 
25906
25907         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
25908         the rules for the special rule on Type/instances.  First check if
25909         we have the same name, and if so, try that special static path
25910         rather than the instance path.
25911
25912 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
25913
25914         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
25915         for, while and if.
25916
25917         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
25918         Enum, ValueType, Delegate or Array for non-corlib compiles.
25919
25920         * cs-tokenizer.cs: Catch long identifiers (645)
25921
25922         * typemanager.cs (IndexerPropetyName): Ravi never tested this
25923         piece of code.
25924
25925         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
25926         fix, we were returning too early, so we were not registering
25927         pending methods from abstract classes.
25928
25929         Do not register pending methods if the class is abstract.
25930
25931         * expression.cs (Conditional.DoResolve): Report circular implicit
25932         conversions when we neecd to compute it for conditional
25933         expressions. 
25934
25935         (Is.DoResolve): If the expression is always of the provided type,
25936         flag warning 183.  If the expression can not ever be of the
25937         provided type flag warning 184.
25938
25939         * class.cs: Catch 169 as well.
25940
25941         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
25942         read. 
25943
25944 2002-01-18  Nick Drochak  <ndrochak@gol.com>
25945
25946         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
25947
25948 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
25949
25950         * interface.cs: (PopulateMethod): Check for pointers being defined
25951         only if the unsafe context is active.
25952         (PopulateProperty): ditto.
25953         (PopulateIndexer): ditto.
25954
25955         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
25956         specified.  If pointers are present, make sure that they are
25957         present in an unsafe context.
25958         (Constructor, Constructor.Define): ditto.
25959         (Field, Field.Define): ditto.
25960         (Property, Property.Define): ditto.
25961         (Event, Event.Define): ditto.
25962
25963         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
25964         hashtable if there are classes or structs defined.
25965
25966         * expression.cs (LocalVariableReference.DoResolve): Simplify this
25967         code, as the constant resolution moved.
25968
25969         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
25970         the metadata, so we can flag error 133. 
25971
25972         * decl.cs (MemberCore.UnsafeOK): New function to test that a
25973         pointer is being declared in an unsafe context.
25974
25975 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
25976
25977         * modifiers.cs (Modifiers.Check): Require a Location argument.
25978         Report error 227 for Unsafe use.
25979
25980         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
25981
25982         * statement.cs (For.Emit): If the test is null, then report that
25983         we do `return', as we wont reach anything afterwards.
25984
25985         (Switch.SwitchGoverningType): Track the expression that matched
25986         the conversion.
25987
25988         * driver.cs: Allow negative numbers as an error code to flag.
25989
25990         * cs-parser.jay: Handle 1551.
25991
25992         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
25993
25994 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
25995
25996         * cs-parser.jay: Report 1518 (type declaration can only contain
25997         class, struct, interface, enum or delegate)
25998
25999         (switch_label): Report 1523 (keywords `case' or `default' must
26000         preced code)
26001
26002         (opt_switch_sections): Report 1522 (empty switch)
26003
26004         * driver.cs: Report 1515 (response file specified multiple times)
26005         Report 1516 (Source file specified multiple times).
26006
26007         * expression.cs (Argument.Resolve): Signal 1510
26008
26009         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26010         access not allowed in static code)
26011
26012 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26013
26014         * typemanager.cs (IsPointerType): Utility method which we are going
26015         to need a lot.
26016
26017         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26018         the object type, so we take care of that.
26019
26020         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26021
26022         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26023         added to non-params parameters :-)
26024
26025         * typemanager.cs (CSharpName): Include 'void' type too. 
26026
26027         (void_ptr_type): Include in the set of core types.
26028
26029         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26030         duplicating code.
26031
26032         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26033         an unsafe context.
26034
26035         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26036         completely forgotten about it.
26037
26038 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26039
26040         * cs-parser.jay (pointer_type): Add. This begins our implementation
26041         of parsing rules for unsafe code.
26042
26043         (unsafe_statement): Implement.
26044
26045         (embedded_statement): Modify to include the above.
26046
26047         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26048
26049         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26050         if the current context is an unsafe one.
26051
26052         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26053         are handled differently, we need separate rules for them.
26054
26055         (local_variable_declaration): Update to use local_variable_pointer_type
26056         to allow variable declarations of unmanaged pointer types.
26057
26058         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26059         in unsafe contexts.
26060
26061         * ../errors/cs0214.cs : Add.
26062
26063 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26064
26065         * makefile: remove 'response' file when cleaning.
26066
26067 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26068
26069         * cs-parser.jay: Report 1524.
26070
26071 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26072
26073         * typemanager.cs (RegisterMethod): drop checking if we have
26074         registered this from here
26075
26076 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26077
26078         * class.cs (Method.EmitDestructor): Implement calling our base
26079         destructor. 
26080
26081         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26082         value of InFinally.
26083
26084         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26085         this routine and will wrap the call in a try/catch block.  Deal
26086         with the case.
26087
26088 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26089
26090         * ecore.cs (Expression.MemberLookup): instead of taking a
26091         parameter `same_type' that was used to tell whether we could
26092         access private members we compute our containing type from the
26093         EmitContext.
26094
26095         (FieldExpr): Added partial support for volatile fields.  This does
26096         not work for volatile fields exposed from assemblies, as I can not
26097         figure out how to extract the modreq from it.
26098
26099         Updated all the source files to use this.
26100
26101         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26102         because it is referenced by MemberLookup very often. 
26103
26104 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26105
26106         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26107         TypeBuilder.GetCustomAttributes to retrieve what we need.
26108
26109         Get rid of redundant default_member_attr_type as this is the same as
26110         default_member_type which already exists.
26111
26112         * interface.cs, attribute.cs : Update accordingly.
26113
26114 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26115
26116         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26117         work for TYpeBuilders though.  Ravi, can you please fix this?
26118
26119         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26120
26121         * expression.cs (Argument.Emit): Handle the case of ref objects
26122         being passed to ref functions;  
26123
26124         (ParameterReference.EmitLoad): Loads the content of the pointer
26125         without dereferencing.
26126
26127 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26128
26129         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26130
26131 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26132
26133         * class.cs (Indexer.DefineMethod): Incorporate the interface
26134         type in the name of the method if we are doing explicit interface
26135         implementation.
26136
26137         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26138
26139         (BetterConversion): Fix extremely trivial bug where we were referring to
26140         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26141         again !
26142
26143         * ../errors/bug16.cs : Add although we have fixed it.
26144
26145 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26146
26147         * expression.cs (BaseIndexer): Begin implementation.
26148
26149         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26150
26151         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26152         production directly to remove a shift/reduce, and implement
26153         explicit interface implementation.
26154
26155         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26156         after a floating point suffix.
26157
26158         * expression.cs (DoNumericPromotions): Improved the conversion for
26159         uint/uint.  If we have a constant, we avoid doing a typecast to a
26160         larger type.
26161
26162         * class.cs (Indexer): Implement explicit interface implementation
26163         for indexers.
26164
26165 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26166
26167         * class.cs: make the default instance constructor public and hidebysig.
26168
26169 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26170
26171         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26172         so we can call it from elsewhere.
26173
26174         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26175         we emit it internally if the class has a defined indexer; otherwise the user
26176         emits it by decorating the class definition with the DefaultMemberAttribute.
26177
26178         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26179         attribute is not used on a type which defines an indexer.
26180
26181         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26182         character when we skip whitespace.
26183
26184         * ../errors/cs0646.cs : Add.
26185
26186 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26187
26188         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26189         again. 
26190
26191         * makefile: Add practical target `mcs3.exe' which builds the third
26192         generation compiler. 
26193
26194         * expression.cs (New): Fix structures constructor calling.
26195
26196         * class.cs (Property, Method, Indexer): Emit Final flag on the
26197         method if we are an interface implementation and we are not
26198         abstract. 
26199
26200         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26201         whether this property is referencing a `base' method.
26202
26203         * expression.cs (Invocation.EmitCall): take an extra argument:
26204         is_base, this is used to determine whether the `call' or
26205         `callvirt' opcode should be used.
26206
26207
26208         * delegate.cs: update EmitCall.
26209
26210         * class.cs (Method.Define): Set NewSlot for the cases where we are
26211         not implementing an interface method.
26212
26213         (Property.Define): ditto.
26214
26215 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26216
26217         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26218         'r'.  Allows mcs to parse itself fully.
26219
26220 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26221
26222         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26223         of the number of initializers that require the InitializeArray method.
26224
26225         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26226         update the above field where necessary.
26227
26228         (MakeByteBlob): Update accordingly.
26229
26230         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26231         greater than 2.
26232
26233         (EmitDynamicInitializers): Update in accordance with the new optimization.
26234
26235         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26236         same OpCode applies.
26237
26238         * cs-parser.jay : Fix some glaring errors I introduced.
26239
26240 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26241
26242         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26243         so that we can check for name clashes there too.
26244
26245         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26246         for interface indexers.
26247
26248         * interfaces.cs (Define): Emit the default member attribute.
26249
26250         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26251         variable was being referred to while setting the value ;-)
26252
26253 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26254
26255         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26256         byte-by-byte information when we know the data is zero.
26257
26258         Make the block always a multiple of 4, because
26259         DefineInitializedData has a bug.
26260
26261         * assign.cs: Fix, we should assign from the temporary, not from
26262         the source. 
26263
26264         * expression.cs (MakeByteBlob): Fix my incorrect code.
26265
26266 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26267
26268         * typemanager.cs (EnumToUnderlying): This function is used to get
26269         the underlying type from an enumeration, because it does not
26270         always work. 
26271
26272         * constant.cs: Use the I4_S form for values between -128 and 127.
26273
26274         * statement.cs (Block.LookupLabel): Looks up a label.
26275         (Block): Drop support for labeled blocks.
26276
26277         (LabeledStatement): New kind of statement that represents a label
26278         only.
26279
26280         (Goto): Finally implement this bad boy.
26281
26282         * cs-parser.jay: Update to reflect new mechanism to implement
26283         labels.
26284
26285 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26286
26287         * codegen.cs (EmitContext.This): a codegen property that keeps the
26288         a single instance of this instead of creating many different this
26289         instances. 
26290
26291         * delegate.cs (Delegate.DoResolve): Update to use the property;
26292
26293         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
26294
26295         * expression.cs (BaseAccess.DoResolve): Ditto.
26296
26297 2001-12-29  Ravi Pratap  <ravi@ximian.com>
26298
26299         * typemanager.cs (methodimpl_attr_type): Add to hold the type
26300         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
26301
26302         (InitCoreTypes): Update accordingly.
26303
26304         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
26305         so we can quickly store the state.
26306
26307         (ApplyAttributes): Set the correct implementation flags
26308         for InternalCall methods.
26309
26310 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
26311
26312         * expression.cs (EmitCall): if a method is not virtual, then do
26313         not use callvirt on it.
26314
26315         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
26316         user defined stuff) requires the use of stobj, which takes an
26317         address on the stack instead of an array and an index.  So emit
26318         the Ldelema operation for it.
26319
26320         (EmitStoreOpcode): Use stobj for valuetypes.
26321
26322         (UnaryMutator.EmitCode): Use the right 1 value depending on
26323         whether we are dealing with int64/uint64, float or doubles.
26324
26325         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
26326         constructors that I implemented last night.
26327
26328         (Constructor.IsDefault): Fix to work properly for static
26329         constructors.
26330
26331         * cs-parser.jay (CheckDef): report method signature errors.
26332         Update error number 103 to be 132.
26333
26334         * decl.cs: New AdditionResult enumeration value: MethodExists.
26335         Although we do this check for methods later on in the semantic
26336         analysis, catching repeated default constructors is so easy that
26337         we catch these here. 
26338
26339         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
26340         promotions code.
26341
26342         (ParameterReference.EmitAssign, Emit): handle
26343         bools as bytes.
26344
26345         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
26346         (ArrayAccess.EmitStoreOpcode): ditto.
26347
26348         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
26349
26350         * expression.cs (MakeByteBlob): Complete all the missing types
26351         (uint, short, ushort, byte, sbyte)
26352
26353         * class.cs: Only init instance field initializers on instance
26354         constructors. 
26355
26356         Rename `constructors' to instance_constructors. 
26357
26358         (TypeContainer.AddConstructor): Only add constructors to the list
26359         if it is not static.
26360
26361         Make sure that we handle default_static_constructor independently
26362         everywhere where we handle instance_constructors
26363
26364 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
26365
26366         * class.cs: Do not lookup or create a base initializer for a
26367         static constructor.
26368
26369         (ConstructorInitializer.Resolve): use the proper type to lookup
26370         for constructors.
26371
26372         * cs-parser.jay: Report error 1585 (modifiers between type and name).
26373
26374         * enum.cs, interface.cs: Remove CloseType, this is taken care by
26375         in DeclSpace. 
26376
26377         * decl.cs: CloseType is now an virtual method, the default
26378         implementation just closes this type.
26379
26380 2001-12-28  Ravi Pratap  <ravi@ximian.com>
26381
26382         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
26383         to PreserveSig by default. Also emit HideBySig on such methods.
26384
26385         Basically, set the defaults to standard values.
26386
26387         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
26388         argument, if candidate is better, it can't be worse than the best !
26389
26390         (Invocation): Re-write bits to differentiate between methods being
26391         applicable in their expanded form and their normal form - for params
26392         methods of course.
26393
26394         Get rid of use_standard everywhere as only standard conversions are allowed
26395         in overload resolution. 
26396
26397         More spec conformance.
26398
26399 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26400
26401         * driver.cs: Add --timestamp, to see where the compiler spends
26402         most of its time.
26403
26404         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
26405         `this' in static code.
26406
26407         (SimpleName.DoResolve): Implement in terms of a helper function
26408         that allows static-references to be passed upstream to
26409         MemberAccess.
26410
26411         (Expression.ResolveWithSimpleName): Resolve specially simple
26412         names when called by MemberAccess to implement the special
26413         semantics. 
26414
26415         (Expression.ImplicitReferenceConversion): Handle conversions from
26416         Null to reference types before others, as Null's type is
26417         System.Object. 
26418
26419         * expression.cs (Invocation.EmitCall): Handle the special case of
26420         calling methods declared on a reference type from a ValueType
26421         (Base classes System.Object and System.Enum)
26422
26423         (MemberAccess.Resolve): Only perform lookups on Enumerations if
26424         the left hand side is a TypeExpr, not on every enumeration. 
26425
26426         (Binary.Resolve): If types are reference types, then do a cast to
26427         object on operators != and == of both arguments.
26428
26429         * typemanager.cs (FindMembers): Extract instance and static
26430         members if requested.
26431
26432         * interface.cs (PopulateProperty): Use void_type instead of null
26433         as the return type for the setter method.
26434
26435         (PopulateIndexer): ditto.
26436
26437 2001-12-27  Ravi Pratap  <ravi@ximian.com>
26438
26439         * support.cs (ReflectionParameters): Fix minor bug where we
26440         were examining the wrong parameter for the ParamArray attribute.
26441
26442         Cope with requests for the type of the parameter at position
26443         greater than the params parameter's. We now return the element
26444         type of the params array as that makes more sense.
26445
26446         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
26447         accordingly as we no longer have to extract the element type
26448         ourselves.
26449
26450         (Invocation.OverloadResolve): Update.
26451
26452 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
26453
26454         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
26455         against IEnumerator, test whether the return value is a descendant
26456         of the IEnumerator interface.
26457
26458         * class.cs (Indexer.Define): Use an auxiliary method to implement
26459         the other bits of the method definition.  Begin support for
26460         explicit interface implementation.
26461
26462         (Property.DefineMethod): Use TypeManager.void_type instead of null
26463         for an empty return value.
26464
26465 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
26466
26467         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
26468         dealing with a FieldExpr which is composed of a FieldBuilder, in
26469         the code path we did extract the constant, but we should have
26470         obtained the underlying value to be able to cast it (otherwise we
26471         end up in an infinite loop, this is what Ravi was running into).
26472
26473         (ArrayCreation.UpdateIndices): Arrays might be empty.
26474
26475         (MemberAccess.ResolveMemberAccess): Add support for section
26476         14.5.4.1 that deals with the special case of E.I when E is a type
26477         and something else, that I can be a reference to a static member.
26478
26479         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
26480         handle a particular array type to create byte blobs, it is just
26481         something we dont generate byteblobs for.
26482
26483         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
26484         arguments. 
26485
26486         * location.cs (Push): remove the key from the hashtable that we
26487         are about to add.   This happens for empty files.
26488
26489         * driver.cs: Dispose files after we have parsed them.
26490
26491         (tokenize): new function that only runs the tokenizer on its
26492         input, for speed testing.
26493
26494 2001-12-26  Ravi Pratap  <ravi@ximian.com>
26495
26496         * class.cs (Event.Define): Define the private field only if there
26497         are no accessors defined.
26498
26499         * expression.cs (ResolveMemberAccess): If there is no associated
26500         field with the event, that means we have an event defined with its
26501         own accessors and we should flag error cs0070 since transforming
26502         ourselves into a field is not valid in that case.
26503
26504         * ecore.cs (SimpleName.DoResolve): Same as above.
26505
26506         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
26507         and charset to sane values.
26508
26509 2001-12-25  Ravi Pratap  <ravi@ximian.com>
26510
26511         * assign.cs (DoResolve): Perform check on events only if they 
26512         are being accessed outside the declaring type.
26513
26514         * cs-parser.jay (event_declarations): Update rules to correctly
26515         set the type of the implicit parameter etc.
26516
26517         (add_accessor, remove_accessor): Set current local parameters.
26518
26519         * expression.cs (Binary): For delegate addition and subtraction,
26520         cast the return value from the method into the appropriate delegate
26521         type.
26522
26523 2001-12-24  Ravi Pratap  <ravi@ximian.com>
26524
26525         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
26526         of these as the workaround is unnecessary.
26527
26528         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
26529         delegate data - none of that is needed at all.
26530
26531         Re-write bits to extract the instance expression and the delegate method
26532         correctly.
26533
26534         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
26535         on delegates too.
26536
26537         * attribute.cs (ApplyAttributes): New method to take care of common tasks
26538         of attaching attributes instead of duplicating code everywhere.
26539
26540         * everywhere : Update code to do attribute emission using the above method.
26541
26542 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26543
26544         * expression.cs (IsParamsMethodApplicable): if there are not
26545         parameters, return immediately.
26546
26547         * ecore.cs: The 0 literal can be implicity converted to an enum
26548         type. 
26549
26550         (SimpleName.DoResolve): First lookup the type, then lookup the
26551         members. 
26552
26553         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
26554         want to get its address.  If the InstanceExpression is not
26555         addressable, store the result in a temporary variable, then get
26556         the address of it.
26557
26558         * codegen.cs: Only display 219 errors on warning level or above. 
26559
26560         * expression.cs (ArrayAccess): Make it implement the
26561         IMemoryLocation interface.
26562
26563         (Binary.DoResolve): handle the operator == (object a, object b)
26564         and operator != (object a, object b) without incurring into a
26565         BoxedCast (because 5 != o should never be performed).
26566
26567         Handle binary enumerator operators.
26568
26569         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
26570         value type, otherwise use Ldelem_ref.
26571
26572         Use precomputed names;
26573
26574         (AddressOf): Implement address of
26575
26576         * cs-parser.jay (labeled_statement): Fix recursive block
26577         addition by reworking the production.
26578
26579         * expression.cs (New.DoEmit): New has a special case:
26580                 
26581                  If we are dealing with a ValueType, we have a few
26582                  situations to deal with:
26583                 
26584                     * The target of New is a ValueType variable, that is
26585                       easy, we just pass this as the variable reference
26586                 
26587                     * The target of New is being passed as an argument,
26588                       to a boxing operation or a function that takes a
26589                       ValueType.
26590                 
26591                       In this case, we need to create a temporary variable
26592                       that is the argument of New.
26593
26594
26595 2001-12-23  Ravi Pratap  <ravi@ximian.com>
26596
26597         * rootcontext.cs (LookupType): Check that current_type is not null before
26598         going about looking at nested types.
26599
26600         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
26601         not implement the IAssignMethod interface any more.
26602
26603         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
26604         where we tranform them into FieldExprs if they are being resolved from within
26605         the declaring type.
26606
26607         * ecore.cs (SimpleName.DoResolve): Do the same here.
26608
26609         * assign.cs (DoResolve, Emit): Clean up code considerably. 
26610
26611         * ../errors/bug10.cs : Add.
26612
26613         * ../errors/cs0070.cs : Add.
26614
26615         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
26616
26617         * assign.cs : Get rid of EventIsLocal everywhere.
26618
26619 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
26620
26621         * ecore.cs (ConvertIntLiteral): finished the implementation.
26622
26623         * statement.cs (SwitchLabel): Convert the value we are using as a
26624         key before looking up the table.
26625
26626 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26627
26628         * codegen.cs (EmitTopBlock): Require a Location argument now.
26629
26630         * cs-parser.jay (constructor_declarator): We need to setup
26631         current_local_parameters before we parse the
26632         opt_constructor_initializer, to allow the variables to be bound
26633         to the constructor arguments.
26634
26635         * rootcontext.cs (LookupType): First lookup nested classes in our
26636         class and our parents before we go looking outside our class.
26637
26638         * expression.cs (ConstantFold): Extract/debox the values at the
26639         beginnning. 
26640
26641         * rootcontext.cs (EmitCode): Resolve the constants first before we
26642         resolve the types.  This is not really needed, but it helps debugging.
26643
26644         * statement.cs: report location.
26645
26646         * cs-parser.jay: pass location to throw statement.
26647
26648         * driver.cs: Small bug fix.
26649
26650         * report.cs: Updated format to be 4-zero filled digits.
26651
26652 2001-12-22  Ravi Pratap  <ravi@ximian.com>
26653
26654         * expression.cs (CheckIndices): Fix minor bug where the wrong
26655         variable was being referred to ;-)
26656
26657         (DoEmit): Do not call EmitStaticInitializers when the 
26658         underlying type is System.Object.
26659
26660 2001-12-21  Ravi Pratap  <ravi@ximian.com>
26661
26662         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
26663         and do the usual workaround for SRE.
26664
26665         * class.cs (MyEventBuilder.EventType): New member to get at the type
26666         of the event, quickly.
26667
26668         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
26669
26670         * assign.cs (Assign.DoResolve): Handle the case when the target
26671         is an EventExpr and perform the necessary checks.
26672
26673         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
26674         interface.
26675
26676         (SimpleName.MemberStaticCheck): Include check for EventExpr.
26677
26678         (EventExpr): Set the type in the constructor itself since we 
26679         are meant to be born fully resolved.
26680
26681         (EventExpr.Define): Revert code I wrote earlier.
26682                 
26683         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
26684         instance expression is null. The instance expression is a This in that case
26685         or a null, depending on whether it is a static method or not.
26686
26687         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
26688         refers to more than one method.
26689
26690         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
26691         and accordingly flag errors.
26692
26693 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26694
26695         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
26696
26697 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
26698
26699         * location.cs (ToString): Provide useful rutine.
26700
26701 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
26702
26703         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
26704         objects, return the actual integral boxed.
26705
26706         * statement.cs (SwitchLabel): define an ILLabel for each
26707         SwitchLabel. 
26708
26709         (Switch.CheckSwitch): If the value is a Literal, extract
26710         the underlying literal.
26711
26712         Also in the unused hashtable we had, add the SwitchLabel so we can
26713         quickly look this value up.
26714
26715         * constant.cs: Implement a bunch of new constants.  Rewrite
26716         Literal based on this.  Made changes everywhere to adapt to this.
26717
26718         * expression.cs (Expression.MakeByteBlob): Optimize routine by
26719         dereferencing array only once, and also copes with enumrations.
26720
26721         bytes are two bytes wide, not one.
26722
26723         (Cast): Perform constant conversions.
26724
26725         * ecore.cs (TryImplicitIntConversion): Return literals instead of
26726         wrappers to the literals here.
26727
26728         * expression.cs (DoNumericPromotions): long literals can converted
26729         to ulong implicity (this is taken care of elsewhere, but I was
26730         missing this spot).
26731
26732         * ecore.cs (Expression.Literalize): Make the return type Literal,
26733         to improve type checking.
26734
26735         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
26736
26737 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26738
26739         * literal.cs: Revert code from ravi that checked the bounds.  The
26740         bounds are sane by the definition of the type itself. 
26741
26742         * typemanager.cs: Fix implementation of ImplementsInterface.  We
26743         need to actually look up in our parent hierarchy for interfaces
26744         implemented. 
26745
26746         * const.cs: Use the underlying type for enumerations
26747
26748         * delegate.cs: Compute the basename for the delegate creation,
26749         that should fix the delegate test case, and restore the correct
26750         Type Lookup semantics in rootcontext
26751
26752         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
26753         referencing a nested type with the Reflection API is using the "+"
26754         sign. 
26755
26756         * cs-parser.jay: Do not require EOF token at the end.
26757
26758 2001-12-20  Ravi Pratap  <ravi@ximian.com>
26759
26760         * rootcontext.cs (LookupType): Concatenate type names with
26761         a '.' instead of a '+' The test suite passes again.
26762
26763         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
26764         field of the enumeration.
26765
26766         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
26767         the case when the member is an EventExpr.
26768
26769         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
26770         static has an associated instance expression.
26771
26772         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
26773
26774         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
26775
26776         * class.cs (Event.Define): Register event and perform appropriate checks
26777         for error #111.
26778
26779         We define the Add and Remove methods even if the use provides none because
26780         in that case, we provide default implementations ourselves.
26781
26782         Define a private field of the type of the event. This is done by the CSC compiler
26783         and we should be doing it too ;-)
26784
26785         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
26786         More methods we use in code we generate.
26787
26788         (multicast_delegate_type, delegate_type): Two separate types since the distinction
26789         is important.
26790
26791         (InitCoreTypes): Update accordingly for the above.
26792
26793         * class.cs (Event.Emit): Generate code for default accessors that we provide
26794
26795         (EmitDefaultMethod): Do the job in the above.
26796
26797         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
26798         appropriate place.
26799
26800 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
26801
26802         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
26803         builders even if we were missing one.
26804
26805         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
26806         pass the Basename as our class name instead of the Name.  The
26807         basename will be correctly composed for us.
26808
26809         * parameter.cs (Paramters): Now takes a Location argument.
26810
26811         * decl.cs (DeclSpace.LookupType): Removed convenience function and
26812         make all the code call directly LookupType in RootContext and take
26813         this chance to pass the Location information everywhere.
26814
26815         * Everywhere: pass Location information.
26816
26817 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
26818
26819         * class.cs (Constructor.Define): Updated way of detecting the
26820         length of the parameters.
26821
26822         (TypeContainer.DefineType): Use basename as the type name for
26823         nested types.
26824
26825         (TypeContainer.Define): Do not recursively define types here, as
26826         definition is taken care in order by the RootContext.
26827
26828         * tree.cs: Keep track of namespaces in a per-file basis.
26829
26830         * parameter.cs (Parameter.ComputeSignature): Update to use
26831         DeclSpace. 
26832
26833         (Parameters.GetSignature): ditto.
26834
26835         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
26836         instead of a TypeContainer.
26837
26838         (Interface.SemanticAnalysis): Use `this' instead of our parent to
26839         resolve names.  Because we need to be resolve in our context, not
26840         our parents.
26841
26842         * driver.cs: Implement response files.
26843
26844         * class.cs (TypeContainer.DefineType): If we are defined, do not
26845         redefine ourselves.
26846
26847         (Event.Emit): Emit the code for add/remove handlers.
26848         (Event.Define): Save the MethodBuilders for add/remove.
26849
26850         * typemanager.cs: Use pair here too.
26851
26852         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
26853         DictionaryEntry requires the first argument to be non-null.  
26854
26855         (enum_declaration): Compute full name for registering the
26856         enumeration.
26857
26858         (delegate_declaration): Instead of using
26859         formal_parameter_list, use opt_formal_parameter_list as the list
26860         can be empty.
26861
26862         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
26863         (EventParsing): New property that controls whether `add' and
26864         `remove' are returned as tokens or identifiers (for events);
26865
26866 2001-12-19  Ravi Pratap  <ravi@ximian.com>
26867
26868         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
26869         use MyEventBuilder only and let it wrap the real builder for us.
26870
26871         (MyEventBuilder): Revamp constructor etc.
26872
26873         Implement all operations that we perform on EventBuilder in precisely the same
26874         way here too.
26875
26876         (FindMembers): Update to use the EventBuilder member.
26877
26878         (Event.Emit): Update accordingly.
26879
26880 2001-12-18  Ravi Pratap  <ravi@ximian.com>
26881
26882         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
26883         by calling the appropriate methods.
26884
26885         (GetCustomAttributes): Make stubs as they cannot possibly do anything
26886         useful.
26887
26888         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
26889
26890 2001-12-17  Ravi Pratap  <ravi@ximian.com>
26891
26892         * delegate.cs (Delegate.Populate): Check that the return type
26893         and various parameters types are indeed accessible.
26894
26895         * class.cs (Constructor.Define): Same here.
26896
26897         (Field.Define): Ditto.
26898
26899         (Event.Define): Ditto.
26900
26901         (Operator.Define): Check that the underlying Method defined itself
26902         correctly - so it's MethodBuilder should not be null.
26903
26904         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
26905         expression happens to be null.
26906
26907         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
26908         members but as of now we don't seem to be able to do anything really useful with it.
26909
26910         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
26911         not the EventBuilder.
26912
26913 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
26914
26915         * cs-tokenizer.cs: Add support for defines.
26916         Add support for #if, #elif, #else, #endif
26917
26918         (eval_var): evaluates a variable.
26919         (eval): stubbed for evaluating functions.
26920
26921         * cs-parser.jay: Pass the defines information
26922
26923         * driver.cs: Add --define command line option.
26924
26925         * decl.cs: Move MemberCore here.
26926
26927         Make it the base class for DeclSpace.  This allows us to catch and
26928         report 108 and 109 for everything now.
26929
26930         * class.cs (TypeContainer.Define): Extract all the members
26931         before populating and emit the warning 108 (new keyword required
26932         to override) instead of having each member implement this.
26933
26934         (MemberCore.Define): New abstract method, we will be using this in
26935         the warning reporting engine in Populate.
26936
26937         (Operator.Define): Adjust to new MemberCore protocol. 
26938
26939         * const.cs (Const): This does not derive from Expression, it is a
26940         temporary object we use to create fields, it is a MemberCore. 
26941
26942         * class.cs (Method.Define): Allow the entry point to be in a
26943         specific class.
26944
26945         * driver.cs: Rewrite the argument handler to clean it up a bit.
26946
26947         * rootcontext.cs: Made it just an auxiliary namespace feature by
26948         making everything static.
26949
26950         * driver.cs: Adapt code to use RootContext type name instead of
26951         instance variable.
26952
26953         * delegate.cs: Remove RootContext argument.
26954
26955         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
26956         argument. 
26957
26958         * class.cs (Event.Define): The lookup can fail.
26959
26960         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
26961
26962         * expression.cs: Resolve the this instance before invoking the code.
26963
26964 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
26965
26966         * cs-parser.jay: Add a production in element_access that allows
26967         the thing to become a "type" reference.  This way we can parse
26968         things like "(string [])" as a type.
26969
26970         Note that this still does not handle the more complex rules of
26971         casts. 
26972
26973
26974         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
26975
26976         * ecore.cs: (CopyNewMethods): new utility function used to
26977         assemble the list of methods from running FindMembers.
26978
26979         (MemberLookup): Rework FindMembers so that 
26980
26981 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
26982
26983         * class.cs (TypeContainer): Remove Delegates who fail to be
26984         defined.
26985
26986         * delegate.cs (Populate): Verify that we dont get null return
26987         values.   TODO: Check for AsAccessible.
26988
26989         * cs-parser.jay: Use basename to emit error 574 (destructor should
26990         have the same name as container class), not the full name.
26991
26992         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
26993         possible representation.  
26994
26995         Also implements integer type suffixes U and L.
26996
26997 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
26998
26999         * expression.cs (ArrayCreation.DoResolve): We need to do the
27000         argument resolution *always*.
27001
27002         * decl.cs: Make this hold the namespace.  Hold the root context as
27003         well.
27004         (LookupType): Move here.
27005
27006         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27007
27008         * location.cs (Row, Name): Fixed the code, it was always returning
27009         references to the first file.
27010
27011         * interface.cs: Register properties defined through interfaces.
27012
27013         * driver.cs: Add support for globbing on the command line
27014
27015         * class.cs (Field): Make it derive from MemberCore as well.
27016         (Event): ditto.
27017
27018 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27019
27020         * class.cs (Event::Define): Check that the type of the event is a delegate
27021         type else flag error #66.
27022
27023         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27024         same.
27025
27026         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27027         values of EntryPoint, CharSet etc etc.
27028
27029         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27030
27031         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27032         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27033         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27034         which needs this to do its work.
27035
27036         * ../errors/cs0066.cs : Add.
27037
27038 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27039
27040         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27041         helper functions.
27042
27043         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27044         clears out the parameters field.
27045         (MemberSignatureCompare): Cleanup
27046
27047         (MemberCore): New base class used to share code between MethodCore
27048         and Property.
27049
27050         (RegisterRequiredImplementations) BindingFlags.Public requires
27051         either BindingFlags.Instace or Static.  Use instance here.
27052
27053         (Property): Refactored code to cope better with the full spec.
27054
27055         * parameter.cs (GetParameterInfo): Return an empty array instead
27056         of null on error.
27057
27058         * class.cs (Property): Abstract or extern properties have no bodies.
27059
27060         * parameter.cs (GetParameterInfo): return a zero-sized array.
27061
27062         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27063         method modifier validation to the typecontainer so we can reuse
27064         this on properties.
27065
27066         (MethodCore.ParameterTypes): return an empty sized array of types.
27067
27068         (Property.Define): Test property modifier validity.
27069
27070         Add tests for sealed/override too.
27071
27072         (Method.Emit): abstract or extern methods have no bodies.
27073
27074 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27075
27076         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27077         thing.
27078
27079         (Method::Define, ::Emit): Modify accordingly.
27080
27081         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27082
27083         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27084
27085         * makefile: Pass in /unsafe.
27086
27087 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27088
27089         * class.cs (MakeKey): Kill routine.
27090
27091         * class.cs (TypeContainer.Define): Correctly define explicit
27092         method implementations (they require the full interface name plus
27093         the method name).
27094
27095         * typemanager.cs: Deply the PtrHashtable here and stop using the
27096         lame keys.  Things work so much better.
27097
27098         This of course broke everyone who depended on `RegisterMethod' to
27099         do the `test for existance' test.  This has to be done elsewhere.
27100
27101         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27102         the object stupid Equals method (because, that like fails all over
27103         the place).  We still do not use it.
27104
27105         * class.cs (TypeContainer.SetRequiredInterface,
27106         TypeContainer.RequireMethods): Killed these two routines and moved
27107         all the functionality to RegisterRequiredImplementations.
27108
27109         (TypeContainer.RegisterRequiredImplementations): This routine now
27110         registers all the implementations required in an array for the
27111         interfaces and abstract methods.  We use an array of structures
27112         which can be computed ahead of time to reduce memory usage and we
27113         also assume that lookups are cheap as most classes will not
27114         implement too many interfaces.
27115
27116         We also avoid creating too many MethodSignatures.
27117
27118         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27119         clear the "pending" bit if we find that there are problems with
27120         the declaration.
27121
27122         (TypeContainer.VerifyPendingMethods): Update to report errors of
27123         methods that look like implementations but are not.
27124
27125         (TypeContainer.Define): Add support for explicit interface method
27126         implementation. 
27127
27128 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27129
27130         * typemanager.cs: Keep track of the parameters here instead of
27131         being a feature of the TypeContainer.
27132
27133         * class.cs: Drop the registration of parameters here, as
27134         InterfaceMethods are also interface declarations.
27135
27136         * delegate.cs: Register methods with the TypeManager not only with
27137         the TypeContainer.  This code was buggy.
27138
27139         * interface.cs: Full registation here.
27140
27141 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27142
27143         * expression.cs: Remove reducer for binary expressions, it can not
27144         be done this way.
27145
27146         * const.cs: Put here the code that used to go into constant.cs
27147
27148         * constant.cs: Put here the code for constants, this is a new base
27149         class for Literals.
27150
27151         * literal.cs: Make Literal derive from Constant.
27152
27153 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27154
27155         * statement.cs (Return.Emit): Report error 157 if the user
27156         attempts to return from a finally block.
27157
27158         (Return.Emit): Instead of emitting a return, jump to the end of
27159         the function.
27160
27161         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27162         LocalBuilder to store the result of the function.  ReturnLabel is
27163         the target where we jump.
27164
27165
27166 2001-12-09  Radek Doulik  <rodo@ximian.com>
27167
27168         * cs-parser.jay: remember alias in current namespace
27169
27170         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27171         namespaces
27172
27173         * class.cs (LookupAlias): lookup alias in my_namespace
27174
27175         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27176         aliases hashtable
27177         (LookupAlias): lookup alias in this and if needed in parent
27178         namespaces
27179
27180 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27181
27182         * support.cs: 
27183
27184         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27185         making things static.  I need this to avoid passing the
27186         TypeContainer when calling ParameterType.
27187
27188         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27189         that did string manipulation to compute the type and then call
27190         GetType.  Use Parameter.ParameterType instead.
27191
27192         * cs-tokenizer.cs: Consume the suffix for floating values.
27193
27194         * expression.cs (ParameterReference): figure out whether this is a
27195         reference parameter or not.  Kill an extra variable by computing
27196         the arg_idx during emission.
27197
27198         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27199         function that returns whether a parameter is an out/ref value or not.
27200
27201         (Parameter.ParameterType): The type of the parameter (base,
27202         without ref/out applied).
27203
27204         (Parameter.Resolve): Perform resolution here.
27205         (Parameter.ExternalType): The full type (with ref/out applied).
27206
27207         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27208         support for expressions on the using statement.
27209
27210 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27211
27212         * statement.cs (Using.EmitLocalVariableDecls): Split the
27213         localvariable handling of the using statement.
27214
27215         (Block.EmitMeta): Keep track of variable count across blocks.  We
27216         were reusing slots on separate branches of blocks.
27217
27218         (Try.Emit): Emit the general code block, we were not emitting it. 
27219
27220         Check the type of the declaration to be an IDisposable or
27221         something that can be implicity converted to it. 
27222
27223         Emit conversions if required.
27224
27225         * ecore.cs (EmptyExpression): New utility class.
27226         (Expression.ImplicitConversionExists): New utility function.
27227
27228 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27229
27230         * statement.cs (Using): Implement.
27231
27232         * expression.cs (LocalVariableReference): Support read only variables.
27233
27234         * statement.cs: Remove the explicit emit for the Leave opcode.
27235         (VariableInfo): Add a readonly field.
27236
27237 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27238
27239         * ecore.cs (ConvCast): new class used to encapsulate the various
27240         explicit integer conversions that works in both checked and
27241         unchecked contexts.
27242
27243         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27244         properly generate the overflow opcodes.
27245
27246 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27247
27248         * statement.cs: The correct type for the EmptyExpression is the
27249         element_type, not the variable type.  Ravi pointed this out.
27250
27251 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27252
27253         * class.cs (Method::Define): Handle PInvoke methods specially
27254         by using DefinePInvokeMethod instead of the usual one.
27255
27256         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27257         above to do the task of extracting information and defining the method.
27258
27259 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27260
27261         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27262         of the condition for string type.
27263
27264         (Emit): Move that here. 
27265
27266         (ArrayCreation::CheckIndices): Keep string literals in their expression
27267         form.
27268
27269         (EmitDynamicInitializers): Handle strings appropriately.
27270
27271 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27272
27273         * codegen.cs (EmitContext): Replace multiple variables with a
27274         single pointer to the current Switch statement.
27275
27276         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27277         EmitContext.
27278
27279 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27280
27281         * statement.cs 
27282
27283         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27284         default'.
27285
27286         (Foreach.Emit): Foreach on arrays was not setting
27287         up the loop variables (for break/continue).
27288
27289         (GotoCase): Semi-implented.
27290
27291 2001-12-03  Ravi Pratap  <ravi@ximian.com>
27292
27293         * attribute.cs (CheckAttribute): Handle system attributes by using
27294         Attribute.GetAttributes to examine information we need.
27295
27296         (GetValidPlaces): Same here.
27297
27298         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
27299
27300         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
27301
27302         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
27303
27304         (Method::Define): Set appropriate flags if we have a DllImport attribute.
27305
27306         (Method::Emit): Handle the case when we are a PInvoke method.
27307
27308 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27309
27310         * expression.cs: Use ResolveWithSimpleName on compound names.
27311
27312 2001-12-02  Ravi Pratap  <ravi@ximian.com>
27313
27314         * constant.cs (EmitConstant): Make sure we resolve the associated expression
27315         before trying to reduce it.
27316
27317         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
27318
27319         * constant.cs (LookupConstantValue): Implement.
27320
27321         (EmitConstant): Use the above in emitting the constant.
27322
27323         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
27324         that are user-defined by doing a LookupConstantValue on them.
27325
27326         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
27327         too, like above.
27328
27329 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
27330
27331         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
27332
27333         (BaseAccess.DoResolve): Implement.
27334
27335         (MemberAccess.DoResolve): Split this routine into a
27336         ResolveMemberAccess routine that can be used independently
27337
27338 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
27339
27340         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
27341         As that share bits of the implementation.  Is returns a boolean,
27342         while As returns the Type that is being probed.
27343
27344 2001-12-01  Ravi Pratap  <ravi@ximian.com>
27345
27346         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
27347         instead of a Literal - much easier.
27348
27349         (EnumInTransit): Remove - utterly useless :-)
27350
27351         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
27352
27353         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
27354
27355         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
27356         chain when we have no associated expression.
27357
27358 2001-11-30  Ravi Pratap  <ravi@ximian.com>
27359
27360         * constant.cs (Define): Use Location while reporting the errror.
27361
27362         Also emit a warning when 'new' is used and there is no inherited
27363         member to hide.
27364
27365         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
27366         populated.
27367
27368         (LookupEnumValue): Implement to lookup an enum member's value and define it
27369         if necessary.
27370
27371         (Populate): Re-write accordingly to use the above routine.
27372
27373 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
27374
27375         * expression.cs (This): Fix prototype for DoResolveLValue to
27376         override the base class DoResolveLValue.
27377
27378         * cs-parser.cs: Report errors cs574 and cs575 (destructor
27379         declarations) 
27380
27381         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
27382         (we need to load the address of the field here).  This fixes
27383         test-22. 
27384
27385         (FieldExpr.DoResolveLValue): Call the DoResolve
27386         function to initialize the Instance expression.
27387
27388         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
27389         correctly the GetEnumerator operation on a value type.
27390
27391         * cs-parser.jay: Add more simple parsing error catches.
27392
27393         * statement.cs (Switch): Add support for string switches.
27394         Handle null specially.
27395
27396         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
27397
27398 2001-11-28  Ravi Pratap  <ravi@ximian.com>
27399
27400         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
27401
27402         (declare_local_constant): New helper function.
27403
27404         * statement.cs (AddConstant): Keep a separate record of constants
27405
27406         (IsConstant): Implement to determine if a variable is a constant.
27407
27408         (GetConstantExpression): Implement.
27409
27410         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
27411
27412         * statement.cs (IsVariableDefined): Re-write.
27413
27414 2001-11-27  Ravi Pratap  <ravi@ximian.com>
27415
27416         * class.cs (TypeContainer::FindMembers): Look for constants
27417         in the case when we are looking for MemberTypes.Field
27418
27419         * expression.cs (MemberAccess::DoResolve): Check that in the
27420         case we are a FieldExpr and a Literal, we are not being accessed
27421         by an instance reference.
27422
27423         * cs-parser.jay (local_constant_declaration): Implement.
27424
27425         (declaration_statement): Implement for constant declarations.
27426
27427 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
27428
27429         * statement.cs (Switch): Catch double defaults.
27430
27431         (Switch): More work on the switch() statement
27432         implementation.  It works for integral values now, need to finish
27433         string support.
27434
27435
27436 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27437
27438         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
27439         integer literals into other integer literals.  To be used by
27440         switch. 
27441
27442 2001-11-24  Ravi Pratap  <ravi@ximian.com>
27443
27444         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
27445         some memory.
27446
27447         (EmitDynamicInitializers): Cope with the above since we extract data
27448         directly from ArrayData now.
27449
27450         (ExpectInitializers): Keep track of whether initializers are mandatory
27451         or not.
27452
27453         (Bounds): Make it a hashtable to prevent the same dimension being 
27454         recorded for every element in that dimension.
27455
27456         (EmitDynamicInitializers): Fix bug which prevented the Set array method
27457         from being found.
27458
27459         Also fix bug which was causing the indices to be emitted in the reverse
27460         order.
27461
27462 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
27463
27464         * expression.cs (ArrayCreation): Implement the bits that Ravi left
27465         unfinished.  They do not work, because the underlying code is
27466         sloppy.
27467
27468 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27469
27470         * cs-parser.jay: Remove bogus fixme.
27471
27472         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
27473         on Switch statement.
27474
27475 2001-11-23  Ravi Pratap  <ravi@ximian.com>
27476
27477         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
27478         the same. 
27479
27480         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
27481         parameter. Apparently, any expression is allowed. 
27482
27483         (ValidateInitializers): Update accordingly.
27484
27485         (CheckIndices): Fix some tricky bugs thanks to recursion.
27486
27487         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
27488         I was being completely brain-dead.
27489
27490         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
27491         and re-write acordingly.
27492
27493         (DelegateInvocation): Re-write accordingly.
27494
27495         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
27496
27497         (MakeByteBlob): Handle types more correctly.
27498
27499         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
27500         initialization from expressions but it is incomplete because I am a complete
27501         Dodo :-|
27502
27503 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27504
27505         * statement.cs (If.Emit): Fix a bug that generated incorrect code
27506         on If.  Basically, we have to return `true' (ie, we do return to
27507         our caller) only if both branches of the if return.
27508
27509         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
27510         short-circuit operators, handle them as short circuit operators. 
27511
27512         (Cast.DoResolve): Resolve type.
27513         (Cast.Cast): Take an expression as the target type.
27514
27515         * cs-parser.jay (cast_expression): Remove old hack that only
27516         allowed a limited set of types to be handled.  Now we take a
27517         unary_expression and we resolve to a type during semantic
27518         analysis.
27519
27520         Use the grammar productions from Rhys to handle casts (this is
27521         not complete like Rhys syntax yet, we fail to handle that corner
27522         case that C# has regarding (-x), but we will get there.
27523
27524 2001-11-22  Ravi Pratap  <ravi@ximian.com>
27525
27526         * class.cs (EmitFieldInitializer): Take care of the case when we have a
27527         field which is an array type.
27528
27529         * cs-parser.jay (declare_local_variables): Support array initialization too.
27530
27531         * typemanager.cs (MakeKey): Implement.
27532
27533         (everywhere): Use the above appropriately.
27534
27535         * cs-parser.jay (for_statement): Update for array initialization while
27536         declaring variables.
27537
27538         * ecore.cs : The error message was correct, it's the variable's names that
27539         were misleading ;-) Make the code more readable.
27540
27541         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
27542         the correct type etc.
27543
27544         (ConvertExplicit): Handle Enum types by examining the underlying type.
27545
27546 2001-11-21  Ravi Pratap  <ravi@ximian.com>
27547
27548         * parameter.cs (GetCallingConvention): Always return
27549         CallingConventions.Standard for now.
27550
27551 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
27552
27553         * expression.cs (Binary.ResolveOperator): Update the values of `l'
27554         and `r' after calling DoNumericPromotions.
27555
27556         * ecore.cs: Fix error message (the types were in the wrong order).
27557
27558         * statement.cs (Foreach.ProbeCollectionType): Need to pass
27559         BindingFlags.Instance as well 
27560
27561         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
27562         implicit int literal conversion in an empty cast so that we
27563         propagate the right type upstream.
27564
27565         (UnboxCast): new class used to unbox value types.
27566         (Expression.ConvertExplicit): Add explicit type conversions done
27567         by unboxing.
27568
27569         (Expression.ImplicitNumericConversion): Oops, forgot to test for
27570         the target type before applying the implicit LongLiterals to ULong
27571         literal cast.
27572
27573 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
27574
27575         * cs-parser.jay (for_statement): Reworked the way For works: now
27576         we declare manually any variables that are introduced in
27577         for_initializer to solve the problem of having out-of-band code
27578         emition (that is what got for broken).
27579
27580         (declaration_statement): Perform the actual variable declaration
27581         that used to be done in local_variable_declaration here.
27582
27583         (local_variable_declaration): Do not declare anything, just pass
27584         the information on a DictionaryEntry
27585
27586 2001-11-20  Ravi Pratap  <ravi@ximian.com>
27587
27588         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
27589         re-write of the logic to now make it recursive.
27590
27591         (UpdateIndices): Re-write accordingly.
27592
27593         Store element data in a separate ArrayData list in the above methods.
27594
27595         (MakeByteBlob): Implement to dump the array data into a byte array.
27596
27597 2001-11-19  Ravi Pratap  <ravi@ximian.com>
27598
27599         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
27600         into CheckIndices.
27601
27602         * constant.cs (Define): Implement.
27603
27604         (EmitConstant): Re-write fully.
27605
27606         Pass in location info.
27607
27608         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
27609         respectively.
27610
27611         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
27612         DictionaryEntry since we need location info too.
27613
27614         (constant_declaration): Update accordingly.
27615
27616         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
27617         code into another method : UpdateIndices.
27618
27619 2001-11-18  Ravi Pratap  <ravi@ximian.com>
27620
27621         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
27622         some type checking etc.
27623
27624 2001-11-17  Ravi Pratap  <ravi@ximian.com>
27625
27626         * expression.cs (ArrayCreation::ValidateInitializers): Implement
27627         bits to provide dimension info if the user skips doing that.
27628
27629         Update second constructor to store the rank correctly.
27630
27631 2001-11-16  Ravi Pratap  <ravi@ximian.com>
27632
27633         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
27634         and try to implement.
27635
27636         * ../errors/cs0150.cs : Add.
27637
27638         * ../errors/cs0178.cs : Add.
27639
27640 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
27641
27642         * statement.cs: Implement foreach on multi-dimensional arrays. 
27643
27644         * parameter.cs (Parameters.GetParameterByName): Also lookup the
27645         name of the params argument.
27646
27647         * expression.cs: Use EmitStoreOpcode to get the right opcode while
27648         initializing the array.
27649
27650         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
27651         we can use this elsewhere.
27652
27653         * statement.cs: Finish implementation of foreach for single
27654         dimension arrays.
27655
27656         * cs-parser.jay: Use an out-of-band stack to pass information
27657         around, I wonder why I need this.
27658
27659         foreach_block: Make the new foreach_block the current_block.
27660
27661         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
27662         function used to return a static Parameters structure.  Used for
27663         empty parameters, as those are created very frequently.
27664
27665         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
27666
27667 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27668
27669         * interface.cs : Default modifier is private, not public. The
27670         make verify test passes again.
27671
27672 2001-11-15  Ravi Pratap  <ravi@ximian.com>
27673
27674         * support.cs (ReflectionParameters): Fix logic to determine
27675         whether the last parameter is a params one. Test 9 passes again.
27676
27677         * delegate.cs (Populate): Register the builders we define with
27678         RegisterParameterForBuilder. Test 19 passes again.
27679
27680         * cs-parser.jay (property_declaration): Reference $6 instead
27681         of $$ to get at the location.
27682
27683         (indexer_declaration): Similar stuff.
27684
27685         (attribute): Ditto.
27686
27687         * class.cs (Property): Register parameters for the Get and Set methods
27688         if they exist. Test 23 passes again.
27689
27690         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
27691         call to EmitArguments as we are sure there aren't any params arguments. 
27692         Test 32 passes again.
27693
27694         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
27695         IndexOutOfRangeException. 
27696
27697         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
27698         Test 33 now passes again.
27699
27700 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
27701
27702         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
27703         broke a bunch of things.  Will have to come up with a better way
27704         of tracking locations.
27705
27706         * statement.cs: Implemented foreach for single dimension arrays.
27707
27708 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27709
27710         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
27711         an error.  This removes the lookup from the critical path.
27712
27713         * cs-parser.jay: Removed use of temporary_loc, which is completely
27714         broken. 
27715
27716 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
27717
27718         * support.cs (ReflectionParameters.ParameterModifier): Report
27719         whether the argument is a PARAMS argument or not.
27720
27721         * class.cs: Set the attribute `ParamArrayAttribute' on the
27722         parameter argument.
27723
27724         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
27725         and cons_param_array_attribute (ConstructorInfo for
27726         ParamArrayAttribute)., 
27727
27728         * codegen.cs: Emit the return using the `Return' statement, that
27729         way we can report the error correctly for missing return values. 
27730
27731         * class.cs (Method.Emit): Clean up.
27732
27733         * expression.cs (Argument.Resolve): Take another argument: the
27734         location where this argument is used.  Notice that this is not
27735         part of the "Argument" class as to reduce the size of the
27736         structure (we know the approximate location anyways).
27737
27738         Test if the argument is a variable-reference, if not, then
27739         complain with a 206.
27740
27741         (Argument.Emit): Emit addresses of variables.
27742
27743         (Argument.FullDesc): Simplify.
27744
27745         (Invocation.DoResolve): Update for Argument.Resolve.
27746
27747         (ElementAccess.DoResolve): ditto.
27748
27749         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
27750         method should be virtual, as this method is always virtual.
27751
27752         (NewDelegate.DoResolve): Update for Argument.Resolve.
27753
27754         * class.cs (ConstructorInitializer.DoResolve): ditto.
27755
27756         * attribute.cs (Attribute.Resolve): ditto.
27757
27758 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
27759
27760         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
27761
27762         * expression.cs (ParameterReference): Drop IStackStorage and implement
27763         IAssignMethod instead. 
27764
27765         (LocalVariableReference): ditto.
27766
27767         * ecore.cs (FieldExpr): Drop IStackStorage and implement
27768         IAssignMethod instead. 
27769
27770 2001-11-13  Miguel de Icaza <miguel@ximian.com>
27771
27772         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
27773         enumerations that are used in heavily used structures derive from
27774         byte in a laughable and pathetic attempt to reduce memory usage.
27775         This is the kind of pre-optimzations that you should not do at
27776         home without adult supervision.
27777
27778         * expression.cs (UnaryMutator): New class, used to handle ++ and
27779         -- separatedly from the other unary operators.  Cleans up the
27780         code, and kills the ExpressionStatement dependency in Unary.
27781
27782         (Unary): Removed `method' and `Arguments' from this class, making
27783         it smaller, and moving it all to SimpleCall, so I can reuse this
27784         code in other locations and avoid creating a lot of transient data
27785         strucutres when not required.
27786
27787         * cs-parser.jay: Adjust for new changes.
27788
27789 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
27790
27791         * enum.cs (Enum.Populate): If there is a failure during
27792         definition, return
27793
27794         * cs-parser.jay (opt_enum_base): we used to catch type errors
27795         here, but this is really incorrect.  The type error should be
27796         catched during semantic analysis.
27797
27798 2001-12-11  Ravi Pratap  <ravi@ximian.com>
27799
27800         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
27801         current_local_parameters as expected since I, in my stupidity, had forgotten
27802         to do this :-)
27803
27804         * attribute.cs (GetValidPlaces): Fix stupid bug.
27805
27806         * class.cs (Method::Emit): Perform check on applicability of attributes.
27807
27808         (Constructor::Emit): Ditto.
27809
27810         (Field::Emit): Ditto.
27811
27812         (Field.Location): Store location information.
27813
27814         (Property, Event, Indexer, Operator): Ditto.
27815
27816         * cs-parser.jay (field_declaration): Pass in location for each field.
27817
27818         * ../errors/cs0592.cs : Add.
27819
27820 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27821
27822         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
27823
27824         (InitCoreTypes): Update accordingly.
27825
27826         (RegisterAttrType, LookupAttr): Implement.
27827
27828         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
27829         info about the same.
27830
27831         (Resolve): Update to populate the above as necessary.
27832
27833         (Error592): Helper.
27834
27835         (GetValidPlaces): Helper to the above.
27836
27837         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
27838
27839         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
27840
27841 2001-11-12  Ravi Pratap  <ravi@ximian.com>
27842
27843         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
27844
27845         * ../errors/cs0617.cs : Add.
27846
27847 2001-11-11  Ravi Pratap  <ravi@ximian.com>
27848
27849         * enum.cs (Emit): Rename to Populate to be more consistent with what
27850         we expect it to do and when exactly it is called.
27851
27852         * class.cs, rootcontext.cs : Update accordingly.
27853
27854         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
27855         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
27856
27857         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
27858
27859         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
27860         of a fieldinfo using the above, when dealing with a FieldBuilder.
27861
27862 2001-11-10  Ravi Pratap  <ravi@ximian.com>
27863
27864         * ../errors/cs0031.cs : Add.
27865
27866         * ../errors/cs1008.cs : Add.
27867
27868         * ../errrors/cs0543.cs : Add.
27869
27870         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
27871         enum type.
27872
27873         (FindMembers): Implement.
27874
27875         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
27876         enums and delegates too.
27877
27878         (enum_types): Rename to builder_to_enum.
27879
27880         (delegate_types): Rename to builder_to_delegate.
27881
27882         * delegate.cs (FindMembers): Implement.
27883
27884 2001-11-09  Ravi Pratap  <ravi@ximian.com>
27885
27886         * typemanager.cs (IsEnumType): Implement.
27887
27888         * enum.cs (Emit): Re-write parts to account for the underlying type
27889         better and perform checking etc.
27890
27891         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
27892         of the underlying type.
27893
27894         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
27895         value
27896
27897         * enum.cs (error31): Helper to report error #31.
27898
27899         * cs-parser.jay (enum_declaration): Store location of each member too.
27900
27901         * enum.cs (member_to_location): New hashtable. 
27902
27903         (AddEnumMember): Update location hashtable.
27904
27905         (Emit): Use the location of each member while reporting errors.
27906
27907 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
27908
27909         * cs-parser.jay: A for_initializer if is a
27910         local_variable_declaration really ammount to have an implicit
27911         block with the variable declaration and no initializer for for.
27912
27913         * statement.cs (For.Emit): Cope with null initializers.
27914
27915         This fixes the infinite loop on for initializers.
27916
27917 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
27918
27919         * enum.cs: More cleanup.
27920
27921         * ecore.cs: Remove dead code.
27922
27923         * class.cs (Property.Emit): More simplification.
27924         (Event.Emit): ditto.
27925
27926         Reworked to have less levels of indentation.
27927
27928 2001-11-08  Ravi Pratap  <ravi@ximian.com>
27929
27930         * class.cs (Property): Emit attributes.
27931
27932         (Field): Ditto.
27933
27934         (Event): Ditto.
27935
27936         (Indexer): Ditto.
27937
27938         (Operator): Ditto.
27939
27940         * enum.cs (Emit): Ditto.
27941
27942         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
27943         Enums too.
27944
27945         * class.cs (Field, Event, etc.): Move attribute generation into the
27946         Emit method everywhere.
27947
27948         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
27949         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
27950         as we had no way of defining nested enums !
27951
27952         * rootcontext.cs : Adjust code accordingly.
27953
27954         * typemanager.cs (AddEnumType): To keep track of enum types separately.
27955
27956 2001-11-07  Ravi Pratap  <ravi@ximian.com>
27957
27958         * expression.cs (EvalConstantExpression): Move into ecore.cs
27959
27960         * enum.cs (Enum): Rename some members and make them public and readonly
27961         according to our convention.
27962
27963         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
27964         nothing else.
27965
27966         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
27967
27968         (Enum::Emit): Write a simple version for now which doesn't try to compute
27969         expressions. I shall modify this to be more robust in just a while.
27970
27971         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
27972
27973         (TypeContainer::CloseType): Create the Enum types too.
27974
27975         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
27976
27977         * expression.cs (EvalConstantExpression): Get rid of completely.
27978
27979         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
27980         user-defined values and other cases.
27981
27982         (IsValidEnumLiteral): Helper function.
27983
27984         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
27985         out there in the case we had a literal FieldExpr.
27986
27987         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
27988
27989         (Literalize): Revamp a bit to take two arguments.
27990
27991         (EnumLiteral): New class which derives from Literal to wrap enum literals.
27992
27993 2001-11-06  Ravi Pratap  <ravi@ximian.com>
27994
27995         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
27996
27997         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
27998
27999         (Resolve): Use the above to ensure we have proper initializers.
28000
28001 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28002
28003         * expression.cs (Expression::EvalConstantExpression): New method to 
28004         evaluate constant expressions.
28005
28006         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28007
28008 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28009
28010         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28011         in an array.
28012
28013         (Binary.ResolveOperator): Handle operator != (object a, object b)
28014         and operator == (object a, object b);
28015
28016         (Binary.DoNumericPromotions): Indicate whether the numeric
28017         promotion was possible.
28018
28019         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28020         Implement.  
28021
28022         Made the ArrayAccess implement interface IAssignMethod instead of
28023         IStackStore as the order in which arguments are passed reflects
28024         this.
28025
28026         * assign.cs: Instead of using expr.ExprClass to select the way of
28027         assinging, probe for the IStackStore/IAssignMethod interfaces.
28028
28029         * typemanager.cs: Load InitializeArray definition.
28030
28031         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28032         static data that can be used to initialize arrays. 
28033
28034 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28035
28036         * expression.cs: Handle operator== and operator!= for booleans.
28037
28038         (Conditioal.Reduce): Implement reducer for the ?: operator.
28039
28040         (Conditional.Resolve): Implement dead code elimination.
28041
28042         (Binary.Resolve): Catch string literals and return a new
28043         concatenated string.
28044
28045         (Unary.Reduce): Implement reduction of unary expressions.
28046
28047         * ecore.cs: Split out the expression core handling here.
28048
28049         (Expression.Reduce): New method used to perform constant folding
28050         and CSE.  This is needed to support constant-expressions. 
28051
28052         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28053         targets, and optimize for !x.
28054
28055 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28056
28057         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28058         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28059         set custom atttributes.
28060
28061         * literal.cs (Literal::GetValue): New abstract method to return the actual
28062         value of the literal, cast as an object.
28063
28064         (*Literal): Implement GetValue method.
28065
28066         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28067         expressions to the arraylist but objects of type Argument.
28068
28069         * class.cs (TypeContainer::Emit): Emit our attributes too.
28070
28071         (Method::Emit, Constructor::Emit): Ditto.
28072
28073         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28074         to be ignoring earlier.
28075
28076 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28077
28078         * attribute.cs (AttributeSection::Define): Implement to do the business
28079         of constructing a CustomAttributeBuilder.
28080
28081         (Attribute): New trivial class. Increases readability of code.  
28082
28083         * cs-parser.jay : Update accordingly.
28084
28085         (positional_argument_list, named_argument_list, named_argument): New rules
28086
28087         (attribute_arguments): Use the above so that we are more correct.
28088
28089 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28090
28091         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28092         to perform all checks for a method with a params parameter.
28093
28094         (Invocation::OverloadResolve): Update to use the above method and therefore
28095         cope correctly with params method invocations.
28096
28097         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28098         params too.
28099
28100         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28101         constructors in our parent too because we can't afford to miss out on 
28102         protected ones ;-)
28103
28104         * attribute.cs (AttributeSection): New name for the class Attribute
28105
28106         Other trivial changes to improve readability.
28107
28108         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28109         use the new class names.
28110
28111 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28112
28113         * class.cs (Method::Define): Complete definition for params types too
28114
28115         (Indexer::Define): Ditto.
28116
28117         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28118         Cope everywhere with a request for info about the array parameter.
28119
28120 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28121
28122         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28123
28124         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28125         local_variable_type to extract the string corresponding to the type.
28126
28127         (local_variable_type): Fixup the action to use the new helper method.
28128
28129         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28130         go.
28131
28132         * expression.cs : Clean out code which uses the above.
28133
28134 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28135
28136         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28137         and bale out if necessary by returning a false.
28138
28139         (RegisterProperty): Ditto.
28140
28141         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28142         and print out appropriate error messages.
28143
28144         * interface.cs (everywhere): Ditto.
28145
28146         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28147         location to constructor.
28148
28149         * class.cs (Property, Event, Indexer): Update accordingly.
28150
28151         * ../errors/cs111.cs : Added.
28152
28153         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28154         of a method, as laid down by the spec.
28155
28156         (Invocation::OverloadResolve): Use the above method.
28157
28158 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28159
28160         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28161         now take a TypeContainer and a Parameters object.
28162
28163         (ParameterData): Modify return type of ParameterModifier method to be 
28164         Parameter.Modifier and not a string.
28165
28166         (ReflectionParameters, InternalParameters): Update accordingly.
28167
28168         * expression.cs (Argument::GetParameterModifier): Same here.
28169
28170         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28171         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28172         symbol in it at all so maybe this is only for now.
28173
28174 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28175
28176         * support.cs (InternalParameters): Constructor now takes an extra argument 
28177         which is the actual Parameters class.
28178
28179         (ParameterDesc): Update to provide info on ref/out modifiers.
28180
28181         * class.cs (everywhere): Update call to InternalParameters to pass in
28182         the second argument too.
28183
28184         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28185         to return the modifier info [ref/out etc]
28186
28187         (InternalParameters, ReflectionParameters): Implement the above.
28188
28189         * expression.cs (Argument::ParameterModifier): Similar function to return
28190         info about the argument's modifiers.
28191
28192         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28193         too.
28194
28195         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28196         a new SetFormalParameters object which we pass to InternalParameters.
28197
28198 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28199
28200         * expression.cs (NewArray): Merge into the ArrayCreation class.
28201
28202 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28203
28204         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28205         NewUserdefinedArray into one as there wasn't much of a use in having
28206         two separate ones.
28207
28208         * expression.cs (Argument): Change field's name to ArgType from Type.
28209
28210         (Type): New readonly property which returns the proper type, taking into 
28211         account ref/out modifiers.
28212
28213         (everywhere): Adjust code accordingly for the above.
28214
28215         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28216         whether we are emitting for a ref or out parameter.
28217
28218         * expression.cs (Argument::Emit): Use the above field to set the state.
28219
28220         (LocalVariableReference::Emit): Update to honour the flag and emit the
28221         right stuff.
28222
28223         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28224
28225         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28226
28227         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28228
28229         (ReflectionParameters, InternalParameters): Implement the above method.
28230
28231         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28232         reporting errors.
28233
28234         (Invocation::FullMethodDesc): Ditto. 
28235
28236 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28237
28238         * cs-parser.jay: Add extra production for the second form of array
28239         creation. 
28240
28241         * expression.cs (ArrayCreation): Update to reflect the above
28242         change. 
28243
28244         * Small changes to prepare for Array initialization.
28245
28246 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28247
28248         * typemanager.cs (ImplementsInterface): interface might be null;
28249         Deal with this problem;
28250
28251         Also, we do store negative hits on the cache (null values), so use
28252         this instead of calling t.GetInterfaces on the type everytime.
28253
28254 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28255
28256         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28257
28258         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28259         split functionality out into different classes.
28260
28261         (New::FormArrayType): Move into NewBuiltinArray.
28262
28263         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28264         quite useless.
28265
28266         (NewBuiltinArray): New class to handle creation of built-in arrays.
28267
28268         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28269         account creation of one-dimensional arrays.
28270
28271         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28272
28273         (NewUserdefinedArray::DoResolve): Implement.
28274
28275         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28276
28277         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28278         we maintain inside the TypeManager. This is necessary to perform lookups on the
28279         module builder.
28280
28281         (LookupType): Update to perform GetType on the module builders too.     
28282
28283         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28284
28285         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28286
28287 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28288
28289         * expression.cs (New::DoResolve): Implement guts of array creation.
28290
28291         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
28292
28293 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
28294
28295         * expression.cs: Fix bug I introduced lsat night that broke
28296         Delegates. 
28297
28298         (Expression.Resolve): Report a 246 error (can not resolve name)
28299         if we find a SimpleName in the stream.
28300
28301         (Expression.ResolveLValue): Ditto.
28302
28303         (Expression.ResolveWithSimpleName): This function is a variant of
28304         ResolveName, this one allows SimpleNames to be returned without a
28305         warning.  The only consumer of SimpleNames is MemberAccess
28306
28307 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
28308
28309         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
28310         might arrive here.  I have my doubts that this is correct.
28311
28312         * statement.cs (Lock): Implement lock statement.
28313
28314         * cs-parser.jay: Small fixes to support `lock' and `using'
28315
28316         * cs-tokenizer.cs: Remove extra space
28317
28318         * driver.cs: New flag --checked, allows to turn on integer math
28319         checking. 
28320
28321         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
28322         Threading.Monitor.Exit 
28323
28324 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
28325
28326         * expression.cs (IndexerAccess::DoResolveLValue): Set the
28327         Expression Class to be IndexerAccess.
28328
28329         Notice that Indexer::DoResolve sets the eclass to Value.
28330
28331 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
28332
28333         * class.cs (TypeContainer::Emit): Emit code for indexers.
28334
28335         * assign.cs (IAssignMethod): New interface implemented by Indexers
28336         and Properties for handling assignment.
28337
28338         (Assign::Emit): Simplify and reuse code. 
28339
28340         * expression.cs (IndexerAccess, PropertyExpr): Implement
28341         IAssignMethod, clean up old code. 
28342
28343 2001-10-22  Ravi Pratap  <ravi@ximian.com>
28344
28345         * typemanager.cs (ImplementsInterface): New method to determine if a type
28346         implements a given interface. Provides a nice cache too.
28347
28348         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
28349         method.
28350
28351         (ConvertReferenceExplicit): Ditto.
28352
28353         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
28354         various methods, with correct names etc.
28355
28356         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
28357         Operator.UnaryNegation.
28358
28359         * cs-parser.jay (operator_declarator): Be a little clever in the case where
28360         we have a unary plus or minus operator.
28361
28362         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
28363         UnaryMinus.
28364
28365         * everywhere : update accordingly.
28366
28367         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
28368         respectively.
28369
28370         * class.cs (Method::Define): For the case where we are implementing a method
28371         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
28372         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
28373
28374 2001-10-21  Ravi Pratap  <ravi@ximian.com>
28375
28376         * interface.cs (FindMembers): Implement to work around S.R.E
28377         lameness.
28378
28379         * typemanager.cs (IsInterfaceType): Implement.
28380
28381         (FindMembers): Update to handle interface types too.
28382
28383         * expression.cs (ImplicitReferenceConversion): Re-write bits which
28384         use IsAssignableFrom as that is not correct - it doesn't work.
28385
28386         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
28387         and accordingly override EmitStatement.
28388
28389         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
28390         using the correct logic :-)
28391
28392 2001-10-19  Ravi Pratap  <ravi@ximian.com>
28393
28394         * ../errors/cs-11.cs : Add to demonstrate error -11 
28395
28396 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
28397
28398         * assign.cs (Assign::Resolve): Resolve right hand side first, and
28399         then pass this as a hint to ResolveLValue.
28400
28401         * expression.cs (FieldExpr): Add Location information
28402
28403         (FieldExpr::LValueResolve): Report assignment to readonly
28404         variable. 
28405
28406         (Expression::ExprClassFromMemberInfo): Pass location information.
28407
28408         (Expression::ResolveLValue): Add new method that resolves an
28409         LValue. 
28410
28411         (Expression::DoResolveLValue): Default invocation calls
28412         DoResolve. 
28413
28414         (Indexers): New class used to keep track of indexers in a given
28415         Type. 
28416
28417         (IStackStore): Renamed from LValue, as it did not really describe
28418         what this did.  Also ResolveLValue is gone from this interface and
28419         now is part of Expression.
28420
28421         (ElementAccess): Depending on the element access type
28422
28423         * typemanager.cs: Add `indexer_name_type' as a Core type
28424         (System.Runtime.CompilerServices.IndexerNameAttribute)
28425
28426         * statement.cs (Goto): Take a location.
28427
28428 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28429
28430         * delegate.cs (Delegate::VerifyDelegate): New method to verify
28431         if two delegates are compatible.
28432
28433         (NewDelegate::DoResolve): Update to take care of the case when
28434         we instantiate a delegate from another delegate.
28435
28436         * typemanager.cs (FindMembers): Don't even try to look up members
28437         of Delegate types for now.
28438
28439 2001-10-18  Ravi Pratap  <ravi@ximian.com>
28440
28441         * delegate.cs (NewDelegate): New class to take care of delegate
28442         instantiation.
28443
28444         * expression.cs (New): Split the delegate related code out into 
28445         the NewDelegate class.
28446
28447         * delegate.cs (DelegateInvocation): New class to handle delegate 
28448         invocation.
28449
28450         * expression.cs (Invocation): Split out delegate related code into
28451         the DelegateInvocation class.
28452
28453 2001-10-17  Ravi Pratap  <ravi@ximian.com>
28454
28455         * expression.cs (New::DoResolve): Implement delegate creation fully
28456         and according to the spec.
28457
28458         (New::DoEmit): Update to handle delegates differently.
28459
28460         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
28461         because of which we were printing out arguments in reverse order !
28462
28463         * delegate.cs (VerifyMethod): Implement to check if the given method
28464         matches the delegate.
28465
28466         (FullDelegateDesc): Implement.
28467
28468         (VerifyApplicability): Implement.
28469
28470         * expression.cs (Invocation::DoResolve): Update to accordingly handle
28471         delegate invocations too.
28472
28473         (Invocation::Emit): Ditto.
28474
28475         * ../errors/cs1593.cs : Added.
28476
28477         * ../errors/cs1594.cs : Added.
28478
28479         * delegate.cs (InstanceExpression, TargetMethod): New properties.
28480
28481 2001-10-16  Ravi Pratap  <ravi@ximian.com>
28482
28483         * typemanager.cs (intptr_type): Core type for System.IntPtr
28484
28485         (InitCoreTypes): Update for the same.
28486
28487         (iasyncresult_type, asynccallback_type): Ditto.
28488
28489         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
28490         correct.
28491
28492         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
28493         too.
28494
28495         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
28496         the builders for the 4 members of a delegate type :-)
28497
28498         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
28499         type.
28500
28501         * expression.cs (New::DoResolve): Implement guts for delegate creation.
28502
28503         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
28504
28505 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
28506
28507         * statement.cs (Break::Emit): Implement.   
28508         (Continue::Emit): Implement.
28509
28510         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28511         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28512         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
28513         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
28514         end loop
28515
28516         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
28517         properties that track the label for the current loop (begin of the
28518         loop and end of the loop).
28519
28520 2001-10-15  Ravi Pratap  <ravi@ximian.com>
28521
28522         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
28523         use of emitting anything at all.
28524
28525         * class.cs, rootcontext.cs : Get rid of calls to the same.
28526
28527         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
28528
28529         (Populate): Define the constructor correctly and set the implementation
28530         attributes.
28531
28532         * typemanager.cs (delegate_types): New hashtable to hold delegates that
28533         have been defined.
28534
28535         (AddDelegateType): Implement.
28536
28537         (IsDelegateType): Implement helper method.
28538
28539         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
28540
28541         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
28542         and accordingly handle it.
28543
28544         * delegate.cs (Populate): Take TypeContainer argument.
28545         Implement bits to define the Invoke method. However, I still haven't figured out
28546         how to take care of the native int bit :-(
28547
28548         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
28549         Qualify the name of the delegate, not its return type !
28550
28551         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
28552         conversion.
28553
28554         (StandardConversionExists): Checking for array types turns out to be recursive.
28555
28556         (ConvertReferenceExplicit): Implement array conversion.
28557
28558         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
28559
28560 2001-10-12  Ravi Pratap  <ravi@ximian.com>
28561
28562         * cs-parser.jay (delegate_declaration): Store the fully qualified
28563         name as it is a type declaration.
28564
28565         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
28566         readonly.
28567
28568         (DefineDelegate): Renamed from Define. Does the same thing essentially,
28569         as TypeContainer::DefineType.
28570
28571         (Populate): Method in which all the definition of the various methods (Invoke)
28572         etc is done.
28573
28574         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
28575         see.
28576
28577         (CloseDelegate): Finally creates the delegate.
28578
28579         * class.cs (TypeContainer::DefineType): Update to define delegates.
28580         (Populate, Emit and CloseType): Do the same thing here too.
28581
28582         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
28583         delegates in all these operations.
28584
28585 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
28586
28587         * expression.cs: LocalTemporary: a new expression used to
28588         reference a temporary that has been created.
28589
28590         * assign.cs: Handle PropertyAccess back here, so that we can
28591         provide the proper semantic access to properties.
28592
28593         * expression.cs (Expression::ConvertReferenceExplicit): Implement
28594         a few more explicit conversions. 
28595
28596         * modifiers.cs: `NEW' modifier maps to HideBySig.
28597
28598         * expression.cs (PropertyExpr): Make this into an
28599         ExpressionStatement, and support the EmitStatement code path. 
28600
28601         Perform get/set error checking, clean up the interface.
28602
28603         * assign.cs: recognize PropertyExprs as targets, and if so, turn
28604         them into toplevel access objects.
28605
28606 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
28607
28608         * expression.cs: PropertyExpr::PropertyExpr: use work around the
28609         SRE.
28610
28611         * typemanager.cs: Keep track here of our PropertyBuilders again to
28612         work around lameness in SRE.
28613
28614 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
28615
28616         * expression.cs (LValue::LValueResolve): New method in the
28617         interface, used to perform a second resolution pass for LValues. 
28618
28619         (This::DoResolve): Catch the use of this in static methods.
28620
28621         (This::LValueResolve): Implement.
28622
28623         (This::Store): Remove warning, assigning to `this' in structures
28624         is 
28625
28626         (Invocation::Emit): Deal with invocation of
28627         methods on value types.  We need to pass the address to structure
28628         methods rather than the object itself.  (The equivalent code to
28629         emit "this" for structures leaves the entire structure on the
28630         stack instead of a pointer to it). 
28631
28632         (ParameterReference::DoResolve): Compute the real index for the
28633         argument based on whether the method takes or not a `this' pointer
28634         (ie, the method is static).
28635
28636         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
28637         value types returned from functions when we need to invoke a
28638         method on the sturcture.
28639
28640
28641 2001-10-11  Ravi Pratap  <ravi@ximian.com>
28642
28643         * class.cs (TypeContainer::DefineType): Method to actually do the business of
28644         defining the type in the Modulebuilder or Typebuilder. This is to take
28645         care of nested types which need to be defined on the TypeBuilder using
28646         DefineNestedMethod.
28647
28648         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
28649         methods in RootContext, only ported to be part of TypeContainer.
28650
28651         (TypeContainer::GetInterfaceOrClass): Ditto.
28652
28653         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
28654
28655         * interface.cs (Interface::DefineInterface): New method. Does exactly
28656         what RootContext.CreateInterface did earlier, only it takes care of nested types 
28657         too.
28658
28659         (Interface::GetInterfaces): Move from RootContext here and port.
28660
28661         (Interface::GetInterfaceByName): Same here.
28662
28663         * rootcontext.cs (ResolveTree): Re-write.
28664
28665         (PopulateTypes): Re-write.
28666
28667         * class.cs (TypeContainer::Populate): Populate nested types too.
28668         (TypeContainer::Emit): Emit nested members too.
28669
28670         * typemanager.cs (AddUserType): Do not make use of the FullName property,
28671         instead just use the name argument passed in as it is already fully
28672         qualified.
28673
28674         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
28675         to TypeContainer mapping to see if a type is user-defined.
28676
28677         * class.cs (TypeContainer::CloseType): Implement. 
28678
28679         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
28680         the default constructor.
28681
28682         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
28683         twice.
28684
28685         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
28686
28687         * interface.cs (CloseType): Create the type here.
28688
28689         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
28690         the hierarchy.
28691
28692         Remove all the methods which are now in TypeContainer.
28693
28694 2001-10-10  Ravi Pratap  <ravi@ximian.com>
28695
28696         * delegate.cs (Define): Re-write bits to define the delegate
28697         correctly.
28698
28699 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
28700
28701         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
28702
28703         * expression.cs (ImplicitReferenceConversion): handle null as well
28704         as a source to convert to any reference type.
28705
28706         * statement.cs (Return): Perform any implicit conversions to
28707         expected return type.  
28708
28709         Validate use of return statement.  
28710
28711         * codegen.cs (EmitContext): Pass the expected return type here.
28712
28713         * class.cs (Method, Constructor, Property): Pass expected return
28714         type to EmitContext.
28715
28716 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
28717
28718         * expression.cs: Make DoResolve take an EmitContext instead of a
28719         TypeContainer.
28720
28721         Replaced `l' and `location' for `loc', for consistency.
28722
28723         (Error, Warning): Remove unneeded Tc argument.
28724
28725         * assign.cs, literal.cs, constant.cs: Update to new calling
28726         convention. 
28727
28728         * codegen.cs: EmitContext now contains a flag indicating whether
28729         code is being generated in a static method or not.
28730
28731         * cs-parser.jay: DecomposeQI, new function that replaces the old
28732         QualifiedIdentifier.  Now we always decompose the assembled
28733         strings from qualified_identifier productions into a group of
28734         memberaccesses.
28735
28736 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
28737
28738         * rootcontext.cs: Deal with field-less struct types correctly now
28739         by passing the size option to Define Type.
28740
28741         * class.cs: Removed hack that created one static field. 
28742
28743 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28744
28745         * statement.cs: Moved most of the code generation here. 
28746
28747 2001-10-09  Ravi Pratap  <ravi@ximian.com>
28748
28749         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
28750         seem very right.
28751
28752         (ElementAccess): Remove useless bits for now - keep checks as the spec
28753         says.
28754
28755 2001-10-08  Ravi Pratap  <ravi@ximian.com>
28756
28757         * expression.cs (ElementAccess::DoResolve): Remove my crap code
28758         and start performing checks according to the spec.
28759
28760 2001-10-07  Ravi Pratap  <ravi@ximian.com>
28761
28762         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
28763         rank_specifiers instead.
28764
28765         (rank_specifiers): Change the order in which the rank specifiers are stored
28766
28767         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
28768
28769         * expression.cs (ElementAccess): Implement the LValue interface too.
28770
28771 2001-10-06  Ravi Pratap  <ravi@ximian.com>
28772
28773         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
28774         except that user defined conversions are not included.
28775
28776         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
28777         perform the conversion of the return type, if necessary.
28778
28779         (New::DoResolve): Check whether we are creating an array or an object
28780         and accordingly do the needful.
28781
28782         (New::Emit): Same here.
28783
28784         (New::DoResolve): Implement guts of array creation.
28785
28786         (New::FormLookupType): Helper function.
28787
28788 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
28789
28790         * codegen.cs: Removed most of the code generation here, and move the
28791         corresponding code generation bits to the statement classes. 
28792
28793         Added support for try/catch/finalize and throw.
28794
28795         * cs-parser.jay: Added support for try/catch/finalize.
28796
28797         * class.cs: Catch static methods having the flags override,
28798         virtual or abstract.
28799
28800         * expression.cs (UserCast): This user cast was not really doing
28801         what it was supposed to do.  Which is to be born in fully resolved
28802         state.  Parts of the resolution were being performed at Emit time! 
28803
28804         Fixed this code.
28805
28806 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28807
28808         * expression.cs: Implicity convert the result from UserCast.
28809
28810 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28811
28812         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
28813         prevented it from working correctly. 
28814
28815         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
28816         merely ConvertImplicit.
28817
28818 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
28819
28820         * typemanager.cs: Make the LookupTypeContainer function static,
28821         and not per-instance.  
28822
28823         * class.cs: Make static FindMembers (the one that takes a Type
28824         argument). 
28825
28826         * codegen.cs: Add EmitForeach here.
28827
28828         * cs-parser.jay: Make foreach a toplevel object instead of the
28829         inline expansion, as we need to perform semantic analysis on it. 
28830
28831 2001-10-05  Ravi Pratap  <ravi@ximian.com>
28832
28833         * expression.cs (Expression::ImplicitUserConversion): Rename to
28834         UserDefinedConversion.
28835
28836         (Expression::UserDefinedConversion): Take an extra argument specifying 
28837         whether we look for explicit user conversions too.
28838
28839         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
28840
28841         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
28842
28843         (ExplicitUserConversion): Make it a call to UserDefinedConversion
28844         with the appropriate arguments.
28845
28846         * cs-parser.jay (cast_expression): Record location too.
28847
28848         * expression.cs (Cast): Record location info.
28849
28850         (Expression::ConvertExplicit): Take location argument.
28851
28852         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
28853         to determine if we are doing explicit conversions.
28854
28855         (UserCast::Emit): Update accordingly.
28856
28857         (Expression::ConvertExplicit): Report an error if everything fails.
28858
28859         * ../errors/cs0030.cs : Add.
28860
28861 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
28862
28863         * modifiers.cs: If the ABSTRACT keyword is present, also set the
28864         virtual and newslot bits. 
28865
28866         * class.cs (TypeContainer::RegisterRequiredImplementations):
28867         Record methods we need.
28868
28869         (TypeContainer::MakeKey): Helper function to make keys for
28870         MethodBases, since the Methodbase key is useless.
28871
28872         (TypeContainer::Populate): Call RegisterRequiredImplementations
28873         before defining the methods.   
28874
28875         Create a mapping for method_builders_to_methods ahead of time
28876         instead of inside a tight loop.
28877
28878         (::RequireMethods):  Accept an object as the data to set into the
28879         hashtable so we can report interface vs abstract method mismatch.
28880
28881 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28882
28883         * report.cs: Make all of it static.
28884
28885         * rootcontext.cs: Drop object_type and value_type computations, as
28886         we have those in the TypeManager anyways.
28887
28888         Drop report instance variable too, now it is a global.
28889
28890         * driver.cs: Use try/catch on command line handling.
28891
28892         Add --probe option to debug the error reporting system with a test
28893         suite. 
28894
28895         * report.cs: Add support for exiting program when a probe
28896         condition is reached.
28897
28898 2001-10-03  Ravi Pratap  <ravi@ximian.com>
28899
28900         * expression.cs (Binary::DoNumericPromotions): Fix the case when
28901         we do a forcible conversion regardless of type, to check if 
28902         ForceConversion returns a null.
28903
28904         (Binary::error19): Use location to report error.
28905
28906         (Unary::error23): Use location here too.
28907
28908         * ../errors/cs0019.cs : Check in.
28909
28910         * ../errors/cs0023.cs : Check in.
28911
28912         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
28913         case of a non-null MethodInfo object with a length of 0 !
28914
28915         (Binary::ResolveOperator): Flag error if overload resolution fails to find
28916         an applicable member - according to the spec :-)
28917         Also fix logic to find members in base types.
28918
28919         (Unary::ResolveOperator): Same here.
28920
28921         (Unary::report23): Change name to error23 and make first argument a TypeContainer
28922         as I was getting thoroughly confused between this and error19 :-)
28923
28924         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
28925         (::FindMostEncompassedType): Implement.
28926         (::FindMostEncompassingType): Implement.
28927         (::StandardConversionExists): Implement.
28928
28929         (UserImplicitCast): Re-vamp. We now need info about most specific
28930         source and target types so that we can do the necessary conversions.
28931
28932         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
28933         mathematical union with no duplicates.
28934
28935 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
28936
28937         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
28938         in order from base classes to child classes, so that we can in
28939         child classes look up in our parent for method names and
28940         attributes (required for handling abstract, virtual, new, override
28941         constructs: we need to instrospect our base class, and if we dont
28942         populate the classes in order, the introspection might be
28943         incorrect.  For example, a method could query its parent before
28944         the parent has any methods and would determine that the parent has
28945         no abstract methods (while it could have had them)).
28946
28947         (RootContext::CreateType): Record the order in which we define the
28948         classes.
28949
28950 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
28951
28952         * class.cs (TypeContainer::Populate): Also method definitions can
28953         fail now, keep track of this.
28954
28955         (TypeContainer::FindMembers): Implement support for
28956         DeclaredOnly/noDeclaredOnly flag.
28957
28958         (Constructor::Emit) Return the ConstructorBuilder.
28959
28960         (Method::Emit) Return the MethodBuilder. 
28961         Check for abstract or virtual methods to be public.
28962
28963         * rootcontext.cs (RootContext::CreateType): Register all the
28964         abstract methods required for the class to be complete and the
28965         interface methods that must be implemented. 
28966
28967         * cs-parser.jay: Report error 501 (method requires body if it is
28968         not marked abstract or extern).
28969
28970         * expression.cs (TypeOf::Emit): Implement.
28971
28972         * typemanager.cs: runtime_handle_type, new global type.
28973
28974         * class.cs (Property::Emit): Generate code for properties.
28975
28976 2001-10-02  Ravi Pratap  <ravi@ximian.com>
28977
28978         * expression.cs (Unary::ResolveOperator): Find operators on base type
28979         too - we now conform exactly to the spec.
28980
28981         (Binary::ResolveOperator): Same here.
28982
28983         * class.cs (Operator::Define): Fix minor quirk in the tests.
28984
28985         * ../errors/cs0215.cs : Added.
28986
28987         * ../errors/cs0556.cs : Added.
28988
28989         * ../errors/cs0555.cs : Added.
28990
28991 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
28992
28993         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
28994         single integer which is really efficient
28995
28996 2001-10-01  Ravi Pratap  <ravi@ximian.com>
28997
28998         *  expression.cs (Expression::ImplicitUserConversion): Use location
28999         even in the case when we are examining True operators.
29000  
29001         * class.cs (Operator::Define): Perform extensive checks to conform
29002         with the rules for operator overloading in the spec.
29003
29004         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29005         some of the other conversions mentioned in the spec.
29006
29007         * typemanager.cs (array_type): New static member for the System.Array built-in
29008         type.
29009
29010         (cloneable_interface): For System.ICloneable interface.
29011
29012         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29013         we start resolving the tree and populating types.
29014
29015         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29016  
29017 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29018
29019         * expression.cs (Expression::ExprClassFromMemberInfo,
29020         Expression::Literalize): Create literal expressions from
29021         FieldInfos which are literals.
29022
29023         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29024         type casts, because they were wrong.  The test suite in tests
29025         caught these ones.
29026
29027         (ImplicitNumericConversion): ushort to ulong requires a widening
29028         cast. 
29029
29030         Int32 constant to long requires widening cast as well.
29031
29032         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29033         for integers because the type on the stack is not i4.
29034
29035 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29036
29037         * expression.cs (report118): require location argument. 
29038
29039         * parameter.cs: Do not dereference potential null value.
29040
29041         * class.cs: Catch methods that lack the `new' keyword when
29042         overriding a name.  Report warnings when `new' is used without
29043         anything being there to override.
29044
29045         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29046
29047         * class.cs: Only add constructor to hashtable if it is non-null
29048         (as now constructors can fail on define).
29049
29050         (TypeManager, Class, Struct): Take location arguments.
29051
29052         Catch field instance initialization in structs as errors.
29053
29054         accepting_filter: a new filter for FindMembers that is static so
29055         that we dont create an instance per invocation.
29056
29057         (Constructor::Define): Catch errors where a struct constructor is
29058         parameterless 
29059
29060         * cs-parser.jay: Pass location information for various new
29061         constructs. 
29062
29063         * delegate.cs (Delegate): take a location argument.
29064
29065         * driver.cs: Do not call EmitCode if there were problesm in the
29066         Definition of the types, as many Builders wont be there. 
29067
29068         * decl.cs (Decl::Decl): Require a location argument.
29069
29070         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29071         into integers, and find the most appropiate integer for it.
29072
29073         * literal.cs: Implement ULongLiteral.
29074
29075         * rootcontext.cs: Provide better information about the location of
29076         failure when CreateType fails.
29077
29078 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29079
29080         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29081         as well.
29082
29083         * expression.cs (Binary::CheckShiftArguments): Add missing type
29084         computation.
29085         (Binary::ResolveOperator): Add type to the logical and and logical
29086         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29087         before.
29088
29089         (Binary::DoNumericPromotions): In the case where either argument
29090         is ulong (and most signed types combined with ulong cause an
29091         error) perform implicit integer constant conversions as well.
29092
29093 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29094
29095         * expression.cs (UserImplicitCast): Method should always be
29096         non-null. 
29097         (Invocation::BetterConversion): Simplified test for IntLiteral.
29098
29099         (Expression::ImplicitNumericConversion): Split this routine out.
29100         Put the code that performs implicit constant integer conversions
29101         here. 
29102
29103         (Expression::Resolve): Become a wrapper around DoResolve so we can
29104         check eclass and type being set after resolve.
29105
29106         (Invocation::Badness): Remove this dead function
29107
29108         (Binary::ResolveOperator): Do not compute the expensive argumnets
29109         unless we have a union for it.
29110
29111         (Probe::Emit): Is needs to do an isinst and then
29112         compare against null.
29113
29114         (::CanConvert): Added Location argument.  If the Location argument
29115         is null (Location.Null), then we do not report errors.  This is
29116         used by the `probe' mechanism of the Explicit conversion.  We do
29117         not want to generate an error for something that the user
29118         explicitly requested to be casted.  But the pipeline for an
29119         explicit cast first tests for potential implicit casts.
29120
29121         So for now, if the Location is null, it means `Probe only' to
29122         avoid adding another argument.   Might have to revise this
29123         strategy later.
29124
29125         (ClassCast): New class used to type cast objects into arbitrary
29126         classes (used in Explicit Reference Conversions).
29127
29128         Implement `as' as well.
29129
29130         Reverted all the patches from Ravi below: they were broken:
29131
29132                 * The use of `level' as a mechanism to stop recursive
29133                   invocations is wrong.  That was there just to catch the
29134                   bug with a strack trace but not as a way of addressing
29135                   the problem.
29136
29137                   To fix the problem we have to *understand* what is going
29138                   on and the interactions and come up with a plan, not
29139                   just get things going.
29140
29141                 * The use of the type conversion cache that I proposed
29142                   last night had an open topic: How does this work across
29143                   protection domains.  A user defined conversion might not
29144                   be public in the location where we are applying the
29145                   conversion, a different conversion might be selected
29146                   (ie, private A->B (better) but public B->A (worse),
29147                   inside A, A->B applies, but outside it, B->A will
29148                   apply).
29149
29150                 * On top of that (ie, even if the above is solved),
29151                   conversions in a cache need to be abstract.  Ie, `To
29152                   convert from an Int to a Short use an OpcodeCast', not
29153                   `To convert from an Int to a Short use the OpcodeCast on
29154                   the variable 5' (which is what this patch was doing).
29155
29156 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29157
29158         * expression.cs (Invocation::ConversionExists): Re-write to use
29159         the conversion cache
29160
29161         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29162         cache all conversions done, not just user-defined ones.
29163
29164         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29165         to determine if a conversion exists instead of acutually trying to 
29166         perform the conversion. It's faster too.
29167
29168         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29169         and only then attempt the implicit conversion.
29170
29171 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29172
29173         * expression.cs (ConvertImplicit): Use a cache for conversions
29174         already found. Check level of recursion and bail out if necessary.
29175
29176 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29177
29178         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29179         Export standard methods that we expect for string operations.
29180
29181         * statement.cs (Block::UsageWarning): Track usage of variables and
29182         report the errors for not used variables.
29183
29184         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29185         operator. 
29186
29187 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29188
29189         * codegen.cs: remove unnneded code 
29190
29191         * expression.cs: Removed BuiltinTypeAccess class
29192
29193         Fix the order in which implicit conversions are
29194         done.  
29195
29196         The previous fixed dropped support for boxed conversions (adding a
29197         test to the test suite now)
29198
29199         (UserImplicitCast::CanConvert): Remove test for source being null,
29200         that code is broken.  We should not feed a null to begin with, if
29201         we do, then we should track the bug where the problem originates
29202         and not try to cover it up here.
29203
29204         Return a resolved expression of type UserImplicitCast on success
29205         rather than true/false.  Ravi: this is what I was talking about,
29206         the pattern is to use a static method as a "constructor" for
29207         objects. 
29208
29209         Also, do not create arguments until the very last minute,
29210         otherwise we always create the arguments even for lookups that
29211         will never be performed. 
29212
29213         (UserImplicitCast::Resolve): Eliminate, objects of type
29214         UserImplicitCast are born in a fully resolved state. 
29215
29216         * typemanager.cs (InitCoreTypes): Init also value_type
29217         (System.ValueType). 
29218
29219         * expression.cs (Cast::Resolve): First resolve the child expression.
29220
29221         (LValue): Add new method AddressOf to be used by
29222         the `&' operator.  
29223
29224         Change the argument of Store to take an EmitContext instead of an
29225         ILGenerator, because things like FieldExpr need to be able to call
29226         their children expression to generate the instance code. 
29227
29228         (Expression::Error, Expression::Warning): Sugar functions for
29229         reporting errors.
29230
29231         (Expression::MemberLookup): Accept a TypeContainer instead of a
29232         Report as the first argument.
29233
29234         (Expression::ResolvePrimary): Killed.  I still want to improve
29235         this as currently the code is just not right.
29236
29237         (Expression::ResolveMemberAccess): Simplify, but it is still
29238         wrong. 
29239
29240         (Unary::Resolve): Catch errors in AddressOf operators.
29241
29242         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29243         index to a byte for the short-version, or the compiler will choose
29244         the wrong Emit call, which generates the wrong data.
29245
29246         (ParameterReference::Emit, ::Store): same.
29247
29248         (FieldExpr::AddressOf): Implement.
29249
29250         * typemanager.cs: TypeManager: made public variable instead of
29251         property.
29252
29253         * driver.cs: document --fatal.
29254
29255         * report.cs (ErrorMessage, WarningMessage): new names for the old
29256         Error and Warning classes.
29257
29258         * cs-parser.jay (member_access): Turn built-in access to types
29259         into a normal simplename
29260
29261 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29262
29263         * expression.cs (Invocation::BetterConversion): Fix to cope
29264         with q being null, since this was introducing a bug.
29265
29266         * expression.cs (ConvertImplicit): Do built-in conversions first.
29267
29268 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29269
29270         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29271
29272 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29273
29274         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29275         I had introduced long ago (what's new ?).
29276
29277         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29278         the work of all the checking. 
29279         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29280         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29281
29282         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29283         that is the right way. 
29284
29285         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29286         overloading resolution. Use everywhere instead of cutting and pasting code.
29287
29288         (Binary::ResolveOperator): Use MakeUnionSet.
29289
29290         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29291         we have to convert to bool types. Not complete yet.
29292
29293 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29294
29295         * typemanager.cs (TypeManager::CSharpName): support ushort.
29296
29297         * expression.cs (Expression::TryImplicitIntConversion): Attempts
29298         to provide an expression that performsn an implicit constant int
29299         conversion (section 6.1.6).
29300         (Expression::ConvertImplicitRequired): Reworked to include
29301         implicit constant expression conversions.
29302
29303         (Expression::ConvertNumericExplicit): Finished.
29304
29305         (Invocation::Emit): If InstanceExpression is null, then it means
29306         that we perform a call on this.
29307
29308 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29309
29310         * expression.cs (Unary::Emit): Remove some dead code.
29311         (Probe): Implement Resolve and Emit for `is'.
29312         (Expression::ConvertImplicitRequired): Attempt to do constant
29313         expression conversions here.  Maybe should be moved to
29314         ConvertImplicit, but I am not sure.
29315         (Expression::ImplicitLongConstantConversionPossible,
29316         Expression::ImplicitIntConstantConversionPossible): New functions
29317         that tell whether is it possible to apply an implicit constant
29318         expression conversion.
29319
29320         (ConvertNumericExplicit): Started work on explicit numeric
29321         conversions.
29322
29323         * cs-parser.jay: Update operator constants.
29324
29325         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
29326         (Parameters::GetSignature): Hook up VerifyArgs here.
29327         (Parameters::VerifyArgs): Verifies that no two arguments have the
29328         same name. 
29329
29330         * class.cs (Operator): Update the operator names to reflect the
29331         ones that the spec expects (as we are just stringizing the
29332         operator names).
29333
29334         * expression.cs (Unary::ResolveOperator): Fix bug: Use
29335         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
29336         previous usage did only work for our methods.
29337         (Expression::ConvertImplicit): Handle decimal implicit numeric
29338         conversions as well.
29339         (Expression::InternalTypeConstructor): Used to invoke constructors
29340         on internal types for default promotions.
29341
29342         (Unary::Emit): Implement special handling for the pre/post
29343         increment/decrement for overloaded operators, as they need to have
29344         the same semantics as the other operators.
29345
29346         (Binary::ResolveOperator): ditto.
29347         (Invocation::ConversionExists): ditto.
29348         (UserImplicitCast::Resolve): ditto.
29349
29350 2001-09-26  Ravi Pratap  <ravi@ximian.com>
29351
29352         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
29353         operator, return after emitting body. Regression tests pass again !
29354
29355         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
29356         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
29357         (Invocation::OverloadResolve): Ditto.
29358         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
29359
29360         * everywhere : update calls to the above methods accordingly.
29361
29362 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
29363
29364         * assign.cs (Assign): Make it inherit from ExpressionStatement.
29365
29366         * expression.cs (ExpressionStatement): New base class used for
29367         expressions that can appear in statements, so that we can provide
29368         an alternate path to generate expression that do not leave a value
29369         on the stack.
29370
29371         (Expression::Emit, and all the derivatives): We no longer return
29372         whether a value is left on the stack or not.  Every expression
29373         after being emitted leaves a single value on the stack.
29374
29375         * codegen.cs (EmitContext::EmitStatementExpression): Use the
29376         facilties of ExpressionStatement if possible.
29377
29378         * cs-parser.jay: Update statement_expression.
29379
29380 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
29381
29382         * driver.cs: Change the wording of message
29383
29384 2001-09-25  Ravi Pratap  <ravi@ximian.com>
29385
29386         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
29387         the type of the expression to the return type of the method if
29388         we have an overloaded operator match ! The regression tests pass again !
29389         (Unary::ResolveOperator): Ditto.
29390
29391         * expression.cs (Invocation::ConversionExists): Correct the member lookup
29392         to find "op_Implicit", not "implicit" ;-)
29393         (UserImplicitCast): New class to take care of user-defined implicit conversions.
29394         (ConvertImplicit, ForceConversion): Take TypeContainer argument
29395
29396         * everywhere : Correct calls to the above accordingly.
29397
29398         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
29399         (ConvertImplicit): Do user-defined conversion if it exists.
29400
29401 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
29402
29403         * assign.cs: track location.
29404         (Resolve): Use implicit conversions on assignment.
29405
29406         * literal.cs: Oops.  Not good, Emit of short access values should
29407         pass (Bytes) or the wrong argument will be selected.
29408
29409         * expression.cs (Unary::Emit): Emit code for -expr.
29410
29411         (Unary::ResolveOperator): Handle `Substract' for non-constants
29412         (substract from zero from the non-constants).
29413         Deal with Doubles as well. 
29414
29415         (Expression::ConvertImplicitRequired): New routine that reports an
29416         error if no implicit conversion exists. 
29417
29418         (Invocation::OverloadResolve): Store the converted implicit
29419         expressions if we make them
29420
29421 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29422
29423         * class.cs (ConstructorInitializer): Take a Location argument.
29424         (ConstructorBaseInitializer): Same here.
29425         (ConstructorThisInitializer): Same here.
29426
29427         * cs-parser.jay : Update all calls accordingly.
29428
29429         * expression.cs (Unary, Binary, New): Take location argument.
29430         Update accordingly everywhere.
29431
29432         * cs-parser.jay : Update all calls to the above to take a location
29433         argument.
29434
29435         * class.cs : Ditto.
29436
29437 2001-09-24  Ravi Pratap  <ravi@ximian.com>
29438
29439         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
29440         (Invocation::BetterConversion): Same here
29441         (Invocation::ConversionExists): Ditto.
29442
29443         (Invocation::ConversionExists): Implement.
29444
29445 2001-09-22  Ravi Pratap  <ravi@ximian.com>
29446
29447         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
29448         Also take an additional TypeContainer argument.
29449
29450         * All over : Pass in TypeContainer as argument to OverloadResolve.
29451
29452         * typemanager.cs (CSharpName): Update to check for the string type and return
29453         that too.
29454
29455         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
29456         a given method.
29457
29458 2001-09-21  Ravi Pratap  <ravi@ximian.com>
29459
29460         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
29461         (Invocation::BetterFunction): Implement.
29462         (Invocation::BetterConversion): Implement.
29463         (Invocation::ConversionExists): Skeleton, no implementation yet.
29464
29465         Okay, things work fine !
29466
29467 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
29468
29469         * typemanager.cs: declare and load enum_type, delegate_type and
29470         void_type. 
29471
29472         * expression.cs (Expression::Emit): Now emit returns a value that
29473         tells whether a value is left on the stack or not.  This strategy
29474         might be reveted tomorrow with a mechanism that would address
29475         multiple assignments.
29476         (Expression::report118): Utility routine to report mismatches on
29477         the ExprClass.
29478
29479         (Unary::Report23): Report impossible type/operator combination
29480         utility function.
29481
29482         (Unary::IsIncrementableNumber): Whether the type can be
29483         incremented or decremented with add.
29484         (Unary::ResolveOperator): Also allow enumerations to be bitwise
29485         complemented. 
29486         (Unary::ResolveOperator): Implement ++, !, ~,
29487
29488         (Invocation::Emit): Deal with new Emit convetion.
29489
29490         * All Expression derivatives: Updated their Emit method to return
29491         whether they leave values on the stack or not.
29492
29493         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
29494         stack for expressions that are statements. 
29495
29496 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29497
29498         * expression.cs (LValue): New interface.  Must be implemented by
29499         LValue objects.
29500         (LocalVariableReference, ParameterReference, FieldExpr): Implement
29501         LValue interface.
29502
29503         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
29504         interface for generating code, simplifies the code.
29505
29506 2001-09-20  Ravi Pratap  <ravi@ximian.com>
29507
29508         * expression.cs (everywhere): Comment out return statements in ::Resolve
29509         methods to avoid the warnings.
29510
29511 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
29512
29513         * driver.cs (parse): Report error 2001 if we can not open the
29514         source file.
29515
29516         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
29517         not resolve it.
29518
29519         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
29520         object. 
29521
29522         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
29523         otherwise nested blocks end up with the same index.
29524
29525         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
29526
29527         * expression.cs:  Instead of having FIXMEs in the Resolve
29528         functions, throw exceptions so it is obvious that we are facing a
29529         bug. 
29530
29531         * cs-parser.jay (invocation_expression): Pass Location information.
29532
29533         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
29534         Use a basename for those routines because .NET does not like paths
29535         on them. 
29536
29537         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
29538         already defined.
29539
29540 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
29541
29542         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
29543         are loading the correct data types (throws an exception if not).
29544         (TypeManager::InitCoreTypes): Use CoreLookupType
29545
29546         * expression.cs (Unary::ResolveOperator): return the child
29547         expression for expressions which are just +expr.
29548         (Unary::ResolveOperator): Return negative literals for -LITERAL
29549         expressions (otherwise they are Unary {Literal}).
29550         (Invocation::Badness): Take into account `Implicit constant
29551         expression conversions'.
29552
29553         * literal.cs (LongLiteral): Implement long literal class.
29554         (IntLiteral): export the `Value' of the intliteral. 
29555
29556 2001-09-19  Ravi Pratap  <ravi@ximian.com>
29557
29558         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
29559
29560         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
29561         instead of 'Operator'
29562
29563         * expression.cs (Binary::ResolveOperator): Update accordingly.
29564         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
29565         and 'Minus'
29566
29567         * cs-parser.jay (unary_expression): Update to use the new names.
29568
29569         * gen-treedump.cs (GetUnary): Same here.
29570
29571         * expression.cs (Unary::Resolve): Implement.
29572         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
29573         operators are found instead of making noise ;-)
29574         (Unary::ResolveOperator): New method to do precisely the same thing which
29575         Binary::ResolveOperator does for Binary expressions.
29576         (Unary.method, .Arguments): Add.
29577         (Unary::OperName): Implement.   
29578         (Unary::ForceConversion): Copy and Paste !
29579
29580         * class.cs (Operator::Define): Fix a small bug for the case when we have 
29581         a unary operator.
29582
29583         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
29584         for the inbuilt operators. Only overloading works for now ;-)
29585
29586 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
29587
29588         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
29589         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
29590
29591         * expression.cs (This::Emit): Implement. 
29592         (This::Resolve): Implement.
29593         (TypeOf:Resolve): Implement.
29594         (Expression::ResolveSimpleName): Add an implicit this to instance
29595         field references. 
29596         (MemberAccess::Resolve): Deal with Parameters and Fields. 
29597         Bind instance variable to Field expressions.
29598         (FieldExpr::Instance): New field used to track the expression that
29599         represents the object instance.
29600         (FieldExpr::Resolve): Track potential errors from MemberLookup not
29601         binding 
29602         (FieldExpr::Emit): Implement.
29603
29604         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
29605         the last instruction contains a return opcode to avoid generating
29606         the last `ret' instruction (this generates correct code, and it is
29607         nice to pass the peverify output).
29608
29609         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
29610         initializer for static and instance variables.
29611         (Constructor::Emit): Allow initializer to be null in the case of
29612         static constructors.  Only emit initializer for instance
29613         constructors. 
29614
29615         (TypeContainer::FindMembers): Return a null array if there are no
29616         matches.
29617
29618         Also fix the code for the MemberTypes.Method branch, as it was not
29619         scanning that for operators (or tried to access null variables before).
29620
29621         * assign.cs (Assign::Emit): Handle instance and static fields. 
29622
29623         * TODO: Updated.
29624
29625         * driver.cs: Stop compilation if there are parse errors.
29626
29627         * cs-parser.jay (constructor_declaration): Provide default base
29628         initializer for non-static constructors.
29629         (constructor_declarator): Do not provide a default base
29630         initializers if none was specified.
29631         Catch the fact that constructors should not have parameters.
29632
29633         * class.cs: Do not emit parent class initializers for static
29634         constructors, that should be flagged as an error.
29635
29636 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29637
29638         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
29639         Move back code into TypeContainer::Populate.
29640
29641 2001-09-18  Ravi Pratap  <ravi@ximian.com>
29642
29643         * class.cs (TypeContainer::AddConstructor): Fix the check to
29644         compare against Name, not Basename. 
29645         (Operator::OpType): Change Plus and Minus to Add and Subtract.
29646
29647         * cs-parser.jay : Update accordingly.
29648
29649         * class.cs (TypeContainer::FindMembers): For the case where we are searching
29650         for methods, don't forget to look into the operators too.
29651         (RegisterMethodBuilder): Helper method to take care of this for
29652         methods, constructors and operators.
29653         (Operator::Define): Completely revamp.
29654         (Operator.OperatorMethod, MethodName): New fields.
29655         (TypeContainer::Populate): Move the registering of builders into
29656         RegisterMethodBuilder.
29657         (Operator::Emit): Re-write.
29658
29659         * expression.cs (Binary::Emit): Comment out code path to emit method
29660         invocation stuff for the case when we have a user defined operator. I am
29661         just not able to get it right !
29662
29663 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29664
29665         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
29666         argument. 
29667
29668         (Expression::MemberLookup): Provide a version that allows to
29669         specify the MemberTypes and BindingFlags. 
29670
29671         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
29672         so it was not fetching variable information from outer blocks.
29673
29674         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
29675         Beforefieldinit as it was buggy.
29676
29677         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
29678         that Ravi put here.  
29679
29680         * class.cs (Constructor::Emit): Only emit if block is not null.
29681         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
29682         deal with this by semantically definining it as if the user had
29683         done it.
29684
29685         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
29686         constructors as we now "emit" them at a higher level.
29687
29688         (TypeContainer::DefineDefaultConstructor): Used to define the
29689         default constructors if none was provided.
29690
29691         (ConstructorInitializer): Add methods Resolve and Emit. 
29692
29693         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
29694
29695 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29696
29697         * class.cs (TypeContainer::EmitDefaultConstructor): Register
29698         the default constructor builder with our hashtable for methodbuilders
29699         to methodcores.
29700
29701         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
29702         and argument_count is 0 in which case we have a match.
29703         (Binary::ResolveOperator): More null checking and miscellaneous coding
29704         style cleanup.
29705
29706 2001-09-17  Ravi Pratap  <ravi@ximian.com>
29707
29708         * rootcontext.cs (IsNameSpace): Compare against null.
29709
29710         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
29711
29712         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
29713         and Unary::Operator.
29714
29715         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
29716         accordingly.
29717
29718         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
29719         we have overloaded operators.
29720         (Binary::ResolveOperator): Implement the part which does the operator overload
29721         resolution.
29722
29723         * class.cs (Operator::Emit): Implement.
29724         (TypeContainer::Emit): Emit the operators we have too.
29725
29726         * expression.cs (Binary::Emit): Update to emit the appropriate code for
29727         the case when we have a user-defined operator.
29728
29729 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
29730
29731         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
29732
29733 2001-09-16  Ravi Pratap  <ravi@ximian.com>
29734
29735         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
29736         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
29737         (Constructor::Emit): Implement.
29738         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
29739         if we have no work to do. 
29740         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
29741         Emit method.
29742
29743         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
29744         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
29745
29746         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
29747         of parent.parent.
29748
29749 2001-09-15  Ravi Pratap  <ravi@ximian.com>
29750
29751         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
29752         in the source.
29753         (Tree::RecordNamespace): Method to do what the name says ;-)
29754         (Tree::Namespaces): Property to get at the namespaces hashtable.
29755
29756         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
29757         keep track.
29758
29759         * rootcontext.cs (IsNamespace): Fixed it :-)
29760
29761 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29762
29763         * class.cs (TypeContainer::FindMembers): Add support for
29764         constructors. 
29765         (MethodCore): New class that encapsulates both the shared aspects
29766         of a Constructor and a Method.  
29767         (Method, Constructor): Factored pieces into MethodCore.
29768
29769         * driver.cs: Added --fatal which makes errors throw exceptions.
29770         Load System assembly as well as part of the standard library.
29771
29772         * report.cs: Allow throwing exceptions on errors for debugging.
29773
29774         * modifiers.cs: Do not use `parent', instead use the real type
29775         container to evaluate permission settings.
29776
29777         * class.cs: Put Ravi's patch back in.  He is right, and we will
29778         have to cope with the
29779
29780 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29781
29782         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
29783         FamORAssem, not FamANDAssem.
29784
29785 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
29786
29787         * driver.cs: Added --parse option that only parses its input files
29788         and terminates.
29789
29790         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
29791         incorrect.  IsTopLevel is not used to tell whether an object is
29792         root_types or not (that can be achieved by testing this ==
29793         root_types).  But to see if this is a top-level *class* (not
29794         necessarly our "toplevel" container). 
29795
29796 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29797
29798         * enum.cs (Enum::Define): Modify to call the Lookup method on the
29799         parent instead of a direct call to GetType.
29800
29801 2001-09-14  Ravi Pratap  <ravi@ximian.com>
29802
29803         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
29804         Modifiers.TypeAttr. This should just be a call to that method.
29805
29806         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
29807         object so that we can determine if we are top-level or not.
29808
29809         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
29810         TypeContainer too.
29811
29812         * enum.cs (Enum::Define): Ditto.
29813
29814         * modifiers.cs (FieldAttr): Re-write.
29815
29816         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
29817         (TypeContainer::HaveStaticConstructor): New property to provide access
29818         to precisely that info.
29819
29820         * modifiers.cs (MethodAttr): Re-write.
29821         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
29822
29823         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
29824         of top-level types as claimed.
29825
29826 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29827
29828         * expression.cs (MemberLookup): Fruitless attempt to lookup
29829         constructors.  Maybe I need to emit default constructors?  That
29830         might be it (currently .NET emits this for me automatically).
29831         (Invocation::OverloadResolve): Cope with Arguments == null.
29832         (Invocation::EmitArguments): new function, shared by the new
29833         constructor and us.
29834         (Invocation::Emit): Handle static and instance methods.  Emit
29835         proper call instruction for virtual or non-virtual invocations.
29836         (New::Emit): Implement.
29837         (New::Resolve): Implement.
29838         (MemberAccess:Resolve): Implement.
29839         (MethodGroupExpr::InstanceExpression): used conforming to the spec
29840         to track instances.
29841         (FieldExpr::Resolve): Set type.
29842
29843         * support.cs: Handle empty arguments.
29844                 
29845         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
29846         SimpleLookup): Auxiliary routines to help parse a qualifier
29847         identifier.  
29848
29849         Update qualifier_identifier rule.
29850
29851         * codegen.cs: Removed debugging messages.
29852
29853         * class.cs: Make this a global thing, this acts just as a "key" to
29854         objects that we might have around.
29855
29856         (Populate): Only initialize method_builders_to_methods once.
29857
29858         * expression.cs (PropertyExpr): Initialize type from the
29859         PropertyType. 
29860
29861         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
29862         Resolve pattern.  Attempt to implicitly convert value to boolean.
29863         Emit code.
29864
29865         * expression.cs: Set the type for the int32/int32 argument case.
29866         (Binary::ResolveOperator): Set the return type to boolean for
29867         comparission operators
29868
29869         * typemanager.cs: Remove debugging print code.
29870
29871         (Invocation::Resolve): resolve type.
29872
29873         * class.cs: Allocate a MemberInfo of the correct size, as the code
29874         elsewhere depends on the test to reflect the correct contents.
29875
29876         (Method::) Keep track of parameters, due to System.Reflection holes
29877
29878         (TypeContainer::Populate): Keep track of MethodBuilders to Method
29879         mapping here.
29880
29881         (TypeContainer::FindMembers): Use ArrayList and then copy an array
29882         of the exact size and return that.
29883
29884         (Class::LookupMethodByBuilder): New function that maps
29885         MethodBuilders to its methods.  Required to locate the information
29886         on methods because System.Reflection bit us again.
29887
29888         * support.cs: New file, contains an interface ParameterData and
29889         two implementations: ReflectionParameters and InternalParameters
29890         used to access Parameter information.  We will need to grow this
29891         as required.
29892
29893         * expression.cs (Invocation::GetParameterData): implement a cache
29894         and a wrapper around the ParameterData creation for methods. 
29895         (Invocation::OverloadResolve): Use new code.
29896
29897 2001-09-13  Ravi Pratap  <ravi@ximian.com>
29898
29899         * class.cs (TypeContainer::EmitField): Remove and move into 
29900         (Field::Define): here and modify accordingly.
29901         (Field.FieldBuilder): New member.
29902         (TypeContainer::Populate): Update accordingly.
29903         (TypeContainer::FindMembers): Implement.
29904
29905 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
29906
29907         * statement.cs: (VariableInfo::VariableType): New field to be
29908         initialized with the full type once it is resolved. 
29909
29910 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
29911
29912         * parameter.cs (GetParameterInfo): Use a type cache to compute
29913         things only once, and to reuse this information
29914
29915         * expression.cs (LocalVariableReference::Emit): Implement.
29916         (OpcodeCast::Emit): fix.
29917
29918         (ParameterReference::Resolve): Implement.
29919         (ParameterReference::Emit): Implement.
29920
29921         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
29922         that are expressions need to stay as Expressions.
29923
29924         * typemanager.cs (CSharpName): Returns the C# name of a type if
29925         possible. 
29926
29927         * expression.cs (Expression::ConvertImplicit): New function that
29928         implements implicit type conversions.
29929
29930         (Expression::ImplicitReferenceConversion): Implements implicit
29931         reference conversions.
29932
29933         (EmptyCast): New type for transparent casts.
29934
29935         (OpcodeCast): New type for casts of types that are performed with
29936         a sequence of bytecodes.
29937
29938         (BoxedCast): New type used for casting value types into reference
29939         types.  Emits a box opcode.
29940
29941         (Binary::DoNumericPromotions): Implements numeric promotions of
29942         and computation of the Binary::Type.
29943
29944         (Binary::EmitBranchable): Optimization.
29945
29946         (Binary::Emit): Implement code emission for expressions.
29947
29948         * typemanager.cs (TypeManager): Added two new core types: sbyte
29949         and byte.
29950
29951 2001-09-12  Ravi Pratap  <ravi@ximian.com>
29952
29953         * class.cs (TypeContainer::FindMembers): Method which does exactly
29954         what Type.FindMembers does, only we don't have to use reflection. No
29955         implementation yet.
29956
29957         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
29958         typecontainer objects as we need to get at them.
29959         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
29960
29961         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
29962         typecontainer object.
29963
29964         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
29965         of just a Report object.
29966
29967 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29968
29969         * class.cs (Event::Define): Go back to using the prefixes "add_" and
29970         "remove_"
29971         (TypeContainer::Populate): Now define the delegates of the type too.
29972         (TypeContainer.Delegates): Property to access the list of delegates defined
29973         in the type.
29974
29975         * delegates.cs (Delegate::Define): Implement partially.
29976
29977         * modifiers.cs (TypeAttr): Handle more flags.
29978
29979 2001-09-11  Ravi Pratap  <ravi@ximian.com>
29980
29981         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
29982         and not <=
29983         (Operator::Define): Re-write logic to get types by using the LookupType method
29984         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
29985         (Indexer::Define): Ditto.
29986         (Event::Define): Ditto.
29987         (Property::Define): Ditto.
29988
29989 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29990
29991         * class.cs (TypeContainer::Populate): Now define operators too. 
29992         (TypeContainer.Operators): New property to access the list of operators
29993         in a type.
29994         (Operator.OperatorMethodBuilder): New member to hold the method builder
29995         for the operator we are defining.
29996         (Operator::Define): Implement.
29997
29998 2001-09-10  Ravi Pratap  <ravi@ximian.com>
29999
30000         * class.cs (Event::Define): Make the prefixes of the accessor methods
30001         addOn_ and removeOn_ 
30002
30003         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30004         of the location being passed in too. Ideally, this should go later since all
30005         error reporting should be done through the Report object.
30006
30007         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30008         (Populate): Iterate thru the indexers we have and define them too.
30009         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30010         for the get and set accessors.
30011         (Indexer::Define): Implement.
30012
30013 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30014
30015         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30016         my previous implementation, did not work.
30017
30018         * typemanager.cs: Add a couple of missing types (the longs).
30019
30020         * literal.cs: Use TypeManager.bool_type instead of getting it.
30021
30022         * expression.cs (EventExpr): New kind of expressions.
30023         (Expressio::ExprClassFromMemberInfo): finish
30024
30025 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30026
30027         * assign.cs: Emit stores to static fields differently.
30028
30029 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30030
30031         * Merge in changes and adjust code to tackle conflicts. Backed out my
30032         code in Assign::Resolve ;-) 
30033
30034 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30035
30036         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30037         instead Report.Error and also pass in the location.
30038         (CSharpParser::Lexer): New readonly property to return the reference
30039         to the Tokenizer object.
30040         (declare_local_variables): Use Report.Error with location instead of plain 
30041         old error.
30042         (CheckDef): Ditto.
30043
30044         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30045         (Operator.CheckBinaryOperator): Ditto.
30046
30047         * cs-parser.jay (operator_declarator): Update accordingly.
30048
30049         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30050         (CheckBinaryOperator): Same here.
30051
30052         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30053         on the name without any prefixes of namespace names etc. This is because we
30054         already might have something already fully qualified like 
30055         'System.Console.WriteLine'
30056
30057         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30058
30059 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30060
30061         * cs-tokenizer.cs (location): Return a string which also contains
30062         the file name.
30063
30064         * expression.cs (ElementAccess): New class for expressions of the
30065         type 'element access.'
30066         (BaseAccess): New class for expressions of the type 'base access.'
30067         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30068         respectively.
30069
30070         * cs-parser.jay (element_access): Implement action.
30071         (base_access): Implement actions.
30072         (checked_expression, unchecked_expression): Implement.
30073
30074         * cs-parser.jay (local_variable_type): Correct and implement.
30075         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30076
30077         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30078
30079         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30080         name and the specifiers.
30081
30082         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30083
30084         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30085         making them all public ;-)
30086
30087         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30088         class anyways.
30089
30090 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30091
30092         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30093         PropertyExprs.
30094         (FieldExpr, PropertyExprs): New resolved expressions.
30095         (SimpleName::MemberStaticCheck): Perform static checks for access
30096         to non-static fields on static methods. Maybe this should be
30097         generalized for MemberAccesses. 
30098         (SimpleName::ResolveSimpleName): More work on simple name
30099         resolution. 
30100
30101         * cs-parser.jay (primary_expression/qualified_identifier): track
30102         the parameter index.
30103
30104         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30105         (EmitContext::EmitBoolExpression): Chain to expression generation
30106         instead of temporary hack.
30107         (::EmitStatementExpression): Put generic expression code generation.
30108
30109         * assign.cs (Assign::Emit): Implement variable assignments to
30110         local variables, parameters and fields.
30111
30112 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30113
30114         * statement.cs (Block::GetVariableInfo): New method, returns the
30115         VariableInfo for a variable name in a block.
30116         (Block::GetVariableType): Implement in terms of GetVariableInfo
30117
30118         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30119         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30120
30121 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30122
30123         * cs-parser.jay (operator_declaration): Continue on my quest : update
30124         to take attributes argument.
30125         (event_declaration): Ditto.
30126         (enum_declaration): Ditto.
30127         (indexer_declaration): Ditto.
30128
30129         * class.cs (Operator::Operator): Update constructor accordingly.
30130         (Event::Event): Ditto.
30131
30132         * delegate.cs (Delegate::Delegate): Same here.
30133
30134         * enum.cs (Enum::Enum): Same here.
30135
30136 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30137
30138         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30139
30140         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30141
30142         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30143         being passed around as an arraylist.
30144         (Attributes::AddAttribute): Method to add attribute sections.
30145
30146         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30147         (struct_declaration): Update accordingly.
30148         (constant_declaration): Update.
30149         (field_declaration): Update.
30150         (method_header): Update.
30151         (fixed_parameter): Update.
30152         (parameter_array): Ditto.
30153         (property_declaration): Ditto.
30154         (destructor_declaration): Ditto.
30155
30156         * class.cs (Struct::Struct): Update constructors accordingly.
30157         (Class::Class): Ditto.
30158         (Field::Field): Ditto.
30159         (Method::Method): Ditto.
30160         (Property::Property): Ditto.
30161         (TypeContainer::OptAttribute): update property's return type.
30162
30163         * interface.cs (Interface.opt_attributes): New member.
30164         (Interface::Interface): Update to take the extra Attributes argument.
30165
30166         * parameter.cs (Parameter::Parameter): Ditto.
30167
30168         * constant.cs (Constant::Constant): Ditto.
30169
30170         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30171         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30172         the attributes as a parameter.
30173         (InterfaceProperty): Update constructor call.
30174         (InterfaceEvent): Ditto.
30175         (InterfaceMethod): Ditto.
30176         (InterfaceIndexer): Ditto.
30177
30178         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30179         pass the attributes too.
30180         (interface_event_declaration): Ditto.
30181         (interface_property_declaration): Ditto.
30182         (interface_method_declaration): Ditto.
30183         (interface_declaration): Ditto.
30184
30185 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30186
30187         * class.cs (Method::Define): Track the "static Main" definition to
30188         create an entry point. 
30189
30190         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30191         EntryPoint if we find it. 
30192
30193         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30194         (EmitContext::ig): Make this variable public.
30195
30196         * driver.cs: Make the default output file be the first file name
30197         with the .exe extension.  
30198
30199         Detect empty compilations
30200
30201         Handle various kinds of output targets.  Handle --target and
30202         rename -t to --dumper.
30203
30204         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30205         methods inherited from Expression return now an Expression.  This
30206         will is used during the tree rewriting as we resolve them during
30207         semantic analysis.
30208
30209         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30210         the spec.  Missing entirely is the information about
30211         accessability of elements of it.
30212
30213         (Expression::ExprClassFromMemberInfo): New constructor for
30214         Expressions that creates a fully initialized Expression based on
30215         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30216         a Type.
30217
30218         (Invocation::Resolve): Begin implementing resolution of invocations.
30219
30220         * literal.cs (StringLiteral):  Implement Emit.
30221
30222 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30223
30224         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30225         member.
30226
30227 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30228
30229         * cs-parser.jay (attribute_arguments): Implement actions.
30230         (attribute): Fix bug in production. Implement action.
30231         (attribute_list): Implement.
30232         (attribute_target): Implement.
30233         (attribute_target_specifier, opt_target_specifier): Implement
30234         (CheckAttributeTarget): New method to check if the attribute target
30235         is valid.
30236         (attribute_section): Implement.
30237         (opt_attributes): Implement.
30238
30239         * attribute.cs : New file to handle attributes.
30240         (Attribute): Class to hold attribute info.
30241
30242         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30243         (attribute_section): Modify production to use 2 different rules to 
30244         achieve the same thing. 1 s/r conflict down !
30245         Clean out commented, useless, non-reducing dimension_separator rules.
30246
30247         * class.cs (TypeContainer.attributes): New member to hold list
30248         of attributes for a type.
30249         (Struct::Struct): Modify to take one more argument, the attribute list.
30250         (Class::Class): Ditto.
30251         (Field::Field): Ditto.
30252         (Method::Method): Ditto.
30253         (Property::Property): Ditto.
30254
30255         * cs-parser.jay (struct_declaration): Update constructor call to
30256         pass in the attributes too.
30257         (class_declaration): Ditto.
30258         (constant_declaration): Ditto.
30259         (field_declaration): Ditto.
30260         (method_header): Ditto.
30261         (fixed_parameter): Ditto.
30262         (parameter_array): Ditto.
30263         (property_declaration): Ditto.
30264
30265         * constant.cs (Constant::Constant): Update constructor similarly.
30266         Use System.Collections.
30267
30268         * parameter.cs (Parameter::Parameter): Update as above.
30269
30270 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30271
30272         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30273         (TypeContainer.delegates): New member to hold list of delegates.
30274
30275         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30276         this time as I seem to be on crack ;-)
30277
30278 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30279
30280         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30281         tell whether an identifier represents a namespace.
30282
30283         * expression.cs (NamespaceExpr): A namespace expression, used only
30284         temporarly during expression resolution.
30285         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30286         utility functions to resolve names on expressions.
30287
30288 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30289
30290         * codegen.cs: Add hook for StatementExpressions. 
30291
30292         * class.cs: Fix inverted test for static flag in methods.
30293
30294 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30295
30296         * class.cs (Operator::CheckUnaryOperator): Correct error number used
30297         to make it coincide with MS' number.
30298         (Operator::CheckBinaryOperator): Ditto.
30299
30300         * ../errors/errors.txt : Remove error numbers added earlier.
30301
30302         * ../errors/cs1019.cs : Test case for error # 1019
30303
30304         * ../errros/cs1020.cs : Test case for error # 1020
30305
30306         * cs-parser.jay : Clean out commented cruft.
30307         (dimension_separators, dimension_separator): Comment out. Ostensibly not
30308         used anywhere - non-reducing rule.
30309         (namespace_declarations): Non-reducing rule - comment out.
30310
30311         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
30312         with TypeContainer::AddEnum.
30313
30314         * delegate.cs : New file for delegate handling classes.
30315         (Delegate): Class for declaring delegates.
30316
30317         * makefile : Update.
30318
30319         * cs-parser.jay (delegate_declaration): Implement.
30320
30321 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
30322
30323         * class.cs (Event::Define): Implement.
30324         (Event.EventBuilder): New member.
30325
30326         * class.cs (TypeContainer::Populate): Update to define all enums and events
30327         we have.
30328         (Events): New property for the events arraylist we hold. Shouldn't we move to using
30329         readonly fields for all these cases ?
30330
30331 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30332
30333         * class.cs (Property): Revamp to use the convention of making fields readonly.
30334         Accordingly modify code elsewhere.
30335
30336         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
30337         the Define method of the Property class.
30338
30339         * class.cs : Clean up applied patch and update references to variables etc. Fix 
30340         trivial bug.
30341         (TypeContainer::Populate): Update to define all the properties we have. Also
30342         define all enumerations.
30343
30344         * enum.cs (Define): Implement.
30345
30346 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
30347
30348         * cs-parser.jay (overloadable_operator): The semantic value is an
30349         enum of the Operator class.
30350         (operator_declarator): Implement actions.
30351         (operator_declaration): Implement.
30352
30353         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
30354         validity of definitions.
30355         (Operator::CheckBinaryOperator): Static method to check for binary operators
30356         (TypeContainer::AddOperator): New method to add an operator to a type.
30357
30358         * cs-parser.jay (indexer_declaration): Added line to actually call the
30359         AddIndexer method so it gets added ;-)
30360
30361         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
30362         already taken care of by the MS compiler ?  
30363
30364 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30365
30366         * class.cs (Operator): New class for operator declarations.
30367         (Operator::OpType): Enum for the various operators.
30368
30369 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
30370
30371         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
30372         ostensibly handle this in semantic analysis.
30373
30374         * cs-parser.jay (general_catch_clause): Comment out
30375         (specific_catch_clauses, specific_catch_clause): Ditto.
30376         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
30377         (catch_args, opt_catch_args): New productions.
30378         (catch_clause): Rewrite to use the new productions above
30379         (catch_clauses): Modify accordingly.
30380         (opt_catch_clauses): New production to use in try_statement
30381         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
30382         and re-write the code in the actions to extract the specific and
30383         general catch clauses by being a little smart ;-)
30384
30385         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
30386         Hooray, try and catch statements parse fine !
30387
30388 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30389
30390         * statement.cs (Block::GetVariableType): Fix logic to extract the type
30391         string from the hashtable of variables.
30392
30393         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
30394         I end up making that mistake ;-)
30395         (catch_clauses): Fixed gross error which made Key and Value of the 
30396         DictionaryEntry the same : $1 !!
30397
30398 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30399
30400         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
30401
30402         * cs-parser.jay (event_declaration): Correct to remove the semicolon
30403         when the add and remove accessors are specified. 
30404
30405 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
30406
30407         * cs-parser.jay (IndexerDeclaration): New helper class to hold
30408         information about indexer_declarator.
30409         (indexer_declarator): Implement actions.
30410         (parsing_indexer): New local boolean used to keep track of whether
30411         we are parsing indexers or properties. This is necessary because 
30412         implicit_parameters come into picture even for the get accessor in the 
30413         case of an indexer.
30414         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
30415
30416         * class.cs (Indexer): New class for indexer declarations.
30417         (TypeContainer::AddIndexer): New method to add an indexer to a type.
30418         (TypeContainer::indexers): New member to hold list of indexers for the
30419         type.
30420
30421 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30422
30423         * cs-parser.jay (add_accessor_declaration): Implement action.
30424         (remove_accessor_declaration): Implement action.
30425         (event_accessors_declaration): Implement
30426         (variable_declarators): swap statements for first rule - trivial.
30427
30428         * class.cs (Event): New class to hold information about event
30429         declarations.
30430         (TypeContainer::AddEvent): New method to add an event to a type
30431         (TypeContainer::events): New member to hold list of events.
30432
30433         * cs-parser.jay (event_declaration): Implement actions.
30434
30435 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
30436
30437         * cs-parser.jay (dim_separators): Implement. Make it a string
30438         concatenating all the commas together, just as they appear.
30439         (opt_dim_separators): Modify accordingly
30440         (rank_specifiers): Update accordingly. Basically do the same
30441         thing - instead, collect the brackets here.
30442         (opt_rank_sepcifiers): Modify accordingly.
30443         (array_type): Modify to actually return the complete type string
30444         instead of ignoring the rank_specifiers.
30445         (expression_list): Implement to collect the expressions
30446         (variable_initializer): Implement. We make it a list of expressions
30447         essentially so that we can handle the array_initializer case neatly too.
30448         (variable_initializer_list): Implement.
30449         (array_initializer): Make it a list of variable_initializers
30450         (opt_array_initializer): Modify accordingly.
30451
30452         * expression.cs (New::NType): Add enumeration to help us
30453         keep track of whether we have an object/delegate creation
30454         or an array creation.
30455         (New:NewType, New::Rank, New::Indices, New::Initializers): New
30456         members to hold data about array creation.
30457         (New:New): Modify to update NewType
30458         (New:New): New Overloaded contructor for the array creation
30459         case.
30460
30461         * cs-parser.jay (array_creation_expression): Implement to call
30462         the overloaded New constructor.
30463
30464 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
30465
30466         * class.cs (TypeContainer::Constructors): Return member
30467         constructors instead of returning null.
30468
30469 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
30470
30471         * typemanager.cs (InitCoreTypes): Initialize the various core
30472         types after we have populated the type manager with the user
30473         defined types (this distinction will be important later while
30474         compiling corlib.dll)
30475
30476         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
30477         on Expression Classification.  Now all expressions have a method
30478         `Resolve' and a method `Emit'.
30479
30480         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
30481         generation from working.     Also add some temporary debugging
30482         code. 
30483
30484 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
30485
30486         * codegen.cs: Lots of code generation pieces.  This is only the
30487         beginning, will continue tomorrow with more touches of polish.  We
30488         handle the fundamentals of if, while, do, for, return.  Others are
30489         trickier and I need to start working on invocations soon.
30490
30491         * gen-treedump.cs: Bug fix, use s.Increment here instead of
30492         s.InitStatement. 
30493
30494         * codegen.cs (EmitContext): New struct, used during code
30495         emission to keep a context.   Most of the code generation will be
30496         here. 
30497
30498         * cs-parser.jay: Add embedded blocks to the list of statements of
30499         this block.  So code generation proceeds in a top down fashion.
30500
30501 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
30502
30503         * statement.cs: Add support for multiple child blocks.
30504
30505 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
30506
30507         * codegen.cs (EmitCode): New function, will emit the code for a
30508         Block of code given a TypeContainer and its ILGenerator. 
30509
30510         * statement.cs (Block): Standard public readonly optimization.
30511         (Block::Block constructors): Link children. 
30512         (Block::Child): Child Linker.
30513         (Block::EmitVariables): Emits IL variable declarations.
30514
30515         * class.cs: Drop support for MethodGroups here, delay until
30516         Semantic Analysis.
30517         (Method::): Applied the same simplification that I did before, and
30518         move from Properties to public readonly fields.
30519         (Method::ParameterTypes): Returns the parameter types for the
30520         function, and implements a cache that will be useful later when I
30521         do error checking and the semantic analysis on the methods is
30522         performed.
30523         (Constructor::GetCallingConvention): Renamed from CallingConvetion
30524         and made a method, optional argument tells whether this is a class
30525         or a structure to apply the `has-this' bit.
30526         (Method::GetCallingConvention): Implement, returns the calling
30527         convention. 
30528         (Method::Define): Defines the type, a second pass is performed
30529         later to populate the methods.
30530
30531         (Constructor::ParameterTypes): implement a cache similar to the
30532         one on Method::ParameterTypes, useful later when we do semantic
30533         analysis. 
30534
30535         (TypeContainer::EmitMethod):  New method.  Emits methods.
30536
30537         * expression.cs: Removed MethodGroup class from here.
30538
30539         * parameter.cs (Parameters::GetCallingConvention): new method.
30540
30541 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
30542
30543         * class.cs (TypeContainer::Populate): Drop RootContext from the
30544         argument. 
30545
30546         (Constructor::CallingConvention): Returns the calling convention.
30547         (Constructor::ParameterTypes): Returns the constructor parameter
30548         types. 
30549
30550         (TypeContainer::AddConstructor): Keep track of default constructor
30551         and the default static constructor.
30552
30553         (Constructor::) Another class that starts using `public readonly'
30554         instead of properties. 
30555
30556         (Constructor::IsDefault): Whether this is a default constructor. 
30557
30558         (Field::) use readonly public fields instead of properties also.
30559
30560         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
30561         track of static constructors;  If none is used, turn on
30562         BeforeFieldInit in the TypeAttributes. 
30563
30564         * cs-parser.jay (opt_argument_list): now the return can be null
30565         for the cases where there are no arguments. 
30566
30567         (constructor_declarator): If there is no implicit `base' or
30568         `this', then invoke the default parent constructor. 
30569
30570         * modifiers.cs (MethodAttr): New static function maps a set of
30571         modifiers flags into a MethodAttributes enum
30572         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
30573         MethodAttr, TypeAttr to represent the various mappings where the
30574         modifiers are used.
30575         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
30576
30577 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
30578
30579         * parameter.cs (GetParameterInfo): Fix bug where there would be no
30580         method arguments.
30581
30582         * interface.cs (PopulateIndexer): Implemented the code generator
30583         for interface indexers.
30584
30585 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
30586
30587         * interface.cs (InterfaceMemberBase): Now we track the new status
30588         here.  
30589
30590         (PopulateProperty): Implement property population.  Woohoo!  Got
30591         Methods and Properties going today. 
30592
30593         Removed all the properties for interfaces, and replaced them with
30594         `public readonly' fields. 
30595
30596 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
30597
30598         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
30599         initialize their hashtables/arraylists only when they are needed
30600         instead of doing this always.
30601
30602         * parameter.cs: Handle refs and out parameters.
30603
30604         * cs-parser.jay: Use an ArrayList to construct the arguments
30605         instead of the ParameterCollection, and then cast that to a
30606         Parameter[] array.
30607
30608         * parameter.cs: Drop the use of ParameterCollection and use
30609         instead arrays of Parameters.
30610
30611         (GetParameterInfo): Use the Type, not the Name when resolving
30612         types. 
30613
30614 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
30615
30616         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
30617         and instead use public readonly fields.
30618
30619         * class.cs: Put back walking code for type containers.
30620
30621 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
30622
30623         * class.cs (MakeConstant): Code to define constants.
30624
30625         * rootcontext.cs (LookupType): New function.  Used to locate types 
30626
30627
30628 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
30629
30630         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
30631         this System.Reflection code is.  Kudos to Microsoft
30632
30633         * typemanager.cs: Implement a type cache and avoid loading all
30634         types at boot time.  Wrap in LookupType the internals.  This made
30635         the compiler so much faster.  Wow.  I rule!
30636
30637         * driver.cs: Make sure we always load mscorlib first (for
30638         debugging purposes, nothing really important).
30639
30640         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
30641         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
30642
30643         * rootcontext.cs: Lookup types on their namespace;  Lookup types
30644         on namespaces that have been imported using the `using' keyword.
30645
30646         * class.cs (TypeContainer::TypeAttr): Virtualize.
30647         (Class::TypeAttr): Return attributes suitable for this bad boy.
30648         (Struct::TypeAttr): ditto.
30649         Handle nested classes.
30650         (TypeContainer::) Remove all the type visiting code, it is now
30651         replaced with the rootcontext.cs code
30652
30653         * rootcontext.cs (GetClassBases): Added support for structs. 
30654
30655 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
30656
30657         * interface.cs, statement.cs, class.cs, parameter.cs,
30658         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
30659         Drop use of TypeRefs, and use strings instead.
30660
30661 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
30662
30663         * rootcontext.cs: 
30664
30665         * class.cs (Struct::Struct): set the SEALED flags after
30666         checking the modifiers.
30667         (TypeContainer::TypeAttr): new property, returns the
30668         TypeAttributes for a class.  
30669
30670         * cs-parser.jay (type_list): Oops, list production was creating a
30671         new list of base types.
30672
30673         * rootcontext.cs (StdLib): New property.
30674         (GetInterfaceTypeByName): returns an interface by type name, and
30675         encapsulates error handling here.
30676         (GetInterfaces): simplified.
30677         (ResolveTree): Encapsulated all the tree resolution here.
30678         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
30679         types. 
30680
30681         * driver.cs: Add support for --nostdlib, to avoid loading the
30682         default assemblies.
30683         (Main): Do not put tree resolution here. 
30684
30685         * rootcontext.cs: Beginning of the class resolution.
30686
30687 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
30688
30689         * rootcontext.cs: Provide better error reporting. 
30690
30691         * cs-parser.jay (interface_base): set our $$ to be interfaces.
30692
30693         * rootcontext.cs (CreateInterface): Handle the case where there
30694         are no parent interfaces.
30695
30696         (CloseTypes): Routine to flush types at the end.
30697         (CreateInterface): Track types.
30698         (GetInterfaces): Returns an array of Types from the list of
30699         defined interfaces.
30700
30701         * typemanager.c (AddUserType): Mechanism to track user types (puts
30702         the type on the global type hash, and allows us to close it at the
30703         end). 
30704
30705 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
30706
30707         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
30708         RecordInterface instead.
30709
30710         * cs-parser.jay: Updated to reflect changes above.
30711
30712         * decl.cs (Definition): Keep track of the TypeBuilder type that
30713         represents this type here.  Not sure we will use it in the long
30714         run, but wont hurt for now.
30715
30716         * driver.cs: Smaller changes to accomodate the new code.
30717
30718         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
30719         when done. 
30720
30721         * rootcontext.cs (CreateInterface):  New method, used to create
30722         the System.TypeBuilder type for interfaces.
30723         (ResolveInterfaces): new entry point to resolve the interface
30724         hierarchy. 
30725         (CodeGen): Property, used to keep track of the code generator.
30726
30727 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
30728
30729         * cs-parser.jay: Add a second production for delegate_declaration
30730         with `VOID'.
30731
30732         (enum_body): Put an opt_comma here instead of putting it on
30733         enum_body or enum_member_declarations so we can handle trailing
30734         commas on enumeration members.  Gets rid of a shift/reduce.
30735
30736         (type_list): Need a COMMA in the middle.
30737
30738         (indexer_declaration): Tell tokenizer to recognize get/set
30739
30740         * Remove old targets.
30741
30742         * Re-add the parser target.
30743
30744 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30745
30746         * cs-parser.jay: Add precendence rules for a number of operators
30747         ot reduce the number of shift/reduce conflicts in the grammar.
30748
30749 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
30750
30751         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
30752         and put it here.
30753
30754         Get rid of old crufty code.
30755
30756         * rootcontext.cs: Use this to keep track of the parsed
30757         representation and the defined types available to the program. 
30758
30759         * gen-treedump.cs: adjust for new convention.
30760
30761         * type.cs: Split out the type manager, and the assembly builder
30762         from here. 
30763
30764         * typemanager.cs: the type manager will live here now.
30765
30766         * cil-codegen.cs: And the code generator here. 
30767
30768 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
30769
30770         * makefile: Fixed up for easy making.
30771
30772 2001-07-13  Simon Cozens <simon@simon-cozens.org>
30773
30774         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
30775         the 
30776
30777         (unary_expression): Expand pre_increment_expression and
30778         post_decrement_expression to reduce a shift/reduce.
30779
30780 2001-07-11  Simon Cozens
30781
30782         * cs-tokenizer.cs: Hex numbers should begin with a 0.
30783
30784         Improve allow_keyword_as_indent name.
30785
30786 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
30787
30788         * Adjustments for Beta2. 
30789
30790 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
30791
30792         * decl.cs: Added `Define' abstract method.
30793         (InTransit): new property, used to catch recursive definitions. 
30794
30795         * interface.cs: Implement `Define'. 
30796
30797         * modifiers.cs: Map Modifiers.constants to
30798         System.Reflection.TypeAttribute flags.
30799
30800         * class.cs: Keep track of types and user-defined types.
30801         (BuilderInit): New method for creating an assembly
30802         (ResolveType): New function to launch the resolution process, only
30803         used by interfaces for now.
30804
30805         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
30806         that are inserted into the name space. 
30807
30808 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
30809
30810         * ARGH.  I have screwed up my tree so many times due to the use of
30811         rsync rather than using CVS.  Going to fix this at once. 
30812
30813         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
30814         load types.
30815
30816 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
30817
30818         * Experiment successful: Use System.Type rather that our own
30819         version of Type.  
30820
30821 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
30822
30823         * cs-parser.jay: Removed nsAliases from here.
30824
30825         Use new namespaces, handle `using XXX;' 
30826
30827         * namespace.cs: Reimplemented namespace handling, use a recursive
30828         definition of the class.  Now we can keep track of using clauses
30829         and catch invalid using clauses.
30830
30831 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
30832
30833         * gen-treedump.cs: Adapted for all the renaming.
30834
30835         * expression.cs (Expression): this class now has a Type property
30836         which returns an expression Type.
30837
30838         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
30839         `Type', as this has a different meaning now in the base
30840
30841 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
30842
30843         * interface.cs, class.cs: Removed from all the sources the
30844         references to signature computation, as we can not do method
30845         signature computation during the parsing time, as we are not
30846         trying to solve at that point distinguishing:
30847
30848         class X {
30849                 void a (Blah x) {}
30850                 void a (NS.Blah x) {}
30851         }
30852
30853         Which depending on the context might be valid or not, as we do not
30854         know if Blah is the same thing as NS.Blah at that point.
30855
30856         * Redid everything so the code uses TypeRefs now instead of
30857         Types.  TypeRefs are just temporary type placeholders, that need
30858         to be resolved.  They initially have a pointer to a string and the
30859         current scope in which they are used.  This is used later by the
30860         compiler to resolve the reference to an actual Type. 
30861
30862         * DeclSpace is no longer a CIR.Type, and neither are
30863         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
30864         are all DeclSpaces, but no Types. 
30865
30866         * type.cs (TypeRefManager): This implements the TypeRef manager,
30867         which keeps track of all the types that need to be resolved after
30868         the parsing has finished. 
30869
30870 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
30871
30872         * ARGH.  We are going to have to store `foreach' as a class rather
30873         than resolving it, as we need to verify error 1579 after name
30874         resolution.   *OR* we could keep a flag that says `This request to
30875         IEnumerator comes from a foreach statement' which we can then use
30876         to generate the error.
30877
30878 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
30879
30880         * class.cs (TypeContainer.AddMethod): we now add methods to the
30881         MethodGroup instead of the method hashtable.  
30882
30883         * expression.cs: Add MethodGroup abstraction, which gets us one
30884         step closer to the specification in the way we handle method
30885         declarations.  
30886
30887         * cs-parser.jay (primary_expression): qualified_identifier now
30888         tried to match up an identifier to a local variable reference or
30889         to a parameter reference.
30890
30891         current_local_parameters is now a parser global variable that
30892         points to the current parameters for the block, used during name
30893         lookup.
30894
30895         (property_declaration): Now creates an implicit `value' argument to
30896         the set accessor.
30897
30898 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
30899
30900         * parameter.cs: Do not use `param' arguments as part of the
30901         signature, per the spec.
30902
30903 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
30904
30905         * decl.cs: Base class for classes, structs and interfaces.  This
30906         is the "Declaration Space" 
30907
30908         * cs-parser.jay: Use CheckDef for checking declaration errors
30909         instead of having one on each function.
30910
30911         * class.cs: Factor out some code for handling error handling in
30912         accordance to the "Declarations" section in the "Basic Concepts"
30913         chapter in the ECMA C# spec.
30914
30915         * interface.cs: Make all interface member classes derive from
30916         InterfaceMemberBase.
30917
30918 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
30919
30920         * Many things: all interfaces are parsed and generated in
30921         gen-treedump.  Support for member variables, constructors,
30922         destructors, properties, constants is there.
30923
30924         Beginning of the IL backend, but very little done, just there for
30925         testing purposes. 
30926
30927 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
30928
30929         * cs-parser.jay: Fix labeled statement.
30930
30931         * cs-tokenizer.cs (escape): Escape " and ' always.
30932         ref_line, ref_name: keep track of the line/filename as instructed
30933         by #line by the compiler.
30934         Parse #line.
30935
30936 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
30937
30938         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
30939         to match the values in System.CodeDOM.
30940
30941         Divid renamed to Divide.
30942
30943         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
30944         statements. 
30945         (Statements.set): remove.
30946
30947         * System.CodeDOM/CodeCatchClause.cs: always have a valid
30948         statements. 
30949
30950         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
30951         falseStatements always have valid values. 
30952
30953         * cs-parser.jay: Use System.CodeDOM now.
30954