2009-08-13 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2009-08-13  Marek Safar  <marek.safar@gmail.com>
2
3         * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
4         Moved resolved logic from Emit to Resolve.
5
6 2009-08-13  Marek Safar  <marek.safar@gmail.com>
7
8         * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
9         codegen.cs: Reworked atttributes handling of ResolveContext.
10
11 2009-08-12  Marek Safar  <marek.safar@gmail.com>
12
13         * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
14         LookupNamespaceOrType to ResolveContext.
15
16 2009-08-12  Marek Safar  <marek.safar@gmail.com>
17
18         * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
19         class.cs: Removed unused parameters and methods.
20
21 2009-08-11  Marek Safar  <marek.safar@gmail.com>
22
23         * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
24         codegen.cs: Finding the best common type of a set of expressions for
25         lambda statements.
26
27 2009-08-07  Marek Safar  <marek.safar@gmail.com>
28
29         * dynamic.cs, expression.cs: More dynamic conversions.
30
31 2009-08-06  Miguel de Icaza  <miguel@novell.com>
32
33         * generic.cs: This loop was incorrect, it was increment ii, but
34         checking for `i'.  This was a change introduced to fix #327497,
35         now we fix #424012.
36  
37         * class.cs: Catch another case for cs0533 error, fixes #324782.
38
39 2009-08-06 Rodrigo Kumpera  <rkumpera@novell.com>
40
41         * typemanager.cs (GetGenericArguments): SRE returns null for
42         generic methods on type builder instances if they are not generic
43         themselves. For example, for Foo<int>::Bar() it returns null, but
44         not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
45
46 2009-08-05  Marek Safar  <marek.safar@gmail.com>
47
48         * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
49         delegate.cs: Work on dynamic binding.
50
51 2009-08-04  Marek Safar  <marek.safar@gmail.com>
52
53         A second fix for bug #525342
54         * class.cs: Attach partial method attributes to method
55         implementation.
56
57 2009-08-03  Marek Safar  <marek.safar@gmail.com>
58
59         * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
60         restrictions.
61         
62         * rootcontext.cs: Default to langversion v4.
63
64 2009-08-03  Marek Safar  <marek.safar@gmail.com>
65
66         * pending.cs: Check return type before member info is set.
67
68 2009-08-03  Marek Safar  <marek.safar@gmail.com>
69
70         * anonymous.cs: Fully initialize generic hoisted field expression.
71
72 2009-08-02  Miguel de Icaza  <miguel@novell.com>
73
74         * cs-parser.jay: Flag variables declared on the interactive shell
75         as used to prevent the 168 warning about local variable not being
76         used. 
77
78 2009-07-31  Marek Safar  <marek.safar@gmail.com>
79
80         * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
81         attribute.cs: Emit dynamic export attribute.
82
83 2009-07-30  Marek Safar  <marek.safar@gmail.com>
84
85         * expression.cs: More verifier work.
86
87 2009-07-29  Marek Safar  <marek.safar@gmail.com>
88
89         * nullable.cs: Fixed SRE crash during corlib compilation.
90
91 2009-07-29  Marek Safar  <marek.safar@gmail.com>
92
93         * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
94         nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
95         More TypeManager.TypeToCoreType needed.
96
97 2009-07-29  Marek Safar  <marek.safar@gmail.com>
98
99         * anonymous.cs: Update after recent SRE fixes.
100
101 2009-07-28  Marek Safar  <marek.safar@gmail.com>
102
103         * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
104         version of GetFieldHandle for fields of generic types.
105
106 2009-07-27  Marek Safar  <marek.safar@gmail.com>
107
108         * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
109         ecore.cs: Add TypeManager.IsDynamicType,
110         PredefinedAttributes.Dynamic.
111
112 2009-07-27  Marek Safar  <marek.safar@gmail.com>
113
114         A fix for bug #415375
115         * expression.cs: Fixed object and reference type parameter
116         comparison.
117
118 2009-07-27  Marek Safar  <marek.safar@gmail.com>
119
120         A fix for bug #525342
121         * class.cs: Attach partial method attributes to method
122         implementation.
123
124 2009-07-24  Marek Safar  <marek.safar@gmail.com>
125
126         * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
127         Dynamic arguments.
128
129 2009-07-24  Marek Safar  <marek.safar@gmail.com>
130
131         * anonymous.cs (MutateField): Add imported types handling.
132
133 2009-07-23  Marek Safar  <marek.safar@gmail.com>
134
135         * expression.cs, delegate.cs: Moved arguments resolve into their
136         counterparts expressions. Removed argument resolve from
137         CollectionElementInitializer.
138
139 2009-07-23  Marek Safar  <marek.safar@gmail.com>
140
141         A fix for bug #523683
142         * convert.cs, delegate.cs: Use common overload mechanism for method
143         group conversion check.
144
145 2009-07-22  Marek Safar  <marek.safar@gmail.com>
146
147         A fix for bug #523899
148         * generics.cs: Exact type inference with other bound types.
149
150 2009-07-22  Raja R Harinath  <harinath@hurrynot.org>
151
152         Don't complain when the same type is implemented by the output
153         assembly as well as multiple referenced assemblies
154         * namespace.cs (RootNamespace.LookupTypeReflection): Add
155         'must_be_unique' flag.
156         (GlobalRootNamespace): Update to changes.
157         (Namespace.LookupType): Pass 'must_be_unique' only when we don't
158         already have a type in hand.
159
160 2009-07-22  Marek Safar  <marek.safar@gmail.com>
161
162         * expression.cs: More verifier instrumentation.
163         
164         * statement.cs: Do proper throw expression conversion.
165
166 2009-07-22  Marek Safar  <marek.safar@gmail.com>
167
168         A fix for bug #522789
169         * expression.cs: Mutate invocation return type.
170
171 2009-07-16  Marek Safar  <marek.safar@gmail.com>
172
173         * anonymous.cs: Split assignable and readonly generated variable
174         references.
175
176 2009-07-16  Marek Safar  <marek.safar@gmail.com>
177
178         A fix for bug #521671
179         * statement.cs: Fixed crash when checking missing type.
180
181 2009-07-16  Marek Safar  <marek.safar@gmail.com>
182
183         * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
184         assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
185         class.cs, driver.cs: Work on dynamic binding.
186
187         * dynamic.cs: New file.
188
189         * *.sources, *.proj: Updated.
190
191 2009-07-15  Marek Safar  <marek.safar@gmail.com>
192
193         * expression.cs (Conditional): Avoid double Resolve.
194
195 2009-07-13  Marcus Griep  <marcus@griep.us>
196
197         * ecore.cs: Fix obscure bug with resolving members of interfaces
198         that hide parent interface members. Fixes bug #444388 and corrects
199         bug #323096
200
201 2009-07-13  Marek Safar  <marek.safar@gmail.com>
202
203         * expression.cs (LocalVariableReference): Bounce resolve.
204
205 2009-07-10  Marek Safar  <marek.safar@gmail.com>
206
207         * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
208         expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
209         types to new class.
210         
211         * support.cs: New dynamic type wrapper.
212
213 2009-07-08  Marek Safar  <marek.safar@gmail.com>
214
215         * ecore.cs, cs-parser.jay: Better error reporting for implicitly
216         typed local variable.
217
218 2009-07-06  Marek Safar  <marek.safar@gmail.com>
219
220         A fix for bug #519005
221         * anonymous.cs: Use null_type as no return type placeholder.
222
223 2009-07-02  Marek Safar  <marek.safar@gmail.com>
224
225         * generic.cs: Handle type inference of identical type parameters
226         with different bounds.
227
228 2009-07-01  Marek Safar  <marek.safar@gmail.com>
229
230         * expression.cs, class.cs: Events variance.
231         
232         * cs-parser.jay: Interface events error messages.
233
234 2009-07-01  Marek Safar  <marek.safar@gmail.com>
235
236         * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
237
238 2009-06-29  Marek Safar  <marek.safar@gmail.com>
239
240         * parameter.cs, convert.cs, expression.cs, class.cs: Default
241         parameter expression can be value-type New.
242
243         * cs-parser.jay: Clean up too many parameter modifier boolean flags.
244
245 2009-06-26  Marek Safar  <marek.safar@gmail.com>
246
247         * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
248         Implemented C# 4.0 named arguments.
249
250 2009-06-24  Marek Safar  <marek.safar@gmail.com>
251
252         * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
253         expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
254         parameter modifier. Also fixes bug #515497.
255
256 2009-06-24  Marek Safar  <marek.safar@gmail.com>
257
258         * *.cs: Replaced ArrayList with Arguments in need of a nonsequential 
259         arguments expression to be implemented.
260         
261         *.sources: Add argument.cs
262
263 2009-06-23  Marek Safar  <marek.safar@gmail.com>
264
265         * parameter.cs: Moved GetParameterIndexByName to base class.
266         
267         * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
268         unused AType. Use argument's version of GetExpressionTree.
269
270 2009-06-22  Marek Safar  <marek.safar@gmail.com>
271
272         * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
273         arguments grammar.
274
275 2009-06-17  Marek Safar  <marek.safar@gmail.com>
276
277         A fix for bug #514096
278         * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
279
280 2009-06-17  Marek Safar  <marek.safar@gmail.com>
281
282         * expression.cs: The first multi-dimensional array nested array
283         initializers was not checked.
284         
285         * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
286
287 2009-06-17  Marek Safar  <marek.safar@gmail.com>
288
289         A fix for bug #513400
290         * nullable.cs (EmitEquality): Operands emit could be simplified for
291         built-in types when we now emit user operators differently.
292
293 2009-06-16  Marek Safar  <marek.safar@gmail.com>
294
295         * ecore.cs: Report inaccessible delegate methods correctly.
296
297 2009-06-16  Marek Safar  <marek.safar@gmail.com>
298
299         * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
300         cs-parser.jay: Implemented C# 4.0 optional parameters.
301
302 2009-06-16  Marek Safar  <marek.safar@gmail.com>
303
304         * driver.cs: Removed broken DefineManifestResource.
305
306 2009-06-16  Raja R Harinath  <harinath@hurrynot.org>
307
308         * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
309         Use $(BOOTSTRAP_PROFILE) instead.
310
311 2009-06-12  Jb Evain  <jbevain@novell.com>
312
313         * rootcontext.cs: add a Platform field.
314         * driver.cs: handle /platform.
315         * codegen.cs: pass the proper flags according to
316         the platform when saving the assembly.
317
318 2009-06-11  Marek Safar  <marek.safar@gmail.com>
319
320         * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
321         Add optional parameters grammar.
322
323 2009-06-10  Marek Safar  <marek.safar@gmail.com>
324
325         * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
326         driver.cs: Split lang version and metadata version.
327
328 2009-06-10  Marek Safar  <marek.safar@gmail.com>
329
330         * decl.cs: Better overload ctor collision error message.
331
332 2009-06-05  Jb Evain  <jbevain@novell.com>
333
334         * driver.cs (EmbededResource): avoid using an internal method
335         in gmcs to embed manifest resources.
336
337 2009-06-04  Sebastien Pouliot  <sebastien@ximian.com>
338
339         * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
340         the compiler from older mono versions (like moon's bots)
341
342 2009-06-04  Marek Safar  <marek.safar@gmail.com>
343
344         * namespace.cs (LookupTypeReflection): Ignore collisions between
345         forwarded types.
346
347 2009-06-04  Marek Safar  <marek.safar@gmail.com>
348
349         * codegen.cs: Enabled generic type forwarders.
350
351 2009-06-04  Marek Safar  <marek.safar@gmail.com>
352
353         * dmcs.*: Add another version of SRE compiler.
354
355 2009-06-03  Marek Safar  <marek.safar@gmail.com>
356
357         * generic.cs, typemanager.cs, parameter.cs, convert.cs,
358         generic-mcs.cs: Fixed variant type conversions.
359
360 2009-06-02  Marek Safar  <marek.safar@gmail.com>
361
362         A fix for bug #507863
363         * codegen.cs: Fixes a crash on invalid string value attribute.
364
365 2009-06-01  Marek Safar  <marek.safar@gmail.com>
366
367         A fix for bug #508334
368         * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
369         cs-parser.jay: Fully import __arglist modifier.
370
371 2009-05-29  Marek Safar  <marek.safar@gmail.com>
372
373         * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
374         delegate.cs, generic-mcs.cs: Rewrote type variance checks to
375         actually work with closed generic types.
376
377 2009-05-27  Alan McGovern  <amcgovern@novell.com>
378
379         * class.cs, decl.cs, delegate.cs, parameter.cs: 
380         Fix the build by replacing the use of 'var' with the actual type.
381
382 2009-05-27  Marek Safar  <marek.safar@gmail.com>
383
384         * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
385     cs-parser.jay, generic-mcs.cs: Report wrong variant types
386         declarations.
387           
388         * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
389         filter.
390
391 2009-05-26  Rodrigo Kumpera  <rkumpera@novell.com>
392                         Marek Safar  <marek.safar@gmail.com>
393
394         A fix for bug #377509
395         * parameter.cs: Use predefined and not empty name for implicit
396         setters.
397
398 2009-05-21  Marek Safar  <marek.safar@gmail.com>
399
400         * class.cs: Don't report wrong warnings for event fields.
401
402 2009-05-21  Marek Safar  <marek.safar@gmail.com>
403
404         A fix for bug #504667
405         * class.cs: Check for static class using parent container instead of
406         parent type.
407
408 2009-05-08  Marek Safar  <marek.safar@gmail.com>
409
410         A fix for bug #496922
411         * expression.cs: Always use temporary variable when using object
412         initializer.
413
414 2009-04-28  Marek Safar  <marek.safar@gmail.com>
415
416         A fix for bug #495112
417         * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
418         local cache.
419
420 2009-04-27  Miguel de Icaza  <miguel@novell.com>
421
422         * driver.cs: Add a flag to work as a replacement for CSC in VS.
423
424 2009-04-24  Miguel de Icaza  <miguel@novell.com>
425
426         * complete.cs: No idea how gonzalo got a null in the list, but
427         avoid crashing.
428
429 2009-04-24  Miguel de Icaza  <miguel@novell.com>
430
431         * complete.cs (CompletionElementInitializer): New completion class
432         to support completing inside a C# 3 element initializer, so this
433         allows completion for Silverlight situations where it is very
434         common to do:
435
436         new TextBlock () { Fo<TAB>
437
438         (CompletionSimpleName): Expose the prefix that was
439         passed to the simple name.
440
441         * cs-parser.jay (object_or_collection_initializer): Add support
442         for element_initializers.
443
444         * expression.cs (CollectionOrObjectInitializers.DoResolve):
445         special case completion expressions as this method aggressively
446         collects data before it operates, and errors were being thrown
447         earlier than we were able to complete.
448
449 2009-04-23  Miguel de Icaza  <miguel@novell.com>
450
451         * eval.cs: Make getcompletions silent and enable debugging output
452         if the -v option is passed.
453
454         * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
455         Consider looking up the namespace that matches the prefix being
456         used. 
457
458         This is part of the support for allowing completions like:
459         `System.Co<TAB>' to complete to System.Console.
460
461         * complete.cs (CompletionSimpleName.AppendResults): Make this
462         routine reusable.
463
464 2009-04-21  Raja R Harinath  <harinath@hurrynot.org>
465
466         * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
467         COMPLETE_COMPLETION as internal.
468
469 2009-04-17  Miguel de Icaza  <miguel@novell.com>
470
471         * complete.cs: Include namespace resolution in simple names as
472         well as global types and types in the using scope in the
473         resolution. 
474
475         * namespace.cs: Supporting infrastrcture to provide completions
476         based on the current using scope. 
477
478         * eval.cs: Introduce an entry point that allows for initialization
479         to return a list of the files passed on the command line.
480
481 2009-04-14  Marek Safar  <marek.safar@gmail.com>
482
483         A fix for bug #494243
484         * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
485
486 2009-04-13  Marek Safar  <marek.safar@gmail.com>
487
488         A fix for bug #493887
489         * statement.cs: Don't skip string multi-section with default or
490         null label when populating string hashtable.
491
492 2009-04-06  Marek Safar  <marek.safar@gmail.com>
493
494         A fix for bug #492329
495         * expression.cs (New): Load variable when assigning type parameter
496         to ref variable.
497
498 2009-04-06  Marek Safar  <marek.safar@gmail.com>
499
500         A fix for bug #488960
501         * decl.cs: Compare MVAR types using non-null values.
502
503 2009-03-27  Marek Safar  <marek.safar@gmail.com>
504
505         * typemanager.cs, expression.cs: Removed unused nullable checks.
506
507 2009-03-27  Marek Safar  <marek.safar@gmail.com>
508
509         * *.cs: Removed some gmcs conditionals.
510
511 2009-03-26  Marek Safar  <marek.safar@gmail.com>
512
513         * generic.cs, support.cs: Moved generics stuff out of support.cs
514
515 2009-03-24  Marek Safar  <marek.safar@gmail.com>
516
517         * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
518         DeclaringType.
519
520 2009-03-23  Marek Safar  <marek.safar@gmail.com>
521
522         * attribute.cs: Consider all members for error reporting when
523         checking named arguments.
524
525 2009-03-23  Marek Safar  <marek.safar@gmail.com>
526
527         A fix for bug #487625
528         * namespace.cs: Use a warning for all predefined type conflicts.
529
530 2009-03-23  Marek Safar  <marek.safar@gmail.com>
531
532         A fix for bug #485706
533         * statement.cs: Explicitly type catch type argument to pass verifier
534         check.
535
536 2009-03-22  Miguel de Icaza  <miguel@novell.com>
537
538         Initial support to provide code completion facilities to consumers
539         of the evaluator API.
540         
541         * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
542         support the completion engine.   When we reach the end of the
543         input stream instead of returning EOF, when this flag is true the
544         tokenizer instead produces:
545
546                 One GENERATE_COMPLETION token: this token then must be
547                 handled in the grammar at every point where the user
548                 would likely request a completion.
549
550                 As many COMPLETE_COMPLETION tokens as necessary.   These
551                 tokens are generated to assist the parser in unwinding and
552                 producing a valid parse tree.    
553
554         The parser rules do not have to be perfect, the parser needs to be
555         augmented with judicious use of GENERATE_COMPLETION tokens to
556         improve the areas where we can provide completion and the parser
557         needs to add support for COMPLETE_COMPLETION tokens in productions
558         to make them work.
559
560         It is common to not have enough support for COMPLETE_COMPLETION
561         under certain rules and that even if we generated the
562         GENERATE_COMPLETION token that the resulting tree will be invalid
563         due to the missing rules that support COMPLETE_COMPLETION.
564
565         The final EOF token is produced by having the parser notify the
566         tokenizer when it reaches the root production that the next token
567         should be EOF.
568
569         * support.cs (CompletionResult): New Exception.   This exception
570         is thrown to return the completion results when one of the special
571         completion expressions is reached.
572
573         This exception is thrown by the completing ExpressionStatements
574         classes that live in complete.cs
575
576         * complete.cs (CompletingExpression): a new base class for
577         completing expressions.   This derives from the
578         ExpressionStatement class and not from Expression as it allows
579         completion to happen not only where expressions are expected in
580         the grammar, but also where statements are expected.
581
582         (CompletionSimpleName): A new class used to provide completions
583         for SimpleNames.     This currently only resolves to local
584         variables from the evaluator context (GetVars call).
585
586         (CompletionMemberAccess): Implements support for completing member
587         access patterns. 
588
589         * cs-parser.jay: Add support for completion in a few places. 
590
591         * eval.cs (GetCompletions): New public API for the evaluator that
592         returns a list of possible completions given the input.   The
593         return value is an array of completions 
594
595         * anonymous.cs (Compatible): If the exception thrown from the
596         resolved expression is a CompletionResult exception let that one
597         through instead of printing a diagnostic error in the try/catch. 
598 <       
599 2009-03-22  Miguel de Icaza  <miguel@novell.com>
600
601         * 
602
603         * driver.cs (Main): Use Environment.Exit to quit quickly and
604         prevent the compiler from doing the usual wait for helper thread
605         to terminate.  
606
607         This is to prevent a slowdown that was reported by Gonzalo on
608         ASP.NET 
609
610 2009-03-19  Marek Safar  <marek.safar@gmail.com>
611
612         * ecore.cs: Load build-in types directly instead of accessing
613         an internal field.
614
615 2009-03-18  Marek Safar  <marek.safar@gmail.com>
616
617         * ecore.cs: Always use unbox.any when available.
618
619 2009-03-18  Marek Safar  <marek.safar@gmail.com>
620
621         * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
622
623 2009-03-17  Marek Safar  <marek.safar@gmail.com>
624
625         * generic.cs: Removed obsolete version of type inference.
626
627 2009-03-16  Marek Safar  <marek.safar@gmail.com>
628
629         * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
630         expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
631         delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
632         attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
633
634 2009-03-11  Marek Safar  <marek.safar@gmail.com>
635
636         A fix for bug #482996
637         * anonymous.cs: Make sure we are not infering return type when
638         checking type compatibility.
639
640 2009-03-11  Marek Safar  <marek.safar@gmail.com>
641
642         * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
643         rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
644         generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
645         attributes in their own structure. Needed when accessing their
646         properties before they are resolved.
647
648 2009-03-09  Marek Safar  <marek.safar@gmail.com>
649
650         * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
651         hashtable (~10x faster).
652         
653         * driver.cs: Removed wrong Reset.
654
655 2009-03-08  Marek Safar  <marek.safar@gmail.com>
656
657         * class.cs: Use correct common base type for unmanaged delayed
658         check.
659
660         * rootcontext.cs: Wrap unhandled exception.
661
662 2009-03-06  Raja R Harinath  <harinath@hurrynot.org>
663
664         Make SeekableStreamReader self-tuning and arbitrarily seekable
665         * support.cs (SeekableStreamReader.ResetStream): New.  Allocates
666         the buffer.
667         (SeekableStreamReader.Position.set): Use it.  Simplify logic
668         which, as a side-effect, makes it arbitrarily-seekable.  Tune the
669         buffer size when the stream needs to be re-read from the beginning.
670
671 2009-03-05  Marek Safar  <marek.safar@gmail.com>
672
673         A fix for bug #480100
674         * parameter.cs: A parameter is not hoisted when used directly as ET.
675
676 2009-03-04  Marek Safar  <marek.safar@gmail.com>
677
678         * statement.cs: Fixed an issue when using variable is of interface
679         type.
680
681 2009-03-03  Marek Safar  <marek.safar@gmail.com>
682
683         A fix for bug #480319
684         * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
685
686 2009-03-03  Marek Safar  <marek.safar@gmail.com>
687
688         A fix for bug #480867
689         * typemanager.cs, expression.cs, ecore.cs: Changed method group
690         expression to have no valid type.
691
692 2009-03-03  Marek Safar  <marek.safar@gmail.com>
693
694         A fix for bug #481258
695         * class.cs: Set extension method flag in partial container.
696
697 2009-03-03  Marek Safar  <marek.safar@gmail.com>
698
699         * statement.cs, typemanager.cs: Use expression for StringEmitter.
700         
701         * attribute.cs: Add sanity check.
702
703 2009-02-27  Marek Safar  <marek.safar@gmail.com>
704
705         * class.cs: Add external constructor error.
706
707 2009-02-26  Marek Safar  <marek.safar@gmail.com>
708
709         A fix for bug #475354
710         * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
711         correctly user defined nullable equality operators.
712
713 2009-02-25  Marek Safar  <marek.safar@gmail.com>
714
715         A fix for bug #479532
716         * expression.cs: Implement NewInitialize::AddressOf.
717
718 2009-02-25  Marek Safar  <marek.safar@gmail.com>
719
720         A fix for bug #413633
721         * expression.cs: Iterate all base class-constraint types.
722
723 2009-02-24  Marek Safar  <marek.safar@gmail.com>
724
725         A fix for bug #479209
726         * literal.cs: Mutate null underlying type.
727
728 2009-02-24  Marek Safar  <marek.safar@gmail.com>
729
730         A fix for bug #476295
731         * convert.cs: Avoid wrapping implicitly convertible reference type.
732
733 2009-02-23  Marek Safar  <marek.safar@gmail.com>
734
735         * iterators.cs: Create MemberName correctly.
736
737 2009-02-23  Marek Safar  <marek.safar@gmail.com>
738
739         A fix for bug #478655
740         * literal.cs: Check also underlying null type conversion.
741
742 2009-02-21  Marek Safar  <marek.safar@gmail.com>
743
744         * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
745
746 2009-02-20  Marek Safar  <marek.safar@gmail.com>
747
748         A fix for bug #477447
749         * statement.cs: Add reference to correct parent storey when this
750         is accessible from deep children storey (more than 1 level).
751
752 2009-02-19  Marek Safar  <marek.safar@gmail.com>
753
754         A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
755         * class.cs: Define base type members before setting up member cache.
756
757 2009-02-18  Marek Safar  <marek.safar@gmail.com>
758
759         A fix for bug #477378
760         * nullable.cs, expression.cs, statement.cs: More precise null type
761         sanity checks.
762
763 2009-02-18  Marek Safar  <marek.safar@gmail.com>
764
765         A fix for bug #472805
766         * typemanager.cs, namespace.cs: Import only visible extension method
767         types.
768
769 2009-02-18  Marek Safar  <marek.safar@gmail.com>
770
771         A fix for bug #476895
772         * attribute.cs: Use correct resolve context for attribute type.
773
774 2009-02-18  Marek Safar  <marek.safar@gmail.com>
775
776         A fix for bug #476266
777         * anonymous.cs: Mutate multi-dimensional arrays.
778
779 2009-02-18  Marek Safar  <marek.safar@gmail.com>
780
781         A fix for bug #476400
782         * statement.cs, expression.cs: Removed wrong Dispose optimization.
783
784 2009-02-18  Marek Safar  <marek.safar@gmail.com>
785
786         A fix for bug #476811
787         * generics.cs: Fixed null-literal check.
788
789 2009-02-17  Marek Safar  <marek.safar@gmail.com>
790
791         * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
792         expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
793         messing with static variables.
794
795 2009-02-16  Marek Safar  <marek.safar@gmail.com>
796
797         A fix for bug #475965
798         * generics.cs: Check generic parameter type after extracting from
799         Expression<T>.
800
801 2009-02-16  Marek Safar  <marek.safar@gmail.com>
802
803         A fix for bug #475823
804         * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
805         typed-null support.
806
807 2009-02-14  Marek Safar  <marek.safar@gmail.com>
808
809         * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
810         Simplified event field definition using backing field and not
811         field builder directly.
812
813         * expression.cs (EmitLdArg): Optimize fast paths.
814
815 2009-02-13  Marek Safar  <marek.safar@gmail.com>
816
817         A fix for bug #475327
818         * expression.cs (ArrayCreation): Don't mutate values optimized away.
819
820 2009-02-13  Marek Safar  <marek.safar@gmail.com>
821
822         A fix for bug #475342
823         * cs-parser.jay: Using 'super' instead of 'base' to call base
824         constructor crashes compiler.
825
826 2009-02-13  Marek Safar  <marek.safar@gmail.com>
827
828         A fix for bug #475354
829         * expression.cs (Constantify): Add nullable types.
830         
831         * const.cs (EmitDecimalConstant): Avoid explicit cast.
832
833 2009-02-12  Marek Safar  <marek.safar@gmail.com>
834
835         A fix for bug #475246
836         * expression.cs: More broken flowanalysis hacking needed.
837
838 2009-02-12  Marek Safar  <marek.safar@gmail.com>
839
840         * attribute.cs: Compare only ref/out array modifiers. 
841
842 2009-02-11  Marek Safar  <marek.safar@gmail.com>
843
844         * statement.cs: Use member cache when looking for foreach members.
845
846 2009-02-11  Marek Safar  <marek.safar@gmail.com>
847
848         * expression.cs: Don't expose internal initializer types.
849         
850         * statement.cs: Check also explicit conversions for goto case.
851
852 2009-02-11  Marek Safar  <marek.safar@gmail.com>
853
854         * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
855
856 2009-02-10  Marek Safar  <marek.safar@gmail.com>
857
858         * *.cs: Replace null-type with NullLiteral where appropriate.
859
860 2009-02-09  Marek Safar  <marek.safar@gmail.com>
861
862         * expression.cs: Initializer of reference argument use temporary
863         variable to be verifiable.
864         
865         * parameter.cs: Share EmitLdArg.
866
867 2009-02-09  Marek Safar  <marek.safar@gmail.com>
868
869         A fix for bug #473559
870         * class.cs: Fixed: Not reporting error about nested class with the
871         same name.
872
873 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
874
875         Contributed under the MIT/X11 license.
876
877         * generic.cs: Added VerifyVariantTypeParameters which performs new
878         variance verification logic. The old logic, based on the spec, was
879         wrong because the spec is full of LIES!
880
881         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
882
883         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
884
885         * class.cs:
886         * ecore.cs: Added calls to the new variance verification logic.
887
888         * parameter.cs:
889         * delegate.cs: Removed calls to the old variance verification logic.
890
891 2009-02-06  Marek Safar  <marek.safar@gmail.com>
892
893         * delegate.cs: Use cached Invoke method directly.
894
895 2009-02-06  Marek Safar  <marek.safar@gmail.com>
896
897         * expression.cs: Emit expression tree for hoisted variable access.
898
899 2009-02-04  Marek Safar  <marek.safar@gmail.com>
900
901         * namespace.cs: Add better extension class check.
902
903 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
904
905         * generic.cs: Fixed typeo (TypeParameter.Variacne).
906
907 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
908
909         This patch adds initial generic variance support to the compiler.
910         It is contributed under the MIT/X11 license.
911
912         * typemanager.cs: Modified ImplementsInterface to check variance.
913         Added VerifyVariantTypeParameters which checks the specified type to see
914         if it uses a variant type parameter as a type argument (which is not
915         allowed). Added IsVariantOf which determins if the first type is a
916         variant of the second. NOTE: This only supports reference types at
917         the moment to conform with the current level of VM support. When the
918         VM supports value types, this will follow step.
919
920         * generic.cs: Added the Variance enum. Added a Variance property to
921         TypeParameter and added variance support to definition phase. Added a
922         Variance property to TypeParameterName. Also check to make sure that
923         no variant types appear in generic method parameters.
924
925         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
926         keywords if the langversion supports it.
927
928         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
929         that variant types are only used in legal positions. Also added
930         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
931         parameters.
932
933         * decl.cs: Construct TypeParameter with the variance information.
934
935         * convert.cs: Checks variance in ImplicitReferenceConversionExists
936         and ImplicitConversionStandard.
937
938         * rootcontext.cs: Added new "Future" language version.
939
940         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
941         type parameters are not used as type arguments in interface inheritance.
942         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
943         parameters are not used as method return types. In MemberBase.
944         ResolveMemberType, ensure that variant type parameters are not used
945         as type arguments. Also call VerifyNoVariantTypeParameters on every
946         set of parameters which are resolved.
947
948         * delegate.cs: Modified Delegate.Define to ensure that variant
949         parameters are not used as type arguments and that a contravariant
950         parameter is not used as the return type. Also call
951         VerifyNoVariantTypeParameters on the delegate parameters.
952
953         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
954         to specify generic variance.
955
956         * driver.cs: Added support for LanguageVersion.Future in the form of
957         "-langversion:future".
958
959         * generic-mcs.cs: Stubbed out new members in generic.cs.
960
961 2009-02-03  Marek Safar  <marek.safar@gmail.com>
962
963         * class.cs, generic.cs: Emit type parameter constraints for nested
964         types.
965
966 2009-02-02  Marek Safar  <marek.safar@gmail.com>
967
968         A fix for bug #471213
969         * class.cs: Avoid emitting backing field for abstract event fields.
970
971 2009-02-01  Marek Safar  <marek.safar@gmail.com>
972
973         A fix for bug #359731
974         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
975         expressions.
976
977 2009-01-30  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bug #470767
980         * statement.cs: Introduced BlockScopeExpression, needed when 
981         expression tree conversion has to emit scope variables.
982
983 2009-01-29  Marek Safar  <marek.safar@gmail.com>
984
985         * class.cs: Remove duplicate CallingConvention.
986
987 2009-01-29  Marek Safar  <marek.safar@gmail.com>
988
989         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
990         when I finally found the right naming convention.
991
992 2009-01-29  Marek Safar  <marek.safar@gmail.com>
993
994         * cs-tokenizer.cs: Put back different open parens optimization.
995
996 2009-01-28  Marek Safar  <marek.safar@gmail.com>
997
998         A fix for bug #470227
999         * cs-tokenizer.cs: Remove too agressive parser optimization.
1000
1001 2009-01-28  Marek Safar  <marek.safar@gmail.com>
1002
1003         A fix for bug #324319
1004         * class.cs: Remove too early base type resolve.
1005
1006 2009-01-27  Marek Safar  <marek.safar@gmail.com>
1007
1008         A fix for bug #324319
1009         * ecore.cs: Explicitly type null when assigning to type argument to
1010         make pass verifier check.
1011
1012 2009-01-27  Marek Safar  <marek.safar@gmail.com>
1013
1014         * anonymous.cs: Fixed recent regression when initializing captured 
1015         this.
1016
1017 2009-01-26  Marek Safar  <marek.safar@gmail.com>
1018
1019         A fix for bug #469019
1020         * anonymous.cs: Use all parent type parameters when instantiating
1021         nested generic storey.
1022
1023 2009-01-26  Marek Safar  <marek.safar@gmail.com>
1024
1025         * expression.cs: Check for null instance methodgroup expression.
1026
1027 2009-01-26  Marek Safar  <marek.safar@gmail.com>
1028
1029         A fix for bug #469244
1030         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
1031         instance inside a conditional expression.
1032
1033 2009-01-23  Marek Safar  <marek.safar@gmail.com>
1034
1035         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
1036         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
1037         GetElementType and HasElementType. IsValueType clean up.
1038
1039 2009-01-23  Marek Safar  <marek.safar@gmail.com>
1040
1041         * nullable.cs: Use common EmitCall.
1042         
1043         * expression.cs: Emit constraint. for virtual calls only.
1044
1045 2009-01-23  Marek Safar  <marek.safar@gmail.com>
1046
1047         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
1048         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
1049         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
1050         checks.
1051
1052 2009-01-22  Jb Evain  <jbevain@novell.com>
1053
1054         * anonymous.cs: make anonymous types' ToString implementation
1055         match what csc outputs.
1056
1057 2009-01-21  Marek Safar  <marek.safar@gmail.com>
1058
1059         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
1060         up.
1061
1062 2009-01-17  Marek Safar  <marek.safar@gmail.com>
1063
1064         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
1065         verifier checks.
1066
1067 2009-01-16  Marek Safar  <marek.safar@gmail.com>
1068
1069         * nullable.cs (LiftedBinaryOperator): Check for all possible null
1070         expressions.
1071
1072 2009-01-15  Marek Safar  <marek.safar@gmail.com>
1073
1074         A fix for bug #466634
1075         * statement.cs: Add reference for nested storey when only this
1076         is captured.
1077
1078 2009-01-15  Marek Safar  <marek.safar@gmail.com>
1079
1080         A fix for bug #466474
1081         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
1082         was specified.
1083
1084 2009-01-15  Marek Safar  <marek.safar@gmail.com>
1085
1086         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
1087         Fixed nested stories parent referencing process. Also fixes #463985.
1088
1089 2009-01-06  Marek Safar  <marek.safar@gmail.com>
1090
1091         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
1092         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
1093         implementation. Also fixes #463108.
1094
1095 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1096
1097         A fix for bug #416109
1098         * decl.cs: Issue correct CLSAttribute warning location.
1099
1100 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1101
1102         A fix for bug #456775
1103         * attribute.cs: Use attribute owner scope when resolving attribute
1104         arguments.
1105
1106 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1107
1108         A fix for bug #457257
1109         * decl.cs: Fixed incorrect member declaring type comparison.
1110
1111 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1112
1113         A fix for bug #460896
1114         * driver.cs: Handle /RES resources as embeddable.
1115
1116 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1117
1118         A fix for bug #462515
1119         * ecore.cs: Report inacessible members upwards.
1120
1121 2009-01-05  Marek Safar  <marek.safar@gmail.com>
1122
1123         A fix for bug #463190, #463192
1124         * decl.cs, namespace.cs: Also import internal extension classes.
1125
1126 2009-01-04  Marek Safar  <marek.safar@gmail.com>
1127
1128         A fix for bug #463415
1129         * generic.cs: Use right index for RemoveDependentTypes.
1130
1131 2009-01-02  Marek Safar  <marek.safar@gmail.com>
1132
1133         A fix for bug #463196
1134         * expression.cs: Fixed enum to null comparison.
1135
1136 2009-01-02  Marek Safar  <marek.safar@gmail.com>
1137
1138         A fix for bug #463121
1139         * nullable.cs: Fixed nullable user equality operator comparison.
1140
1141 2009-01-02  Marek Safar  <marek.safar@gmail.com>
1142
1143         A fix for bug #462950
1144         * class.cs, decl.cs: Use full explicit name when defining automatic
1145         property backing field.
1146
1147 2009-01-02  Marek Safar  <marek.safar@gmail.com>
1148
1149         A fix for bug #462592
1150         * pending.cs: Emit type arguments for generic proxy method.
1151
1152 2008-12-30  Marek Safar  <marek.safar@gmail.com>
1153
1154         * expression.cs (As): Mutate all type arguments.
1155
1156 2008-12-29  Marek Safar  <marek.safar@gmail.com>
1157
1158         A fix for bug #462622
1159         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
1160         context.
1161
1162 2008-12-29  Marek Safar  <marek.safar@gmail.com>
1163
1164         A fix for bug #450782
1165         * ecore.cs: Consider more variables of form V.I to be fixed.
1166
1167 2008-12-29  Marek Safar  <marek.safar@gmail.com>
1168
1169         A fix for bug #460712
1170         * typemanager.cs: Core types could be imported.
1171
1172 2008-12-28  Marek Safar  <marek.safar@gmail.com>
1173
1174         A fix for bugs #460847, #460772, #458049, #457339, #447807
1175         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
1176         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
1177         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
1178         user lambdas used inside query clauses.
1179
1180 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1181
1182         A fix for bug #460229
1183         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
1184
1185 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1186
1187         A fix for bug #459952
1188         * decl.cs, namespace.cs: Use common CheckAccessLevel.
1189
1190 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1191
1192         A fix for bug #459630
1193         * convert.cs: Enum to valuetype conversion is not allowed.
1194
1195 2008-12-18  Marek Safar  <marek.safar@gmail.com>
1196
1197         A fix for bug #457087
1198         * generic.cs: Don't crash when constraint comes from type
1199         declaration.
1200
1201 2008-12-16  Marek Safar  <marek.safar@gmail.com>
1202
1203         A fix for bug #459221
1204         * anonymous.cs, statement.cs: Delay only captured this
1205         initialization.
1206
1207 2008-12-12  Marek Safar  <marek.safar@gmail.com>
1208
1209         A fix for bug #457489
1210         * anonymous.cs, statement.cs: Split anonymous storey instantiation
1211         and initialization to capture scope initializers correctly.
1212
1213 2008-12-11  Marek Safar  <marek.safar@gmail.com>
1214
1215         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
1216         ParameterReference refactoring.
1217
1218 2008-12-03  Marek Safar  <marek.safar@gmail.com>
1219
1220         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
1221         to be imported from any assembly.
1222
1223 2008-12-03  Marek Safar  <marek.safar@gmail.com>
1224
1225         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
1226         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
1227         from anonymous method and lambda expression.
1228
1229 2008-12-01  Marek Safar  <marek.safar@gmail.com>
1230
1231         A fix for bug #448560
1232         * expression.cs (As): Box any generic type arguments to be
1233         verifiable.
1234
1235 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
1236
1237         Add tripwire for implicit conversion bugs
1238         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
1239         for CS1501 error.
1240         (MethodGroupExpr.OverloadResolve): Add sanity check between
1241         IsApplicable and VerifyArgumentsCompat.
1242         (VerifyArgumentsCompat): Report CS1501 where appropriate.
1243
1244 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
1245
1246         Fix build break in System.Data_test
1247         * convert.cs (ImplicitConversionExists): Move NullLiteral
1248         conversions ...
1249         (ImplicitStandardConversionExists): ... here.
1250
1251 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1252
1253         * literal.cs: Emit correctly explicit null to nullable cast.
1254
1255 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1256
1257         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
1258         resolve.
1259
1260 2008-11-28  Marek Safar  <marek.safar@gmail.com>
1261
1262         A fix for bug #449005
1263         * convert.cs, nullable.cs: Use only one implicit nullable
1264         conversion.
1265
1266 2008-11-27  Marek Safar  <marek.safar@gmail.com>
1267
1268         * convert.cs, literal.cs: More Convert cleanup is needed.
1269
1270 2008-11-27  Marek Safar  <marek.safar@gmail.com>
1271
1272         * decl.cs, class.cs: Fixed misleading error message.
1273
1274 2008-11-26  Marek Safar  <marek.safar@gmail.com>
1275
1276         A fix for bug #449005
1277         * nullable.cs (EmitEquality): Disable optimization for user operator
1278         operands.
1279
1280 2008-11-25  Marek Safar  <marek.safar@gmail.com>
1281
1282         A fix for bug #447027
1283         * anonymous.cs (HoistedVariable): Cache also outer access to deal
1284         with context variables stored as expression instances.
1285
1286 2008-11-25  Marek Safar  <marek.safar@gmail.com>
1287
1288         A fix for bug #447027
1289         * delegate.cs: Fixed delegate VerifyMethod logic.
1290
1291 2008-11-24  Marek Safar  <marek.safar@gmail.com>
1292
1293         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
1294         but not verifiable.
1295
1296 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1297
1298         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
1299         member type resolve to follow normal flow, instead of random
1300         property access.
1301
1302 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1303
1304         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
1305         type.
1306
1307 2008-11-21  Marek Safar  <marek.safar@gmail.com>
1308
1309         * const.cs: Emit decimal array constant as literal.
1310
1311 2008-11-20  Marek Safar  <marek.safar@gmail.com>
1312
1313         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1314
1315 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1316
1317         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1318         into real property (saves 8 MB for corlib compilation).
1319
1320 2008-11-19  Marek Safar  <marek.safar@gmail.com>
1321
1322         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1323         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1324         generic-mcs.cs: Small cleanup of TypeArguments.
1325
1326 2008-11-18  Marek Safar  <marek.safar@gmail.com>
1327
1328         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1329         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1330         of ConstructedType expression, renamed to GenericTypeExpr.
1331
1332 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1333
1334         A fix for bug #445303
1335         * location.cs (IsConditionalDefined): Handle undefined global
1336         defines.
1337
1338 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1339
1340         A fix for bug #444678
1341         * expression.cs (TryReduceConstant): Always create new constant
1342         instance.
1343
1344 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1345
1346         A fix for bug #444673
1347         * ecore.cs: Ignore open generic types when used as generic type
1348         instance fields.
1349
1350 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1351
1352         A fix for bug #445458
1353         * expression.cs, cs-parser.jay: Don't crash when an expression
1354         statement is null.
1355
1356 2008-11-17  Marek Safar  <marek.safar@gmail.com>
1357
1358         A fix for bug #445464
1359         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1360         inside unbound type.
1361
1362 2008-11-14  Jb Evain  <jbevain@novell.com>
1363
1364         * driver.cs: ignore empty -nowarn argument such as
1365         the one in -nowarn:12,13,,.
1366
1367 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1368
1369         A fix for bug #444271
1370         * anonymous.cs: Rescan parent storeys when best candidate was
1371         undone.
1372
1373 2008-11-13  Marek Safar  <marek.safar@gmail.com>
1374
1375         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1376         useless UnboundTypeExpression.
1377         
1378         * attribute.cs: Do check obsolete attribute on generic types.
1379
1380 2008-11-12  Marek Safar  <marek.safar@gmail.com>
1381
1382         A fix for bugs #425680, #400139
1383         * ecore.cs, expression.cs: Trying to do some almost_matched_members
1384         refactoring.
1385
1386 2008-11-11  Marek Safar  <marek.safar@gmail.com>
1387
1388         A fix for bug #435747
1389         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1390         compound value types assignment. Few micro optimizations added.
1391
1392 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1393
1394         A fix for bug #442610
1395         * anonymous.cs (MutateConstructor): More SRE hacking.
1396
1397 2008-11-10  Marek Safar  <marek.safar@gmail.com>
1398
1399         A fix for bug #442579
1400         * ecore.cs: Also initialize expanded form of a method with 1 params
1401         parameter.
1402
1403 2008-11-06  Marek Safar  <marek.safar@gmail.com>
1404
1405         * expression.cs (UnaryMutator): Do early l-side check.
1406
1407 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1408
1409         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1410         Init, otherwise we would crash later on when checking for friend
1411         assemblies. 
1412
1413         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1414         Otherwise we never get any meaningful information as to what
1415         failed. 
1416
1417 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1418
1419         A fix for bug #436318
1420         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1421
1422 2008-11-05  Miguel de Icaza  <miguel@novell.com>
1423
1424         * namespace.cs: Turns out that it was a really bad idea to hide
1425         the errors for namespaces not found here in eval mode.    
1426
1427         * eval.cs: When we process using clauses, only enter those into
1428         the list of valid using clauses after they have been validated.   
1429
1430         The above change gives the proper semantics: it does not
1431         senselessly report the same errors with broken using statements by
1432         never storing them in the first place when they are invalid.
1433
1434 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1435
1436         A fix for bug #421839
1437         * cs-parser.jay: Remove expression from coalesce rule to force lower
1438         priority than the assignment operator.
1439
1440 2008-11-05  Marek Safar  <marek.safar@gmail.com>
1441
1442         A fix for bug #437875
1443         * nullable.cs: Compile correctly method group operand used with null
1444         coalescing operator.
1445
1446 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1447
1448         A fix for bug #434589
1449         * expression.cs (Binary): Ignore lifted conversions when at least
1450         one operand is of reference type.
1451
1452 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1453
1454         * cs-parser.jay: Better syntax error report.
1455
1456 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1457
1458         A fix for bug #436792
1459         * cs-parser.jay: Use GetLocation to access location.
1460
1461 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1462
1463         A fix for bug #440774
1464         * cs-parser.jay: Also set current_array_type when parsing local
1465         variables types.
1466
1467 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1468
1469         A fix for bug #440785
1470         * expression.cs (As): Don't resolve self modifing expression
1471         multiple times.
1472
1473 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1474
1475         A fix for bug #439447
1476         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1477
1478 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1479
1480         A fix for bug #437571
1481         * cs-parser.jay: Fixes internal error for invalid expression
1482         statements.
1483
1484 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1485
1486         * ecore.cs: Resolve correctly ambiguous params delegate methods.
1487
1488 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1489
1490         * generic.cs, anonymous.cs: Simplified GetDeclarations.
1491
1492 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1493
1494         * cs-tokenizer.cs: More precise cast parsing.
1495
1496 2008-10-16  Martin Baulig  <martin@ximian.com>
1497
1498         * anonymous.cs (AnonymousMethodStorey): Put back the
1499         `hoisted_locals' hashtable and use it in EmitType().
1500
1501 2008-10-15  Marek Safar  <marek.safar@gmail.com>
1502
1503         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1504         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1505         ~5MB for corlib.
1506
1507 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1508
1509         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1510
1511 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1512
1513         * statement.cs: Mutate scope initializers.
1514
1515 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1516
1517         * expression.cs: Use typeless value for This constant.
1518         
1519         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1520
1521 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1522
1523         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1524         tokenizer.
1525
1526 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1527
1528         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1529         type to type cast.
1530
1531 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1532
1533         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1534         parser and tokenizer. Fixes many ambiguities including #433258.
1535
1536 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1537
1538         * cs-parser.jay: Fixed missing accessor recovery.
1539
1540 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1541
1542         A fix for bug #433701
1543         * expression.cs: Better error message.
1544
1545 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1546
1547         * cs-parser.jay, expression.cs: Start reporting real parser errors.
1548         
1549         * Makefile: Disabled unused debug symbols.
1550
1551         Also fixes: #320556, #321097, #321656, #321876, #351316
1552
1553 2008-10-09  Miguel de Icaza  <miguel@novell.com>
1554
1555         * eval.cs: rename "<interactive>" to "{interactive}", to work
1556         around a requirement in the compiler that this be a valid
1557         filename, and in Windows it is not (433886).
1558
1559 2008-10-09  Marek Safar  <marek.safar@gmail.com>
1560
1561         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1562
1563 2008-10-08  Marek Safar  <marek.safar@gmail.com>
1564
1565         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1566         cs-parser.jay: Generic type declaration and type arguments cleanup.
1567
1568 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1569
1570         * cs-parser.jay: Allow parsing weird array creation construct.
1571
1572 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1573
1574         * cs-parser.jay: Conflicts reduction.
1575
1576 2008-10-04  Marek Safar  <marek.safar@gmail.com>
1577
1578         * cs-parser.jay: Conflicts reduction.
1579
1580 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
1581
1582         Fix #398325
1583         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1584         property.  Add a 'count' hint about the use of the shared vector.
1585         Ensure that we don't leak out dirty bits.
1586         (UsageVector.MergeChild): Throw away information about variables
1587         in child vectors.
1588         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1589
1590 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1591
1592         A fix for bug #431746
1593         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1594         parameters when iterator is created.
1595
1596 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1597
1598         A fix for bug #431827
1599         * expression.cs: Fixed right based pointer arithmetic operations
1600         emit.
1601
1602 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1603
1604         A fix for bug #353779
1605         * assign.cs, expression.cs: Fixed compound assignment conversions.
1606
1607 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1608
1609         A fix for bug #375262
1610         * statement.cs: Refactor ArrayForeach to be usable with string
1611         indexer. Optimized single dimentional arrays foreach.
1612
1613 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1614
1615         A fix for bug #431255
1616         * anonymous.cs, expression.cs: Removed broken optimization.
1617
1618 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1619
1620         * anonymous.cs: Use full type parameters of parent generic
1621         containers. Removed unnecessary AddParentStoreyReference call.
1622
1623 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1624
1625         A fix for bug #324702
1626         * class.cs: Use better shorter names for explicit interface member
1627         implementations.
1628
1629         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1630
1631 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1632         
1633         * expression.cs: Use new interface to check fixed expression.
1634
1635 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1636
1637         A fix for bug #421101
1638         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1639         interface to check for fixed fixed-buffers.
1640
1641 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1642
1643         A fix for bug #429264
1644         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1645         
1646         * delegate.cs: Removed unnecessary casts.
1647
1648 2008-09-30  Marek Safar  <marek.safar@gmail.com>
1649
1650         A fix for bug #352151
1651         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1652         class.cs: Fixed already defined explicit interface members check.
1653
1654 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
1655
1656         cs-tokenizer.cs: Fix typo.
1657
1658 2008-09-28  Miguel de Icaza  <miguel@novell.com>
1659
1660         * eval.cs (InteractiveBase): The quit command now just sets a
1661         flag, instead of calling Environment.Exit(), it is milder on
1662         embedded hosts. 
1663
1664         CompiledMethod is now in Mono.CSharp, not nested inside
1665         the Evaluator, it was inconvenient to use.
1666
1667 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1668
1669         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1670         code to be invoked without having to reparse.
1671
1672 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1673
1674         * ecore.cs: The recent changes to FieldExpr broke this as well.
1675         Fixes LINQ queries in the interactive shell.
1676
1677         * Multiple files: indentation fixing for the Mono coding
1678         guidelines for the switch statement.
1679
1680         * eval.cs: Make the Evaluator API thread safe.
1681
1682 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1683
1684         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1685         constructor parsing.
1686
1687 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1688
1689         A fix for bug #325326
1690         * statement.cs: Check possible mistaken empty statement using
1691         explicit blocks only.
1692
1693 2008-09-25  Miguel de Icaza  <miguel@novell.com>
1694
1695         * eval.cs (LoadAssembly, ReferenceAssembly): Call
1696         RootNamespace.ComputeNamespaces to update the internal list of
1697         namespaces, this is no longer done for us.
1698
1699         (InteractiveBase): Use the Evaluator APIs instead of calling into
1700         Driver directly
1701
1702 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1703
1704         A fix for bug #429264
1705         * expression.cs: Missing mutator for access to multidimensional
1706         arrays.
1707
1708 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1709
1710         * class.cs, statement: Emit DebuggerHidden attribute for iterator
1711         entry wrapper.
1712         
1713         * driver.cs: Missing input argument check.
1714
1715 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1716
1717         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1718         expression.cs, statement.cs, rootcontext.cs, class.cs, 
1719         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1720         DefineMembers.
1721
1722 2008-09-24  Miguel de Icaza  <miguel@novell.com>
1723
1724         * ecore.cs (FieldExpr): Only initialize eclass when we return a
1725         fully constructed FieldExpr, fixes the regression introduced in
1726         the last commit.
1727         
1728         * ecore.cs, expression.cs: Plug back the eclass initialization as
1729         otherwise it regresses `csharp'. 
1730
1731 2008-09-24  Marek Safar  <marek.safar@gmail.com>
1732
1733         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1734         ecore.cs, attribute.cs: Moved obsolete method checks from emit
1735         phase to resolve phase. It resolves problems with expression trees
1736         and fixes bugs #323796, #325156.
1737
1738 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1739
1740         * codegen.cs: Report better error when symbol writer is missing.
1741
1742 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1743
1744         * codegen.cs: Set .NET symbol writer.
1745         
1746         * decl.cs: Guard against null generic arguments.
1747         
1748         * report.cs: Don't report exactly same additional details.
1749
1750 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1751
1752         A fix for bug #324917
1753         * cs-parser.jay: Add missing multidimensional non-expression type
1754         ranks.
1755         
1756 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1757
1758         A fix for bug #428191
1759         * anonymous.cs: Create an outer generic fields also for non-storey
1760         anonymous methods.
1761
1762 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1763
1764         A fix for bug #378294
1765         * class.cs: Make fixed size buffers gmcs feature only.
1766
1767 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1768
1769         A fix for bug #355622, #324993
1770         * assign.cs, const.cs, class.cs: Create new EmitContext for each
1771         field initializer.
1772
1773 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1774
1775         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1776         error reporting.
1777
1778 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1779
1780         A fix for bug #416110
1781         * generic.cs: Struct constraint results in default ctor and
1782         ValueType base type constraint to be set.
1783
1784 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #423791
1787         * generic.cs: Fixed params output type type-inference.
1788
1789 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1790
1791         * cs-parser.jay, expression.cs: Fixed few expression crashes.
1792         
1793 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1794
1795         * cs-tokenizer.cs: Don't break on extra partial modifier.
1796
1797 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1798
1799         A fix for bug #427592
1800         * generic.cs: Use common parameter resolve method.
1801
1802 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1803
1804         A fix for bug #414758
1805         * expression.cs, ecore.cs: Fixed crash when accessing non-static
1806         property.
1807
1808 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1809
1810         * driver.cs, namespace.cs: Read types and namespaces after all
1811         requested assemblies are loaded, fixes issues with System.Core
1812         auto-reference, and #419888.
1813
1814 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1815
1816         A fix for bug #417705
1817         * cs-parser.jay: Fixed as/is operator expression split.
1818
1819 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1820
1821         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1822         Fixed expression tree representation of empty new expression and
1823         new initializer expression.
1824
1825 2008-09-18  Miguel de Icaza  <miguel@novell.com>
1826
1827         * eval.cs: Remove warning, keep reference to driver around.
1828
1829         * Hide fields that do not need to be public.
1830
1831 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1832
1833         A fix for bug #426385
1834         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1835         conversion for array elements.
1836
1837 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1838
1839         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1840         void parsing conflicts.
1841
1842 2008-09-15  Marek Safar  <marek.safar@gmail.com>
1843
1844         A fix for bug #425601
1845         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1846         System.Core only when there is no custom ExtensionAttribute
1847         implementation.
1848
1849 2008-09-15  Miguel de Icaza  <miguel@novell.com>
1850
1851         * namespace.cs: Do not report CS0246 (name
1852
1853 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1854
1855         A fix for bug #425669
1856         * generic.cs: Don't cache generic static anonymous method 
1857         containers.
1858
1859 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1860
1861         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1862         conflicting constraints.
1863
1864 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1865
1866         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1867         mcs too.
1868
1869 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1870
1871         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1872         to null pointer conversion fixes.
1873
1874 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1875
1876         * cs-parser.jay, expression.cs: An implicitly typed local variable
1877         declarator cannot use an array initializer.
1878
1879 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1880
1881         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1882
1883 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1884
1885         * generic.cs (InflatedConstraints): Don't crash when constraints
1886         are different.
1887         
1888         * cs-parser.jay: const_declarator is a block.
1889
1890         * constant.cs: Check for not allowed NaN conversions.
1891
1892 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1893
1894         * driver.cs: Drop --shell argument, the compiler is no longer a
1895         REPL. 
1896
1897         * eval.cs: Move most of the code that deals with evaluation into
1898         this file and document the public API from repl.cs
1899
1900         * repl.cs: Remove from here.
1901         
1902 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1903
1904         A fix for bug #424684
1905         * generic.cs: Generic class constraints must come first.
1906
1907 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1908
1909         * cs-parser.jay: Improve error reporting for syntax errors in
1910         statements and expressions, we now report the expected tokens
1911         instead of reporting the useless "; expected".
1912
1913         Drop the strings from the token declaration, it turns out that
1914         they did not do what I thought they did.  Instead they were adding
1915         two sets of tokens to the tables.
1916
1917 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1918
1919         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1920         delegate.cs: Share special type check.
1921
1922 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1923
1924         A fix for bug #423981
1925         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1926
1927 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1928
1929         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1930         ConvertImplicitly.
1931
1932 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1933
1934         A fix for bugs: #324750, #335946
1935         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1936         lookup rule to determine ?-based tokens.
1937
1938 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1939
1940         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1941         expressions (like event adding or removing) end up here, so we
1942         need to treat those as statements.
1943
1944         Add LoadAssembly method.
1945
1946 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1947
1948         * repl.cs: Add Time method.
1949
1950 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1951
1952         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1953
1954 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1955
1956         * repl.cs: Add workaround for old compilers.
1957
1958 2008-09-04  Jb Evain  <jbevain@novell.com>
1959
1960         * repl.cs (PrettyPrint): pretty print everything that
1961         implements IDictionary, as well as IEnumerables. Also,
1962         add a quit helper property.
1963
1964 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1965
1966         * constant.cs: Better error reporting for decimal literals.
1967         
1968         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1969         field attributes.
1970         
1971 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1972                         Miguel de Icaza  <miguel@novell.com>
1973
1974         A fix for bug #422951
1975         * assign.cs (Assign.DoResolve): Perform the type conversions
1976         checks before we attempt to initialize `New' initializers. 
1977
1978 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1979
1980         A fix for bug #422853
1981         * delegate.cs (DelegateCreation): Add special handling for
1982         EmptyExpression.Null instance expression which is just another
1983         hack for undecided member instance exression.
1984
1985 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1986
1987         * expression.cs, ecore.cs: Emit full expression tree for reduced
1988         binary expressions.
1989
1990 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1991
1992         * expression.cs (This): Guard against multi-resolving.
1993         
1994         * ecore.cs, statement.cs (Throw): Simplified.
1995         
1996         * flowanalysis.cs: Also verify event fields.
1997
1998 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1999
2000         * assign.cs (Assign.DoResolve): Perform the type conversions
2001         checks before we attempt to initialize `New' initializers. 
2002
2003         * repl.cs (PrettyPrint): Add Hashtable prettyprint
2004
2005         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
2006         public. 
2007
2008         * repl.cs: Update help.
2009
2010 2008-09-03  Miguel de Icaza  <miguel@novell.com>
2011
2012         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
2013         handling of the default config handling, including the special
2014         treatment of System.Core assembly. 
2015
2016         Fixes the REPL processing for LINQ.
2017
2018 2008-09-03  Marek Safar  <marek.safar@gmail.com>
2019
2020         A fix for bug #422507
2021         * expression.cs (UnboxCast): Add missing child expression mutator.
2022
2023 2008-09-03  Marek Safar  <marek.safar@gmail.com>
2024
2025         * driver.cs: Don't self reference System.Core assembly.
2026
2027 2008-09-03  Marek Safar  <marek.safar@gmail.com>
2028
2029         A fix for bug #422507
2030         * expression.cs (StringConcat): Add missing type mutator.
2031
2032 2008-09-03  Marek Safar  <marek.safar@gmail.com>
2033
2034         * generic.cs (TypeInferenceContext): Follow equality rule for
2035         constructed type lower bound type inference.
2036
2037 2008-09-02  Miguel de Icaza  <miguel@novell.com>
2038
2039         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
2040         <dblank@cs.brynmawr.edu> which updates the cursor position on
2041         refresh.
2042         
2043 2008-09-02  Marek Safar  <marek.safar@gmail.com>
2044
2045         A fix for bug #367145
2046         * driver.cs: Fixed import of extension methods when using -noconfig
2047         option.
2048
2049 2008-09-02  Marek Safar  <marek.safar@gmail.com>
2050
2051         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
2052         version from non-generic implementation instead.
2053
2054 2008-09-01  Marek Safar  <marek.safar@gmail.com>
2055
2056         A fix for bug #418908
2057         * class.cs: Use AddScopeStatement for field initializers.
2058
2059 2008-09-01  Marek Safar  <marek.safar@gmail.com>
2060
2061         A fix for bug #415385
2062         * ecore.cs, convert.cs: Do method group conversion for equal group types.
2063
2064 2008-09-01  Marek Safar  <marek.safar@gmail.com>
2065
2066         A fix for bug #421736
2067         * iterators.cs: Don't crash on unreachable iterators.
2068
2069 2008-09-01  Marek Safar  <marek.safar@gmail.com>
2070
2071         A fix for bug #421628
2072         * parameter.cs, attribute.cs: Clone also parameter attributes.
2073
2074 2008-08-30  Miguel de Icaza  <miguel@novell.com>
2075
2076         * namespace.cs (LookupType): In EvalMode, try to replace
2077         the TypeBuilder from our cache with a Type as Reflection.Emit does
2078         not  like to mix code from older assemblies emitted and new
2079         assemblies emitted. 
2080
2081         This sounds like a serious Mono bug that prevents multiple
2082         assemblies to be generated and consumed at the same time.
2083
2084         * cs-parser.jay (push_current_class): Do not make interactive
2085         classes internal or private, make them public as we currently
2086         generate each new class in a new assembly.   
2087
2088 2008-08-29  Miguel de Icaza  <miguel@novell.com>
2089
2090         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
2091         remove types that are entered into the global namespace during
2092         parsing so that we can remove them on failure.
2093  
2094         * cs-parser.jay: Parsing: we now keep track of types that are
2095         entered into global variables and queue those in case the parsing
2096         or resolution fail.
2097  
2098         This happens in a few situations: during partial-input, we invoke
2099         the parser repeatedly for example with the string "class X", this
2100         would cause X to be registed, and we need to remove this
2101         registration so that another parse attempt later with say "class X {"
2102         would actually work.
2103  
2104         Additionally, if there is an error in the resolution phase, for
2105         example: "class X : NonExistant {}" th
2106         
2107         * cs-parser.jay: Be more precise with the errors being raised,
2108         instead of flagging all exceptions during parsing to be attributed
2109         to the parsing process, distinguish those from errors happening in
2110         the actions and hint that using -v would produce the actual
2111         exception. 
2112
2113         * repl.cs: Do not load all compiler references on each reset,
2114         doing the partial reset takes care of this.
2115         
2116 2008-08-28  Miguel de Icaza  <miguel@novell.com>
2117
2118         * repl.cs: Add support for loading all the files from
2119         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
2120         as shell libraries.
2121
2122         Introduce a micro-parser that is able to deambiguate on its input
2123         whether we are dealing with a compilation unit (namespace, class,
2124         interface, struct, delegate) declaration or a statement.   This
2125         allows both declarations and statements to be entered. 
2126
2127         Set history size by default to 300 lines.
2128
2129         Instead of distinguishing based on the parser.InteractiveResult,
2130         have only two cases: statements were parsed, or a compilation unit
2131         was.   Always pull the Using statement additions from the
2132         compilation unit parse.
2133         
2134         * cs-tokenizer.cs: Rename tokens to better describe their intent
2135         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
2136         
2137         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
2138         EvalMode is used to trigger the lookup of global variables while
2139         StatementMode is used turn variable declarations into static
2140         fields.
2141
2142         * getline.cs: Allow history size to be set.
2143         
2144 2008-08-29  Marek Safar  <marek.safar@gmail.com>
2145
2146         A fix for bug #360755
2147         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
2148
2149 2008-08-29  Marek Safar  <marek.safar@gmail.com>
2150
2151         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
2152         
2153         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
2154         member name, it is too confusing
2155         
2156         * decl.cs, class.cs: Don't report unused fields with attached attribute.
2157         
2158         * rootcontext.cs: Finally default to warning level 4.
2159
2160 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2161
2162         * class.cs (CheckBase): Ignore overloaded operators.
2163
2164 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2165
2166         A fix for bug #420830
2167         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
2168
2169 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2170
2171         A fix for bug #420832
2172         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
2173
2174 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2175
2176         A fix for bug #420386
2177         * nullables.cs: Fixed logic of nullable user comparison operators involving
2178         null values.
2179
2180 2008-08-28  Marek Safar  <marek.safar@gmail.com>
2181         
2182         * attribute (IsClsCompliant): Use FALSE value for pointer types.
2183
2184 2008-08-27  Miguel de Icaza  <miguel@novell.com>
2185
2186         * repl.cs: Add support for aborting the running code with C-c. 
2187
2188 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
2189
2190         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
2191
2192 2008-08-27  Miguel de Icaza  <miguel@novell.com>
2193
2194         * cs-parser.jay (interactive_statement_list): A new set of rules
2195         for hosting statements that uses the "interactive_" prefix.   
2196
2197         * repl.cs: Add support for parsing `using' as a statement or as a
2198         directive.  Deambiguating before passing this to the parser.
2199
2200         We need to distinguish statement_expressions that occur at the
2201         toplevel vs those that occur embedded into expressions.
2202
2203         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
2204         that fixes the cursor key handling, and a history bug.
2205         
2206 2008-08-26  Miguel de Icaza  <miguel@novell.com>
2207
2208         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
2209         limitations in Console, instead the 2.0 bootstrap libraries now
2210         include the Console bits.
2211
2212         Also, remove the use of Nullables from getline.cs
2213
2214         ------------
2215         
2216         Interactive support for the C# compiler.   Use gmcs --shell to
2217         enter a read-eval-print loop shell.
2218
2219         Docs: http://www.mono-project.com/CsharpRepl
2220         
2221         * sources: include repl.cs here and getline.cs for gmcs.exe,
2222         everything else is getline.cs impaired.
2223
2224         * Makefile: when bootstrapping pass a special flag
2225         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
2226         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
2227         This distinguishes those two cases.
2228
2229         * repl.cs: Support for a read-eval-print loop.   Will be soon
2230         refactored into eval support and then REPL on top of it.
2231
2232         * ecore.cs: If a simplename lookup fails, before erroring out,
2233         if we are in EvalMode to resolve the name to a declaration in the
2234         Eval-land.    
2235
2236         This means that variable declarations that happened in previous
2237         classes (as repl puts every statement in a separate class) are
2238         made visible in this way.
2239
2240         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
2241         triggered an error due to the end of file being reached.   This is
2242         used to do multi-line input, and notify the caller that the user
2243         needs to provide more text before a successful parse.
2244
2245         Add new grammar rules after the INTERACTIVE_PARSER token is seen
2246         to drive the evaluation with a custom wrapper. 
2247
2248         * driver.cs: Add support for --shell, and refactor some code to be
2249         reused from repl.cs
2250         
2251         * namespace.cs: Add support for serializing the contents of the
2252         namespaces and reloading them.  
2253
2254         * getline.cs: A managed implementation of ReadLine under
2255         X11/Apache2 license terms.  Easy to embed in other applications as
2256         well.
2257
2258         * namespace.cs: Add some functions to save and restore the
2259         namespace state.
2260
2261         * rootcontext.cs: New public field.
2262
2263         * cs-tokenizer.cs: Add support for one of the possible characters
2264         we introduce into the token stream.  
2265
2266         This patch does not affect the regular tokenization process, the
2267         only performance hit would happen if there is an invalid character
2268         on the input string.
2269
2270         * support.cs: Move isatty helper routine here.
2271
2272         * codegen.cs: Small cleanup, and add a mechanism to initialize the
2273         code generator for in-memory assemblies.
2274
2275 2008-08-26  Marek Safar  <marek.safar@gmail.com>
2276
2277         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
2278         parameter cannot be always used as a type.
2279
2280 2008-08-21  Marek Safar  <marek.safar@gmail.com>
2281
2282         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
2283
2284 2008-08-21  Marek Safar  <marek.safar@gmail.com>
2285
2286         * convert.cs: Implement explicit array to IList<T> conversion.
2287
2288 2008-08-20  Marek Safar  <marek.safar@gmail.com>
2289
2290         A fix for bug #362740
2291         * cs-tokenizer.cs: Handle UTF-16 surrogates.
2292
2293 2008-08-20  Marek Safar  <marek.safar@gmail.com>
2294         
2295         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
2296         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
2297         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
2298         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
2299         handling to use just one type of infrastructure and deal with generics
2300         more effectivelly.
2301
2302 2008-07-23  Martin Baulig  <martin@ximian.com>
2303
2304         *** Merged this from trunk revision 108527 ***
2305
2306         * statement.cs
2307         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2308         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2309         scope variable.
2310
2311 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2312         
2313         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2314         error checks.
2315
2316 2008-08-15  Marek Safar  <marek.safar@gmail.com>
2317         
2318         * delegate.cs: Fixed compiler crash when creating delegate using partial
2319         method.
2320         
2321         * typemanager.cs: MulticastDelegate is not a delegate.
2322
2323 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2324         
2325         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2326         checks.
2327
2328 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
2329
2330         * cs-parser.jay (type): Allow 'var' in mcs too.
2331         (local_variable_type): Likewise.
2332
2333 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2334         
2335         * driver.cs: Removed broken -noconfig variants.
2336
2337 2008-08-14  Marek Safar  <marek.safar@gmail.com>
2338         
2339         A fix for bug #417078
2340         * expression.cs: Emit correctly left side pointer operators.
2341
2342 2008-08-13  Marek Safar  <marek.safar@gmail.com>
2343
2344         * generic.cs, lambda.cs: Inflate method generic arguments only.
2345
2346 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2347
2348         * class.cs: Fixed struct layout check regression.
2349
2350 2008-08-12  Marek Safar  <marek.safar@gmail.com>
2351
2352         * cs-parser.jay, enum.cs: Simplified enum parsing.
2353         
2354         * decl.cs: Check all type parameters conflicts.
2355         
2356         * expression.cs, statement.cs, attribute.cs: More expression checks.
2357
2358 2008-08-11  Marek Safar  <marek.safar@gmail.com>
2359
2360         * generic.cs: Add type inference types restriction.
2361         
2362         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2363         anonymous.cs, expression.cs: Allocate less accessor parameters.
2364
2365 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2366
2367         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2368         classes.
2369
2370 2008-08-08  Marek Safar  <marek.safar@gmail.com>
2371
2372         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
2373
2374 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2375
2376         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2377         Also fixes #362146 and #381592.
2378
2379 2008-08-07  Marek Safar  <marek.safar@gmail.com>
2380
2381         * ecore.cs: Reduced constant cannot be used as an attribute value.
2382         
2383         * cs-parser.jay: Base expression has to be a type.
2384         
2385         * expression.cs (Conditional): Uses ReducedExpression.
2386
2387 2008-08-06  Marek Safar  <marek.safar@gmail.com>
2388
2389         A fix for bug #376826
2390         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2391         address of hoisted local variable or parameter cannot be taken.
2392
2393 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2394
2395         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
2396         anonymous method inside checked/unchecked expression.
2397
2398 2008-08-05  Marek Safar  <marek.safar@gmail.com>
2399
2400         * typemanager.cs (IsEqual): Guard against null.
2401         
2402         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2403         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2404         routine. Fixed few misleading conversion errors.
2405
2406 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2407
2408         * class.cs: Consider generics when checking cycles in struct layout.
2409
2410 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
2411
2412         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
2413
2414 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2415
2416         A fix for bug #414165
2417         * anonymous.cs: Use same anonymous implementation method for all anonymous
2418         method emits.
2419
2420 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2421
2422         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2423         constraints.
2424
2425 2008-08-04  Marek Safar  <marek.safar@gmail.com>
2426
2427         * cs-parser.jay: Typeof argument has to be a type expression.
2428         
2429         * namespace.cs: Check alias and namespace definitions collisions.
2430         
2431         * class.cs, pending.cs: Moved explicit interface accessor implementation
2432         check.
2433         
2434         * delegate.cs, expression.cs: Verify special name invocations.
2435         
2436 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2437
2438         * cs-parser.jay: Don't choke on empty generic type arguments.
2439         
2440         * cs-tokenizer.cs: Handle escaped preprocessor directives.
2441         
2442         * expression.cs, ecore.cs: Minor expressions bugs.
2443
2444 2008-08-01  Marek Safar  <marek.safar@gmail.com>
2445
2446         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2447         and added more error handling.
2448         
2449         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2450         
2451         *  modifiers.cs, enum.cs: Fixed.
2452
2453 2008-07-31  Jb Evain  <jbevain@novell.com>
2454
2455         * driver.cs: remove -pkg ability of smcs.
2456
2457 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2458
2459         * statement.cs (Switch): Correctly set empty default target for single
2460         blocks.
2461
2462 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2463
2464         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2465         string switch statement implementation to use string dictionary which
2466         significantly (2-8x) improves performance of generated code.
2467
2468 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2469
2470         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2471         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2472         
2473 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2474
2475         A fix for bug #412595
2476         * typemanager.cs, convert.cs, expression.cs: Some types are never
2477         convertible to each other.
2478
2479 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2480
2481         * nullable.cs (CreateNullConstant): An error messages update.
2482
2483 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2484
2485         A fix for bug #412595
2486         * cfold.cs: Don't cast undefined bool constant.
2487
2488 2008-07-29  Martin Baulig  <martin@ximian.com>
2489
2490         * symbolwriter.cs
2491         (SymbolWriter.Reset): New public static method.
2492
2493         * driver.cs
2494         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2495
2496 2008-07-28  Marek Safar  <marek.safar@gmail.com>
2497
2498         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2499         
2500         * expression.cs (ElementAccess): Exact size allocation.
2501
2502 2008-07-26  Marek Safar  <marek.safar@gmail.com>
2503
2504         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2505
2506 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2507
2508         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2509         
2510         * class.cs: Removed $PRIVATE$ field hack which caused problems during
2511         flow analysis.
2512
2513 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2514
2515         A fix for bug #412217
2516         * assign.cs: Mutate also assignment type.
2517
2518 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2519
2520         A fix for bug #323644
2521         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2522         indexers.
2523
2524 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2525
2526         A fix for bug #412134
2527         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2528         non-enumerable operands when overloading equality or bitwise operators.
2529
2530 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2531
2532         * anonymous.cs: Cache closed generic anonymous method delegates.
2533
2534 2008-07-24  Marek Safar  <marek.safar@gmail.com>
2535
2536         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
2537         anonymous.cs, statement.cs: Always emit anonymous method as static method
2538         when is instance free. Use nesting for nested anynomous methods blocks.
2539         
2540 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2541
2542         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2543         types.
2544
2545 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2546
2547         * expression.cs: Removed MakeSimpleCall.
2548
2549 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2550
2551         A fix for bug #323012
2552         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2553         Base method implementing interface has to be public.
2554
2555 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2556
2557         * cs-parser.jay: Don't break on missing argument.
2558
2559 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2560
2561         A fix for bug #320993
2562         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2563           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2564
2565 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2566
2567         A fix for bug #320748
2568         * convert.cs: Implicit user operators cannot convert to interfaces
2569
2570 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2571
2572         A fix for bug #312686
2573         * driver.cs: Ignore empty assembly references.
2574
2575 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2576
2577         A fix for bug #387040
2578         * ecore.cs: Skip constrains check for an explicit implementation.
2579
2580 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2581
2582         A fix for bug #409045
2583         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2584           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2585           identifiers are file specific unless passed as input arguments.
2586
2587 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2588
2589          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2590          to emit UnmanagedMarshal data under 2.0 profile.
2591
2592 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2593
2594         A fix for bug #410369
2595         * parameter.cs: Clone correctly ParamsParameter.
2596
2597 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2598
2599         * expression.cs (Argument): Always report type for type based expressions
2600         errors.
2601
2602 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2603
2604         A fix for bug #410666
2605         * anonymous.cs: Correctly initialize generic storey reference.
2606
2607 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2608
2609         * convert.cs: Don't box same type arguments.
2610
2611 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2612
2613         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2614         Finished missing generic type mutators.
2615
2616 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2617
2618         * iterators.cs, statement.cs: Finished statements CloneTo.
2619
2620 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2621
2622         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2623         
2624         * expression.cs: Emit optimized default value expressions in expression tree
2625         array initializer.
2626
2627 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2628
2629         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2630
2631 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2632
2633         A fix for bug #367536
2634         * cs-parser.jay: Check static constructor of generic types for an access
2635         modifier.
2636
2637 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2638
2639         A fix for bug #353800
2640         * lambda.cs: Emit ret for contextual statements.
2641         
2642         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2643         up emitting redundant ret for all anonymous methods with return.
2644
2645 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2646
2647         A fix for bug #365188
2648         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2649         create anonymous method storey in unreachable block.
2650
2651 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2652
2653         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2654         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2655         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2656         statement.cs: Fixed relevant defects found by Gendarme.
2657
2658 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2659
2660         A fix for bug #325291
2661         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
2662         statement.cs: Replaced IAnonymousHost with top level block flag.
2663
2664 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2665
2666         * cs-parser.jay: Clean up unused open_parens.
2667
2668 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2669
2670         * ecore.cs: Custom error message for a range variable assignment.
2671
2672 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2673
2674         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2675         load.
2676
2677 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2678
2679         * literal.cs: Null literal is of object type.
2680
2681 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2682
2683         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2684         expression of nullable equality comparison.
2685
2686 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2687
2688         * expression.cs(PointerArithmetic): Removed redundant assignment.
2689
2690 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2691
2692         * decl.cs (GetSignatureForError): Report full namespace name for containers.
2693
2694 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2695
2696         A fix for bug #408361
2697         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2698         they are replaced by GetMethod.
2699
2700 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2701
2702         A fix for bug #408721 by jeremie.laval@gmail.com
2703         * expression.cs (Indirection): Implemented CloneTo.
2704
2705 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2706
2707         * statement.cs (AssignableSlots): Temporary disabled variable initialization
2708         assert check.
2709
2710 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2711
2712         * report.cs (EnableReporting): Don't reinitialize 0-based values.
2713
2714 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2715
2716         * linq.cs: Reset tranparent parameter counter in probing mode.
2717
2718 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2719
2720         * anonymous.cs: Mutate anonymous method type.
2721
2722 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2723
2724         * ecore.cs, anonymous.cs: Mutate field expressions.
2725
2726 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2727
2728         A fix for bug #369670
2729         * linq.cs, statement.cs: Use explicit block for query expressions variables.
2730
2731 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2732
2733         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2734
2735 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
2736
2737         Fix bug #314902
2738         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2739         only one '>', and finds a '>>', abort the generic lookahead.
2740
2741 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2742
2743         A fix for bug #319902
2744         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
2745
2746 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2747
2748         A fix for bug #406371
2749         * statement.cs: Moved EmitSymbolInfo to Block.
2750
2751 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2752
2753         * ecore.cs: Report better error for extension method overload failures.
2754
2755 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2756
2757         * expression.cs (Is): No need to box reference values.
2758
2759 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2760
2761         * class.cs: Use event resolve context when initializing CreateEmitContext.
2762
2763 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2764
2765         A fix for bug #394436
2766         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2767         method used inside expression trees. Added more LINQ to expression tree
2768         conversions.
2769
2770 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2771
2772         A fix for bug #378189, #370577
2773         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2774         from expression.
2775
2776 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2777
2778         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2779         hierarchically.
2780
2781 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2782
2783         A fix for bug #406702
2784         * anonymous.cs: Always park anonymous method in the nearest parent storey.
2785
2786 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2787
2788         A fix for bug #406648
2789         * cs-parser.jay: Report nullable use in mcs for some cases.
2790
2791 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2792
2793         * ecore.cs: Improved argument mismatch error messages.
2794
2795 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2796
2797         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2798
2799 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2800
2801         * expression.cs (TypeOf): Mutate type argument.
2802
2803 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2804
2805         * class.cs: Report missing partial modifier for correct type.
2806
2807 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2808
2809         * ecore.cs, expression.cs (VariableReference): Variable property is 
2810         protected.
2811
2812 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2813
2814         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2815         
2816 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2817
2818         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2819         method delegates.
2820
2821 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2822
2823         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2824         anonymous method storey to an instance method when only "this" is hoisted.
2825
2826 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2827
2828         A fix for bug #321615
2829         * expression.cs: Pointer comparisons use unsigned operator.
2830
2831 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2832
2833         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2834
2835 2008-07-02  Marek Safar  <marek.safar@gmail.com>
2836
2837         A fix for bug #404905
2838         * class.cs: Always initialize local unsafe variables.
2839
2840 2008-06-30  Marek Safar  <marek.safar@gmail.com>
2841
2842         A fix for bug #396987
2843         * expression.cs (NewInitialize): Clear local temporary variable for next run
2844
2845 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2846
2847         A fix for bug #401020
2848         * ecore.cs: Both types and modifiers have to match for ref and out arguments
2849
2850 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2851
2852         A fix for bug #398319
2853         * cs-parser.jay: Implemented undocumented base access expression inside
2854         anonymous types.
2855
2856 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2857
2858         A fix for bug #404227
2859         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2860
2861 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2862
2863         A fix for bug #404227
2864         * convert.cs: Fixed explicit array to interface cast.
2865
2866 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2867
2868         A fix for bug #403894
2869         * delegate.cs: Mutate DelegateInvocation type.
2870
2871 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2872
2873         A fix for bug #379348
2874         * delegate.cs: Box a load of generic parameters.
2875
2876 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2877
2878         * expression.cs: Add an array creation arguments mutate.
2879
2880 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2881
2882         A fix for bug #386068
2883         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2884         parameter.
2885
2886 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2887
2888         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2889         CloneTo.
2890
2891 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2892
2893         A fix for bug #403518
2894         * delegate.cs: Type correctly anonymous method new invocation.
2895
2896 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2897
2898         A fix for bug #394826
2899         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2900         calls.
2901
2902 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2903
2904         A fix for bug #394826
2905         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2906         needed.
2907
2908 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2909
2910         * class.cs: Clone indexer parameters for localized capturing.
2911
2912 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2913
2914         A fix for bug #402379
2915         * expression.cs: Don't crash when an object initializer resolve fails.
2916
2917 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2918
2919         A fix for bug #402888
2920         * expression.cs: Mutate conditional expression.
2921
2922 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2923
2924         A fix for bug #401012
2925         * class.cs: Keep StructLayout in shared container.
2926
2927 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2928
2929         A fix for bug #400438
2930         * decl.cs, class.cs: Only properties can be automatically implemented.
2931
2932 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2933
2934         * statement.cs (ChangeToIterator): Copy also labels.
2935
2936 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2937
2938         * ecore.cs: Pass type argument details to parent extension method.
2939
2940 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2941
2942         A fix for bug #375966
2943         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2944
2945 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2946
2947         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2948
2949 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2950
2951         A fix for bug #394347
2952         * anonymous.cs: Cache compatible delegates as compatibility check produces
2953         a new method every time.
2954
2955 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2956
2957         * anonymous.cs: Propagate storey reference for single references.
2958
2959 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2960
2961         A fix for bug #387615
2962         * assign.cs, expression.cs: Correctly clone compound assignment.
2963
2964 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2965
2966         A fix for bug #359611, #359604
2967         * anonymous.cs: Mutate all types of hoisted parameters.
2968
2969 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2970
2971         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2972         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2973         expression.cs, codegen.cs, statement.cs
2974         
2975         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2976         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2977         
2978         ** Anonymous methods, lambda expressions rewrite **
2979         
2980         Anonymous expressions are now resolved when an explicit block is resolved 
2981         and they don't require any registration procedure anymore. Further,
2982         anonymous methods are defined when explicit block is emitted which allows
2983         better control of whole process and opens possibilities for more
2984         optimizations as well as alternative to reverse whole process.
2985         
2986         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2987         process consistent and to correctly emit hoisted generic methods when they
2988         have at least 1 hoisted variable.
2989         
2990 2008-06-17  Martin Baulig  <martin@ximian.com>
2991
2992         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2993         iterator method.
2994         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2995         virtual property; check it in Emit().
2996         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2997         an iterator.
2998         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2999         an iterator.
3000         (Indexer.Define): Likewise.
3001
3002 2008-06-17  Marek Safar  <marek.safar@gmail.com>
3003
3004         * convert.cs: Don't use IsInterface on type arguments.
3005         
3006         * delegate.cs: DelegateInvocation uses MethodInfo.
3007         
3008         * parameter.cs: Removed IsTypeParameter.
3009         
3010         * generic-mcs.cs: More missing stuff.
3011
3012 2008-06-16  Martin Baulig  <martin@ximian.com>
3013
3014         * modifiers.cs
3015         (Modifiers.DEBUGGER_HIDDEN): New public const.
3016
3017         * typemanager.cs
3018         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
3019
3020         * class.cs
3021         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
3022         (AbstractPropertyEventMethod): Likewise.
3023         (Constructor.Emit): Likewise.
3024         (SourceMethod.SetCompilerGenerated): Removed.
3025
3026         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
3027         on MoveNext().
3028
3029         * anonymous.cs
3030         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
3031         if we're an `IteratorHost'.
3032         (AnonymousMethodMethod..ctor): Don't set
3033         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
3034         not on the method.
3035
3036 2008-06-16  Marek Safar  <marek.safar@gmail.com>
3037
3038         * statement.cs: Clean-up foreach statements.
3039
3040 2008-06-12  Marek Safar  <marek.safar@gmail.com>
3041
3042         * class.cs: Stop using public method which should not exist
3043         (MethodBuilder.SetGenericMethodSignature).
3044
3045 2008-06-11  Martin Baulig  <martin@ximian.com>
3046
3047         * location.cs
3048         (Location.LookupFile): Add `CompilationUnit' argument; when given
3049         a relative file name, make it relative to the directory the .cs
3050         file is located in instead of using the current directory.
3051
3052 2008-06-11  Martin Baulig  <martin@ximian.com>
3053
3054         * class.cs
3055         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
3056         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
3057         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
3058         (SourceMethod.SetCompilerGenerated): Likewise.
3059
3060 2008-06-11  Marek Safar  <marek.safar@gmail.com>
3061
3062         * codegen.cs, driver: Only write symbol file when it's asked for.
3063
3064 2008-06-11  Marek Safar  <marek.safar@gmail.com>
3065
3066         * codegen.cs: Don't use assembly writer error handling for symbol writer.
3067
3068 2008-06-10  Martin Baulig  <martin@ximian.com>
3069
3070         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
3071
3072 2008-06-09  Marek Safar  <marek.safar@gmail.com>
3073
3074         A fix for bug #316290
3075         * expression.cs: Include decimal operators in predefined table.
3076         
3077         * parameters.cs: More readonlyness.
3078
3079 2008-06-09  Marek Safar  <marek.safar@gmail.com>
3080
3081         A fix for bug #397213
3082         * cs-parser.jay: One more missing current_local_parameters reset.
3083
3084 2008-06-09  Marek Safar  <marek.safar@gmail.com>
3085
3086         A fix for bug #396633
3087         * class.cs: Host backing field in partial container.
3088
3089 2008-06-09  Marek Safar  <marek.safar@gmail.com>
3090
3091         A fix for bug #397068
3092         * expression.cs: Check both operand types when predefined operator is used.
3093
3094 2008-06-05  Martin Baulig  <martin@ximian.com>
3095
3096         Merged the `debugger-kahalo' branch.
3097
3098         * class.cs
3099         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
3100         we're an iterator method.
3101         (SourceMethod): Reflect latest symbol writer changes;
3102         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
3103         now `start_row' and `end_row'.
3104         (Constructor.Emit): Fix the logic whether to emit symbol information.
3105
3106         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
3107         generated methods.
3108
3109         * location.cs
3110         (CompilationUnit): New public class; derives from `SourceFile'.
3111         (SourceFileEntry.DefineSymbolInfo): New public method.
3112         (SourceFileEntry.SetChecksum): New public method.
3113         (Location): Encode hidden line numbers by using `column == 255';
3114         the .ctor now accepts `column == -1' to mark a hidden line number.
3115         (Location.Hidden): New public property.
3116         (Location.CheckPoint): Add `CompilationUnit'.
3117         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
3118         (Location.Push): Add `CompilationUnit compile_unit' argument.
3119         (Location.CompilationUnit): New public property.
3120
3121         * statement.cs
3122         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
3123
3124         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
3125
3126         * driver.cs: `SourceFile' -> `CompilationUnit'.
3127
3128         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
3129
3130         * namespace.cs: `SourceFile' -> `CompilationUnit'.
3131
3132         * cs-tokenizer.cs: Add support for `#pragma checksum' and
3133         `#line hidden'.
3134
3135         * symbolwriter.cs
3136         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
3137         new symbol writer API to also pass the file.
3138
3139 2008-06-05  Marek Safar  <marek.safar@gmail.com>
3140
3141         * statement.cs: Emit catch variable assignment using variable expression.
3142         
3143 2008-06-05  Marek Safar  <marek.safar@gmail.com>
3144
3145         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
3146         with other variable types.
3147
3148 2008-06-04  Marek Safar  <marek.safar@gmail.com>
3149
3150         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
3151         GetLength method emit, it breaks resolve rules.
3152         
3153 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
3154             Marek Safar  <marek.safar@gmail.com>
3155                         
3156         A fix for bug #395542
3157         * cs-parser.jay: The trailing comma is allowed in anonymous type member
3158         declaration.
3159         
3160 2008-06-02  Marek Safar  <marek.safar@gmail.com>
3161
3162         A fix for bug #395287
3163         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
3164
3165 2008-05-31  Marek Safar  <marek.safar@gmail.com>
3166
3167         A fix for bug #395845
3168         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
3169         non-nullable parameter type.
3170         
3171 2008-05-31  Marek Safar  <marek.safar@gmail.com>
3172
3173         * class.cs: Handle contructor initializer as a statement in top-level block.
3174
3175 2008-05-30  Marek Safar  <marek.safar@gmail.com>
3176
3177         * attribute.cs: Don't mix old and new corlib types when emitting corlib
3178         security attributes.
3179
3180 2008-05-24  Marek Safar  <marek.safar@gmail.com>
3181
3182         * ecore.cs, expression.cs: Small IVariable refactoring.
3183
3184 2008-05-22  Marek Safar  <marek.safar@gmail.com>
3185
3186         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
3187
3188 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3189
3190         * cs-parser.jay: Removed redundant catch type check.
3191
3192 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3193
3194         A fix for bug #390372
3195         * nullable.cs: Set correct return type.
3196
3197 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3198
3199         A fix for bug #391062
3200         * typemanager.cs: Fixed crash when comparing null types.
3201
3202 2008-05-21  Marek Safar  <marek.safar@gmail.com>
3203
3204         A fix for bug #391871
3205         * cs-parser.jay: Better error handling for invalid catch type.
3206
3207 2008-05-20  Marek Safar  <marek.safar@gmail.com>
3208
3209         A fix for bug #392155
3210         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
3211
3212 2008-05-15  Marek Safar  <marek.safar@gmail.com>
3213
3214         A fix for bug #390666
3215         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
3216         expressions.
3217
3218 2008-05-15  Marek Safar  <marek.safar@gmail.com>
3219
3220         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
3221         in getter.
3222
3223 2008-05-13  Marek Safar  <marek.safar@gmail.com>
3224
3225         A fix for bug #389625
3226         * delegate.cs, generic.cs: Some progress on method group return type
3227         inference.
3228
3229 2008-05-13  Marek Safar  <marek.safar@gmail.com>
3230
3231         A fix for bug #378419
3232         * namespace.cs: Inspect also parent namespaces not only namespace entries.
3233
3234 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3235
3236         * class.cs (Constructor): Added IsCompilerGenerated.
3237
3238 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3239
3240         * expression.cs: Enum binary operators can accept non-enum operand only when
3241         is implicitly convertible to underlying type.
3242
3243 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3244
3245         A fix for bug #389272
3246         * support.cs: Workaround System.InvalidOperationException for enums.
3247
3248 2008-05-12  Marek Safar  <marek.safar@gmail.com>
3249
3250         A fix for bug #389073
3251         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
3252
3253 2008-05-10  Marek Safar  <marek.safar@gmail.com>
3254
3255         * driver.cs: Split Parse.
3256         
3257         * location.cs (LookupFile): Uses string.Empty.
3258
3259 2008-05-07  Marek Safar  <marek.safar@gmail.com>
3260
3261         * expression.cs, parameter.cs: Small ParameterReference clean up.
3262
3263 2008-05-07  Marek Safar  <marek.safar@gmail.com>
3264
3265         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
3266         hack. Fixes #387502.
3267
3268 2008-05-06  Martin Baulig  <martin@ximian.com>
3269
3270         * class.cs (Constructor.Emit): Fix the logic whether to emit
3271         symbol information.
3272
3273 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
3274
3275         Fix #385503
3276         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
3277         InvalidOperationException when the iterator is before the start or
3278         after the end.
3279
3280 2008-05-06  Marek Safar  <marek.safar@gmail.com>
3281
3282         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
3283         when left is nullable type.
3284
3285 2008-05-06  Marek Safar  <marek.safar@gmail.com>
3286
3287         A fix for bug #386628
3288         * expression.cs (LocalVariableReference): Continue in resolving when
3289         variable is not assigned.
3290
3291 2008-05-05  Marek Safar  <marek.safar@gmail.com>
3292
3293         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
3294         nullable operations.
3295
3296 2008-05-04  Marek Safar  <marek.safar@gmail.com>
3297
3298         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
3299         it saves many redundant temporary variables for nullable operations.
3300
3301 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3302
3303         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
3304         
3305         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3306         method.
3307         
3308         * nullable.cs: Constant coalescing operator optimizations.
3309
3310 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3311
3312         * constant.cs: Use unsigned conversion for values which are unsigned only.
3313
3314 2008-05-03  Marek Safar  <marek.safar@gmail.com>
3315
3316         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
3317         coalescing operator as it should be.
3318
3319 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3320
3321         A fix for bug #371016
3322         * expression.cs: All predefined delegate operators require implicit method
3323         group conversion.
3324         
3325 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3326
3327         * constant.cs: Emit long constant as uint when fits the range.
3328         
3329         * convert.cs, expression.cs: Fixed few unsafe conversions.
3330
3331 2008-05-02  Marek Safar  <marek.safar@gmail.com>
3332
3333         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3334
3335 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
3336
3337         Fix #385758
3338         * convert.cs (ImplicitNumericConversion): Don't modify the type of
3339         'expr'.
3340         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3341
3342 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3343
3344         * constant.cs, literal.cs: IsLiteral property for error reporting.
3345         
3346         * ecore.cs, expression.cs: Implemented Property expression.
3347
3348 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3349
3350         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3351         
3352         * nullable.cs: Implemented nullable coalescing null operator.
3353
3354         * ecore.cs, expression.cs: Expression trees work.
3355
3356 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3357
3358         * ecore.cs: CreateExpressionTree is finally abstract.
3359
3360         * expression.cs, linq.cs: Updated.
3361
3362 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3363
3364         * expression.cs, ecore.cs: Block base access expression inside expression
3365         tree.
3366
3367 2008-05-01  Marek Safar  <marek.safar@gmail.com>
3368
3369         A fix for bug #385058
3370         * expression.cs: User-defined operator implementations always take
3371         precedence over predefined operator implementations.
3372
3373 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3374
3375         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3376         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3377         expression tree conversions.
3378         
3379 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3380
3381         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3382         operators method details to Operator class.
3383
3384 2008-04-30  Marek Safar  <marek.safar@gmail.com>
3385
3386         * anonymous.cs: Pass unsafe flags to anonymous container.
3387         
3388         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3389         inside expression tree.
3390
3391 2008-04-29  Martin Baulig  <martin@ximian.com>
3392
3393         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3394         (Tokenizer.PopPosition): Also restore the `line'.
3395
3396 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3397
3398         * delegate.cs: Implemented Invoke expression.
3399
3400 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3401
3402         * expression.cs: Fixed equality reference comparison regression.
3403
3404 2008-04-29  Marek Safar  <marek.safar@gmail.com>
3405
3406         * ecore.cs: Clean up EmptyCast hack.
3407         
3408         * expression.cs, nullable.cs: Implemented enum binary and unary operations
3409         using correct conversion rules. Also fixes #383993.
3410
3411 2008-04-28  Martin Baulig  <martin@ximian.com>
3412
3413         * class.cs (Constructor.Emit): Don't emit debugging information
3414         for generated default .ctor's.
3415
3416 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3417
3418         * convert.cs: Empty-cast ushort to int conversion.
3419
3420 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3421
3422         A fix for bug #384191
3423         * ecore.cs, expression.cs: Fixed expression cloning.
3424
3425 2008-04-28  Marek Safar  <marek.safar@gmail.com>
3426
3427         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3428
3429 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
3430
3431         Fix #381559, test-638.cs, test-639.cs
3432         * assign.cs (CompoundAssign.Helper): New wrapper.
3433         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3434         access.
3435         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3436         Pass unconverted expressions to the params array creation expression.
3437         (FieldExpr.EmitAssign): Don't special-case StringConcat.
3438         (PropertyExpr.EmitAssign): Likewise.
3439         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3440         element if it is of kind CompoundAssign.Helper.
3441         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3442         first before anything else.
3443         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3444         (ArrayAccess.LoadArrayAndArguments): Simplify.
3445
3446 2008-04-27  Marek Safar  <marek.safar@gmail.com>
3447
3448         * expression.cs: Fixed cloning of typeof(void).
3449
3450 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
3451
3452         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3453         (Assign.Emit): Likewise.  Move it to ...
3454         (CompoundAssign.DoResolve): ... here and ...
3455         (CompoundAssign.Emit): ... here.
3456         (EventAddOrRemove): New helper to handle += and -= on events, and
3457         avoid the use of BinaryDelegates.
3458         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3459         (EventExpr.EmitAddOrRemove): Improve.
3460         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3461
3462         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3463         create VarExprs for 'foo.bar.var'.
3464         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3465         is a highly inappropriate name for its functionality.
3466
3467 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3468
3469         Simplify handling of multiple assignments
3470         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
3471         inheritable-only.
3472         (SimpleAssign): New.  Class to be used for normal assignments.
3473         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3474         * expression.cs, parameter.cs, statement.cs: Likewise.
3475
3476 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3477
3478         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3479         for incompatible underlying types, more to come, uff.
3480
3481 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3482
3483         Fix gtest-388.cs
3484         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3485         Handle 'leave_copy'.
3486
3487 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3488
3489         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3490
3491 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
3492
3493         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
3494         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3495         * statement.cs (While, Do, For): Allow test to have side effects.
3496         (For.DoEmit): Always emit InitStatement.
3497
3498         Fix test-635.cs
3499         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3500         Always create SideEffectConstant.
3501         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3502         of type EnumConstant.
3503
3504         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3505         Handle 'right' being SideEffectConstant of type 'bool'.
3506
3507         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3508         Use left.EmitBranchable instead of open coding it, so as to
3509         improve optimization opportunities.
3510
3511         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3512
3513         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3514         assumptions.
3515         (Expression.EmitSideEffect): Document.
3516
3517 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3518
3519         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3520
3521 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3522
3523         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3524
3525 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3526
3527         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3528         conversion to expression tree.
3529
3530 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3531
3532         * ecore.cs: Removed unused expression.
3533
3534 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3535
3536         * expression.cs: Implemented NegateChecked and New expressions.
3537
3538 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3539
3540         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3541
3542 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
3543
3544         Fix #351102
3545         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3546         needing final 'ret' instruction.
3547
3548 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3549
3550         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3551
3552 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3553
3554         * expression.cs: Emit ldnull and not null expression as an instance argument
3555          of static method expression calls.
3556
3557 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3558
3559         A fix for bug #378200
3560         * expression.cs: Fixed crash when creating parameterless expression tree
3561         method call.
3562
3563 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3564
3565         A fix for bug #375297
3566         * anonymous.cs: Fixed crash when inferring from null argument anonymous
3567         method.
3568
3569 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3570
3571         A fix for bug #377596
3572         * decl.cs, class.cs: Emit delegate type argument attributes.
3573
3574 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3575
3576         A fix for bug #365314
3577         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3578         
3579 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3580
3581         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3582         only.
3583
3584 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3585
3586         * generic.cs (TypeParameter): Removed redundant location.
3587
3588 2008-04-19  Marek Safar  <marek.safar@gmail.com>
3589
3590         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3591         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3592         FullNamedExpression in all declaration type expression, statements will come
3593         later.
3594
3595 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3596
3597         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3598         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3599
3600 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3601
3602         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3603         code.
3604
3605 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3606
3607         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3608         constraints.
3609
3610 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3611
3612         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3613         name expressions.
3614         Also fixes #340463.
3615
3616 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
3617
3618         Hook up 'EmitSideEffect'
3619         * constant.cs (Constant.EmitSideEffect): New.
3620         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
3621         (SideEffectConstant.EmitSideEffect): New.
3622         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
3623         unconditional branch in EmitBranchable.
3624         (FieldExpr.EmitBranchable): New.
3625         * expression.cs (Unary.EmitSideEffect): New.
3626         (Binary.EmitSideEffect): New.
3627         (VariableReference.EmitSideEffect): New.  Do nothing.
3628
3629 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3630
3631         Introduce 'EmitSideEffect'
3632         * ecore.cs (Expression.EmitSideEffect): New.
3633         (TypeCast): Rename from EmptyCast.
3634         (EmptyCast): New.
3635         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3636         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3637         * convert.cs, nullable.cs: Update to changes.
3638
3639 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3640
3641         * class.cs, cs-parser.jay: Early check for base types expression.
3642
3643 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3644
3645         * decl.cs (MemberName): Declare PrettyName as obsolete.
3646
3647 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3648
3649         * namespace.cs: Use MemberName comparison.
3650
3651 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3652
3653         Fix build break
3654         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
3655         FullName.
3656         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3657         (MemberName.FullyQualifiedName): New.  Provides the functionality
3658         that users assume FullName would have.
3659         * ecore.cs, namespace.cs: Update to changes.
3660
3661         * statement.cs (Using.assign): Make into ExpressionStatement.
3662         (Using.EmitPreTryBody): Simplify.
3663
3664 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3665
3666         * report.cs: ColorFormat is protected.
3667         
3668         * rootcontext.cs: Unused fields clean-up.
3669         
3670         * namespace.cs: Made UsingEntry name private.
3671
3672 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3673
3674         * cs-tokenizer.cs, location.cs: Removed unused field.
3675
3676 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
3677             Raja R Harinath  <harinath@hurrynot.org>
3678
3679         Fix #379822
3680         * constant.cs (SideEffectConstant.value): Rename from 'left'.
3681         (SideEffectConstant.side_effect): Rename from 'right'.
3682         (SideEffectConstant..ctor): Normalize 'side_effect'.
3683         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3684         value of this constant.
3685         * cfold.cs: Update to changes.
3686
3687 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3688
3689         * cs-paser.jay: Removed unused variable.
3690         
3691         * driver.cs: Made Compile instance method.
3692
3693 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
3694
3695         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3696
3697 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3698
3699         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
3700
3701 2008-04-13  Jb Evain  <jbevain@novell.com>
3702
3703         * namespace.cs: update the System.Core fullname for 2.1
3704         * driver.cs: update the list of required assemblies for 2.1.
3705         Merged from the Moonlight 2 branch.
3706
3707 2008-04-11  Marek Safar  <marek.safar@gmail.com>
3708
3709         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3710         types and user defined operators. User operators arguments has to be checked
3711         for null value before invocation, which also means no operator is called
3712         when any argument is not convertible to unwrapped nullable type.
3713         
3714 2008-04-09  Marek Safar  <marek.safar@gmail.com>
3715
3716         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3717         of Unary expressions to follow operator overloading rules precisely.
3718         Also fixes #321794, #323794
3719         
3720 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3721
3722         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3723         expression.
3724         
3725 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3726
3727         * expression.cs, ecore.cs: Implemented MemberInit expression.
3728         
3729 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
3730
3731         Fix mono/tests/exception4.cs
3732         * statement.cs (ExceptionStatement, TryCatch): Revert to using
3733         ec.NeedReturnLabel () rather emitting a 'nop'.
3734
3735         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3736         simple heuristic.
3737         (TryCatch.SomeCodeFollows): Likewise.
3738         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3739         for 'break', 'continue' and 'return' statements inside a try.
3740         We're fairly sure that the generated IL stream will have more
3741         instructions textually following the try.
3742         (FlowBranchingTryCatch): Likewise.
3743
3744         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3745         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3746         overrides.
3747
3748         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3749         wrapper -- forward everything to CollectionForeach.
3750         (CollectionForeach.NonDisposableWrapper): New.
3751         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3752         instead of a pop + branch to end.
3753
3754 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3755
3756         A fix for bug #377485
3757         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
3758         Propagate location for extension method groups. Report conversion failure at
3759         right place.
3760
3761 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3762
3763         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3764         ListInit and Field expressions.
3765
3766 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
3767
3768         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3769         Since $PC is always -1 inside the body of MoveNext, the fault
3770         handler is a no-op.
3771         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3772         * statement.cs (ExceptionStatement.emit_finally): Likewise.
3773         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3774
3775         The denouement!  Fix #324708
3776         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3777         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3778         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3779         'finally' inside the finally clause.
3780
3781         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3782         inside an iterator.  Don't emit the body of the 'finally' inside
3783         the finally clause yet.
3784
3785         Use the ResumableStatement infrastructure for MoveNext ()
3786         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3787         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
3788         'old_resume_points'.  Move dispatcher upfront.
3789         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3790         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3791         in an enumerator.  This encodes the main fix in this patch series
3792         -- we can only jump into the first instruction of a try from the
3793         outside, but we want to emit try/finally regions in iterators and
3794         resume in the middle of them.
3795
3796 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
3797
3798         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3799         of NeedReturnLabel here.
3800
3801         Introduce a common point for emitting try/finally to IL
3802         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
3803         features of the various subclasses, which are now driven by ...
3804         (ExceptionStatement.EmitPreTryBody): ... this and ...
3805         (ExceptionStatement.EmitTryBody): ... this and the original
3806         EmitFinallyBody.
3807         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3808         Remove DoEmit and update to follow above protocol.
3809
3810         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3811         of the dispatcher are the same, skip emitting the 'switch'.
3812         * iterator.cs (Iterator.EmitDispose): Update to changes.
3813
3814         Clean up handling of 'using' statement
3815         * statement.cs (UsingTemporary): New.  Carved out of ...
3816         (Using): ... this.  Simplify drastically.  Handle exactly
3817         one variable.
3818         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
3819         or Using as appropriate.  If there are multiple variable declared,
3820         create nested Using statements.
3821         (resource_acquisition): Kill.
3822
3823         * statement.cs (ExceptionStatement.EmitForDispose): Use
3824         EmitFinallyBody, not EmitFinally.
3825
3826         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3827         * iterator.cs: Update to changes.
3828
3829         Start using the ResumableStatement infrastructure
3830         * statement.cs (ResumeableStatement.PrepareForDispose): New.
3831         (ResumableStatement.EmitForDispose): New.
3832         (ExceptionStatement): Override them.
3833         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3834         EmitForDispose to create the body of the Dispose method.  Don't
3835         use OldResumePoint.
3836
3837         * iterator.cs (Iterator.AddResumePoint): Move here from ...
3838         * statement.cs (Toplevel.AddResumePoint): ... here.
3839         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3840         * flowanalysis.cs (FlowBranchingIterator): New.
3841         * codegen.cs (EmitContext): Update to changes.
3842
3843         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3844         (Iterator.old_resume_points): Rename from 'resume_points'.
3845         (Iterator.MoveNextStatement): Remove unused class.
3846
3847         New infrastructure for try/finally in iterators (still unused)
3848         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3849         (FlowBranchingToplevel.AddResumePoint): Hook into
3850         ToplevelBlock.AddResumePoint.
3851         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3852         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3853         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
3854         resume points and assign program-counter values.
3855         (ExceptionBlock.AddResumePoint): Collect resume points for
3856         de-muxer at the top of try block.
3857         * iterators.cs (Yield.CheckContext): Simplify.
3858         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3859
3860 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3861
3862         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3863         argument to an ExitStatement.
3864         (FlowBranchingException): Refactor saved origins code.
3865         * statement.cs (ExitStatement): Update to cahges.
3866         * iterator.cs (YieldBreak): Likewise.
3867
3868         * statement.cs (ResumableStatement): New.  Common base class for
3869         YieldReturn and ExceptionStatement.
3870         (ExitStatement): New.  Common base class for Return and YieldBreak.
3871         (Return): Update to changes.
3872         * iterator.cs (YieldBreak): Likewise.
3873         * lambda.cs (ContextualReturn): Likewise.
3874
3875         Fix #377028
3876         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3877         emit a meaningful error message.
3878
3879         Fix #324765, #319508
3880         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3881         (VariableInfo.SetAssigned): Set it.
3882         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3883         determine if CS0219 or CS0168 is appropriate.  Don't use
3884         flow-analysis information.
3885         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3886         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3887         (EmitContext.EndFlowBranching): ... this.
3888
3889 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3890
3891         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3892
3893 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3894
3895         A fix for bug #376508
3896         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3897         ImplicitConversionExists.
3898
3899 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3900
3901         * expression.cs (Binary): Added remaining binary operators to expression
3902         tree builder.
3903
3904         * nullable.cs: Optimize shift with null argument.
3905
3906 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3907
3908         Fix minor IL regression
3909         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3910         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3911         * cs-parser.jay (try_statement): Update to changes.
3912
3913         * statement.cs (TryFinally.need_exc_block): Delete.
3914         (TryFinally): Update to changes.
3915
3916         Now all ExceptionStatements are unconditional
3917         * statement.cs (CollectionForeach.DisposableWrapper): New.
3918         Extract out the try/finally code into a new wrapper.
3919         (CollectionForeach.Resolve): Use it to simplify the code.
3920
3921 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3922
3923         Start at simplifying ExceptionStatement semantics a bit
3924         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3925         * cs-parser.jay (try_statement): Update to changes.
3926         (opt_catch_clauses): Remove.
3927         * flowanalysis.cs: Update to changes.
3928         (FlowBranching.BranchingType.TryCatch): New.
3929         (FlowBranchingTryCatch): New.
3930
3931         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3932         (FlowBranching.CreateBranching): Update to changes.
3933         (FlowBranchingBlock.AddSibling): Add sanity check.
3934         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3935         Update to changes.
3936
3937         * iterators.cs (Iterator.MarkFinally): Remove.
3938         * statement.cs (ExceptionStatement): Update to changes.
3939
3940         Add support for skipping over finally blocks at runtime.  First
3941         in a series to fix #324708
3942         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3943         (Iterator.EmitMoveNext): Initialize it.
3944         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3945         branch over the body of the 'finally' clause.
3946
3947 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3948
3949         Avoid lopsided use of Foo/DoFoo names
3950         * statement.cs (ExpressionStatement.EmitFinallyBody):
3951         Rename from EmitFinally.
3952         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3953         * iterator.cs: Update to changes.
3954
3955 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3956
3957         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3958         based on UserOperatorCall. More binary nullable operators clean up.
3959
3960 2008-04-02  Martin Baulig  <martin@ximian.com>
3961
3962         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3963
3964 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3965
3966         * nullable.cs: Merge user and empty conversions when lifting expression
3967         trees.
3968         
3969         * expression.cs (StringConcat): Implemented expression tree representation.
3970
3971 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3972
3973         * nullable.cs: When lifting null literal and a user operator exists, no call 
3974         is made.
3975         
3976 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3977
3978         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3979         null.
3980
3981 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3982
3983         * nullable.cs, expression.cs: Use namespace instead heavily nested
3984         monster abstract class.
3985
3986 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3987
3988         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3989         lifting of null literal and user operators. Clean up of some temporary
3990         nullable hacks.
3991
3992 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3993
3994         Fix #368224, test-629.cs
3995         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3996         if it crossed an unwind-protect boundary.
3997         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3998         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3999         inside an unwind-protected region.
4000         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
4001         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
4002         'leave' instead of a 'br' if unwind-protected.
4003         (Iterator.EmitYieldBreak): Likewise.
4004
4005 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
4006
4007         * driver.cs: Only define versioninfo resources if no win32 resource
4008         file was specified.
4009
4010 2008-03-28  Marek Safar  <marek.safar@gmail.com>
4011
4012         A fix for bug #372375
4013         * convert.cs: Fixed boxing of nullable types.
4014
4015 2008-03-28  Marek Safar  <marek.safar@gmail.com>
4016
4017         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
4018         type.
4019
4020 2008-03-28  Marek Safar  <marek.safar@gmail.com>
4021
4022         A fix for bug #374619
4023         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
4024         
4025 2008-03-27  Marek Safar  <marek.safar@gmail.com>
4026
4027         * lambda.cs: Check return type only for invocation.
4028         
4029 2008-03-27  Marek Safar  <marek.safar@gmail.com>
4030
4031         A fix for bug #374214
4032         * ecore.cs: Correctly report argument type mismatch.
4033
4034 2008-03-27  Marek Safar  <marek.safar@gmail.com>
4035
4036         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
4037         and not rely on broken IsEnum.
4038
4039 2008-03-27  Marek Safar  <marek.safar@gmail.com>
4040
4041         * nullable.cs: New file, extracted from generic.cs.
4042         
4043         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
4044
4045 2008-03-27  Marek Safar  <marek.safar@gmail.com>
4046
4047         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
4048         predefined comparison operators and null literals.
4049         
4050         * report.cs: New warning ID.
4051         
4052 2008-03-25  Marek Safar  <marek.safar@gmail.com>
4053
4054         A fix for bug #370577
4055         * lambda.cs: Check return type too.
4056
4057 2008-03-25  Marek Safar  <marek.safar@gmail.com>
4058
4059         A fix for bug #372846
4060         * class.cs: Automatic properties can be declared as unsafe.
4061
4062 2008-03-20  Marek Safar  <marek.safar@gmail.com>
4063
4064         * location.cs: Use string based concatenation.
4065         
4066         * expression.cs: LiftedBinaryOperator is gmcs only.
4067         
4068 2008-03-20  Marek Safar  <marek.safar@gmail.com>
4069
4070         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
4071         conversions rules and expression trees.
4072
4073 2008-03-19  Marek Safar  <marek.safar@gmail.com>
4074
4075         * delegate.cs: Use extension method source as delegate target.
4076
4077 2008-03-19  Marek Safar  <marek.safar@gmail.com>
4078
4079         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
4080         binary operations to be purely based on binary operations and optimized
4081         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
4082         and other ET refactoring.
4083         
4084         * typemanager.cs: Fixed warning.
4085         
4086 2008-03-17  Marek Safar  <marek.safar@gmail.com>
4087
4088         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
4089         
4090         * symbolwriter.cs: Fixed.
4091
4092 2008-03-17  Marek Safar  <marek.safar@gmail.com>
4093
4094         * anonymous.cs, driver.cs: Reset anonymous types counters.
4095
4096 2008-03-17  Marek Safar  <marek.safar@gmail.com>
4097
4098         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
4099         
4100         * class.cs: Use fullname for all type member definitions.
4101         
4102 2008-02-19  Martin Baulig  <martin@ximian.com>
4103
4104         * class.cs
4105         (IMethodData.EmitExtraSymbolInfo): New interface method.
4106         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
4107         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
4108         interface method here as an empty public virtual method.
4109
4110         * anonymous.cs
4111         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
4112         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
4113         CodeGen.SymbolWriter.SetRealMethodName().       
4114
4115 2008-02-18  Martin Baulig  <martin@ximian.com>
4116
4117         * anonymous.cs
4118         (ScopeInfo.EmitType): Override this and emit debugging
4119         information for captured variables.
4120         (RootScopeInfo.EmitType): Override this and emit symbol
4121         information for a captured `this'.
4122
4123 2008-02-15  Martin Baulig  <martin@ximian.com>
4124
4125         * iterators.cs: Emit debugging info.
4126
4127         * codegen.cs
4128         (EmitContext.Flags): Add `OmitDebuggingInfo'.
4129         (EmitContext.OmitDebuggingInfo): New public property.
4130
4131         * statement.cs
4132         (While): Override Emit() and don't emit symbol info there; do it
4133         inside DoEmit() instead.
4134         (Block.Emit): Omit symbol information while emitting the scope
4135         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
4136         block logic.
4137         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
4138         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
4139         .ctor to make `IsIterator' work.
4140
4141 2008-03-14  Martin Baulig  <martin@ximian.com>
4142
4143         * symbolwriter.cs: Added the new symbol writer function from the
4144         debugger's `terrania' branch; temporarily enclose them inside
4145         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
4146         my vacations.
4147
4148 2008-03-14  Martin Baulig  <martin@ximian.com>
4149
4150         * symbolwriter.cs
4151         (SymbolWriter): Make this a public static class.
4152
4153         * codegen.cs
4154         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
4155         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
4156
4157 2008-03-14  Marek Safar  <marek.safar@gmail.com>
4158
4159         A fix for bug #370577
4160         * statement.cs, lambda.cs: Added extra limitations when dealing with void
4161         return type.
4162         
4163 2008-03-14  Marek Safar  <marek.safar@gmail.com>
4164
4165         * typemanager.cs (CSharpName): Made 250 times faster.
4166
4167 2008-03-13  Marek Safar  <marek.safar@gmail.com>
4168
4169         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
4170         
4171 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4172
4173         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4174         crash when predefined field does not exist.
4175         
4176 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4177
4178         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
4179         
4180 2008-03-12  Marek Safar  <marek.safar@gmail.com>
4181
4182         * class.cs (FixedField): Don't crash when contructors are missing.
4183
4184 2008-03-11  Marek Safar  <marek.safar@gmail.com>
4185
4186         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
4187         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
4188         check internal types accessibility for internal and external types.
4189         Replaced EnumToUnderlying by GetEnumUnderlyingType.
4190
4191 2008-03-11  Marek Safar  <marek.safar@gmail.com>
4192
4193         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
4194         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
4195         attribute.cs, statement: Use corect instance of predefined types (work
4196         related to #364674).
4197
4198 2008-03-07  Marek Safar  <marek.safar@gmail.com>
4199
4200         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
4201         
4202 2008-03-07  Marek Safar  <marek.safar@gmail.com>
4203
4204         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
4205         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
4206         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
4207         predefined types clean up, delayed predefined types members initialization
4208         (work related to #364674).
4209
4210 2008-03-05  Marek Safar  <marek.safar@gmail.com>
4211
4212         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
4213         
4214 2008-03-05  Marek Safar  <marek.safar@gmail.com>
4215
4216         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
4217         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
4218         predefined types clean up (work related to #364674).
4219
4220 2008-03-04  Marek Safar  <marek.safar@gmail.com>
4221
4222         * ecore.cs: Print an error message instead of throwing exception.
4223         
4224 2008-03-04  Marek Safar  <marek.safar@gmail.com>
4225
4226         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
4227         expression.cs, statement.cs: Unififed null literal representation.
4228
4229 2008-03-03  Marek Safar  <marek.safar@gmail.com>
4230
4231         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
4232         expression.cs: Refactored binary operators resolve phase and improved speed.
4233         The nullable code is still missing and won't work correctly, more fixes
4234         required.
4235
4236         It also fixes #323726, #324312, #324248, and many other unreported issues.
4237
4238 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
4239
4240         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
4241         instead of 'gmcs'.
4242
4243 2008-02-27  Marek Safar  <marek.safar@gmail.com>
4244
4245         * ecore.cs: Clean-up and split BetterConversion.
4246         
4247 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
4248
4249         Fix #363791
4250         * enum.cs (EnumMember.Value): Only access 'value' if
4251         ResolveValue says it's ok.
4252         (EnumMember.DoResolveValue): Don't set prev_member.value.
4253         (Enum.GetDefinition): Reverse arguments of Equals --
4254         EnumMember.Value can return 'null'.
4255
4256         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
4257
4258 2008-02-22  Marek Safar  <marek.safar@gmail.com>
4259
4260         * generic.cs, expression.cs: More ongoing work on expression trees.
4261         
4262 2008-02-21  Marek Safar  <marek.safar@gmail.com>
4263
4264         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
4265         handle missing matches when mutiple operators exist.
4266         
4267 2008-02-20  Marek Safar  <marek.safar@gmail.com>
4268
4269         A fix for bug #363218
4270         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
4271         initializers.
4272         
4273 2008-02-20  Marek Safar  <marek.safar@gmail.com>
4274
4275         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
4276         update. This time to deal correctly with SideEffectConstant expression used
4277         as an argument for another constant folding.
4278
4279 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
4280
4281         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
4282         MethodBuilder.
4283
4284 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4285
4286         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
4287
4288 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4289
4290         A fix for bug #328136
4291         * expression.cs: Do not fold immediately LogicalAnd operators when the left
4292         side is a false constant, because we still need to evaluate the right-hand
4293         side.
4294
4295         * statement.cs (If): Emit two types of boolean constants (simple constant,
4296         side-effect constant).
4297
4298 2008-02-19  Marek Safar  <marek.safar@gmail.com>
4299
4300         * constant.cs (SideEffectConstant): Don't emit boolean constant.
4301
4302         * expression.cs: Fold immediately LogicalAnd operators when both sides are
4303         constants.
4304
4305 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4306
4307         A fix for bug #361457
4308         * ecore.cs (IsApplicable): Params methods have lower priority.
4309
4310         * support.cs: Return correct parameter modifier for params types.
4311
4312 2008-02-18  Marek Safar  <marek.safar@gmail.com>
4313
4314         * generic.cs (TypeParameter): Cache attribute target name.
4315
4316         * support.cs: Removed unused variable.
4317
4318         * typemanager.cs: Removed debugging leftover.
4319
4320         * ecore.cs: Use local type instead of a property;
4321
4322         * class.cs (VerifyMembers): Consider also parent to test whether type member
4323         is local or public.
4324
4325         * expression.cs (FullMethodDesc): Removed.
4326
4327         * attribute.cs (IsValidArgumentType): Made static.
4328
4329 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
4330
4331         Cleanup to be more readable.
4332         * Makefile (GMCS_PROFILE): Remove.
4333         (COMPILER_NAME): New helper.
4334
4335 2008-02-15  Miguel de Icaza  <miguel@novell.com>
4336
4337         * cs-tokenizer.cs: if a conditional expression happens inside a
4338         (...) this also means that we do not need to de-ambiguate between
4339         an parenthesized expression and a cast.
4340
4341         Fixes 346484.
4342
4343         * constant.cs (SideEffectConstant): a constant value that happens
4344         to have a side effect.
4345
4346         Fixes the build regressions introduced by the fix for #359789
4347
4348 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
4349
4350         * expression.cs (Conditional.Emit): when emitting the ternary
4351         operator, use local variables to generate code verifiable code.
4352
4353         The verifier cannot infer that the type on stack before the
4354         stloc.0 is executed is of type ParentB. This happens because the
4355         stack merge algorithm uses only parent types when deciding which
4356         is the common type.  This is described in Part III 1.8.1.3 of ECMA
4357         335.
4358
4359         This code compiled with mcs is not verifiable under MS. The MS
4360         verifier picks the first common interface of Foo and Bar, which is
4361         wrong, but doesn't use a full join type of the 2 interfaces.
4362
4363         CSC uses a clever hack to compile such code in a verifiable
4364         way. It stores the intermediate values in a local variable with
4365         the expected type.
4366
4367         Fixes: #358102
4368
4369 2008-02-14  Miguel de Icaza  <miguel@novell.com>
4370
4371         * expression.cs: Do not fold BitwiseAnd operators when the left
4372         side is a false constant, because we still need to evaluate the
4373         right-hand side.
4374
4375         Fixes #359789
4376
4377         * support.cs: Instead of throwing an InternalErrorException when
4378         the position of the stream is outside the boundary of our buffer,
4379         reset the state of the reader, and restart the reading from the
4380         beginning of the file.
4381
4382 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4383
4384         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4385
4386 2008-02-14  Marek Safar  <marek.safar@gmail.com>
4387
4388         A fix for bug #361686
4389         * decl.cs: A protected types used inside a private class which parents
4390         derives from the protected class are accessible.
4391
4392 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4393
4394         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4395         the parameterless constructor.
4396
4397 2008-02-13  Marek Safar  <marek.safar@gmail.com>
4398
4399         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4400         lookup methods to use standard member cache when doing member lookup.
4401
4402 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4403
4404         * driver.cs: Don't report full path for referenced module as assembly error.
4405
4406 2008-02-12  Marek Safar  <marek.safar@gmail.com>
4407
4408         * Makefile: Fixed `qh' target to work on all machines.
4409
4410         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4411         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4412         and HasElementType with TypeManager implementation.
4413
4414 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4415
4416         A fix for bugs #325134, #359749
4417         * expression.cs, ecore.cs: Try to resolve an extension method even if the
4418         first binds point to non-method member expression.
4419
4420 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4421
4422         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4423
4424 2008-02-08  Marek Safar  <marek.safar@gmail.com>
4425
4426         A fix for bugs #321394, #323028
4427         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4428         Reworked naive IsAccessibleAs implementation to handle nested types.
4429
4430 2008-02-05  Jb Evain  <jbevain@novell.com>
4431
4432         * class.cs: use generic type comparison for parameters
4433         as well.
4434
4435 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4436
4437         A fix for bug #325372
4438         * class.cs: Use generic type comparison when testing method signatures.
4439
4440 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4441
4442         A fix for bug #357047
4443         * ecore.cs: Applied C# 3.0 changes to better conversion.
4444
4445 2008-02-05  Marek Safar  <marek.safar@gmail.com>
4446
4447         A fix for bug #358374
4448         * cs-parser.jay: Correctly set modifiers for all constructor types.
4449
4450 2008-02-04  Marek Safar  <marek.safar@gmail.com>
4451
4452         A fix for bug #355251
4453         * generic.cs: Added base class constraint based type inference.
4454
4455 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4456
4457         A fix for bug #357255
4458         * decl.cs: One more missing visibility check.
4459
4460 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4461
4462         * support.cs: Fixed broken return.
4463
4464 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4465
4466         * report.cs: Correctly reset warnings count after probing.
4467
4468 2008-01-25  Martin Baulig  <martin@ximian.com>
4469
4470         * namespace.cs
4471         (NamespaceEntry.SymbolFileID): Make this work again after
4472         MemberName.ToString() is gone.
4473
4474 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4475
4476         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4477         expressions.
4478
4479 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4480
4481         * generic.cs: Use full implicit conversion for type inference fixing.
4482
4483 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4484
4485         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4486         Fixed user operator conversions.
4487
4488 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4489
4490         * generic.cs: Do nullable type to null comparison optimization during
4491         resolve phase.
4492
4493 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4494
4495         A fix for bug #355163
4496         * generic.cs: Enabled l-value resolve on nullable expressions.
4497
4498 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4499
4500         A fix for bug #353986
4501         * class.cs: Ingore static ctors with parameters for any further checks.
4502
4503 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4504
4505         A fix for bug #354310
4506         * namespace.cs: Removed redundant check.
4507
4508 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4509
4510         A fix for bug #354928
4511         * expression.cs: ElementInitializers can be resolved only once.
4512
4513 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4514
4515         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4516         Condition expressions.
4517
4518 2008-01-23  Marek Safar  <marek.safar@gmail.com>
4519
4520         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4521
4522 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4523
4524         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4525         not allowed.
4526
4527         * generic.cs: Implemented coalesce expression.
4528
4529 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4530
4531         A fix for bug #355145
4532         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4533         expression tree type inference.
4534
4535 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
4536
4537         Fix #354663
4538         * expression.cs (Binary.IsUnsignedType): Fix typo.
4539
4540 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4541
4542         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4543
4544 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4545
4546         A fix for bug #355161
4547         * ecore.cs, expression.cs: Wider range of extension method supported
4548         expressions.
4549
4550 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
4551
4552         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4553         AssemblyBuilder to operate in compiler context. Fixes mcs part of
4554         bug #354970.
4555
4556 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4557
4558         A fix for bug #355148
4559         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4560
4561 2008-01-22  Miguel de Icaza  <miguel@novell.com>
4562
4563         * expression.cs (CreateExpressionTree): Add support for or and
4564         logical or, and indent following the coding conventions.
4565
4566         * typemanager.cs (LinqExpression): renamed from
4567         ExpressionTreeManager, for a shorter name.
4568
4569         Use TypeManager.CoreLookupType to lookup types from our core
4570         assemblies and turn those into "Type" variables.
4571
4572         Consumers that previously used "Namespace" and "Type" from this
4573         class should instead use the TypeExpression which is a type that
4574         is fully resolved (without involving the regular C# resolution
4575         rules). 
4576
4577         This typically looks like this:
4578
4579         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4580         new MemberAccess (texpr, name, type_arguments, loc)
4581
4582         This avoids the problem in: #355178
4583
4584 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4585
4586         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4587         feature in parser only as we do in other cases.
4588         
4589 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4590
4591         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4592         typemanager.cs: A refactoring of params arguments to reuse existing
4593         expressions (params -> array initializer) to emit params argument instead
4594         of specialized handling.
4595         It was required by expression tree implementation and it has other benefits
4596         as well, we now apply same optimization for params arguments as we do for
4597         array initializers.
4598         
4599 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4600
4601         A fix for bug #353526
4602         * generic.cs: A type inference of params arguments may not required any
4603         temporary array creation.
4604         
4605 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4606
4607         A fix for bug #353534
4608         * generic.cs, ecore.cs, expression.cs: A method group type inference is
4609         supported for delegates only.
4610         
4611 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4612
4613         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4614         type for more than 1 candidates.
4615         
4616 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4617
4618         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4619         expressions.
4620         
4621 2008-01-16  Marek Safar  <marek.safar@gmail.com>
4622
4623         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4624         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4625         operator) expressions. 
4626                 
4627 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4628
4629         * statement.cs: Avoid declaring an IL variable for this_variable since it is
4630         not accessed from the generated IL.
4631
4632 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4633
4634         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4635         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4636         statement.cs: The first expression tree implementation drop, mostly
4637         infrastructure work.
4638
4639 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4640
4641         * ecore.cs (IsNestedChild): Refactored.
4642
4643 2008-01-11  Marek Safar  <marek.safar@gmail.com>
4644
4645         * lambda.cs: Don't use a cast on unknown expression statement.
4646
4647 2008-01-10  Geoff Norton  <gnorton@novell.com>
4648
4649         * cs-tokenizer.cs: One more token to distinguish between method and lambda
4650         arguments
4651
4652 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4653
4654         * doc.cs: Report better /doc crash details.
4655         
4656 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4657
4658         A fix for bug #352536
4659         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4660
4661 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4662
4663         A fix for bug #352287
4664         * ecore.cs, expression.cs: Do `this' access checking in all member access
4665         expressions.
4666         
4667 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4668
4669         * rootcontext.cs, driver.cs: Switch to linq mode by default.
4670         
4671         * report.cs: Reset message stacks.
4672         
4673 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4674
4675         * generic.cs (InferInPhases): Correctly calculate params position.
4676         
4677 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4678
4679         * cs-tokenizer.cs: No need to parse full string when parsing lambda
4680         arguments.
4681
4682 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4683
4684         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4685         
4686         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4687         
4688         * driver.cs: Updated --help option.
4689         
4690 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4691
4692         * generic.cs (InferParamsTypeArguments): Removed.
4693         (InferInPhases): Add params type inference.
4694         (LowerBoundInference): Fixed scoring mechanism.
4695         
4696         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4697         
4698 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4699
4700         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4701         byte array for unsigned "baked" assemblies.
4702
4703 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4704
4705         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4706         array for assemblies that are not strongnamed.
4707
4708 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4709
4710         A fix for bug #351481
4711         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4712         declaring type for nested generic types.
4713         
4714 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4715
4716         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4717         instead of ToString.
4718         
4719 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4720
4721         A fix for bug #351047
4722         * expression.cs (Binary.ResolveOperator): Allow equality operators between
4723         null and structs only when equality and inequality operators are defined
4724         either as an user-operators or predefined operators.
4725         
4726 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4727
4728         A fix for bug #351047
4729         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4730         
4731 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4732
4733         A fix for bug #351257
4734         * cs-tokenizer.cs: Advance line number for '\r' correctly.
4735         
4736 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4737
4738         A fix for bug #351157
4739         * class.cs (Using): Fixed yet another broken cloning.
4740         
4741         (Block): Put back more sensible default value for statements.
4742         
4743 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
4744
4745         * codegen.cs: Allow AssemblyVersion with only major version component.
4746         Fixes bug #351055.
4747
4748 2007-12-29  Marek Safar  <marek.safar@gmail.com>
4749
4750         A fix for bug #324654
4751         * class.cs: Use FullName property as member name.
4752
4753 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4754
4755         A fix for bug #342117
4756         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4757         constructor constraint.
4758
4759 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4760
4761         A fix for bug #338273
4762         * class.cs (ProbertyBase): Access modifier checks are required for overrides
4763         only.
4764
4765 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4766
4767         A fix for bug #350839
4768         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4769
4770 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4771
4772         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4773         GHOP:
4774         
4775         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4776
4777         * statement.cs: Changed some Hashtables to use HybridDictionaries
4778         instead. It was observed that some HashTables only contained a few
4779         items in the vast majority of cases. Since HybridDictionary is
4780         more efficient on small sets (<10 elements), "known_variables"
4781         from class ExplicitBlock as well as "labels" and "constants " from
4782         class Block were changed to HybridDictionaries. 
4783
4784         Atsai results: (56216kb->54987kb)
4785
4786         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4787
4788
4789 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4790
4791         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4792         GHOP:
4793         
4794         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4795         
4796         * expression.cs: foreach loop to for loop, saved on allocation of
4797         enumerator (59333kb->59141kb)
4798
4799         * statement.cs. Changed foreach loops to for loops, saved on
4800         allocation of enumerator (59141kb->59006kb)
4801
4802         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4803         when constructed with no specified capacity. This was causing a
4804         few ArrayLists to allocate more memory than they would potentially
4805         need in the Block class and MemberCache class. Setting the
4806         ArrayLists to construct with a capacity of 1 saves some
4807         memory. (56216kb->55585kb)
4808
4809 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4810
4811         A fix for bug #347189 (2nd issue)
4812         * expression.cs (MemberAccess): Nested type can be found in base non-generic
4813         type.
4814
4815 2007-12-27  Miguel de Icaza  <miguel@novell.com>
4816         
4817         * report.cs: Do not use colors if stdout and stderr are not a
4818         terminal.
4819
4820 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4821
4822         A fix for bug #346998
4823         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4824         overloads.
4825
4826 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4827
4828         A fix for bug #343465
4829         * class.cs: Explicit method name for nested types uses dots only.
4830
4831 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4832
4833         A fix for bug #343707
4834         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4835
4836 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4837
4838         * ecore.cs: Report type inference errors only when arguments count matches
4839         parameter count.
4840         
4841         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4842         
4843         * expression.cs, report.cs: New warning.
4844         
4845         * typemanager.cs: Catch anonymous method type too.
4846
4847 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4848
4849         A fix for bug #346379
4850         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4851
4852 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4853
4854         A fix for bug #347359
4855         * expression.cs (Invocation): Don't resolve already resolved expression.
4856
4857 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4858
4859         A fix for bug #347189
4860         * class.cs (FixedField): Use non-dependent code only in the define phase.
4861
4862 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4863
4864         A fix for bug #348076
4865         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4866
4867 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4868
4869         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4870         discovered extension methods.
4871
4872 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4873
4874         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4875         method.
4876
4877 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4878
4879         * report.cs (ErrorMessage): Add support for using colors on
4880         terminals that support it. 
4881
4882 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4883
4884         * ecore.cs: Use information about expanded params for error reporting.
4885
4886 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4887
4888         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4889         and logic for params overloads.
4890         
4891 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4892
4893         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4894         as this is also created from the parser.  Fixes #349034
4895
4896 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4897
4898         * statement.cs (Throw.CloneTo): it is valid to have empty
4899         expressions for throw. 
4900
4901 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4902
4903         * cs-parser.jay: Set delegate constraint parsing region correctly.
4904
4905 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4906
4907         A fix for bug #345467
4908         * typemanager.cs (IsEqual): Compare generic parameters position only.
4909         
4910 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4911
4912         * expression.cs (BaseAccess): Type arguments can be null.
4913
4914 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4915
4916         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4917         consistent even when an error has occured.
4918         (Switch.Resolve): Likewise.
4919
4920 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4921
4922         A fix for bug #334505
4923         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4924         overrides.
4925         
4926 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4927
4928         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4929         refactorings required to resolve extension methods correctly when mixing
4930         generics and non-generics members.
4931         
4932 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4933
4934         A fix for bug #342584
4935         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4936         conversion.
4937         
4938 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4939
4940         A fix for bug #342512
4941         * delegate.cs: Use delegate argument expression when is available. Don't
4942         emit virtual call when class is sealed.
4943         
4944 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4945
4946         A fix for bug #325423
4947         * assign.cs (FieldInitializer): Use resolved expression for emit.
4948         
4949         * class.cs: Print less confusing error message.
4950         
4951 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4952
4953         * cs-tokenizer.cs: Removed GMCS ifdefs.
4954         
4955         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4956         mcs.
4957         
4958         * cs-parser.jay: Disabled nullable check.
4959         
4960         * generic-mcs: Copied more generic stuff.
4961                 
4962 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4963
4964         * gcs-parser.jay: Merged to cs-parser.jay.
4965         
4966         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4967         * *.csproj, *.sources: Updated to use only jay parser file.
4968
4969 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4970
4971         * gcs-parser.jay: Added nullable and default expression feature checks.
4972         
4973 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4974
4975         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4976         it fixes many TODOs and hidden bugs.
4977         
4978         * expression: Removed duplicate error check.
4979
4980 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4981
4982         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4983         implicitly type local variable only when it is used in a declaration.
4984
4985 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4986
4987         * attribute.cs: Use CS0612 for empty strings.
4988
4989 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4990
4991         * lambda.cs, statement.cs: Contextual return may act as a statement.
4992
4993 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4994
4995         A fix for a regression cause by #324222
4996         * class.cs: Don't report unused even when it implements an interface.
4997         
4998 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4999
5000         A fix for bug #341205
5001         * ecore.cs, expression.cs: Method group expression cannot do static
5002         method access with an instance reference check before overloading takes
5003         a place.
5004         
5005 2007-11-13  Marek Safar  <marek.safar@gmail.com>
5006
5007         A fix for bug #325359
5008         * class.cs: Use predictable name for automatically generated property.
5009         
5010 2007-11-12  Marek Safar  <marek.safar@gmail.com>
5011
5012         A fix for bug #324996
5013         * expression.cs (Is): Handle case where D is nullable and T is not
5014         correctly.
5015         
5016         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
5017         
5018 2007-11-12  Marek Safar  <marek.safar@gmail.com>
5019
5020         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
5021         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
5022         Flush small error reporting changes.
5023         
5024 2007-11-09  Marek Safar  <marek.safar@gmail.com>
5025
5026         A fix for bug #324996
5027         * expression.cs: Rewrote Is expression implementation to work with
5028         generics, nullable types, anonymous method. A const result expression 
5029         uses existing infrastructure instead of custom not fully-featured one.
5030         
5031 2007-11-08  Marek Safar  <marek.safar@gmail.com>
5032
5033         A fix for bug #340202
5034         * class.cs: Consider generics for volatile field.
5035
5036 2007-11-08  Marek Safar  <marek.safar@gmail.com>
5037
5038         A fix for bug #335594
5039         * expression.cs: Use conversion rules when handling string addition.
5040         
5041 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5042
5043         A fix for bug #336651
5044         * expression.cs: Fixed a crash when probing is on.
5045         
5046 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5047
5048         A fix for bug #324242
5049         * covert.cs: Added a conversion from any nullable-type with an 
5050         underlying enum-type to the type System.Enum.
5051         
5052 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5053
5054         A fix for bug #324222
5055         * class.cs: Report all non-used event fields.
5056         
5057 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5058
5059         A fix for bug #325161
5060         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
5061         qualifier for generic types.
5062         
5063 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5064
5065         A fix for bug #322971
5066         * expression.cs, ecore.cs: Added intermediate result value check for
5067         indexers. 
5068         
5069 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5070
5071         A fix for bug #324754
5072         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
5073         when it was requested.
5074
5075 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5076
5077         A fix for bug #325101
5078         * expression.cs: Do type not value comparison for `is' expression.
5079
5080 2007-11-07  Marek Safar  <marek.safar@gmail.com>
5081
5082         A fix for bug #320236
5083         * convert.cs: Don't apply user conversion on underlying target type.
5084
5085 2007-11-06  Marek Safar  <marek.safar@gmail.com>
5086
5087         * expression.cs: Don't use unresolved expression for error reporting.
5088  
5089 2007-11-06  Marek Safar  <marek.safar@gmail.com>
5090
5091         A fix for bugs #337712, #324490
5092         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
5093         overloading resolution too.
5094         
5095         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
5096         the process consistent and more robust.
5097         
5098         * expression.cs, linq.cs, report.cs: Update.
5099
5100 2007-11-02  Marek Safar  <marek.safar@gmail.com>
5101
5102         A fix for bug #332909
5103         * attribute.cs: Resolve attributes in correct context using error
5104         handling procedure.
5105         
5106         * rootcontext.cs: Define Obsolete attribute members as core members.
5107         
5108 2007-11-02  Marek Safar  <marek.safar@gmail.com>
5109
5110         * statement.cs: Removed unused methods.
5111         
5112 2007-10-31  Wade Berrier  <wberrier@novell.com>
5113
5114         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
5115         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
5116         during 'make dist')
5117
5118 2007-10-31  Marek Safar  <marek.safar@gmail.com>
5119
5120         A fix for bug #338102
5121         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
5122         methods registered as non-generics.
5123         
5124 2007-10-31  Marek Safar  <marek.safar@gmail.com>
5125
5126         A fix for bugs #337712, #324490
5127         * delegate.cs: Delegate covariance and contravariance is not allowed for
5128         value types.
5129         
5130 2007-10-31  Marek Safar  <marek.safar@gmail.com>
5131
5132         A fix for bug #337719 
5133         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
5134         `from' keyword.
5135         
5136 2007-10-30  Marek Safar  <marek.safar@gmail.com>
5137  
5138         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
5139
5140 2007-10-29  Marek Safar  <marek.safar@gmail.com>
5141  
5142         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
5143         query expressions.
5144
5145 2007-10-29  Raja R Harinath  <rharinath@novell.com>
5146
5147         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
5148
5149 2007-10-29  Marek Safar  <marek.safar@gmail.com>
5150  
5151         A fix for bug #334652
5152         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
5153         extension methods when we have not found the best candidate in normal
5154         container.
5155
5156 2007-10-27  Marek Safar  <marek.safar@gmail.com>
5157
5158         * AssemblyInfo.cs: Keep up-to-date.
5159
5160 2007-10-27  Marek Safar  <marek.safar@gmail.com>
5161
5162         * Makefile: Fixed generics compiler name.
5163         
5164 2007-10-27  Marek Safar  <marek.safar@gmail.com>
5165
5166         * lambda.test: removed, lambda parsing is done differently.
5167         
5168         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
5169
5170 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
5171
5172         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
5173
5174 2007-10-27  Marek Safar  <marek.safar@gmail.com>
5175
5176         * Makefile, *.sources : All C# compilers are in mcs folder.
5177         
5178         * *.cs: Use existing 2_1 define for smcs.
5179
5180 2007-10-26  Marek Safar  <marek.safar@gmail.com>
5181
5182         A fix for bug #335847
5183         * assign.cs, expression.cs: Couple of changes to avoid creating a
5184         temporary variable for each object initializer assignment statement. It
5185         simplifies struct initialization too, otherwise two temporary variables
5186         would be required.
5187         Implemented optimization of redundant default element initializers.
5188         
5189 2007-10-25  Marek Safar  <marek.safar@gmail.com>
5190
5191         A fix for bug #336766
5192         * expression.cs (Class.CheckBase): Use generic name when method is
5193         generic.
5194         
5195 2007-10-25  Marek Safar  <marek.safar@gmail.com>
5196
5197         A fix for bug #334737
5198         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
5199         variable and not variable argument for prepared copies.
5200
5201 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5202
5203         A fix for bug #325110
5204         * class.cs, expression.cs, attribute.cs: Use open generic method when
5205         checking conditional attribute.
5206         
5207 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5208
5209         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
5210         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
5211         FeatureIsNotAvailable.
5212
5213 2007-10-24  Marek Safar  <marek.safar@gmail.com>
5214
5215         ** C# 3.0 Partial methods
5216         
5217         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
5218         methods support. Because of member cache issue with generics only
5219         non-generics partial methods are fully supported.
5220         
5221 2007-10-23  Marek Safar  <marek.safar@gmail.com>
5222         
5223         * class.cs, decl.cs: Rewrote member overloads check to cope with 
5224         generics and to use member cache for member checking. It also improves
5225         performance and fixes remaining overloads issues.
5226         
5227 2007-10-20  Marek Safar  <marek.safar@gmail.com>
5228         
5229         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
5230         roottypes.cs, typemanager.cs:
5231                 
5232         A member cache creation logic changed to add members immediately and
5233         not rely on fallback. The member cache is now only prefered way
5234         how to access and find type declaration members. It saves 5 MB of memory
5235         during MWF compilation and makes code ready for more optimizations and
5236         clean-ups, it's also a pre-requirement for partial methods.
5237         
5238 2007-10-18  Raja R Harinath  <harinath@gmail.com>
5239
5240         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
5241         handling for generic parameters.
5242
5243 2007-10-15  Marek Safar  <marek.safar@gmail.com>
5244         
5245         * class.cs (FixedField): Removed redundant volatile check.
5246         
5247 2007-10-15  Marek Safar  <marek.safar@gmail.com>
5248         
5249         * class.cs, decl.cs: Fixed overload members verification to do only one
5250         check per possible collision.
5251         
5252 2007-10-13  Marek Safar  <marek.safar@gmail.com>
5253         
5254         A fix for bug #325478
5255         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
5256         and create only one disposable flags container.
5257         
5258 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5259         
5260         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
5261         * statement.cs (Fixed): Fixed variables cloning.
5262         
5263 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5264         
5265         A fix for bug #333342
5266         * class.cs (EventField): Don't mark value type event as synchronized. 
5267         
5268 2007-10-12  Marek Safar  <marek.safar@gmail.com>
5269         
5270         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
5271         inference to identify best candidate method correctly.
5272         (ProperyExpr): A range variable is read only and cannot be modified.
5273         
5274 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5275         
5276         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
5277         logic to identify best candidate method correctly.
5278         
5279 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5280         
5281         * location.cs (Equals, GetHashCode): Removed.
5282         
5283 2007-10-11  Marek Safar  <marek.safar@gmail.com>
5284         
5285         * report.cs: Implemented message recorder. It is used mainly for lambda
5286         expressions to capture otherwise swallowed error messages.
5287         
5288         * anonymous.cs, lambda.cs.cs: Do full parameters check.
5289
5290         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
5291         and not at the top.
5292         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
5293                 
5294         * expression.cs (MemberAccess): Always report lookup failure.
5295         
5296         * location.cs: Implemented Equals, GetHashCode.
5297         
5298         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
5299         
5300 2007-10-10  Jb Evain  <jbevain@novell.com>
5301
5302         * codegen.cs: re-enable assembly version check.
5303
5304 2007-10-09  Marek Safar  <marek.safar@gmail.com>
5305         
5306         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5307         checks.
5308         
5309         * namespace.cs (UsingAlias): Do correct version check.
5310         
5311 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5312         
5313         * expresison.cs, ecore.cs: Issue extension method error message when
5314         appropriate.
5315         
5316         * rootcontext.cs: Added ISO_2 compiler mode option.
5317
5318 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5319         
5320         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5321          message.
5322         
5323 2007-10-08  Marek Safar  <marek.safar@gmail.com>
5324         
5325         * attribute.cs (GetString, GetBoolean): Work with both literal and
5326         constant.
5327         
5328         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5329         Moved method overload specific methods to MethodGroupExpr.
5330         
5331         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5332         it should be less memory consuming.
5333         
5334 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5335
5336         * codegen.cs: remove the assembly version check until the buildbot is
5337         fixed.
5338
5339 2007-10-07  Jb Evain  <jbevain@novell.com>
5340
5341         * attribute.cs (Attribute.GetString): if the value
5342         expression is a StringConstant, return its string value.
5343
5344 2007-10-07  Jb Evain  <jbevain@novell.com>
5345
5346         * typemanager.cs: add `assembly_version_attribute_type`.
5347         * codegen.cs: on attribute emission, check that the
5348         AssemblyVersionAttribute doesn't overflow.
5349
5350 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5351         
5352         A fix for bug #324677
5353         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5354         parent container of a scope container with currently resolved one. 
5355         
5356 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5357         
5358         A fix for bug #325534
5359         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5360         only.
5361         
5362 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5363         
5364         A fix for bug #327504
5365         * class.cs (Operator.Define): Refactored implicit and explicit user
5366         operator conversion rules.
5367         
5368 2007-10-05  Marek Safar  <marek.safar@gmail.com>
5369         
5370         A fix for bug #327520
5371         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5372         
5373 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5374         
5375         A fix for bug #328022
5376         * class.cs (MethodData.Define): Use correct method to check whether
5377         a method implementents an accessor.
5378         
5379 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5380         
5381         A fix for bug #330069
5382         * statement.cs (Fixed.Resolve): Read the first array element only when
5383         an array is instantiated. 
5384         
5385 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5386         
5387         * expression.cs, assign.cs, generics.cs: Print correct operator when
5388         compound assignment is used.
5389         
5390 2007-10-04  Marek Safar  <marek.safar@gmail.com>
5391         
5392         A fix for bug #325841
5393         * expression.cs (ArrayAccess): Use full argument cloning only for
5394         string compound concatenation.
5395         
5396 2007-10-03  Marek Safar  <marek.safar@gmail.com>
5397         
5398         A fix for bug #328774
5399         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5400         assignment.
5401         (PropertyExpr.EmitAssign): Fixed string concatenation compound
5402         assignment.
5403
5404 2007-10-03  Raja R Harinath  <rharinath@novell.com>
5405
5406         Fix #328490
5407         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5408         Event accessibility checks here.  Remove some bogus code that
5409         accidently made GenericMethods work.
5410         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5411
5412 2007-09-25  Marek Safar  <marek.safar@gmail.com>
5413         
5414         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5415         
5416         * statement.cs (Block): Refactored AddVariable to allow error handling
5417         customization.
5418         
5419         * generic.cs: New stub.
5420         
5421 2007-09-23  Marek Safar  <marek.safar@gmail.com>
5422         
5423         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5424         flag.
5425         
5426 2007-09-17  Marek Safar  <marek.safar@gmail.com>
5427
5428         * class.cs: Use partial container to record whether any partial part
5429         contains static field initializer and therefore default contructor has
5430         to be defined.
5431         
5432 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5433
5434         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5435         mono-list when only one of two partial parts has defined accessibility
5436         modifier.
5437         
5438 2007-09-14  Marek Safar  <marek.safar@gmail.com>
5439
5440         A fix for bug #82845
5441         
5442         * class.cs (TypeContainer): Set correct resolve context for all field
5443         initializers.
5444         
5445 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5446
5447         * assign.cs: Fixed a crash when field is resolved twice with an error.
5448         
5449         * codegen.cs: Changed InFieldInitializer to be flag.
5450         
5451         * anonymous.cs, ecore.cs, expression.cs: Update after
5452         IsInFieldInitializer rename.
5453         
5454         * const.cs: Removed unused parameter.
5455         
5456         * class.cs: Changed the way how we resolve and emit field initializers.
5457         The field initilizers have to have access to contructor block to emit
5458         compiler generated code.
5459
5460 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5461
5462         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5463         generics use TypeContainer instead.
5464         
5465 2007-09-12  Marek Safar  <marek.safar@gmail.com>
5466         
5467         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5468
5469         * lambda.cs (ResolveParameters): Use more powerful
5470         InflateGenericArgument.
5471         
5472         * parameters.cs: Better exception message.
5473                 
5474 2007-09-10  Marek Safar  <marek.safar@gmail.com>
5475
5476         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5477         correct expression block type. 
5478         
5479         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5480         
5481         * expression.cs (Invocation): Extracted method group resolve to
5482         DoResolveOverload.
5483         
5484 2007-09-07  Marek Safar  <marek.safar@gmail.com>
5485
5486         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5487         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5488         
5489         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5490         generic extension methods.
5491
5492 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5493
5494         A fix for bug #82676 (Do I get it right now?)
5495         * convert.cs (Binary.ResolveOperator): An interface is converted to the
5496         object before a standard conversion is applied.
5497         
5498 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5499
5500         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5501         #82676.
5502         
5503 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5504
5505         A fix for bug #82676
5506         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5507         non-generic interface types.
5508         
5509 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5510
5511         A fix for bug #82690
5512         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5513         
5514 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5515
5516         A fix for bug #82571
5517         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
5518         modifier for container based methods.
5519         
5520 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5521
5522         A fix for bug #82676
5523         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5524         any interface-type T means to any of interface type T.
5525
5526 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5527
5528         * namespace.cs: We have 2 versions of System.Core assembly.
5529
5530 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5531
5532         A fix for bug #82652
5533         * class.cs (Class.GetClassBases): Compare types and not expressions.
5534
5535 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5536
5537         A fix for bug #82620
5538         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5539         actually never worked before.
5540         (IndexerAccess): Emit prepared arguments before they are modified.
5541         
5542 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5543
5544         A fix for bug #82563
5545         * assign.cs: Revert wrong fix.
5546         
5547         * expression.cs (VariableReference.EmitAssign): Handle ref reference
5548         correctly.
5549         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5550         Instead of ldelema/stdind we have to use temporary variables to handle
5551         cases like String.Concat (params string[]).
5552         
5553 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5554
5555         * class.cs: EmitAttributes to Emit rename.
5556         
5557         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5558         null.
5559         (MemberCore.HasClsCompliantAttribute): Don't depend on 
5560         GetClsCompliantAttributeValue execution.
5561         
5562 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5563
5564         * anonymous.cs: Use shorter type prefix.
5565         
5566         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5567         when exist.
5568         
5569         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5570         variables when probing is on.
5571         
5572         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
5573         unresolved variables.
5574         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5575         handle transparent identifiers.
5576         
5577 2007-08-26  Marek Safar  <marek.safar@gmail.com>
5578
5579         * attribute.cs (IsClsCompliant): Add nullable types test.
5580         
5581 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5582
5583         * doc.cs : catch other types of exception than XmlException to
5584           report CS1570. Fixed bug #82565.
5585
5586 2007-08-23  Marek Safar  <marek.safar@gmail.com>
5587
5588         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
5589         The number of delegate parameters has to match.
5590         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5591         arrays.
5592
5593 2007-08-21  Marek Safar  <marek.safar@gmail.com>
5594
5595         * anonymous.cs (AnonymousMethod): Generate private anonymous method
5596         to fix problem with private arguments.
5597
5598 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5599
5600         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5601         
5602         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
5603         
5604         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5605         empty. Add cloning suport.
5606         
5607         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5608
5609 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5610
5611         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
5612         to create EmptyCast. It handles EmptyConstantCast specialization for
5613         constants.
5614         
5615 2007-08-18  Marek Safar  <marek.safar@gmail.com>
5616
5617         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5618         (EmitArrayArgument): One routine for array arguments.
5619         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
5620         
5621 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5622
5623         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5624
5625 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5626
5627         * anonymous.cs: MemberLookupFinal update.
5628
5629         * class.cs (ConstructorInitializer): Is expression based.
5630         
5631         * delegate.cs: MethodGroupExpr update.
5632         
5633         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
5634         messages.
5635         (Error_MemberLookupFailed): Customizable error override.
5636         (MethodGroupExpr): Keep queried type for later usage.
5637         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5638         resolve.
5639         
5640         * expression.cs: Error_MemberLookupFailed refactoring.
5641         (New.DoResolve): Resolve as much as possible.
5642         (ElementInitializer.Error_MemberLookupFailed): Object initializer
5643         customization for invalid member types.
5644
5645         * statement.cs: MethodGroupExpr update.
5646         
5647 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5648
5649         * modifier.cs (Check): Check all modifiers and not only accessibility
5650         ones.
5651
5652 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5653
5654         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5655         type and not an expression.
5656
5657 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5658
5659         * statement.cs (Catch.Clone): Type and variable can be null.
5660
5661 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5662
5663         A fix for bug #81979
5664         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5665         I am really not sure whether this is the best fix.
5666         
5667         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5668         only once.
5669         
5670 2007-08-14  Marek Safar  <marek.safar@gmail.com>
5671
5672         ** C# 3.0 Object and collection initializers (major re-write)
5673         
5674         * assign.cs (DoResolve): Initializers are not assign related.
5675         
5676         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5677         used during collection or object initialization.
5678         
5679         * expression.cs (Error_InvalidArguments): Add initializers specific
5680         messages. More will come later because it requires some general
5681         refactoring.
5682         (New.DoResolve): Better error handling for unsafe types.
5683         (EmptyExpressionStatement): New class.
5684         (ElementInitializer): An object initializer expression.
5685         (CollectionElementInitializer): A collection initializer expression.
5686         (CollectionOrObjectInitializers): A block of object or collection
5687         initializers.
5688         (NewInitialize): New expression with element/object initializers.
5689         
5690         * statement.cs: Reverted object/collection initializer hacks.
5691         
5692         * typemanager.cs (CSharpName): Filter __arglist type.
5693         
5694 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5695
5696         ** C# 3.0 Anonymous Types (update to the latest standard)
5697         
5698         * expression.cs (Binary.ResolveOperator): Threat all null based types
5699         same.
5700         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5701         (AnonymousTypeParameter): Updated.
5702         
5703         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5704         (AnonymousTypeClass): New anonymous type container.
5705         
5706         * class.cs (AddField): Return operation result.
5707         
5708         * generic.cs: Another empty TypeArguments overload.
5709         
5710         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5711         are stored at top of normal hierarchy.
5712         
5713         * typemanager.cs (CSharpName): Filter anonymous types.
5714         
5715 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5716
5717         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5718         as single Concat call. How could we miss that :-(
5719         
5720 2007-08-08  Marek Safar  <marek.safar@gmail.com>
5721
5722         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5723         
5724 2007-08-07  Miguel de Icaza  <miguel@novell.com>
5725
5726         * expression.cs: Fix the previous commit, the creation of the
5727         arguments array list needs also to be conditional on the arguments
5728         not being null.
5729
5730         * class.cs: Add a little bit of help to help narrow down problems.
5731
5732         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5733         not try to copy in that case. 
5734
5735         * driver.cs: When building SMCS, include a new different set of
5736         default assemblies here.   Do this here so we can control whether
5737         to include the default assemblies with /noconfig.
5738
5739 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5740
5741         A fix for bug #81979
5742         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5743         only.
5744
5745 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5746
5747         A fix for bug #82300
5748
5749         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5750         we are in probing scope.
5751
5752 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5753
5754         A fix for bug #82301
5755
5756         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5757         (Statement.CloneTo): Clone and not map children blocks.
5758
5759 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5760
5761         A fix for bug #82299
5762
5763         * expression.cs (LocalVariableReference.CloneTo): Remap local info
5764         variable too.
5765         
5766         * statement.cs (Statement.CloneTo): Clone variables before statements
5767         to allow remaping of local variables.
5768
5769 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5770
5771         A fix for bug #82296
5772
5773         * anonymous.cs,
5774         * report.cs: Log crash details for future clone problems.
5775         
5776         * statement.cs (Return.Clone): Don't clone non-existent expression.
5777
5778 2007-08-03  Raja R Harinath  <harinath@gmail.com>
5779
5780         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5781         (Class.AddBasesForPart): Move CS0537 check here from ...
5782         * cs-parser.jay (class_declaration): ... here.  Move calling of
5783         'AddBasesForPart' to ...
5784         (class_bases): ... here.
5785         (struct_declaration, interface_declaration): Update to changes.
5786
5787 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5788
5789         A fix for bug #81923
5790
5791         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5792         conversion is allowed.
5793
5794 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5795
5796         A fix for bug #81564
5797
5798         * ecore.cs (EventExpr): Add IsBase handling.
5799
5800         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5801         too.    
5802         
5803 2007-08-02  Raja R Harinath  <harinath@gmail.com>
5804
5805         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5806         * cs-parser.jay: Some whitespace cleanups.
5807         (current_delegate): New.
5808         (type_name): New.
5809         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5810         a dummy code block, and use 'type_name' instead of 'member_name'.
5811         (interface_declaration, class_declaration): Likewise.
5812         (delegate_declaration): Likewise.  Rearrange slightly and use
5813         'current_delegate'.
5814         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5815         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
5816
5817 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5818
5819         A fix for bug #82039
5820
5821         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5822         available.
5823
5824         * typemanager.cs (CSharpName): Split to string overload.
5825
5826 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5827
5828         * expression.cs,
5829         * report.cs: Updated warning CS0472.
5830
5831 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5832
5833         A fix for bug #82181
5834         * cs-parser.jay,
5835         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5836
5837 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5838
5839         A fix for bug #82277
5840         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5841
5842 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5843
5844         ** C# 3.0 Type Inference (major bits are working)
5845         
5846         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5847         (.ImplicitStandardConversionExists): Uses compatible.
5848         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5849         (.InferReturnType): New method.
5850         (.Compatible): Refactored.
5851         (.ResolveParameters): Uses factory to create resolved parameters.
5852         (.CompatibleMethod): Add probing mode support.
5853         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5854         clearly distinguish between 2 different operations.
5855         (LambdaMethod): Moved to lambda.cs.
5856         (AnonymousMethod): Removed unused fields and methods.
5857         (AnonymousDelegate): Simplified.
5858         
5859         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5860         
5861         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5862         
5863         * delegate.cs (Delegate): New mehods to reduce code duplication.
5864         (.GetConstructor): New method.
5865         (.GetInvokeMethod): New method.
5866         (DelegateCreation): Updated.
5867         
5868         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5869         does not exist.
5870         (OverloadResolve): Made probing little bit faster.
5871         
5872         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5873         when probing is on.
5874         
5875         * generic.cs (TypeInferenceContext): Dummy implementation.
5876         
5877         * iterators.cs: Updated after Resolve/Define rename.
5878         
5879         * lambda.cs (LambdaExpression)
5880         (.ResolveParameters): Handles both type of arguments and type inference too.
5881         
5882         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5883         (InflateTypes): Updated.
5884         
5885         * support.cs (InflateTypes): Changed signature and updated.
5886         
5887         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5888         (MemberLookup_FindMembers): More MS tricks.
5889         (GetParameterData): Ditto.
5890         (GetDelegateParameters): Uses quick path for dynamic types.
5891         
5892 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5893
5894         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5895         only.
5896
5897 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5898
5899         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5900         syntax.
5901         
5902 2007-07-26  Jb Evain  <jbevain@novell.com>
5903
5904         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5905         which takes a boolean 'report_errors', similar to the GetMethod.
5906         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5907         in .net 2.1, do not report errors here.
5908
5909         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5910         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5911         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5912         in .net 2.1.
5913
5914         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5915         of the type InternalsVisibleToAttribute before the first call
5916         to CoreLookupType which is allowed to fail (third boolean parameter
5917         to true). Because, during the resolution for a type that is not
5918         immediately found, we try to check if the type is not defined in
5919         a friend assembly, and to do so, we need the
5920         InternalVisibleToAttribute.
5921
5922 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5923
5924         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5925         feature that allows structs to be compared against null and inline
5926         the result as true or false.
5927
5928         Notice that the same code is not permitted inside a generic block
5929         of code that would do:
5930
5931         class Foo<T> where T : struct {
5932             bool Eval (T x)
5933             {
5934                  return x == null;
5935             }
5936         }
5937
5938         It is only allowed if the type of T is not bound (no where
5939         clause).   In my opinion, this CSC 2 behavior is broken but people
5940         seem to be using it (IronRuby does, a few bug reports on bugzilla
5941         have it and some people have complained about it).
5942
5943         All of the users that depend on this behavior have code that is
5944         very likely broken. 
5945         
5946         * report.cs (Warning, Error): make these take object arguments,
5947         not strings, as that allows us to take advantage of Format.
5948
5949 2007-07-20  William Holmes  <billholmes54@gmail.com>
5950
5951         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5952           Left member variable for the Count.
5953         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5954           MemberName.CountTypeArguments to avoid a NRE. 
5955
5956         This code is contributed under the MIT X11 license
5957
5958 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5959
5960         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5961
5962 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5963
5964         * doc.cs : generic method arguments are written as ``x while generic
5965           type arguments are `x. Combined with the previous change, fixed bug
5966           #79706.
5967
5968 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5969
5970         Fix #82120
5971         * expression.cs (Binary.ResolveOperator): When converting
5972         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5973
5974 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5975
5976         * doc.cs : when T: or whatever x: is specified, it does not really
5977           check the doc comment's syntax correctness. Fixed bug #82006.
5978
5979 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5980
5981         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5982         LambdaExpression better.
5983         
5984         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5985         
5986         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5987         
5988         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5989         as it can be generated.
5990         
5991         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5992         modifiers.
5993         
5994         * lambda.cs (LambdaExpression): Refactored to share same code with
5995         AnonymousMethodExpression.
5996         
5997 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5998
5999         * anonymous.cs (MakeName): Include host name for easier debugging.
6000         (LambdaMethod): New class for lambda spcecific stuff.
6001         
6002         * attribute.cs: Set EmitContext return type.
6003
6004         * class.cs: Set EmitContext return type.
6005         
6006         * codegen.cs (EmitContext): Return type cannot be null to stop messing
6007         with null/void meaning.
6008         
6009         * iterators.cs (ContainerType): Implemented.
6010         
6011         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
6012         
6013         * statement.cs (Return): Updated to lambda expressions.
6014         (Block.CloneTo): Parent can be null.
6015                 
6016 2007-07-13  Marek Safar  <marek.safar@gmail.com>
6017
6018         A fix for bug #81917
6019         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
6020         
6021         * class.cs (FixedField): Check whether field is in unsafe scope.
6022
6023         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
6024         (FieldExpr.Emit): Fixed buffers cannot be volatile.
6025
6026         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
6027         FieldExpr.
6028         
6029         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
6030                 
6031 2007-07-13  Marek Safar  <marek.safar@gmail.com>
6032
6033         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
6034         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
6035         from Report class.
6036
6037 2007-07-13  Marek Safar  <marek.safar@gmail.com>
6038
6039         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
6040         
6041 2007-07-13  Marek Safar  <marek.safar@gmail.com>
6042
6043         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
6044         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
6045         
6046         * codegen.cs(EmitContext): Add ProbingMode flag.
6047         
6048         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
6049         
6050         * driver.cs: For now set both warning values.
6051         
6052         * ecore.cs (SimpleName): Name is readonly.
6053         (MethodGroup.OverloadResolve): One quick path for probing.
6054         
6055         * expression.cs (Unary): Set Oper r/o.
6056         (Binary): Set Oper r/o.
6057         (ParameterReference): Set few instance variables as r/o.
6058         (ParameterReference.DoResolveBase): Don't capture aruments when 
6059         the probing is on.
6060         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
6061         (Arglist): arguments are private.
6062         (SizeOf): type is private and r/o.
6063         (MemberAccess): arguments are private.
6064
6065         * report.cs: Enhanced reporting on/off capabilities.
6066         
6067         * lambda.cs: Uses ec.IsInProbingMode.
6068         (ContextualReturn): Derives from return.
6069         
6070         * rootcontext.cs: For now set both warning values.
6071         
6072         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
6073         copy if one exists.
6074         (Return.Resolve): Don't die immediately.
6075         (Block.Resolve): Speed-up probing.
6076         (Block.CloneTo): Clone only child blocks.
6077
6078 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
6079
6080         * iterators.cs: reverted Miguel's latest change (r81925) as it
6081         breaks the build in System.
6082
6083 2007-07-13  Miguel de Icaza  <miguel@novell.com>
6084
6085         * iterators.cs (Yield.CheckContext): Check for the iterator type
6086         also here as we can call into Yield even in codepaths that are not
6087         directly checked by
6088         (MethodOrOperator is the only path that was checked).
6089
6090         In addition to the standard check, use a more specific check for
6091         constructors to report a more verbose error. 
6092
6093 2007-07-12  Miguel de Icaza  <miguel@novell.com>
6094
6095         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
6096         report the warning and continue 
6097
6098         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
6099         values on the stack on the call to Emit.   Use EmitStatement if
6100         possible, or using Emit + Pop if not possible.   Fixes #82064
6101
6102 2007-07-12  Raja R Harinath  <rharinath@novell.com>
6103
6104         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
6105         avoid try...finally in some cases.
6106
6107 2007-07-10  Marek Safar  <marek.safar@gmail.com>
6108
6109         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
6110         
6111         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
6112         instead of method. Re-use standard error handling.
6113         (ConstructorInitializer.Emit): Simplified.
6114         
6115         * delegate.cs: Updated after Invocation.EmitCall change.
6116         
6117         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
6118         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
6119         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
6120         method and don't permanently changing input arguments.
6121         (MethodGroupExpr): Introduced resolved best_candidate, when method group
6122         is resolved it has one of the candidates is the best one which is later
6123         used to emit. Removed a few unused method.
6124         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
6125
6126         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
6127         (Binary.ResolveOperator): Ditto.
6128         (ConditionalLogicalOperator.DoResolve): Ditto.
6129         (Invocation): Uses method group.
6130         (Invocation.DoResolve): Simplified.
6131         (Invocation.EmitCall): Removed useless is_static.
6132         (Invocation.Emit): Delegate to method group.
6133         (Invocation.EmitStatement): Simplified.
6134         (New): Uses method group.
6135         (MemberAccess.DoResolve): Don't destroy original expression.
6136         
6137         * statement.cs (ForEach.Resolve): Use null for no method arguments.
6138         
6139 2007-07-04  Marek Safar  <marek.safar@gmail.com>
6140
6141         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
6142         
6143         * anonymous.cs,
6144         * lambda.cs: Add custom error message type.
6145
6146 2007-07-03  Marek Safar  <marek.safar@gmail.com>
6147
6148         * lambda.cs: Simplified little bit.
6149         
6150         * parameter.cs: Introduced ImplicitLambdaParameter.
6151         (Parameters.CreateFullyResolved): New factory instead of ctor.
6152         
6153         * anonymous.cs,
6154         * class.cs,
6155         * delegate.cs: Updated parameter creation.
6156         
6157 2007-07-03  Marek Safar  <marek.safar@gmail.com>
6158
6159         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
6160         arguments.
6161         
6162         * generic.cs: Synchronized with gmcs.
6163         
6164 2007-07-03  Marek Safar  <marek.safar@gmail.com>
6165
6166         * class.cs (Indexer): Check return type as soon as possible.
6167         
6168         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
6169         members too.
6170         
6171         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
6172         
6173         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
6174         
6175         * parameter.cs (Parameter): Use expression type when it is available.
6176         
6177         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
6178         method modifier for the first parameter only.
6179
6180 2007-06-24  Marek Safar  <marek.safar@gmail.com>
6181
6182         A fix for bug #81938
6183         * typemanager.cs (ChangeType): Fixed couple of char conversions.
6184         
6185         * constant.cs: Tide up an exception message.
6186
6187 2007-06-22  Marek Safar  <marek.safar@gmail.com>
6188
6189         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
6190         an uninitialized variable is used.
6191         
6192         * expression.cs (LocalVariableReference.DoResolve): Ditto.
6193
6194 2007-06-22  Marek Safar  <marek.safar@gmail.com>
6195
6196         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
6197         not found error handling.
6198
6199         * expression.cs (ArrayCreation): Removed redundant fields and little bit
6200         simplified.
6201         (ArrayCreation.ResolveArrayElement): To be ready to customization.
6202         (ArrayCreation.DoResolve): Simplified.
6203         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
6204         its own resolve process.
6205         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
6206
6207 2007-06-20  Marek Safar  <marek.safar@gmail.com>
6208
6209         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
6210         more error details.
6211         
6212 2007-06-20  Marek Safar  <marek.safar@gmail.com>
6213
6214         * cs-tokenizer.cs: Removed var related stuff.
6215         
6216         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
6217         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
6218         a type and a keyword at same time.
6219         
6220         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
6221         matches to "var".
6222         
6223         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
6224         implicitly typed arrays, more changes will follow.
6225         
6226         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
6227         
6228 2007-06-19  Marek Safar  <marek.safar@gmail.com>
6229
6230         * ecore.cs (VarExpr): Removed Handled field.
6231         
6232         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
6233         build-in assign functionality.
6234         (ForEach.Resolve): Removed all implicitly typed local variable code and
6235         simplified.
6236         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
6237         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
6238
6239 2007-06-18  Marek Safar  <marek.safar@gmail.com>
6240
6241         * assign.cs: Removed implicitly typed local variable check.
6242         
6243         * expression.cs (LocalVariableReference.DoResolve): Add check for self
6244         referencing implicitly typed local variable.
6245         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
6246         variable here.
6247         
6248         * statement.cs (Fixed): Removed unsupported implicitly typed local
6249         variable code.
6250
6251 2007-06-15  Marek Safar  <marek.safar@gmail.com>
6252
6253         * decl.cs (MemberName): Moved all Unbound stuff to parser.
6254
6255 2007-06-14  Marek Safar  <marek.safar@gmail.com>
6256
6257         A fix for bugs #81855 and #76274
6258         * attribute.cs (AttachTo): Always set owner for global attributes to
6259         prefined owner.
6260         
6261         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
6262         usefull too.
6263         
6264         * cs-parser.jay: Assembly and module attributes must precede all other
6265         elements except using clauses and extern alias declarations.
6266
6267 2007-06-13  Marek Safar  <marek.safar@gmail.com>
6268
6269         A fix for bug #81748
6270         * cs-tokenizer.cs,
6271         * expression.cs: More checks for non ISO-1 features.
6272
6273 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6274
6275         A fix for bug #81807
6276         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
6277         present inside switch statement and it is required by nullable check.
6278
6279 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6280
6281         A fix for bug #81840
6282         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
6283         when type matching fails.
6284         
6285         * namespace.cs: Tiny error message change.
6286
6287 2007-06-12  Marek Safar  <marek.safar@gmail.com>
6288
6289         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
6290         reporting. Added automatic property check.
6291         
6292         * class.cs: Updated after CheckAbstractAndExtern relocation.
6293         (AEventPropertyAccessor.GetSignatureForError): Customized.
6294         
6295 2007-06-11  Marek Safar  <marek.safar@gmail.com>
6296
6297         * class.cs (DefineBaseTypes): Base type can be undefined.
6298         
6299         * ecore.cs (TypeLookup): Minor refactoring.
6300         (DoResolveAsTypeStep): Removed redundant check.
6301
6302         * namespace.cs (Lookup): Removed redundant check.
6303                 
6304         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
6305         ResolveAsTypeTerminal step.
6306         (BootstrapCorlib_*): Simplified.
6307         (PopulateCoreType): Core types can be now external.
6308
6309 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6310
6311         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6312          verification only.
6313          (InferTypeArguments): Infers anonymous expression type arguments.
6314          (Compatible): Split to Compatible and InferTypeArguments. 
6315         
6316         * lambda.cs: Updated.
6317
6318 2007-06-08  Marek Safar  <marek.safar@gmail.com>
6319
6320         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6321
6322 2007-06-07  Raja R Harinath  <harinath@gmail.com>
6323
6324         Fix #80477, cs0135-2.cs, cs0135-3.cs
6325         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6326         names to the "known" variables list.
6327         (Block.CheckInvariantMeaningInBlock): Handle the fact the
6328         parameter names are also "known".
6329         (Block.CheckError136): Remove.
6330         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
6331         null.
6332
6333 2007-06-07  Marek Safar  <marek.safar@gmail.com>
6334
6335         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6336
6337 2007-06-06  Marek Safar  <marek.safar@gmail.com>
6338
6339         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6340         internal error not an user error.
6341          
6342         * expression.cs (IsApplicable): Refactored to make debugging easier.
6343
6344         * support.cs: More tricks for non-mono runtimes.
6345         
6346         * typemanager.cs (CoreLookupType): Made public.
6347         (InitSystemCore): All linq specific stuff moved to linq.cs
6348
6349 2007-06-05  Marek Safar  <marek.safar@gmail.com>
6350
6351         * typemanager.cs (CSharpSignature): One more missing build-in types
6352         replacement.
6353         More tricks for non-mono runtime.
6354
6355 2007-06-05  Raja R Harinath  <harinath@gmail.com>
6356
6357         * statement.cs (Block.CheckError136_InParents): Remove.
6358         (Block.AddVariable): Use GetParameterInfo instead.
6359         (ToplevelBlock.ProcessArguments): Likewise.
6360
6361 2007-06-04  Raja R Harinath  <rharinath@novell.com>
6362
6363         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
6364         information too.
6365         (ToplevelBlock.GetParameterInfo): Split out of ...
6366         (ToplevelBlock.GetParameterRefernce): ... this.
6367         (ToplevelBlock.ParameterMap): Remove.
6368         * expression.cs (ParameterReference): Update to use
6369         ToplevelParameterInfo.
6370
6371         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6372         regression.
6373
6374         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6375         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6376
6377         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6378         (ToplevelBlock.ProcessParameters) ... here.
6379         (ToplevelBlock..ctor): Invoke it.
6380
6381         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6382         new parameters.
6383
6384         * statement.cs (IKnownVariable): New interface.
6385         (LocalInfo): Implement it.
6386         (ToplevelParameterInfo): New class.
6387         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6388         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
6389         GetKnownVariableInfo.
6390
6391 2007-06-03  Raja R Harinath  <harinath@gmail.com>
6392
6393         Partly speed up CS0136 error checks.
6394         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6395         'recurse' parameter.
6396         (Block.DoCheckError136): Only check errors in parameters.  Move
6397         local variable checks ...
6398         (Block.AddVariable): ... here, and ...
6399         (ToplevelBlock.ResolveMeta): ... here.
6400
6401 2007-06-02  Raja R Harinath  <harinath@gmail.com>
6402
6403         * statement.cs (Block.IsChildOf): Remove.
6404
6405         * statement.cs (Statement.Clone): Move special case code ...
6406         (Block.CloneTo): ... here.
6407
6408 2007-05-29  Raja R Harinath  <rharinath@novell.com>
6409
6410         * statement.cs (ToplevelBlock.container): Remove field.  It's
6411         redundant with 'Parent'.
6412         (ToplevelBlock.ContainerBlock): Remove accessor.
6413         (ToplevelBlock..ctor): Update to changes.  Register anonymous
6414         child with parent here, ...
6415         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
6416         current_block.
6417         (start_anonymous): Don't save current_block.
6418         (top_current_block): Remove.
6419
6420         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6421         (Block.Resolve): Update to changes.
6422         (Block..ctor): Move setting of "correct" 'Toplevel'
6423         and 'Explicit' fields to ...
6424         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6425
6426 2007-05-27  Raja R Harinath  <harinath@gmail.com>
6427
6428         Kill Block.Implicit
6429         * statement.cs (Block.Implicit): Remove.
6430         (Block): Update to changes.
6431         * flowanalysis.cs: Likewise.
6432
6433         Mildly speed up CheckInvariantMeaningInBlock
6434         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6435         Recursively call AddKnownVariable to all enclosing blocks.
6436         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6437         Remove recursive calls.
6438         (Block): Update to changes.
6439
6440         New ExplicitBlock invariants
6441         * statement.cs (Block.Explicit): New field.  It points to the
6442         immediately enclosing non-implicit block.
6443         (Block..ctor): Maintain the invariant.
6444         * cs-parser.jay: Take advantage of invariant.
6445
6446         Introduce ExplicitBlock
6447         * statement.cs (ExplicitBlock): New.
6448         (ToplevelBlock): Derive from it.
6449         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6450         sense of flag.
6451         (Block.Implicit): Update to changes.
6452         * cs-parser.jay: Update to changes.
6453
6454         Remove unused field
6455         * codegen.cs (EmitContext.IsLastStatement): Remove.
6456         * statement.cs (Block.DoEmit): Update to changes.
6457
6458 2007-05-25  Raja R Harinath  <rharinath@novell.com>
6459
6460         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6461         modifying current_block directly.
6462
6463 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
6464         
6465         * class.cs: Implemented automatic properties (C# 3.0)
6466           Thanks to Marek for the help.
6467
6468 2007-05-23  Raja R Harinath  <rharinath@novell.com>
6469
6470         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6471         variable as assigned, note also that all its components are
6472         assigned too.
6473         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
6474
6475 2007-05-19  Marek Safar  <marek.safar@gmail.com>
6476
6477         * anonymous.cs, class.cs: Emit Compiler generated attribute when
6478         member is marked as compiler generated.
6479         
6480         * decl.cs (MemberCore): Refactored ModFlags into property.
6481
6482         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6483         (Check): Check only accessibility modifiers.
6484
6485 2007-05-18  Raja R Harinath  <rharinath@novell.com>
6486
6487         Track all assignable slots in one bit array
6488         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6489         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
6490         logic from VariableMap constructor here.  Use the same 'offset'
6491         variable that's later used for computing offsets of local
6492         variables.
6493         * flowanalysis.cs (UsageVector.parameters): Remove.
6494         (UsageVector): Update to changes.
6495         (VariableMap): Remove.
6496
6497         Avoid creating ParameterMap in every block
6498         * statement.cs (Block.ParameterMap): Move ...
6499         (ToplevelBlock.ParameterMap): ... here.
6500         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6501         only once.
6502         * flowanalysis.cs (FlowBranching.param_map): Remove.
6503         (FlowBranching.UsageVector): Update to changes.
6504         (FlowBranchingToplevel.CheckOutParameters): Likewise.
6505
6506         * statement.cs (Block.CloneTo): Clone Toplevel field too.
6507
6508         * expression.cs (ParameterReference): Distinguish between block
6509         where parameter was referenced and declared.
6510
6511 2007-05-18  Marek Safar  <marek.safar@gmail.com>
6512
6513         * flowanalysis.cs, statement.cs: Put back improved error handling.
6514
6515 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
6516         
6517         * assign.cs:
6518         * expression.cs:
6519           Imporved object and collection initialization (C# 3.0).
6520
6521 2007-05-15  Marek Safar  <marek.safar@gmail.com>
6522
6523         A fix for bug #81380
6524         * expression.cs (Is.DoResolve): Only value types have constant `is'
6525         behaviour.
6526
6527 2007-05-15  Raja R Harinath  <rharinath@novell.com>
6528
6529         * statement.cs (ToplevelBlock.child): Remove.
6530
6531 2007-05-15  Raja R Harinath  <harinath@gmail.com>
6532
6533         Rationalize ResolveMeta: refactoring
6534         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
6535         out constant handling code into ...
6536         (Block.DoResolveConstants): ... this.
6537
6538         Rationalize ResolveMeta: kill local_map
6539         * statement.cs (Block.local_map, Block.LocalMap): Remove.
6540         (Block.AssignableSlots): New.
6541         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
6542         for locals -- move code from VariableMap here.  Avoid unnecessary
6543         allocations.
6544         * flowanalysis.cs (FlowBranching.local_map): Remove.
6545         (FlowBranching..ctor): Use Block.AssignableSlots.
6546         (VariableMap): Remove unused constructors.
6547
6548 2007-05-11  Raja R Harinath  <rharinath@novell.com>
6549
6550         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6551
6552 2007-05-11  Marek Safar  <marek.safar@gmail.com>
6553
6554         * typemanager.cs (IsFriendAssembly): Should not be called for building
6555         assembly.
6556
6557 2007-05-09  Marek Safar  <marek.safar@gmail.com>
6558
6559         * literal.cs (NullConstant): Print null in all cases.
6560         
6561         * expression.cs (Binary.ResolveOperator): Implemented delegate
6562          comparison based on C# 2.0 changes.
6563
6564 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
6565
6566         This code is contributed under the MIT X11 license
6567         
6568         The following enables support for several C# 3.0 language features:
6569         
6570         * cs-tokenizer.cs: Added support for the "var" keyword.
6571         
6572         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6573           Added VarExpr class to facilitate type inferencing.
6574         
6575         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6576           to support anonymous types.
6577         
6578         * assign.cs: Added support for type inferencing and initialization.
6579         
6580         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6581         
6582         * expression.cs: Added implicit array support to ArrayCreation.
6583           Added 5 types and 1 interface:
6584           
6585           IInitializable                Implementing classes can inject initializing
6586                                         statements after object instantiation.
6587           
6588           Initializer                   Stores data for object initialization.
6589           
6590           AnonymousType                 An expression for anonymous types.
6591           
6592           AnonymousTypeParameter        Stores data about an anonymous type's field.
6593           
6594           NewInitialize                 An expression for object initialization.
6595           
6596           CollectionInitialize          An expression for collection initialization.
6597         
6598         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6599           statements.
6600
6601 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6602
6603         A fix for bug #81500
6604         * cs-tokenizer.cs: Add special handling for coalescing operator.
6605
6606 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6607
6608         A fix for bug #81529
6609         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6610         its value from base class until it is redefined.
6611
6612 2007-05-02  Raja R Harinath  <rharinath@novell.com>
6613
6614         Fix regression in cs0631-3.cs
6615         * cs-parser.jay (operator_declarator): Add opt_attributes to error
6616         fallback.  Make error fallback catch more cases.
6617
6618 2007-05-01  Miguel de Icaza  <miguel@novell.com>
6619
6620         * cs-parser.jay: Allow parameters in operator declarations to have
6621         attributes. 
6622
6623 2007-04-27  Miguel de Icaza  <miguel@novell.com>
6624
6625         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6626         exists. 
6627
6628         * lambda.cs (ContextualReturn.Resolve): An expression is valid
6629         inside the ContextualReturn, it does not have to be an
6630         ExpressionStatement. 
6631
6632 2007-04-24  Miguel de Icaza  <miguel@novell.com>
6633
6634         * lambda.cs (ContextualReturn.Resolve): if the return type is not
6635         set, set it.
6636
6637 2007-04-23  Miguel de Icaza  <miguel@novell.com>
6638
6639         * anonymous.cs (AnonymousContainer): split the virtual Resolve
6640         method in two methods: ResolveNoDefine and Resolve.
6641
6642         ResolveNoDefine will stop just after ResolveTopBlock has been
6643         called.   
6644
6645         Resolve will then continue by creating a method and issuing the
6646         call to method.Define ().
6647
6648         (AnonymousMethod): Split and implement the new Resolve and
6649         ResolveNoDefine as well.
6650
6651         * lambda.cs (LambdaExpression): Split the anonymous method
6652         resolution code into a separate routine (CoreCompatibilityTest)
6653         from DoCompatibleTest.
6654
6655         (LambdaExpression.TryBuild): New method, this method tries to
6656         build the LambdaExpression with the given set of types to be used
6657         as the types for the various parameters of the lambda expression. 
6658
6659         If the compilation succeed with the given types, the infered type
6660         of the Anonymous method is returned, otherwise null is returned.
6661
6662 2007-04-23  Marek Safar  <marek.safar@gmail.com>
6663
6664         A fix for bug #81414
6665         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6666
6667 2007-04-22  Miguel de Icaza  <miguel@novell.com>
6668
6669         * cs-tokenizer.cs: Change various identifiers here from the
6670         camelCasing to the recommended Linux-like style for instance
6671         variables from the Coding Guidelines. 
6672
6673 2007-04-19  Martin Baulig  <martin@ximian.com>
6674
6675         * convert.cs
6676         (Convert.ImplicitReferenceConversionCore): Allow conversions from
6677         System.Enum to System.ValueType.
6678
6679 2007-04-13  Martin Baulig  <martin@ximian.com>
6680
6681         Rewrote implicit reference conversions.  We need to distinguish
6682         between implicit reference conversions (13.1.4) and implicit
6683         boxing conversions (13.1.5).
6684
6685         According to the spec, there's an an implicit conversion
6686         "From a one-dimensional array-type S[] to IList<T> and base
6687         interfaces of this interface, provided there is an implicit
6688         reference conversion from S to T."  Note that this does not
6689         include boxing conversions.
6690
6691         * convert.cs
6692         (Convert.ImplicitTypeParameterBoxingConversion): New method.
6693         (Convert.ImplicitReferenceConversion): Split into
6694         ImplicitReferenceConversionCore() and
6695         ImplicitBoxingConversionExist().
6696         (Convert.ImplicitReferenceConversionExists): Use the new
6697         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6698
6699 2007-04-12  Martin Baulig  <martin@ximian.com>
6700
6701         * convert.cs (Convert.ImplicitReferenceConversion): Move the
6702         `TypeManager.null_type' checks up to the top of the method.
6703
6704 2007-04-11  Marek Safar  <marek.safar@gmail.com>
6705
6706         A fix for bug #81350
6707         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6708         extension methods.
6709
6710 2007-04-11  Martin Baulig  <martin@ximian.com>
6711
6712         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6713         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6714         to make this work for generic classes; fixes #79561.
6715
6716 2007-04-11  Martin Baulig  <martin@ximian.com>
6717
6718         * expression.cs (As): Add support for nullable types; fixes #79371.
6719
6720 2007-04-11  Martin Baulig  <martin@ximian.com>
6721
6722         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6723         `type.FullName' is null; fixes #80243.
6724
6725 2007-04-11  Martin Baulig  <martin@ximian.com>
6726
6727         * expression.cs (Invocation.IsApplicable): Don't modify the method
6728         if type inference succeeded, but the method was not applicable.
6729         Fixes #81250.
6730
6731 2007-04-10  Marek Safar  <marek.safar@gmail.com>
6732
6733         A fix for bug #81324
6734         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6735         internal and external namespaces containers.
6736
6737 2007-04-10  Martin Baulig  <martin@ximian.com>
6738
6739         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6740         TypeManager.DropGenericMethodArguments() so we also call
6741         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
6742
6743 2007-04-10  Martin Baulig  <martin@ximian.com>
6744
6745         * iterators.cs (Iterator.CreateIterator): Don't crash if
6746         `method.ReturnType' is null.  This happens if something went wrong
6747         while resolving that typ (we already reported an error in this case).
6748
6749 2007-04-10  Martin Baulig  <martin@ximian.com>
6750
6751         * expression.cs (New.DoResolve): Don't call CheckComImport() on
6752         generic interfaces; report the CS0144 directly.
6753
6754 2007-04-10  Martin Baulig  <martin@ximian.com>
6755
6756         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6757         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6758
6759 2007-04-10  Martin Baulig  <martin@ximian.com>
6760
6761         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6762
6763 2007-04-09  Raja R Harinath  <rharinath@novell.com>
6764
6765         A better fix
6766         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6767         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6768
6769         Fix #81338
6770         * statement.cs (For.Resolve): If resolution fails, use
6771         KillFlowBranching.
6772
6773 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6774
6775         * anonymous.cs (MakeName): Make faster and zero-based.
6776         (VerifyExplicitParameterCompatibility): Back to mode where generic
6777         parameter is ignored.
6778         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6779
6780         * class.cs (EmitType): Method can emit another new method.
6781
6782         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6783
6784         * driver.cs: Updated.
6785
6786         * lambda.cs: Reuse predefined empty parameters.
6787
6788         * parameter.cs: Updated
6789
6790         * support.cs: Implemented InflateTypes.
6791
6792         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6793         (InitSystemCore): Introduced to isolate 3.0 dependencies.
6794
6795 2007-04-03  Martin Baulig  <martin@ximian.com>
6796
6797         Fix #80632.
6798
6799         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6800         version of TypeManager.IsOverride() which also works with generic
6801         types.  
6802
6803 2007-04-03  Martin Baulig  <martin@ximian.com>
6804
6805         Fix #81044.
6806
6807         * convert.cs
6808         (Convert.ExplicitReferenceConversion): We need to cast when
6809         converting from IList<T> to S[].
6810
6811 2007-04-01  Marek Safar  <marek.safar@gmail.com>
6812
6813         * decl.cs (FindExtensionMethods): Consider all candidates with same name
6814         at this level.
6815         
6816         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6817
6818 2007-03-31  Marek Safar  <marek.safar@gmail.com>
6819
6820         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6821         argument and return type inferring.
6822
6823         * codegen.cs (InferReturnType): Flag whether return can be inferred.
6824         (ReturnType): Turned to property.
6825
6826         * statement.cs (Return): Implemented return type inferring.
6827
6828         * support.cs (ReflectionParameters): Use local types if possible.
6829
6830 2007-03-30  Raja R Harinath  <rharinath@novell.com>
6831
6832         * flowanalysis.cs (FlowBranching.Reachability): Remove.
6833         (FlowBranching.UsageVector): Update to changes.
6834
6835         Prepare to kill 'Reachability'
6836         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6837         argument of constructor.
6838
6839 2007-03-29  Raja R Harinath  <rharinath@novell.com>
6840
6841         Prepare to kill 'Reachability'
6842         * flowanalysis.cs (UsageVector.is_unreachable): New.
6843         (UsageVector): Update to maintain 'is_unreachable' in parallel to
6844         'reachability', and verify they're consistent.
6845
6846         Fix #81121
6847         * expression.cs (New.EmitStatement): Handle type parameters here too.
6848
6849 2007-03-29  Martin Baulig  <martin@ximian.com>
6850
6851         Fix #79148.
6852
6853         * anonymous.cs
6854         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6855         CompilerGeneratedClass.
6856         (ScopeInfo.EmitScopeInstance): Make this protected.
6857         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6858         `ec.CurrentAnonymousMethod.Scope == Scope'.
6859
6860         * statement.cs (Block.ScopeInfo): Make this a property.
6861
6862 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6863
6864         Prepare to kill 'Reachability'
6865         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6866         (FlowBranching.UsageVector.Reachability): Remove property.
6867         (FlowBranching.UsageVector.IsUnreachable): New property.
6868         (FlowBranching.UsageVector.ResetBarrier): New.
6869         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6870         * codegen.cs, statement.cs: Update to changes.
6871
6872 2007-03-27  Martin Baulig  <martin@ximian.com>
6873
6874         Fix #81209.
6875
6876         * decl.cs
6877         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6878         generic types.
6879
6880 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6881
6882         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6883         instead of TriState.  Remove all mention of TriState.
6884
6885         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6886         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6887         and maintain invariants.
6888
6889 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6890
6891         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6892
6893 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6894
6895         * expression.cs: Stop using obsolete 2.0 opcodes.
6896
6897 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6898
6899         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6900         one of the latests Martin's fixes.
6901
6902 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6903
6904         * expression.cs: On BigEndian systems, swap the bytes, temporary
6905         solution until we get a new bitconverter class.
6906
6907 2007-03-23  Martin Baulig  <martin@ximian.com>
6908
6909         Fix #81158.
6910
6911         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6912         "Method" and "Method`1".  Normally, a cache lookup is done on the
6913         "Method" form (ie. without the generic arity), but this one makes
6914         lookups on the full form work as well.
6915
6916 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6917
6918         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6919         unused properties.
6920
6921 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6922         * class.cs: 
6923         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6924         ordered_member_list, to TypeBuilder to store members to be defined
6925         in the order they were parsed in.
6926         - ordered_explicit_member_list contains all properties indexers
6927           and methods that are defined as explicit implementation of an
6928           interface or base class.
6929         - ordered_member_list contains all properties indexers and methods
6930           that are not defined as explicit implementation of an interface
6931           or base class.
6932
6933         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6934         functionality in these removed classes has been replaced with 
6935         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6936         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6937
6938         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6939         to CheckForDuplications inside GetMethod and SetMethod Define Method
6940         to handle method property and indexer name conflicts.
6941
6942         Fixes #79434
6943
6944         All code is contributed under the MIT/X11 license.
6945
6946 2007-03-20  Martin Baulig  <martin@ximian.com>
6947
6948         * class.cs (TypeContainer.Interfaces): Removed; they're now
6949         included in `TypeContainer.Types'.
6950
6951 2007-03-20  Martin Baulig  <martin@ximian.com>
6952
6953         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6954
6955         * class.cs (TypeContainer.CreateType): New public method.  This is
6956         now called before DefineType() to create the TypeBuilders.
6957         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6958         has already been created by CreateType().
6959         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6960         don't resolve our base classes here; this has been moved into
6961         DefineBaseTypes().  We're now called from CreateType().
6962         (TypeContainer.DefineBaseTypes): New private method; resolve our
6963         base classes here.  We're now called from DefineType().
6964
6965         * rootcontext.cs
6966         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6967         our types first to create all the TypeBuilders.  After that, call
6968         TypeContainer.DefineType() on all the types which'll resolve their
6969         base classes and setup the resolve order.
6970
6971 2007-03-20  Martin Baulig  <martin@ximian.com>
6972
6973         * class.cs (TypeContainer.Enums): Removed; they're now included in
6974         `TypeContainer.Types'.  
6975
6976 2007-03-20  Martin Baulig  <martin@ximian.com>
6977
6978         * class.cs
6979         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6980         (TypeContainer.DoResolveMembers): Call DefineType() on our
6981         `compiler_generated' classes; moved here from DefineNestedTypes().
6982
6983         * rootcontext.cs
6984         (RootContext.ResolveTree): Call ResolveMembers() on all
6985         TypeContainer's in the `type_container_resolve_order'.
6986
6987 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6988
6989         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6990
6991 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6992
6993         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6994         implementation flags.
6995
6996 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6997
6998         * class.cs: More optimizations for type parameters.
6999
7000 2007-03-15  Marek Safar  <marek.safar@gmail.com>
7001
7002         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
7003
7004         * ecore.cs, parameter.cs: More common code for both corlibs.
7005
7006         * typemanager.cs (IsGenericMethod): Simplified.
7007
7008 2007-03-15  Raja R Harinath  <rharinath@novell.com>
7009
7010         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7011         'returns'.
7012         * statement.cs, iterators.cs, lambda.cs: Update to changes.
7013
7014         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
7015         unconditionally.  Simplify explanation.
7016         (Try.Resolve, Using.Resolve): Likewise.
7017
7018 2007-03-15  Martin Baulig  <martin@ximian.com>
7019
7020         Fix #80731.
7021
7022         * decl.cs (DeclSpace): If we're a partial class, use our
7023         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
7024
7025 2007-03-15  Raja R Harinath  <rharinath@novell.com>
7026
7027         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7028         'throws'.
7029         (FlowBranching.UsageVector): Update to changes.
7030         (FlowBranching.MergeSiblings): Likewise.
7031         * statement.cs: Likewise.
7032
7033 2007-03-15  Martin Baulig  <martin@ximian.com>
7034
7035         Fix #79302.
7036
7037         * decl.cs
7038         (MemberCache): Added a special .ctor for type parameters.
7039
7040         * typemanager.cs
7041         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
7042         `MemberCache'.  
7043
7044 2007-03-09  Martin Baulig  <martin@ximian.com>
7045
7046         * enum.cs (Enum): Make this a TypeContainer.
7047         (EnumMember): Derive from `Const'.
7048
7049         * const.cs
7050         (Const.DoResolveValue): New protected virtual method; move most of
7051         the functionality of ResolveValue() here so we can override it in
7052         `EnumMember'.
7053         (Const.CreateConstantReference): Make this virtual.
7054
7055         * class.cs (Kind): Add `Kind.Enum'.
7056         (TypeContainer.Emit): Don't emit the enums here; they're already
7057         in the `RootContext.typecontainer_resolve_order'.
7058
7059         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
7060         here; they're already in the `typecontainer_resolve_order'.
7061
7062         * ecore.cs (EnumConstant.ConvertImplicitly): Add
7063         TypeManager.DropGenericTypeArguments().
7064
7065         * typemanager.cs
7066         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
7067         (TypeManager.IsEnumType): Likewise.
7068         (TypeManager.EnumToUnderlying): Likewise.
7069         (TypeManager.IsEqual): Add support for enums.
7070
7071 2007-03-12  Raja R Harinath  <rharinath@novell.com>
7072
7073         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
7074         DefaultParameterValueAttribute to be undefined, say if System.dll
7075         is not referenced.
7076
7077 2007-03-11  Marek Safar  <marek.safar@gmail.com>
7078
7079         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
7080         any mscorlib.
7081
7082 2007-03-10  Marek Safar  <marek.safar@gmail.com>
7083
7084         * class.cs, parameter.cs: Unified parameters verification.
7085
7086 2007-03-08  Martin Baulig  <martin@ximian.com>
7087
7088         * cs-parser.jay (constructor_header): Pass the location to the
7089         newly created TopLevelBlock.
7090
7091 2007-03-07  Martin Baulig  <martin@ximian.com>
7092
7093         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
7094
7095 2007-03-06  Miguel de Icaza  <miguel@novell.com>
7096
7097         * convert.cs (ExplicitReferenceConversionExists): Sync this method
7098         with the changes from David, fixes the build.
7099
7100 2007-03-05  David Mitchell  <dmitchell@logos.com>
7101
7102         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
7103         and its base interfaces to a one-dimensional array type S[],
7104         provided there is an implicit or explicit reference conversion
7105         from S to T.
7106
7107 2007-03-03  Marek Safar  <marek.safar@gmail.com>
7108
7109         * cs-tokenizer.cs: Implemented basic linq grammar.
7110
7111         * driver.cs: Set linq lang version on demand.
7112
7113 2007-02-26  Marek Safar  <marek.safar@gmail.com>
7114
7115         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
7116
7117 2007-02-25  Marek Safar  <marek.safar@gmail.com>
7118
7119         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
7120         (Fixes #80455)
7121
7122         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
7123         here.
7124         Check property and event extern attributes.
7125
7126         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
7127         charset.
7128
7129 2007-02-24  Marek Safar  <marek.safar@gmail.com>
7130
7131         A fix for bug #80407
7132         * ecore.cs: Don't report ambiguity error when methods have same parent.
7133
7134 2007-02-23  Marek Safar  <marek.safar@gmail.com>
7135
7136         A fix for bug #80878
7137         * class.cs, cs-parser.jay: Event property can host anonymous methods.
7138
7139 2007-02-22  Marek Safar  <marek.safar@gmail.com>
7140
7141         * attribute.cs: Enable ExtensionAttribute presence test.
7142
7143 2007-02-22  Marek Safar  <marek.safar@gmail.com>
7144
7145         * class.cs: Warn about missing GetHashCode only when Equals is override.
7146
7147         * decl.cs: Check accessibility of type arguments.
7148
7149         * typemanager.cs: Correctly report nullable array.
7150
7151 2007-02-20  Marek Safar  <marek.safar@gmail.com>
7152
7153         * class.cs, report.cs: Capture more details when things go wrong.
7154
7155 2007-02-20  Marek Safar  <marek.safar@gmail.com>
7156
7157         A fix for bug #80650
7158         * cs-parser.jay: Anonymous container starts at constructor declaration
7159         and not at block beginning because it has to be usable in constructor
7160         initializer.
7161
7162         * statement.cs: Use context location and not block one for error reporting.
7163
7164 2007-02-18  Marek Safar  <marek.safar@gmail.com>
7165
7166         A fix for bug #78712
7167         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
7168         too.
7169
7170 2007-02-18  Marek Safar  <marek.safar@gmail.com>
7171
7172         A fix for bug #80493 by Atsushi Enomoto
7173         * cs-parser.jay: Ignore invalid attribute target.
7174
7175 2007-02-18  Marek Safar  <marek.safar@gmail.com>
7176  
7177         * cs-tokenizer.cs: Ignore '\0' as white space character.
7178
7179 2007-02-17  Miguel de Icaza  <miguel@novell.com>
7180
7181         * cs-parser.jay: Add support for lambda expressions to the mcs
7182         compiler as well.
7183
7184         * lambda.cs: Only clone when we are probing, not on the final call
7185         (Compatible is the final call). 
7186
7187         * statement.cs (CloneContext): Introduce class to provide block
7188         remapping during clone.
7189
7190         All statements Clone themselves now.
7191
7192         (Clone): special handling for blocks, when we clone a block, we
7193         register the block inside this routine, as children of the block
7194         might trigger a lookup. 
7195         
7196         * expression.cs: Add support for CloneContext in all expressions. 
7197         
7198 2007-02-17  Marek Safar  <marek.safar@gmail.com>
7199  
7200         A fix for bug #80493
7201         * statement.cs: Report ambiguous warning when interfaces are not related.
7202
7203 2007-02-15  Marek Safar  <marek.safar@gmail.com>
7204
7205         C# 3.0 extension methods.
7206
7207         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
7208         cannot be used directly.
7209
7210         * class.cs (Class.Emit): Emit extension attribute if any class method
7211         is extension method.
7212         (Method.Define): Add basic extension method validation conditions.
7213         (Method.Emit): Emit extension attribute for method.
7214
7215         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
7216         extension method exists. Currently we follow same approach as Microsoft
7217         does, emit even if a method or a class are private but this can change
7218         later.
7219
7220         * cs-parser.jay: Add handling of `this' keyword in method parameters
7221         context.
7222
7223         * decl.cs (DeclSpace.IsStaticClass): New property.
7224         (MemberCache.FindExtensionMethods): Looks for extension methods with
7225         defined name and extension type.
7226
7227         * doc.cs: Updated after OverloadResolve changes.
7228
7229         * driver.cs: Add new soft reference to System.Core.dll.
7230
7231         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
7232         (ExtensionMethodGroupExpr): Represents group of extension methods.
7233
7234         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
7235         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
7236         to MethodGroupExpr and made non-static for easier customization.
7237         (Invocation.DoResolve): Add extension method lookup when no standard
7238         method was found.
7239         (MemberAccess.DoResolve): Try extension methods if no member exists.
7240
7241         * modifiers.cs: Add METHOD_EXTENSION modifier.
7242
7243         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
7244         as well as candidate extension type.
7245         (ComputeNamespaces): When assembly constains extension methods registers
7246         them.
7247         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
7248         extension method lookup.
7249         (Namespace.LookupExtensionMethod): Looks for extension method in this
7250         namespace.
7251         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
7252         find a method which matches name and extensionType.
7253
7254         * parameter.cs (Parameter): Add This modifer.
7255         (HasExtensionMethodModifier): New property.
7256         (Resolve): Add extension parameter check.
7257         (ModFlags): turned to property to exclude this modifier as it is not real
7258         parameter modifier.
7259         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
7260
7261         * support.cs (ParameterData): Add ExtensionMethodType.
7262         (ReflectionParameters): Implemented ExtensionMethodType interface property.
7263
7264         * typemanager.cs: Add type and ctor extension attribute type.
7265
7266 2007-02-15  Miguel de Icaza  <miguel@novell.com>
7267
7268         * report.cs (DisableErrors, EnableErrors): used to prevent error
7269         output when we are "trying" to compile various methods with
7270         different types. 
7271
7272         * ecore.cs (Expression): Add Clone method that calls the virtual
7273         CloneTo method.  The current CloneTo method in Expression throws
7274         an exception so we can track down all the places where this must
7275         be implemented (not using abstract, because that would be a lot of
7276         up-front-work before we can start testing the implementation
7277         idea). 
7278
7279         Important: we only need Clone capabilities for expressions created
7280         by the parser, as the expressions we will be cloning are
7281         expressions in the pre-resolved state.   This vastly simplifies
7282         the work required. 
7283         
7284         (SimpleName): Add CloneTo that does nothing.
7285         (EmptyCast): Add CloneTo.
7286         
7287         * expression.cs (Binary): Implement CloneTo.
7288         (Invocation.IsApplicable): Store the current ec in
7289         EmitContext.TempEc and restore it on return.  This is used so we
7290         do not have to sprinkle hundres of methods with an extra
7291         EmitContext, we know that the only user is the lambda expression
7292         ImplicitConversionExists code. 
7293         
7294         (Argument): Add Cloning capabilities.
7295         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
7296         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
7297         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
7298         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
7299         IndexerAccess): Add Clone capability.
7300
7301         (LocalVariableReference, This): TODO: needs cloned Block mapping.
7302
7303         (Argument): Add cloning capability.
7304
7305         * assign.cs (Assign): Implement CloneTo.
7306
7307         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7308         
7309         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7310         version by calling Convert with the EmitContext (that we are
7311         currently storing in ec, this is not great, but will do for now,
7312         to avoid passing EmitContext parameters to hundreds of functions
7313         that do not need them now).
7314
7315         (SetExpression): Remove, it is not needed.
7316         
7317         (ContextualReturn): Implement CloneTo.
7318
7319         * statement.cs (Statement): Implement cloning infrastructure,
7320         similar to expressions.
7321
7322         (Block): Partial implementation of Clone for statements.
7323
7324         (Return): Implement clone.
7325         
7326         * constant.cs (Constant.CloneTo): New method, does nothing.
7327
7328         * codegen.cs (TempEc): Add a static EmitContext as a temporary
7329         solution, until we decide how to exactly do this.  
7330         
7331 2007-02-14  Marek Safar  <marek.safar@gmail.com>
7332  
7333         A fix for bug #80493
7334         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7335         a property is override we need to use second accessor.
7336
7337 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7338  
7339         A fix for bug #80418
7340         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7341         methods.
7342
7343 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7344
7345         Another fix for bug #80749
7346         * pending.cs: Abstract class has priority over interfaces.
7347
7348 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7349
7350         Another fix for bug #80749
7351         * pending.cs: Abstract class has priority over interfaces.
7352
7353 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7354
7355         Another fix for bug #80749
7356         * pending.cs: Abstract class has priority over interfaces.
7357
7358 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7359
7360         Another fix for bug #80749
7361         * pending.cs: Abstract class has priority over interfaces.
7362
7363 2007-02-13  Marek Safar  <marek.safar@gmail.com>
7364
7365         * class.cs Better error message.
7366
7367         * driver.cs: Add shorter versions of -optimize option.
7368
7369 2007-02-13  Martin Baulig  <martin@ximian.com>
7370
7371         * class.cs (Constructor.Emit): Check the return value of
7372         ec.ResolveTopBlock() and return on error.
7373
7374 2007-02-13  Raja R Harinath  <rharinath@novell.com>
7375
7376         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7377         message to fix error message regression.
7378
7379 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7380
7381         * delegate.cs: Delegate creation expression cannot be of Nullable type.
7382
7383 2007-02-12  Marek Safar  <marek.safar@gmail.com>
7384
7385         A fix for bug #80749
7386         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7387         its parent container.
7388
7389         * class.cs (DefineFieldInitializers): Each initializer can has different
7390         resolve context.
7391
7392         * const.cs: Updated.
7393
7394 2007-02-11  Miguel de Icaza  <miguel@novell.com>
7395
7396         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7397         now all the heavy lifting to check that embedded statements or
7398         expressions have the right form is done in the ContextualReturn.
7399
7400         (ContextualReturn): New class.  
7401
7402         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7403         method that can be invoked to report 201, so we do not replicate
7404         this everywhere.
7405
7406         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7407         
7408         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7409         treating tabs as spaces. 
7410
7411 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7412
7413         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7414         * assign.cs: Use full implicit conversion for right side check.
7415
7416 2007-02-09  Marek Safar  <marek.safar@gmail.com>
7417
7418         * statement.cs (Switch): Switch over boolean type is not standardized.
7419
7420 2007-02-08  Marek Safar  <marek.safar@gmail.com>
7421
7422         A fix for bug #80755
7423         * decl.cs (FindBaseEvent): Don't use method cache for events.
7424
7425 2007-02-07  Marek Safar  <marek.safar@gmail.com>
7426
7427         * cs-parser.jay: Better syntax error handling.
7428
7429         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7430         instead of underlying type value.
7431
7432 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7433
7434         * driver.cs: Check define identifier before is registered.
7435
7436         * namespace.cs: Use existing error message.
7437
7438         * report.cs: New warning.
7439
7440 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7441
7442         A fix for bug #80742
7443         * expression.cs: Delegate Invoke method can be called directly.
7444
7445 2007-02-06  Marek Safar  <marek.safar@gmail.com>
7446
7447         A fix for bug #80676
7448         * class.cs (IsEntryPoint): The Main method can have params modifier.
7449
7450 2007-02-04  Miguel de Icaza  <miguel@novell.com>
7451
7452         * parameter.cs (Parameter, Parameters): Add Clone method.
7453
7454         * anonymous.cs (Compatible): Turn method into virtual method, so
7455         LambdaExpression can implement a different behavior.
7456
7457         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7458         out the basic checking here, so it can be used by
7459         LambdaExpressions.
7460         
7461         * lambda.cs: Introduce "Compatible" function that will do the
7462         heavy lifting.
7463
7464 2007-02-02  Marek Safar  <marek.safar@gmail.com>
7465
7466         * attribute.cs: Unified one error message.
7467
7468         * class.cs (Class): Use type attributes and not properties to test static
7469         class.
7470         (IsEntryPoint): Don's pass local variable.
7471
7472         * convert.cs: Removed duplicate check.
7473
7474         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7475
7476         * driver.cs: Don't crash when soft reference does not exist.
7477
7478         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7479         (UsingEntry): Removed redundant allocation.
7480
7481         * parameter.cs: Add fast path for type parameters.
7482
7483         * support.cs: Don't allocate attribute when it's not used.
7484
7485 2007-01-30  Miguel de Icaza  <miguel@novell.com>
7486
7487         * anonymous.cs
7488         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7489         this into a virtual method, so we can override it in LambdaExpression.
7490
7491         * driver.cs: Improve diagnostics in case of failure. 
7492
7493         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7494         write a function that is slightly more complex and that parses:
7495
7496         type identifier [, type identifier]* )
7497
7498         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7499         this expression:
7500
7501                 (canEmpty ? i >= 0 : i > 0)
7502
7503 2007-01-30  Raja R Harinath  <rharinath@novell.com>
7504
7505         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7506         exception on possibly valid code.
7507
7508 2007-01-29  Raja R Harinath  <rharinath@novell.com>
7509
7510         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7511         Push/PopPosition.
7512         (parse_opt_type_arguments): Remove.  It's almost the same as
7513         parse_less_than.
7514         (parse_namespace_or_typename): Use parse_less_than.
7515
7516 2007-01-28  Miguel de Icaza  <miguel@novell.com>
7517
7518         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7519         this bug took a few hours to find, because the state saved and
7520         restored by PushPosition and PopPosition was ignoring the state of
7521         parse_generic_less_than.
7522
7523         I can also now remove the handling of OP_LT and OP_GT, this solves
7524         the big mistery.
7525         
7526         * cs-tokenizer.cs: store the location for the ARROW token, we use
7527         that in the parser.
7528
7529         (PushPosition, PopPosition): save/restore also `current_token',
7530         restore `parse_generic_less_than' (was missing).
7531
7532         (parse_opt_type_arguments): use parse_type, not
7533         parse_namespace_or_typename to parse types.
7534
7535         * lambda.cs: Empty new file, will eventually have the lambda
7536         expression implementation.
7537
7538         * lambda.test: used to test the internal tokenizer. 
7539
7540         * report.cs (FeatureIsNotISO1): Rename from
7541         FeatureIsNotStandardized, because it was about the language level
7542         (1 vs 2) it was not about standarization.
7543
7544         (FeatureRequiresLINQ): New.
7545
7546         * support.cs (SeekableStreamReader): Only require that the reader
7547         is a TextReader, not a StreamReader, so we can plug StringReader. 
7548
7549         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7550         given position in the input stream the following tokens can be
7551         parsed as a type followed by an identifier.
7552
7553         (is_punct): after a '(' if parse_type_and_parameter returns true,
7554         then return a special token OPEN_PARENS_LAMBDA which is used to
7555         avoid reduce/reduce errors in the grammar for the
7556         lambda_expression rules.
7557
7558         (parse_type): implement a type parser inside the
7559         tokenizer, the parser only returns true or false depending on
7560         whether the input at a given position can be parsed as a type.
7561
7562         (peek_token): new method used during type parsing.
7563
7564 2007-01-28  Raja R Harinath  <rharinath@novell.com>
7565
7566         Fix #80531
7567         * anonymous.cs (ScopeInfo.InflateParameters): New.
7568         (AnonymousContainer.Resolve): Use it to redirect types of
7569         delegate parameters.
7570
7571 2007-01-27  Raja R Harinath  <rharinath@novell.com>
7572
7573         Fix #80530
7574         * expression.cs (Error_InvalidArguments): Don't use two different
7575         messages for CS1503.  Use ExtraInformation and
7576         SymbolRelatedToPreviousError instead.
7577
7578         Fix #80358
7579         * decl.cs (DeclSpace.initialize_type_params): Don't access
7580         'type_params' of a partial class directly.
7581
7582 2007-01-26  Miguel de Icaza  <miguel@novell.com>
7583
7584         * constant.cs: Removed a handful of out-of-range checks that were
7585         not necessary. 
7586
7587 2007-01-25  Marek Safar  <marek.safar@gmail.com>
7588
7589         * expression.cs (CheckUselessComparison): Add additional check for char
7590         constants.
7591
7592         * namespace.cs: Fixed typo.
7593
7594 2007-01-23  Miguel de Icaza  <miguel@novell.com>
7595
7596         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7597         gone, instead we inline the test, preventing the needless casts to
7598         longs, ulongs and doubles for the parameters, avoiding calls to
7599         methods that overchecked stuff, and instead inlined things
7600         nicely. 
7601
7602 2007-01-20  Marek Safar  <marek.safar@gmail.com>
7603
7604         * cs-parser.jay: Better parameter error handling.
7605
7606 2007-01-17  Marek Safar  <marek.safar@gmail.com>
7607
7608         A fix for bug #80368, #80522
7609         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7610         whether array initializer contains constants only.
7611         (ArrayCreation.Emit): Use better formula to decide when
7612         are array initializers for static initialization.
7613         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7614         have to emit even constants otherwise they are pre-initialized.
7615
7616 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
7617             Raja R Harinath  <rharinath@novell.com>
7618
7619         Fix emit order of 'get' vs. 'set'.
7620         * support.cs (Accessors): New.
7621         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7622         Note the order in which accessors are declared in the source.
7623         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7624         Refactored from Property.Define and Indexer.Define.
7625         (PropertyBase.DefineAccessors): New helper that calls the above in
7626         appropriate order as noted by the parser.
7627         (Property.Define, Indexer.Define): Update to changes.
7628         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7629
7630 2007-01-17  Raja R Harinath  <rharinath@novell.com>
7631
7632         Fix cs0029-6.cs and gcs0029-2.cs (regression)
7633         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7634         there's an implicit conversion from the current type to the target
7635         type before converting the underlying constant.
7636
7637 2007-01-16  Marek Safar  <marek.safar@gmail.com>
7638
7639         * const.cs (ResolveValue): Updated after constant conversion was made more
7640         generic.
7641
7642         * constant.cs (GetAttributableValue): constant to object conversion is
7643         used for attributes only.
7644         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7645         constant conversions.
7646         (LongConstant.ConvertImplicitly): Ditto.
7647
7648         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7649         (ImplicitConversionStandard): Handle constant conversion as extra step.
7650         It solves the issue when constant conversion was called indirectly like
7651         inside array initializer and constant folding was skipped.
7652
7653         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7654         this change.
7655
7656         * statement.cs(ImplicitConversionStandard): Updated after constant
7657         conversion was made more generic.
7658
7659 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
7660
7661         * expression.cs (As.DoResolve): Use GenericConstraints instead of
7662         Constraints, solves the problem where the compiler incorrectly
7663         reported that a type parameter was not constrained to a class (Bug
7664         80518)
7665
7666 2007-01-14  Marek Habersack  <grendello@gmail.com>
7667
7668         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7669
7670 2007-01-14  Marek Safar  <marek.safar@gmail.com>
7671
7672         A fix for bug #80368
7673         * assign.cs (FieldInitializer): New class implements field
7674         initializer statement.
7675
7676         * attribute.cs: Update after FieldMember rename.
7677
7678         * class.cs (PropertyBasedMember): New common class for property based
7679         types.
7680         (InterfaceMemberBase): New base class for all members which can be used as
7681         an interface members.
7682         (MethodCore): Moved really common code to InterfaceMemberBase.
7683         (Method.Define): Equal and GetHasCode detection is relevant for methods
7684         only.
7685         (MethodData.Define): Don't assume that public event implements an
7686         interface automatically.
7687         (MethodData.DefineMethodBuilder): Issue an error even if only extern
7688         modifier is used.
7689         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7690         (FieldMember): Merged with FieldBase.
7691         (EventProperty.AEventPropertyAccessor): New specialization to check whether
7692         event extern modifier can be used.
7693         (EventField.EventFieldAccessor): Moved event field specific code here.
7694         (Event.AllowedModifiers): Even event can be extern.
7695         (Event.FindOutBaseMethod): New override specific to events.
7696         (Indexer.parameters): Reintroduce parameters because base class holds
7697         only properties common data.
7698         (Indexer.CheckForDuplications): Indexers are threated as methods so we
7699         need do extra parameters check.
7700
7701         * const.cs: Update after FieldMember rename.
7702
7703         * decl.cs (MemberCache.FindBaseEvent): New method.
7704
7705         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7706         to reflect that indexer is now derived from PropertyBased.
7707
7708         * ecore.cs (GetMemberType): Made public.
7709         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7710         obsolete event.
7711
7712         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7713         
7714         * typemanager.cs (CSharpSignature): Correctly print event accessors.
7715         (RegisterEvent): Removed.
7716         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7717         (GetPrivateFieldOfEvent): Renamed to GetEventField.
7718
7719 2007-01-11  Raja R Harinath  <rharinath@novell.com>
7720
7721         Fix #80249
7722         * statement.cs (CollectionForeach.TryType): Prefer generic
7723         GetEnumerator over non-generic variant.  Fix code to follow comments.
7724
7725 2007-01-09  Raja R Harinath  <rharinath@novell.com>
7726
7727         Fix #80446
7728         * support.cs (ReflectionParameter): Don't use an invalid index on
7729         the generic parameter data.
7730
7731 2007-01-08  Miguel de Icaza  <miguel@novell.com>
7732
7733         * driver.cs: Just add a tiny bit of infrastructure.
7734
7735 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7736
7737         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7738         where field type is struct from current assembly.
7739         
7740         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7741         it is possible.
7742
7743 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7744
7745         A fix for bug #80381
7746         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7747         the core types.
7748
7749         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7750         messages.
7751         (Namespace.LookupType): Always use core types from corlib when speficied.
7752
7753         * report.cs: A new warning.
7754
7755         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7756         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7757         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7758
7759         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7760         (InitCoreTypes): Set expression type of object_type and value_type
7761         immediately after lookup.
7762
7763 2007-01-01  Miguel de Icaza  <miguel@novell.com>
7764
7765         * cs-tokenizer.cs: Accept Pc class characters (Connector
7766         Punctuation) as valid identifiers.  Fixes #78259
7767
7768         * expression.cs (Invocation.DoResolve): Moved the check for the
7769         use of `this' for doing method calls to the Invocation resolution
7770         step, after overload resolution has taken place instead of doing
7771         the check at the low-level `This.DoResolve' level.
7772
7773         The `This.DoResolve'(appens before overload resolution, so it has
7774         no way of knowing if the method that will be called will be
7775         instace or static, triggering an erroneous report for cs0188 (Bug
7776         78113).
7777
7778         We now do the check for instance method invocations after we know
7779         what method will be called.
7780
7781         (This.CheckThisUsage): Move the actual use of this structure
7782         checking into its own method and expose it. 
7783
7784         * Everywhere that called Error_ValueCannotBeConverted: pass a new
7785         EmitContext.
7786
7787         Exceptions: Null.ConvertImplicitly,
7788         Constant.ImplicitConversionRequired as there are too many call
7789         sites for passing the ec. 
7790
7791         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7792         EmitContext, if the value is null, then we do not try to provide
7793         the extra information from the error (If a userdefined conversion
7794         exists, as UserDefinedConversion requires a non null-EmitContext).
7795
7796         Fixes: #80347
7797
7798 2006-12-30  Raja R Harinath  <rharinath@novell.com>
7799
7800         * flowanalysis.cs (MyBitVector): Document some invariants.
7801         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7802         introduced below, and add a couple of others, 
7803
7804 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7805
7806         * attribute.cs (GetMethodObsoleteAttribute): Uses new
7807         GetPropertyFromAccessor and GetEventFromAccessor.
7808         
7809         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7810         overrides non-obsolete one.
7811         (Indexer.Define): Error message has been moved to the parser.
7812
7813         * cs-parser.jay: Better syntax errors handling.
7814
7815         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7816         when an invocation has no arguments.
7817
7818         * ecore.cs: Removed not used caching.
7819
7820         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7821         implementation.
7822
7823         * report.cs: Add a new warning.
7824
7825         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7826
7827         * typemanager.cs (enumeration_type): Removed.
7828         (CSharpSignature): Reuses IsSpecialMethod.
7829         (IsEqual): Hack for MS BCL.
7830         (GetPropertyFromAccessor): New method.
7831         (GetEventFromAccessor): New method.
7832         (IsSpecialMethod): Fixed to handle more cases.
7833
7834 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7835
7836         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7837         Made white spaces array static.
7838
7839         * ecore.cs (RemoveGenericArity): Optimized.
7840
7841         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7842         10 times faster).
7843         (MyBitVector.initialize_vector): Simplified.
7844
7845 2006-12-22  Miguel de Icaza  <miguel@novell.com>
7846
7847         * ecore.cs: Am not entirely happy with this hack, but it seems to
7848         address the issue in 80257 (a small test case for
7849         CreativeDocs.NET). 
7850
7851         I set the MethodGroupExpr.Type to an internal compiler type
7852         (itself in this case) to force the resolution to take place.   Why
7853         it does not take place with a null is beyond me.
7854
7855 2006-12-20  Marek Safar  <marek.safar@gmail.com>
7856
7857         A fix for bug #80288
7858         * expression.cs (ResolveOperator): Consider user defined conversion for
7859         logical and operator too.
7860         (EmitBranchable): Optimization for logical and when full constant folding
7861         could not be applied but one operand is constant.
7862
7863 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7864
7865         * class.cs (GetClassBases): Write 5 times every day, will never use
7866         FullName for error reporting.
7867
7868         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7869
7870 2006-12-19  Martin Baulig  <martin@ximian.com>
7871
7872         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7873         the symbol file info here.
7874
7875 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7876
7877         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7878         of `elseif' is taking then following sections are not taking.
7879         Fixes an issue reported on mono mailing list.
7880
7881 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7882
7883         A fix for bug #80300
7884         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7885         a caller is not taking.
7886
7887 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7888
7889         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7890         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7891         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7892         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7893         * class.cs: Update to changes.
7894
7895 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7896
7897         A fix for bug #79934
7898         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7899         partial container.
7900
7901         * class.cs (ResolveMembers): Register an iterator in current container and
7902         not in shared one.
7903
7904 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7905
7906         Fix test-543.cs
7907         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7908         satisfy a params annotated parameter.
7909
7910 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7911
7912         A fix for bug #77014
7913         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7914         paramters correctly and not rely on hacks in Parameters class.
7915         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7916         at any possition.
7917         (Invocation.VerifyArgumentsCompat): Ditto.
7918         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7919         any possition.
7920
7921         * parameter.cs (HasParams): Don't assume that params is the last one.
7922
7923         * support.cs (ReflectionParameters.ctor): Look for params attribute
7924         correctly.
7925         (ReflectionParameters.ParameterType): Removed hack when we returned last
7926         parameter for out of range parameters.
7927         (ParameterName, ParameterModifier): Ditto.
7928
7929 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7930
7931         A fix for bug #79987
7932         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7933         when assembly is not CLS compliant but type is. I have no idea why is this
7934         allowed.
7935
7936         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7937
7938 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7939
7940         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7941         in struct constructors, they are basically no-ops.
7942
7943 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7944
7945         * cs-tokenizer.cs (Position): Save preprocessor status too.
7946
7947 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7948
7949         A fix for bug #77794
7950         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7951
7952 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7953
7954         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7955         Fixes #69299.
7956         (pp_expr): Report error for an invalid expression.
7957         (handle_preprocessing_directive): Simplified; add more error checking.
7958
7959 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7960
7961         A fix for bug #74939
7962         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7963         directives handling.
7964
7965 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7966
7967         A fix for bugs #80093, and #75984
7968         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7969         logic, it seems to me as it worked before "by coincidence".
7970         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7971         (cleanup): Enabled endif check.
7972
7973 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7974
7975         A fix for bug #80162
7976         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7977         enumerators are never ambiguous.
7978
7979 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7980
7981         Fix #80060
7982         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7983
7984 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7985
7986         A fix for bug #80144
7987         * class.cs (EventProperty.Define): Explicit implementation means
7988         that an even is used.
7989
7990 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7991
7992         Fixes the operators implementation (part II)
7993
7994         * cfold.cs (DoConstantNumericPromotions): Renamed to
7995         DoBinaryNumericPromotions and simplified.
7996         (BinaryFold): Couple of conversion fixes; simplified.
7997
7998         * constant.cs, ecore.cs, literal.cs
7999         (ToType): Renamed to ConvertImplicitly.
8000         (Reduce): Renamed to ConvertExplicitly.
8001
8002         * class.cs, convert.cs: Updated.
8003
8004         * expression.cs: TryReduce doesn't throw an exception.
8005
8006 2006-12-01  Marek Safar  <marek.safar@gmail.com>
8007
8008         A fix for bug #80108
8009         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
8010         compatible.
8011
8012 2006-11-30  Marek Safar  <marek.safar@gmail.com>
8013
8014         Fixes unary operators implementation (part I)
8015         Also fixes #80026
8016
8017         * cfold.cs (Error_CompileTimeOverflow): Made internal
8018
8019         * const.cs (IConstant): Changed to use reference to constant and
8020         not constant itself.
8021         Updated IConstant implementations.
8022
8023         * constant.cs (CreateConstant): New factory method.
8024         Updated IConstant implementation.
8025
8026         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
8027
8028         * ecore.cs: Updated to use CreateConstantReference.
8029
8030         * enum.cs: Reflects IConstant changes.
8031
8032         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
8033
8034         * literal.cs (NullConstant): Change to be independently usable.
8035
8036 2006-11-29  Martin Baulig  <martin@ximian.com>
8037
8038         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
8039         we need to emit the scope initializer before calling the base .ctor.
8040
8041         * anonymous.cs: Merged back from the new anonymous methods branch.
8042         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
8043
8044         * expression.cs (ParameterReference.DoResolveBase): Create a
8045         "normal" ScopeInfo when capturing parameters rather than using the
8046         root scope; this makes things work with anonymous methods having
8047         parameters.
8048
8049         * statement.cs
8050         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
8051
8052 2006-11-22  Marek Safar  <marek.safar@gmail.com>
8053
8054         A fix for bug #79987
8055         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
8056         check to a base class.
8057         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
8058         only when assembly has missing attribute.
8059         * report.cs: Update.
8060
8061 2006-11-21  Marek Safar  <marek.safar@gmail.com>
8062
8063         * cs-tokenizer.cs: Merged with gmcs version.
8064
8065 2006-11-20  Marek Safar  <marek.safar@gmail.com>
8066
8067         * cs-tokenizer.cs,
8068         * cs-parser.jay: Better error message when partial keyword is misplaced.
8069
8070 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
8071
8072         A fix for bug #79810
8073         report.cs: CS1058 only applies to 2.0 profile (gmcs).
8074         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
8075         a RuntimeWrappedException by default.
8076
8077 2006-11-18  Marek Safar  <marek.safar@gmail.com>
8078
8079         A fix for bug #79843
8080         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
8081         implementation.
8082         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
8083
8084 2006-11-18  Marek Safar  <marek.safar@gmail.com>
8085
8086         * driver.cs, namespace.cs: Uses faster IndexOf version.
8087
8088 2006-11-17  Marek Safar  <marek.safar@gmail.com>
8089
8090         A fix for bug #79941
8091         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
8092         operators.
8093         (Operator.Define): Implicit/Explicit operator of same type is duplicate
8094         even if internal name is different.
8095         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
8096         (UserDefinedConversion): Simplified as the operators cannot be internal.
8097         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
8098         conversions.
8099         (MethodLookup): Replaced EmitContext with parentType.
8100         * expression.cs: Updated.
8101
8102 2006-11-09  Raja R Harinath  <rharinath@novell.com>
8103
8104         * driver.cs (BadAssembly): Handle all the ugliness of
8105         DefineDynamicAssembly.
8106
8107 2006-11-08  Raja R Harinath  <rharinath@novell.com>
8108
8109         Address parts of #58244 -- most of what's left is in the runtime
8110         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
8111         CS1509 error checks, and handle them for all assembly loads, not
8112         just the first invocation.
8113         (LoadModule): Likewise.  Move handling of 'adder_method' ...
8114         * codegen.cs (AssemblyClass.AddModule): ... here.
8115
8116 2006-11-02  Marek Safar  <marek.safar@gmail.com>
8117
8118         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
8119         IEnumerable<T> is ambiguous.
8120
8121 2006-10-31  Marek Safar  <marek.safar@gmail.com>
8122
8123         A fix for bug #67689
8124         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
8125         GetEnumerator is ambiguous.
8126
8127         * report.cs: Add new warning.
8128
8129 2006-10-29  Marek Safar  <marek.safar@gmail.com>
8130
8131         A fix for bug #78602
8132         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8133         to protected member can be nested type.
8134
8135 2006-10-28  Marek Safar  <marek.safar@gmail.com>
8136
8137         A fix for bug #78965
8138         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8139         to protected member must derive from current type.
8140
8141 2006-10-27  Marek Safar  <marek.safar@gmail.com>
8142
8143         assign.cs: Reuses error method.
8144
8145         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
8146         instead of type for constants.
8147         (Expression.Error_ValueAssignment): Common error method.
8148
8149         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
8150         for any assignment.
8151
8152 2006-10-27  Marek Safar  <marek.safar@gmail.com>
8153
8154         A fix for bug #79081
8155         * expression.cs (MemberAccess.DoResolve): Check nested type
8156         accessibility.
8157
8158 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
8159
8160         * doc.cs : nested delegates were not handled. Fixed bug #79754.
8161
8162 2006-10-26  Marek Safar  <marek.safar@gmail.com>
8163
8164         A fix for bug #76591
8165         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
8166
8167 2006-10-26  Marek Safar  <marek.safar@gmail.com>
8168
8169         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
8170         type forwarder of the same type multiple times.
8171
8172 2006-10-26  Raja R Harinath  <rharinath@novell.com>
8173
8174         Fix #78820
8175         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
8176         instance as an rvalue, even when we later resolve as an lvalue.
8177
8178 2006-10-25  Martin Baulig  <martin@ximian.com>
8179
8180         * anonymous.cs: Fix #79673.
8181
8182 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
8183
8184         A fix for bug #79666
8185         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
8186         ignored when is optimized (= default value) as its value is already set.
8187
8188 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
8189
8190         A fix for bug #79724
8191         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
8192         TypeContainer for type lookup.
8193
8194 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
8195
8196         A fix for bug #79231
8197         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
8198         * expression.cs (OverloadResolve): Always convert type name for
8199         an error message.
8200         (ResolveNamespaceOrType): Don't confuse a nested type with any 
8201         other member.
8202
8203 2006-10-18  Martin Baulig <martin@ximian.com>
8204
8205         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
8206
8207 2006-10-17  Miguel de Icaza  <miguel@novell.com>
8208
8209         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
8210         an int32, but requesting an int64 from the conversion
8211
8212 2006-10-12  Martin Baulig  <martin@ximian.com>
8213
8214         * anonymous.cs
8215         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
8216         
8217 2006-10-12  Martin Baulig  <martin@ximian.com>
8218
8219         * statement.cs
8220         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
8221
8222 2006-10-11  Miguel de Icaza  <miguel@novell.com>
8223
8224         * convert.cs: Remove broken code: I was doing the "Existance"
8225         tests for Implicit conversions.
8226
8227 2006-10-10  Miguel de Icaza  <miguel@novell.com>
8228
8229         * convert.cs: Added one missing case in
8230         ImplicitStandardConversionExists uint64 to intptr.
8231
8232         Fixes #59800
8233         
8234         * typemanager.cs (uintptr_type): another core known type.   
8235
8236         * ecore.cs (OperatorCast): routine used to do cast operations that
8237         depend on op_Explicit.  We could change some of the Decimal
8238         conversions to use this.
8239
8240         This one has a probe mechanism that checks both types for an op_
8241         which it coudl be used to eliminate two classes: CastToDecimal
8242         and CastFromDecimal.
8243
8244         * convert.cs: Implement the conversions documented in #59800
8245         
8246 2006-10-10  Martin Baulig  <martin@ximian.com>
8247
8248         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
8249         before RootScope.ResolveMembers().
8250
8251         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
8252         `CurrentType' if appropriate.
8253
8254 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
8255
8256         A fix for bug #78568
8257         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
8258         when contains binary operators.
8259         * cs-parser.jay: Updated.
8260
8261 2006-10-09  Martin Baulig  <martin@ximian.com>
8262
8263         * delegate.cs
8264         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
8265         moved that into Define() and also do the other type parameter
8266         checks there.  Fixes #79094.  Added gtest-292.cs.
8267
8268         * expression.cs
8269         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
8270         since that doesn't include type parameters; don't use `Ldelema'
8271         for type parameters.  Fixes #78980.  Added gtest-293.cs.
8272
8273 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
8274
8275         A fix for #77796
8276         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
8277         conversion is allowed.
8278
8279 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
8282         error reporting when no error occurs.
8283
8284 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
8285
8286         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
8287         does not exist.
8288
8289 2006-10-06  Raja R Harinath  <rharinath@novell.com>
8290
8291         Fix #79584
8292         * class.cs (DefineTypeBuilder): Check circular dependencies before
8293         setting the parent of the TypeBuilder.
8294         (CheckRecursiveDefinition): Don't use 'BaseType', since
8295         it may not be valid until after DefineTypeBuilder.  Use
8296         'base_type' instead.
8297
8298 2006-10-04  Martin Baulig  <martin@ximian.com>
8299
8300         Merged the Anonymous Methods patch.
8301
8302         * anonymous.cs, iterators.cs: The new anonymous methods code.
8303
8304         * statement.cs (Variable): New public abstract class.
8305         (LocalInfo.Variable): New public property.
8306         (LocalInfo.ResolveVariable): New public method.
8307         (Block.Flags): Add `IsIterator'.
8308         (Block.AddVariable): Improved the CS0136 check.
8309         (Block.AnonymousChildren): New public property.
8310         (Block.AddAnonymousChild): New public method.
8311         (ToplevelBlock): Update to use the new anonymous method framework.
8312         (ToplevelBlock.ctor): `container' is now a `Block' and not a
8313         `ToplevelBlock'; this is required to correctly implement the
8314         CS0136 check.
8315         (Fixed, Using): Use `TemporaryVariable' instead of directly
8316         creating the `LocalBuilder'.
8317
8318         * parameter.cs (Parameter.ResolveVariable): New public method.
8319         (Parameters.ResolveVariable): Likewise.
8320
8321         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8322
8323         * class.cs (TypeContainer): Replaced the `iterators' list and
8324         corresponding methods with a list of `CompilerGeneratedClass'es.
8325         (TypeContainer.ResolveMembers): New public method.
8326         (Method): `IIteratorContainer' has been replaced by
8327         `IAnonymousHost'.
8328
8329         * expression.cs (VariableReference): New public abstract base
8330         class for `LocalVariableReference', `ParameterReference' and
8331         `This'.
8332
8333         * codegen.cs (EmitContext): Removed `capture_context',
8334         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8335         (EmitContext.EmitThis): Removed.
8336
8337         * cs-parser.jay: Replace `iterator_container' with
8338         `anonymous_host'.       
8339
8340 2006-10-04  Martin Baulig  <martin@ximian.com>
8341
8342         * generic.cs (GenericMethod): Don't make this abstract.
8343         (Constraints.Clone): Added dummy implementation.
8344
8345 2006-10-04  Raja R Harinath  <harinath@gmail.com>
8346
8347         Fix #79577
8348         * namespace.cs (LookForAnyGenericType): Avoid nullref on
8349         'declspaces'.  Avoid allocating arrays willy-nilly.
8350
8351         Fix #79553
8352         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8353         cases out of the switch.
8354
8355 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8356
8357         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8358         message when non-generic type is used with the type arguments.
8359         * expression.cs: Updated.
8360
8361 2006-09-28  Raja R Harinath  <rharinath@novell.com>
8362
8363         Fix #79013
8364         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8365         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8366         Change semantics slightly.  Don't insist on having only one
8367         temporary EmptyExpression -- just throttle the creation of new ones.
8368
8369         Fix #79451
8370         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8371         non-interfaces too.  If no methods are found, don't try to create
8372         a MethodGroupExpr.
8373
8374 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
8375
8376         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8377         generic type.
8378
8379         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8380         us produce better error message.
8381
8382 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
8383
8384         * expression.cs (Binary.ResolveOperator): Warn about a side effect
8385         of the `|' operator.
8386
8387         * report.cs: A new warning added.
8388
8389 2006-09-27  Martin Baulig  <martin@ximian.com>
8390
8391         * generic.cs (GenericMethod): Don't make this abstract.
8392
8393 2006-09-27  Martin Baulig  <martin@ximian.com>
8394
8395         * report.cs
8396         (InternalErrorException): Added overloaded ctor taking a params array.
8397
8398 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
8399
8400         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8401         Fixed the cases when same error was reported twice.
8402
8403         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8404         now report symbol information.
8405
8406 2006-09-25  Martin Baulig  <martin@ximian.com>
8407
8408         * class.cs: Completely unified with the gmcs version.
8409
8410 2006-09-25  Martin Baulig  <martin@ximian.com>
8411
8412         * typemanager.cs (TypeManager.IsNullableType): New public function.
8413         (TypeManager.IsNullableTypeOf): Likewise.
8414         (TypeManager.IsNullableValueType): Likewise.
8415
8416         * class.cs (MethodCore): Added the `GenericMethod' argument from
8417         gmcs and also unified all classes derived from `MethodCore' with gmcs.
8418
8419 2006-09-24  Raja R Harinath  <harinath@gmail.com>
8420
8421         * convert.cs: Unify with gmcs version.
8422
8423 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8424
8425         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8426         verify them as well.
8427
8428         * report.cs: New warning.
8429
8430 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8431
8432         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8433         for anonymous block with out argument.
8434
8435 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
8436
8437         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8438         not used private events only.
8439
8440 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
8441
8442         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8443
8444         * const.cs (Const.Define): Check for constant type.
8445         (Const.IsConstantTypeValid): Looks for valid constant types.
8446
8447         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8448
8449         * ecore.cs (EmptyConstantCast): New common class for all constant based
8450         EmptyCast(s).
8451
8452         * expression.cs (Is.DoResolve): Handle null constant especially.
8453         (New.DoResolve): Check for new void().
8454         (MemberAccess.DoResolve): Cope with all kind of nulls.
8455
8456         * literal.cs (NullConstant): Uses EmptyConstantCast.
8457         (NullDefault): Based on EmptyConstantCast.
8458         (NullLiteral): Uses EmptyConstantCast.
8459
8460         * statement.cs (Block.ResolveMeta): Check for constant type.
8461
8462 2006-09-22  Martin Baulig  <martin@ximian.com>
8463
8464         * delegate.cs, attribute.cs: Merged with the gmcs versions.
8465
8466 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8467
8468         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8469         not the null type.
8470
8471         Fix part of #79451
8472         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8473         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
8474         code slightly.
8475
8476 2006-09-22  Martin Baulig  <martin@ximian.com>
8477
8478         * ecore.cs: Merged with the gmcs version.
8479
8480         * generic.cs (ConstructedType): New dummy class.
8481         (TypeArguments): Don't make this abstract.
8482
8483         * typemanager.cs
8484         (TypeManager.IsGenericTypeDefinition): New method.
8485         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8486
8487 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8488
8489         * expression.cs (ComposedCast): Check for arrays of TypedReference
8490         before creating the type, not after.
8491
8492 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
8493
8494         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8495         after ToType change.
8496
8497         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8498         when constant must be implicitly convertible.
8499
8500         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8501
8502         * ecore.cs (NullCast): Derives from NullConstant.
8503
8504         * expression.cs (Is.DoResolve): Removed useless variables.
8505         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8506         (New.Constantify): Add enum support.
8507         (MemberAccess.DoResolve): Add warning when accessing null constant or
8508         variable.
8509
8510         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8511         property.
8512
8513         * literal.cs (NullConstant): New abstract class with common
8514         functionality for all null specializations.
8515         (NullDefault): Represents default(X) when result can be
8516         reduced to null.
8517         (NullLiteral): Updated.
8518
8519         * report.cs: Add new warning.
8520
8521 2006-09-21  Martin Baulig  <martin@ximian.com>
8522
8523         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8524
8525 2006-09-21  Martin Baulig  <martin@ximian.com>
8526
8527         * generic.cs (GenericConstraints): New dummy class.
8528         (Constraints): Likewise.
8529         (TypeParameter): Likewise.
8530         (TypeParameterName): Likewise.
8531         (GenericMethod): Likewise.
8532
8533         * typemanager.cs (TypeManager.GetGenericArguments): New method.
8534
8535         * decl.cs: Merged with the gmcs version.
8536
8537 2006-09-21  Raja R Harinath  <rharinath@novell.com>
8538
8539         * generic.cs (TypeParameter): Implement IMemberContainer.
8540         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
8541
8542         * rootcontext.cs: Unify with gmcs version.
8543
8544         * report.cs: Unify with gmcs version.
8545         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8546         from gmcs/generics.cs.
8547         * generics.cs (TypeParameter): New dummy class.
8548
8549         * support.cs: Unify with gmcs version.
8550
8551 2006-09-20  Raja R Harinath  <rharinath@novell.com>
8552
8553         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8554         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8555
8556         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8557         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8558         * mcs.exe.sources: Add generic.cs.
8559
8560         * codegen.cs: Unify with gmcs version.
8561
8562         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8563         (EmitContext): Add GenericDeclContainer implementation.
8564         * decl.cs (MemberCore, DeclSpace): Likewise.
8565         * namespace.cs: Remove #ifdef GMCS_SOURCE.
8566
8567         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8568         MCS TypeManager has a corresponding dummy method.
8569
8570 2006-09-19  Martin Baulig  <martin@ximian.com>
8571
8572         * expression.cs: Completely merged with the gmcs version.
8573
8574 2006-09-19  Martin Baulig  <martin@ximian.com>
8575
8576         * expression.cs (Invocation): Merged with the gmcs version.
8577         (ArrayAccess.GetStoreOpcode): Likewise.
8578
8579 2006-09-19  Martin Baulig  <martin@ximian.com>
8580
8581         * typemanager.cs
8582         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8583         (TypeManager.IsGenericMethodDefinition): Likewise.
8584
8585 2006-09-19  Martin Baulig  <martin@ximian.com>
8586
8587         * typemanager.cs
8588         (TypeManager.IsEqual): Moved the gmcs implementation here.
8589         (TypeManager.DropGenericTypeArguments): Likewise.
8590         (TypeManager.DropGenericMethodArguments): Likewise.
8591         (TypeManager.GetTypeArguments): Moved here from gmcs.
8592         (TypeManager.HasGenericArguments): Likewise.
8593
8594 2006-09-19  Martin Baulig  <martin@ximian.com>
8595
8596         * expression.cs (Binary): Merged with the gmcs version.
8597
8598 2006-09-19  Martin Baulig  <martin@ximian.com>
8599
8600         * expression.cs (Probe, As, Is): Merged with the gmcs version.
8601
8602 2006-09-19  Martin Baulig  <martin@ximian.com>
8603
8604         * typemanager.cs: Merged with the gmcs version.
8605
8606 2006-09-16  Raja R Harinath  <rharinath@novell.com>
8607
8608         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8609         * driver.cs: Likewise.
8610
8611 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
8612
8613         A fix for #79401
8614         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8615         only if parent type is class.
8616         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8617         update.
8618
8619 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
8620
8621         * cs-parser.jay,
8622         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8623         keywords are used.
8624         * typemanager.cs(CSharpName): Converts NullType to null.
8625
8626 2006-09-15  Martin Baulig  <martin@ximian.com>
8627
8628         * typemanager.cs
8629         (TypeManager.GetMethodName): Added mcs implementation.
8630         (TypeManager.IsEqual): Likewise.
8631
8632         * ecore.cs
8633         (SimpleName.RemoveGenericArity): Added dummy implementation.
8634
8635         * pending.cs: Merged with the gmcs version.     
8636
8637 2006-09-15  Martin Baulig  <martin@ximian.com>
8638
8639         * statement.cs: Merge with the gmcs version.
8640
8641 2006-09-15  Martin Baulig  <martin@ximian.com>
8642
8643         * statement.cs (Switch): Merge with the gmcs implementation
8644         (without nullables), which is newer.
8645
8646 2006-09-15  Martin Baulig  <martin@ximian.com>
8647
8648         * statement.cs (Block.Variables): Make this public.
8649         (ToplevelBlock.Parameters): Make this a property.
8650         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8651
8652 2006-09-15  Martin Baulig  <martin@ximian.com>
8653
8654         * namespace.cs: Merge with the gmcs version.
8655
8656 2006-09-15  Martin Baulig  <martin@ximian.com>
8657
8658         * decl.cs (MemberName): Minor code cleanups.
8659
8660 2006-09-15  Martin Baulig  <martin@ximian.com>
8661
8662         * parameter.cs: Merge with the gmcs version.
8663
8664 2006-09-15  Martin Baulig  <martin@ximian.com>
8665
8666         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8667         and an error in mcs.
8668
8669 2006-09-15  Martin Baulig  <martin@ximian.com>
8670
8671         * flowanalysis.cs: Merged from GMCS; added the generics code into
8672         a `GMCS_SOURCE' conditional so we can share this file.
8673
8674 2006-09-08  Martin Baulig  <martin@ximian.com>
8675
8676         * typemanager.cs (TypeManager.interlocked_type): New public field.
8677         (TypeManager.int_interlocked_compare-exchange): New public field.
8678         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8679         enumerator types here and call InitGenericCoreTypes().
8680         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8681         after calling InitEnumUnderlyingTypes().
8682
8683         * rootcontext.cs
8684         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8685         `classes_second_stage'. 
8686
8687 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
8688
8689         * assign.cs, ecore.cs, expression.cs: Share error message text.
8690         * class.cs (FieldMember.Define): Check for varible of static type.
8691         * driver.cs (LoadAssembly): Uses error output for errors.
8692         * statement.cs: Updated.
8693
8694 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
8695
8696         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8697         type instance.
8698
8699 2006-09-07  Martin Baulig  <martin@ximian.com>
8700
8701         * driver.cs
8702         (MainDriver): Revert r62663 from Marek; see #70506 for details.
8703
8704 2006-08-29  Miguel de Icaza  <miguel@novell.com>
8705
8706         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8707         
8708 2006-08-17  Miguel de Icaza  <miguel@novell.com>
8709
8710         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8711         #52019 and #79064, the use of the \uXXXX sequence in source code
8712         to represent unicode characters.
8713
8714 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
8715
8716         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8717         support.
8718         * class.cs, ecore.cs, statement.cs: Merged to one error message.
8719
8720 2006-08-13  Miguel de Icaza  <miguel@novell.com>
8721
8722         * assign.cs: Catch attempts to assign to a method groups in += and
8723         report as 1656
8724
8725 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
8726
8727         A fix for #79056
8728         * cs-parser.jay: Don't destroy current array type by typeof of array's.
8729
8730 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
8731
8732         * class.cs (Method.Define): Issue a warning when generic method looks like
8733         an entry point.
8734         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8735         as well.
8736
8737 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
8738  
8739         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8740         looking for ctor.
8741         * decl.cs (MemberCache.FindMembers): When container is interface we need to
8742         search all base interfaces as a member can be ambiguous.
8743         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8744         Constructor member type filter. 
8745         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8746         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8747         reporting for returned memberinfos.
8748         * report.cs: Updated.
8749         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8750         version to work on all runtimes.
8751         (TypeManager.RealMemberLookup): Removed members filtering.
8752
8753 2006-08-08  Raja R Harinath  <rharinath@novell.com>
8754
8755         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8756         (PropertyExpr.EmitAssign): Likewise.
8757         * expression.cs (Indirection.EmitAssign): Likewise.
8758         (LocalVariableReference.EmitAssign): Likewise.
8759         (ParameterReference.EmitAssign): Likewise.
8760         (Invocation.EmitArguments): Likewise.
8761         (ArrayAccess.EmitAssign): Likewise.
8762         (IndexerAccess.EmitAssign): Likewise.
8763         (This.EmitAssign): Likewise.
8764         (ConditionalLogicalOperator.Emit): Likewise.
8765
8766         Fix #79026
8767         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
8768         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
8769         leave it in after returning it.
8770         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
8771
8772 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
8773
8774         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8775         message.
8776
8777 2006-08-03  Raja R Harinath  <rharinath@novell.com>
8778
8779         Fix cs0146-3.cs and cs0146-4.cs.
8780         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8781         enclosing types don't depend on the current type.
8782
8783 2006-08-02  Raja R Harinath  <rharinath@novell.com>
8784
8785         Fix #77963
8786         * class.cs (TypeContainer.DoDefineMembers): Use
8787         FindBaseMemberWithSameName on Parent, since we're interested in
8788         whether we hide inherited members or not.
8789         (FindBaseMemberWithSameName): Make slightly more robust.
8790
8791         Fix the non-generic testcase from #77396
8792         * decl.cs (DeclSpace.DeclContainer): Remove override.
8793
8794         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8795         declspaces for doppelgangers too.
8796         (UsingEntry): Implement IResolveContext.
8797         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
8798         'this' as the resolve context.
8799         (LocalAliasEntry): Likewise.
8800
8801         Implement parts of #77403
8802         * roottypes.cs (RootDeclSpace): New.  Used to represent the
8803         toplevel declaration space.  Each namespace declaration introduces
8804         a "partial" root declaretion space.
8805         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8806         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8807         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8808         from 'current_namespace.SlaveDeclSpace'.
8809         (namespace_declaration): Likewise.
8810         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8811         check.  It can't happen now.
8812         * decl.cs (DeclSpace.LookupType): Likewise.
8813         * driver.cs (MainDriver): Sanity check.
8814
8815 2006-08-01  Raja R Harinath  <rharinath@novell.com>
8816
8817         * decl.cs (DeclSpace.FindNestedType): Remove.
8818         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8819         LookupTypeContainer to get the container of the nested type.
8820         * class.cs (TypeContainer.FindNestedType): Make non-override.
8821
8822 2006-07-31  Raja R Harinath  <rharinath@novell.com>
8823
8824         * decl.cs (DeclSpace.PartialContainer): Move field from ...
8825         * class.cs (TypeContainer.PartialContainer): ... here.
8826         (TypeContainer.AddBasesForPart): New helper.
8827         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
8828         instead.
8829         * cs-parser.jay (current_class): Convert to DeclSpace.
8830         (struct_declaration, interface_declaration, class_declaration):
8831         Use AddBasesForPart instead of .Bases directly.
8832         * const.cs, iterators.cs: Update to changes.
8833
8834 2006-07-28  Raja R Harinath  <rharinath@novell.com>
8835
8836         * class.cs (TypeContainer.AddMemberType): Rename from
8837         AddToTypeContainer.
8838         (TypeContainer.AddMember): Rename from AddToMemberContainer.
8839         (AddTypeContainer): New.  Combine AddClassOrStruct and
8840         AddInterface.
8841         (AddPartial): Update.  Add 'is_partial' argument.
8842         * roottypes.cs: Update to changes.
8843         * cs-parser.jay (push_current_class): New helper for handling
8844         current_container and current_class.
8845         (struct_declaration, interface_declaration, class_declaration):
8846         Use it.
8847
8848 2006-07-26  Raja R Harinath  <rharinath@novell.com>
8849
8850         * roottypes.cs: Rename from tree.cs.
8851
8852         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8853         * tree.cs (Tree, ITreeDump): Remove types.
8854         * rootcontext.cs (tree, Tree): Remove fields.
8855         (root, ToplevelTypes): New.
8856         * *.cs: Update to rename.
8857
8858         * tree.cs (Tree.RecordDecl): Remove.
8859         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8860         namespace here.
8861         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8862
8863 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8864
8865         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8866         DoFlowAnalysis and OmitStructFlowAnalysis here.
8867         (ec.With): Rename from WithUnsafe and generalize.
8868         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8869         (ec.WithFlowAnalyis): New.
8870         * ecore.cs, expression.cs, statement.cs: Update.
8871
8872 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8873
8874         * statement.cs (Block.ResolveMeta): Simplify slightly.
8875
8876         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8877         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8878         check_state to flags.
8879         (CheckState, ConstantCheckState): Update.
8880         (InUnsafe): New read-only property.
8881         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8882         arbitrary flags.
8883         (WithUnsafe): New helper similar to WithCheckState.
8884         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8885         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8886
8887 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8888
8889         Make comparisons use the same IL irrespective of whether they're
8890         in a 'checked' or 'unchecked' context: one of the issues in #78899
8891         * codegen.cs (EmitContext.CheckState): Make read-only property.
8892         (EmitContext.ConstantCheckState): Likewise.
8893         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8894         helper that implement a save/restore stack for CheckState
8895         values.  This is the only way to change check-state.
8896         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8897         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8898         (CheckedExpr.EmitBranchable): New forwarding method.
8899         (UnCheckedExpr): Likewise.
8900         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8901         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8902         (Checked.Resolve, checked.DoEmit): Likewise.
8903
8904 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8905
8906         * anonymous.cs: Cache the resolved anonymous delegate, and return
8907         this so that the ResolveTopBlock is only triggered once, not
8908         twice.
8909
8910         Currently we trigger ResolvetopBlock twice due to a first pass of
8911         argument check compatibility, and a second pass that does the
8912         actual resolution.   
8913         
8914 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8915
8916         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8917         modifiers.
8918         * rootcontext.cs (Reset): Add helper_classes.
8919
8920 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8921
8922         A fix for #78860
8923         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8924         correctly.
8925
8926 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8927
8928         * statement.cs (Lock): Handle expressions of type
8929         TypeManager.null_type specially.  Fixes #78770
8930
8931 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8932
8933         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8934         to an event.
8935
8936 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8937
8938         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8939         for accessors as well.
8940         * ecore.cs (EventExpr): Add AccessorTable.
8941
8942 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8943
8944         A fix for #78738
8945         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8946         for CS0122 where appropriate.
8947         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8948         level attributes.
8949         (Filter): Assembly can be null in the case of top level attributes.
8950
8951 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8952
8953         A fix for #78690
8954
8955         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8956         is done at global level.
8957
8958 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8959
8960         A fix for #77002, Implemented TypeForwarder support.
8961
8962         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8963         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8964         * typemanager.cs (): Add type_forwarder_attr_type.
8965
8966 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8967
8968         * report.cs: Add CS0469 warning.
8969
8970 2006-06-21  Martin Baulig  <martin@ximian.com>
8971
8972         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8973         the `try'-block, so we also report CS0016 etc. there.
8974
8975 2006-06-21  Martin Baulig  <martin@ximian.com>
8976
8977         * delegate.cs
8978         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8979
8980 2006-06-21  Martin Baulig  <martin@ximian.com>
8981
8982         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8983         also report CS1686 for parameters.
8984
8985 2006-06-21  Martin Baulig  <martin@ximian.com>
8986
8987         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8988         instead of an error if the value is not implicitly convertible to
8989         the switch types; fixes #77964.
8990
8991 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8992
8993         Fix #78673
8994         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8995         FieldBuilder is null.
8996
8997         Fix #78662
8998         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8999         'left' and 'right' before error-checking.
9000
9001 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
9002
9003         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
9004         Fixed bug #78601.
9005         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
9006         (FieldExpr.DoResolve): likewise.
9007         (PropertyExpr.InstanceResolve): likewise.
9008         (EventExpr.InstanceResolve): likewise. 
9009
9010 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
9011
9012         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
9013         attribute applicable tests for attribute argument.
9014
9015 2006-06-02  Raja R Harinath  <rharinath@novell.com>
9016
9017         Fix #78079
9018         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
9019         (Binary.OverloadResolve_PredefinedIntegral): New.
9020         (Binary.OverloadResolve_PredefinedFloating): New.
9021         (Binary.OverloadResolve_PredefinedString): New.
9022         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
9023         Follow the standard more closely, and treat numeric promotions in
9024         terms of overload resolution.
9025         (Binary.CheckShiftArguments): Simplify.
9026
9027 2006-06-01  Raja R Harinath  <rharinath@novell.com>
9028
9029         * flowanalysis.cs (MyBitVector): Simplify representation.
9030         (MyBitVector.Clone): Avoid allocating BitArray.
9031         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
9032         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
9033         (*): Update.  Change all references to MyBitVector.And and
9034         MyBitVector.Or to &= and |=.
9035
9036 2006-05-29  Raja R Harinath  <rharinath@novell.com>
9037
9038         Fix cs0231-[34].cs.
9039         * cs-parser.jay (formal_parameter_list): Extend the pattern below
9040         to param arguments too.
9041
9042 2006-05-26  Miguel de Icaza  <miguel@novell.com>
9043
9044         * cs-parser.jay: Catch another parsing form for arglist being
9045         followed by other arguments.  Fixes #78313.
9046
9047 2006-05-24  Raja R Harinath  <rharinath@novell.com>
9048
9049         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
9050         checking of out parameters to ...
9051         (FlowBranchingToplevel.Merge): ... here.
9052         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
9053         set, propagate the origin upward, and only complain if there was
9054         no other error.
9055         (FlowBranchingException.AddContinueOrigin): Likewise.
9056         (FlowBranchingException.AddReturnOrigin): Likewise.
9057         (FlowBranchingException.AddGotoOrigin): Likewise.       
9058
9059 2006-05-23  Raja R Harinath  <rharinath@novell.com>
9060
9061         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
9062         unreachable, skip it.
9063         (FlowBranchingException.Merge): Always propagate jumps, even if
9064         the finally block renders subsequent code unreachable.
9065
9066 2006-05-18  Raja R Harinath  <rharinath@novell.com>
9067
9068         Fix #77601
9069         * statement.cs (Goto.Resolve): Move responsibility for resolving
9070         'goto' to FlowBranching.AddGotoOrigin.
9071         (Goto.SetResolvedTarget): New.  Callback to set the
9072         LabeledStatement that's the target of the goto.
9073         (Goto.DoEmit): Use Leave instead of Br when crossing an
9074         unwind-protect boundary.
9075         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
9076         LookupLabel and adjust to new semantics.
9077         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
9078         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
9079         Goto.SetResolvedTarget to update target.
9080         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
9081         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
9082         AddBreakOrigin & co.  Delay propagation until ...
9083         (FlowBranchingException.Merge): ... this.
9084
9085         * statement.cs (Block.Resolve): Always depend on flow-branching to
9086         determine unreachability.  Kill workaround that originally emitted
9087         only one statement after an "unreachable" label (see infloop in
9088         test-515.cs).
9089
9090         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
9091         This is still "wrong", but anything better would probably need a
9092         multi-pass algorithm.
9093         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
9094         usage vector.  Force current usage vector to be reachable, to
9095         optimistically signify backward jumps.
9096         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
9097         detected.
9098         (FlowBranchingLabeled.Merge): New.  If no backward jump was
9099         detected, return the original salted-away usage vector instead,
9100         updated with appropriate changes.  Print unreachable warning if
9101         necessary.
9102         * statement.cs (Block.Resolve): Don't print unreachable warning on
9103         a labeled statement.
9104
9105 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
9106
9107         * driver.cs: Pass filename without path to AssemblyBuilder's 
9108         AddResourceFile. Fixes bug #78407.
9109
9110 2006-05-17  Raja R Harinath  <rharinath@novell.com>
9111
9112         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
9113         * flowanalysis.cs (FlowBranchingLabeled): ... here.
9114         (FlowBranching.MergeChild): Overwrite
9115         reachability information from Labeled branchings too.
9116
9117 2006-05-16  Raja R Harinath  <rharinath@novell.com>
9118
9119         * statement.cs (Goto.Resolve): Merge jump origins here ...
9120         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
9121
9122         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
9123         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
9124         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
9125         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
9126         here, ...
9127         * statement.cs (Goto.Resolve): ... not here.
9128         (Goto.Emit): Remove CS1632 check.
9129
9130 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
9131
9132         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
9133         error message.
9134
9135 2006-05-11  Raja R Harinath  <rharinath@novell.com>
9136
9137         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
9138         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
9139         (FlowBranchingException.Label): Likewise.
9140
9141         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
9142         given value.
9143         (MyBitVector.Or): Use it to avoid losing information (Count).
9144         (FlowBranching.MergeOrigins): Likewise.
9145
9146         * flowanalysis.cs (UsageVector.IsDirty): Remove.
9147         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
9148         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
9149         (UsageVector.ToString): Simplify.
9150         (UsageVector.MergeSiblings): Move here from ...
9151         (FlowBranching.Merge): ... here.
9152         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
9153         not a MyBitVector.
9154
9155 2006-05-10  Raja R Harinath  <rharinath@novell.com>
9156
9157         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
9158         null bitvector is treated as all-true.
9159
9160         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
9161         (MyBitVector): Rationalize invariants.  'vector != null' implies
9162         that we have our own copy of the bitvector.  Otherwise,
9163         'InheritsFrom == null' implies all inherited bits are true.
9164
9165 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
9166
9167         * statement.cs (LocalInfo): Add IsConstant.
9168         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
9169         local variable for constants.
9170
9171 2006-05-09  Raja R Harinath  <rharinath@novell.com>
9172
9173         * flowanalysis.cs (MyBitVector.Empty): New.
9174         (MyBitVector): Don't allow InheritedFrom to be null.
9175         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
9176         (UsageVector, FlowBranching): Update to changes.
9177
9178         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
9179         recursion.  The 'Parent == null' condition isn't sufficient for
9180         anonymous methods.
9181         (FlowBranching.AddBreakOrigin): Likewise.
9182         (FlowBranching.AddContinueOrigin): Likewise.
9183         (FlowBranching.AddReturnOrigin): Likewise.
9184         (FlowBranching.StealFinallyClauses): Likewise.
9185         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
9186         (FlowBranching.CheckOutParameters): Likewise.
9187         (FlowBranchingToplevel): Terminate all the above recursions here.
9188         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
9189         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
9190
9191         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
9192         toplevel block.
9193         (FlowBranchingToplevel): New.  Empty for now.
9194         (FlowBranching.MergeTopBlock): Update.
9195         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
9196         branching for the anonymous delegate.
9197         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
9198
9199         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
9200         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
9201         information at the start of the merge.  Reorganize.
9202
9203 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9204
9205         * class.cs (MethodData.Define): Method cannot implement interface accessor.
9206
9207 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9208
9209         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
9210         to newly introduced ctor.
9211
9212         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
9213         message to one place.
9214         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
9215         global namespace.
9216
9217 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
9218
9219         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
9220
9221         * ecore.cs (Expression.ResolveAsConstant): Updated.
9222
9223         * statement.cs (ResolveMeta): Updated.
9224
9225 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
9226
9227         * cs-parser.jay: __arglist cannot be used in initializer.
9228
9229 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
9230
9231         A fix for #77879
9232         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
9233         private types.
9234
9235 2006-05-05  Raja R Harinath  <rharinath@novell.com>
9236
9237         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
9238         (LabeledStatement): Add 'name' parameter.
9239         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
9240         (Block.AddLabel): Update to changes.
9241         * cs-parser.jay (labeled_statement): Likewise.
9242
9243         * flowanalysis.cs (BranchingType.Labeled): New.
9244         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
9245         (FlowBranchingLabeled): New.  Does nothing for now, but will
9246         eventually handle 'goto' flows.
9247         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
9248         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
9249         that's terminated ...
9250         (Block.Resolve): ... here.
9251
9252         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
9253         (UsageVector.MergeFinallyOrigins): Likewise.
9254         (FlowBranching.InTryOrCatch): Likewise.
9255         (FlowBranching.AddFinallyVector): Likewise.
9256         (FlowBranchingException): Update to changes.
9257
9258         Fix #78290
9259         * statement.cs (Return.Resolve): Move error checking to ...
9260         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
9261         (FlowBranchingException): Handle return origins like break and
9262         continue origins.
9263         (FlowBranching.UsageVector.CheckOutParameters): Remove.
9264
9265 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
9266
9267         A fix for #76122
9268         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
9269         filter.
9270
9271 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
9272
9273         A fix for #77543
9274         * class.cs (MethodData.Define): Do public accessor check only when method
9275         implements an interface.
9276
9277 2006-05-04  Raja R Harinath  <rharinath@novell.com>
9278
9279         Remove special handling of 'break'
9280         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
9281         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
9282         (UsageVector.Break): Remove.
9283         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
9284         reachability.
9285         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
9286
9287         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
9288         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
9289
9290 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
9291
9292         A fix for #75726
9293         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
9294         be the interface member.
9295
9296 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
9297
9298         A fix for #60069
9299         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
9300         for emitting small (int) values.
9301
9302 2006-05-03  Raja R Harinath  <rharinath@novell.com>
9303
9304         Fix #59427
9305         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9306         control-flow passes through the 'finally' after merging-in all the
9307         control-flows from 'try' and the 'catch' clauses.
9308
9309         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9310         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
9311         always true at the only non-recursive entry point.
9312         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9313         FlowBranchingBreakable.
9314         (FlowBranchingLoop): Remove.
9315         * statement.cs (Return.DoResolve): Update to changes.
9316
9317         Fix #76471, #76665
9318         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9319         (FlowBranching.CreateBranching): Handle it: create a
9320         FlowBranchingContinuable.
9321         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9322         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9323         except that it handles the 'continue' command.
9324         (FlowBranching.UsageVector.MergeOrigins): Rename from
9325         MergeBreakOrigins.
9326         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9327         except that it overrides AddContinueOrigin.
9328         (FlowBranchingException): Override AddContinueOrigin, similar to
9329         AddBreakOrigin.
9330         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9331         Create a new branching around the embedded statement.
9332         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
9333         control flow after the embedded statement.
9334         (Continue.Resolve): Move all error checking to AddContinueOrigin.
9335
9336         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9337         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9338         FlowBranchingBreakable.
9339         (FlowBranchingSwitch): Remove.
9340
9341         Fix test-503.cs
9342         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
9343         error reporting to ...
9344         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9345         Rename from 'AddBreakVector'.  Add new location argument.  Return
9346         a bool indicating whether the 'break' crosses an unwind-protect.
9347         (FlowBranchingException.AddBreakOrigin): Add.
9348         (FlowBranchingException.Merge): Propagate 'break's to surrounding
9349         flowbranching after updating with the effects of the 'finally'
9350         clause.
9351         (FlowBranchingBreakable): New common base class for
9352         FlowBranchingLoop and FlowBranchingSwitch.
9353
9354         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9355         embedded statement.
9356         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9357
9358 2006-05-02  Raja R Harinath  <rharinath@novell.com>
9359
9360         * statement.cs (Do.Resolve): If the loop is infinite, set the
9361         barrier.
9362         (While.Resolve, For.Resolve): Set a barrier after the embedded
9363         statement.  There's no direct control flow that goes from the end
9364         of the embedded statement to the end of the loop.
9365         * flowanalysis.cs (FlowBranching.Infinite): Remove.
9366         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
9367         above ensure that the reachability is correctly computed.
9368
9369         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9370         (UsageVector.MergeBreakOrigins): If the current path is
9371         unreachable, treat it as if all parameters/locals are initialized.
9372         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
9373         infinite loops before merging-in break origins.
9374
9375         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9376         (Reachability.Reachable): Split part into ...
9377         (Reachability.Unreachable): ... this.  Simplify.
9378         (Reachability.IsUnreachable): Use 'Unreachable' instead.
9379
9380         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9381         (Reachability.SetThrowsSometimes): Likewise.
9382         (FlowBranchingBlock.MergeTopBlock): Don't compare against
9383         TriState.Always, use corresponding property.
9384         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9385         (Block.Resolve): Likewise.  Remove some redundant checks.
9386
9387 2006-05-02  Raja R Harinath  <harinath@gmail.com>
9388
9389         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9390         (Reachability.Meet): Don't bother checking AlwaysThrows --
9391         barrier is always set.
9392         (FlowBranchingBlock.Merge): Likewise.
9393
9394 2006-05-01  Raja R Harinath  <harinath@gmail.com>
9395
9396         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9397         checks for unreachable.
9398
9399 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
9400
9401         A fix for #77980
9402         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9403
9404         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9405         whether field is really assigned.
9406
9407 2006-04-30  Raja R Harinath  <harinath@gmail.com>
9408
9409         * flowanalysis.cs (Reachability): Make 4-argument constructor
9410         private.
9411         (Reachability.Meet): Rename from 'And'.  Remove static variant.
9412         (Reachability.Always): Rename from the highly misleading
9413         'Reachability.Never'.
9414         (FlowBranching.Merge): Update to changes.  Mark an impossible
9415         situation with a 'throw'.
9416         (*): Update to changes.
9417
9418 2006-04-29  Raja R Harinath  <harinath@gmail.com>
9419
9420         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9421         Remove 'Undefined'.
9422         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9423         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9424         (*): Update to changes.
9425         * statement.cs: Update to changes.
9426
9427 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
9428
9429         A fix for #78049
9430         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9431
9432 2006-04-28  Raja R Harinath  <harinath@gmail.com>
9433
9434         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9435         dummy UsageVector.
9436
9437         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9438         argument to two arguments: an usage-vector and a bool.  Move call
9439         to FlowBranching.Merge () ...
9440         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9441
9442         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9443         handling of loop and switch reachability to ...
9444         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9445
9446 2006-04-27  Raja R Harinath  <harinath@gmail.com>
9447
9448         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9449         handling to FlowBranchingLoop.InLoop.
9450         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9451
9452 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
9453
9454         A fix for #78115
9455         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9456         anonymous method is allowed from AnonymousContainer here.
9457
9458         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9459
9460 2006-04-24  Raja R Harinath  <rharinath@novell.com>
9461
9462         Fix #78156
9463         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9464
9465 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
9466
9467         A fix for #49011.
9468         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9469         (DoubleConstant.Reduce): Ditto.
9470
9471 2006-04-23  Raja R Harinath  <rharinath@novell.com>
9472
9473         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9474         Remove 'lvalue_right_side' argument.  Move parts to ...
9475         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9476         (LocalVariable.DoResolveLValue): ... these.
9477
9478 2006-04-21  Raja R Harinath  <rharinath@novell.com>
9479
9480         Fix cs1655.cs
9481         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9482         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9483         (LocalVariableReference.DoResolveBase): Use it to implement new
9484         CS1655 check.
9485         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9486         (Argument.Resolve): Simplify.  Move CS1510 check ...
9487         * ecore.cs (Expression.ResolveLValue): ... here.
9488         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9489         (PropertyExpr.DoResolveLValue): Likewise.
9490         (FieldExpr.Report_AssignToReadonly): Likewise.
9491         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
9492         LValueMemberAccess or LValueMemberOutAccess on instance depending
9493         on it.
9494         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9495         DoResolve as appropriate.
9496
9497 2006-04-20  Raja R Harinath  <rharinath@novell.com>
9498
9499         Fix #75800
9500         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9501         implicit conversions on 'out' and 'ref' arguments.
9502
9503         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9504         improve clarity.  Remove dead code.
9505
9506         Fix #66031
9507         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9508         (Catch.Resolve): Resolve VarBlock if it exists.
9509
9510 2006-04-19  Miguel de Icaza  <miguel@novell.com>
9511
9512         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9513         twice, this was some residual code, the enumerator was emitted
9514         properly in the two branche of if later.
9515
9516 2006-04-19  Raja R Harinath  <rharinath@novell.com>
9517
9518         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
9519         cast is never an lvalue.
9520         (Cast.DoResolve, Cast.ResolveRest): Combine.
9521         (Argument.Emit): Simplify slightly.  Move 'Expr is
9522         IMemoryLocation' check ...
9523         (Argument.Resolve): ... here.
9524         (Argument.Error_LValueRequired): Remove.  Inline into only user.
9525
9526         Simplifications.  Fix cs0191-2.cs
9527         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9528         CS1649 and CS1651 to ...
9529         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
9530         the actual selection of the error code and message to a lookup
9531         table.  Add a dummy return value to simplify callsites.
9532         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9533         readonly fields of other instances of the same type.  Move CS0197
9534         warning from ...
9535         * expression.cs (Argument.Resolve): ... here.  Simplify code.
9536         Ensure that ec.InRefOutArgumentResolving is only set during LValue
9537         resolution of an out or ref argument.  The code simplification
9538         above uses this invariant.
9539
9540 2006-04-18  Raja R Harinath  <rharinath@novell.com>
9541
9542         Possibly fix #77752.  Fix cs1690-[4-7].cs.
9543         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9544         CheckMarshallByRefAccess.  Drop parameter.
9545         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
9546         warning.
9547         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9548         InstanceExpression.
9549         * report.cs (AllWarnings): Add CS1690.
9550         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9551         for ref access too.
9552         (LocalVariableReference.DoResolveBase): Update.
9553
9554 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9555
9556         * class.cs (MethodOrOperator): Moved common parts from method class.
9557         detect obsolete attributes.
9558         (Method.Define): Simplified as it reuses code from base.
9559         (Constructor.ValidAttributeTargets): Fixed issue found during
9560         refactoring.
9561         (Destructor.ValidAttributeTargets): Fixed issue found during
9562         refactoring.
9563         (Operator): Finished refactoring set off by #78020. Operator class is now
9564         ordinary method class.
9565
9566         * anonymous.cs: Updated.
9567
9568         * decl.cs (DeclSpace): Add IsGeneric
9569
9570 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9571
9572         * class.cs (Constructor.Emit): Don't emit the attributes twice.
9573
9574 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9575
9576         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9577         detect obsolete attributes.
9578         (Method.CreateEmitContext): Moved to MethodOrOperator.
9579
9580 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9581
9582         A fix for #78048.
9583         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9584         customized exception to make crash detection easier.
9585         (MethodOrOperator): Started to work on new base class for methods and
9586         operators.
9587         (Method): Derives from MethodOrOperator.
9588         (Constructor.Emit): Emits its own attributes.
9589         (AbstractPropertyEventMethod.Emit): Ditto.
9590         (Operator): Derives from MethodOrOperator, will refactor fully in extra
9591         patch.
9592         (Operator.Emit): It's temporary more tricky than should be.
9593         
9594         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9595
9596         * report.cs (InternalErrorException): Add ctor with inner exception.
9597
9598 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
9599
9600         A fix for #76744.
9601         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9602         only not visible.
9603
9604 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
9605
9606         A fix for #77916.
9607         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9608         array.
9609
9610 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9611
9612         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9613         attribute is present and Guid not.
9614         (Interface.ApplyAttributeBuilder): Ditto.
9615
9616         * attribute.cs: Add error message.
9617
9618 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9619
9620         A fix for #78020.
9621
9622         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9623         sources (it's composite) so hold them in extra array as they are used in
9624         Emit phase only. It worked in the previous versions by mistake.
9625         (Attribute.Emit): Emit attribute for more owners when exist.
9626
9627         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9628         it has now different behaviour.
9629
9630 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
9631
9632         * constant.cs (Constant.IsDefaultInitializer): New method.
9633
9634         * class.cs: Updated.
9635
9636         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9637         re-initialize default values. It saves KBs almost for every assembly.
9638         Thanks Zoltan for the idea.
9639         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9640         (ArrayCreation.DoResolve): Resolve only once.
9641         (ArrayCreation.Emit): Emit static initializer only when it is faster.
9642         (ArrayCreation.GetAttributableValue): Cope with optimized values.
9643
9644 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
9645
9646         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9647         From #77961.
9648
9649 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9650
9651         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9652         in an embedded statement too.
9653
9654 2006-04-01  Raja R Harinath  <rharinath@novell.com>
9655
9656         Fix #77958
9657         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9658
9659 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9660
9661         A fix for #77966.
9662
9663         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9664         was not specified.
9665
9666         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9667
9668 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
9669
9670         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9671         phase.
9672
9673         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9674         LocalTemporary change.
9675
9676         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9677         TypeContainer.
9678         (ClassOrStruct.DefineFieldInitializers): Implemented static field
9679         initializers optimization.
9680         (ClassOrStruct.TypeAttr): Moved from modifiers.
9681         (Constructor.CheckBase): Don't crash when static ctor has parameters.
9682         (FieldBase.ResolveInitializer): Resolves initializer.
9683         (FieldBase.HasDefaultInitializer): New property.
9684
9685         * cs-parser.jay: Removed message.
9686
9687         * expression.cs (CompilerGeneratedThis): New specialization.
9688
9689         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9690
9691 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
9692
9693         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9694
9695 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9696
9697         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9698         be now EnumConstants only.
9699
9700 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9701
9702         * attribute.cs, driver.cs: Reset more caches.
9703
9704 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9705
9706         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9707
9708 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9709
9710         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9711         for easier reuse. Updated all overrides.
9712         (IntegralConstant): New base class for all integral constants.
9713         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9714         of the constant range, report custom error.
9715         (UIntConstant.Reduce): Fixed uint conversion.
9716
9717         * ecore.cs, literal.cs: Reduce updates.
9718
9719 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9720
9721         A fix for #75813.
9722
9723         * class.cs (Constructor.Define): Removed extra if for default ctors.
9724         A patch from Atsushi Enomoto.
9725
9726 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9727
9728         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9729         GetAttributableValue.
9730
9731         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9732         when required.
9733
9734         * convert.cs (ImplicitConversionRequired): Error message moved to
9735         DoubleLiteral.
9736
9737         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9738         automatic implicit conversion of an output value.
9739         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9740
9741         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9742         conversion.
9743         (TypeOf.GetAttributableValue): Add extra handling for object type.
9744
9745         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9746         special error message.
9747
9748 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
9749
9750         * class.cs (Constructor.Emit): Don't crash when struct ctor is
9751         InternalCall.
9752         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9753         compatible with MS runtime.
9754
9755 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
9756
9757         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9758         attribute arguments here.
9759
9760         * class.cs (Indexer.Define): The check was moved to attribute class.
9761
9762 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
9763
9764         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9765         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9766         easier.
9767
9768 2006-03-22  Raja R Harinath  <rharinath@novell.com>
9769
9770         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
9771         mcs to keep code differences small.
9772         * attribute.cs (Attribute.GetParameterDefaultValue): New.
9773         * typemanager.cs (parameter_default_value_attribute_type): New.
9774         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
9775         CS1908 check.
9776
9777 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9778
9779         * expression.cs (StringConcat.Append): Reverted back to no warning state.
9780
9781 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9782
9783         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9784
9785         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9786         the blocks too.
9787
9788 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
9789
9790         * doc-bootstrap.cs : fix build.
9791
9792 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9793
9794         * expression.cs (StringConcat.Append): Issue a warning when empty string
9795         is going to append.
9796
9797 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9798
9799         * assign.cs (CompoundAssign.ResolveSource): Removed.
9800
9801         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9802         clean up.
9803
9804         * class.cs (TypeContainer.FindMethods): Removed.
9805         (TypeContainer.CheckMemberUsage): Made static.
9806
9807         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9808
9809         * constant.cs (CheckRange): Removed unused type argument.
9810         (CheckUnsigned): Removed unused type argument.
9811
9812         * cs-parser.jay: Updated after MemberAccess clean up.
9813         Uses Length for empty string test.
9814
9815         * cs-tokenizer.cs: Uses Length for empty string test.
9816         (IsCastToken): Made static.
9817         (is_hex): Made static.
9818         (real_type_suffix): Made static.
9819
9820         * decl.cs (SetupCache): Made static.
9821         (OnGenerateDocComment): Removed unused ds argument.
9822
9823         * delegate.cs (VerifyDelegate): Removed unused argument.
9824
9825         * doc.cs: Uses Length for empty string test.
9826
9827         * driver.cs: Uses Length for empty string test.
9828
9829         * enum.cs (IsValidEnumType): Made static
9830
9831         * expression.cs (EnumLiftUp): Removed unused argument.
9832         (ResolveMethodGroup): Ditto.
9833         (BetterConversion): Ditto.
9834         (GetVarargsTypes): Ditto.
9835         (UpdateIndices): Ditto.
9836         (ValidateInitializers): Ditto.
9837         (MemberAccess.ctor): Ditto.
9838         (GetIndexersForType): Ditto.
9839
9840         * flowanalysis.cs: (MergeFinally): Removed unused argument.
9841
9842         * iterators.cs: Updated after MemberAccess clean up.
9843
9844         * location.cs: Uses Length for empty string test.
9845
9846         * namespace.cs: Uses Length for empty string test.
9847
9848          * report.cs (CheckWarningCode): Made static.
9849
9850         * statement.cs (LabeledStatement): Removed unused argument.
9851
9852         * typemanager.cs (FilterNone): Removed.
9853
9854 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9855
9856         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9857         obsolete.
9858
9859         * class.cs: Updated.
9860
9861 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9862
9863         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9864
9865 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9866
9867         A fix for #77822.
9868
9869         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9870         reporting, it's more tricky than I thought.
9871
9872 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9873
9874         A fix for #77816.
9875
9876         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9877         host container.
9878         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9879         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9880         Add more error reporting; Fixed issue with params.
9881
9882         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9883
9884         * cs-parser.jay: AnonymousMethod requires host container.
9885
9886         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9887
9888 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9889
9890         * class.cs: Change 'TypeContainer ds' constructor argument to
9891         'DeclSpace parent'.  Some classes were missed below due to
9892         different naming convention.
9893
9894         * class.cs (MemberCore.Parent): Delete.  This makes the
9895         ParentContainer changes below enforceable by the compiler.
9896
9897         Treat pointers to enclosing declaration space as 'DeclSpace', not
9898         'TypeContainer'.
9899         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9900         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9901
9902         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9903         of TypeContainer.
9904         (Block.AddThisVariable): Likewise.
9905         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9906         (AbstractPropertyEventMethod.Emit): Likewise.
9907         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9908         (GetMethod.Define, SetMethod.Define): Likewise.
9909         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9910         (DelegateMethod.EmitMethod): Likewise.
9911
9912         Fix regression test-partial-13.cs.
9913         Rationalize use of PartialContainer.  Ensure that the partial
9914         class semantics can be tied to type-correctness, i.e., any
9915         violation will cause a compile error.
9916         * class.cs, const.cs: Access all fields that belong to class
9917         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9918         Resolve()-like functions still use 'Parent'.
9919
9920         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9921         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9922         (PropertyMethod.CheckModifiers): Remove unused argument.
9923         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9924         DeclSpace.
9925
9926 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9927
9928         Make semantics of PartialContainer simpler.
9929         * decl.cs (DeclSpace.IsPartial): Remove.
9930         * class.cs (TypeContainer.IsPartial): Likewise.
9931         (TypeContainer..ctor): Set PartialContainer to point to self.
9932         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9933         (TypeContainer.FindNestedType): Likewise.
9934         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9935
9936 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9937
9938         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9939
9940 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9941
9942         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9943         classes.
9944
9945 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9946
9947         * class.cs (Operator.Define): An error for base conversion was not
9948         reported correctly.
9949
9950 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9951
9952         * iterator.cs : yield break is allowed in try statement which has
9953           catch clauses. Fixed bug #77767.
9954
9955 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9956
9957         A fix for #77593, #77574.
9958
9959         * class.cs (MethodCore.CheckBase): Another if for operator.
9960
9961 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9962
9963         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9964         were not resolved
9965
9966         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9967         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9968         conversion test.
9969         
9970         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9971         not needed.
9972
9973         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9974         Updated after another emitcontext usage was clean up. It should help us to
9975         synchronize with gmcs easier.
9976
9977 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9978
9979         A fix for #77353.
9980
9981         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9982         (Event.Define): ditto
9983         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9984
9985         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9986         Removed redundant code and set NewSlot for Invoke method too.
9987
9988         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9989         (Parameters.MergeGenerated): New method. Use this method when you merge
9990         compiler generated argument with user arguments.
9991
9992 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9993
9994         * attribute.cs (ResolveAsTypeTerminal): Removed.
9995
9996         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9997         specialization for predefined types; 30% speed up.
9998         Finally placed obsolete check to right place.
9999         (Expression.ResolveType): Removed.
10000
10001         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
10002         Updated after ResolveType was removed.
10003
10004         * expression.cs (Cast.ctor): Check void cast.
10005         (Binary.ResolveAsTypeTerminal): Is never type.
10006         (Conditional.ResolveAsTypeTerminal): Is never type.
10007
10008         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
10009
10010 2006-03-01  Raja R Harinath  <rharinath@novell.com>
10011
10012         Fix #77679.
10013         * expression.cs (ParameterReference.DoResolveBase): Change return
10014         type to bool.
10015         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
10016         Update.
10017
10018         Fix #77628.
10019         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
10020
10021         Fix #77642.
10022         * typemanager.cs (GetFullNameSignature): Don't nullref on
10023         protected accessors.
10024
10025 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
10026
10027         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
10028         these two separated members to simplify the code.
10029         (Attribute.Resolve): Refactored to use new fields and methods.
10030         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
10031         implemented obsolete attribute checking.
10032         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
10033         implemented obsolete checking again. It look line never ending quest ;-)
10034         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
10035
10036         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
10037
10038         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
10039
10040         *class.cs (Property.Define): Add RegisterProperty call.
10041
10042         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
10043         argument groups (only 2).
10044
10045         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
10046         encoding expression to arguments.
10047         (Expression.ExprClassToResolveFlags): Just turned to property.
10048
10049         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
10050         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
10051         optimized as well as implemented support for zero-length attributes.
10052
10053         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
10054         Add caching of PropertyInfo's.
10055
10056 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
10057
10058         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
10059         error multiple times.
10060
10061 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
10062
10063         New partial class implementation.
10064         A fix for #77027, #77029, #77403
10065
10066         * attribute.cs (Attributable): Made attributes protected.
10067
10068         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
10069         the replacements of ClassPart and PartialContainer.
10070         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
10071         (TypeContainer.AddInterface): Ditto.
10072         (TypeContainer.AddPartial): The main method for partial classes. It checks
10073         for errors and merges ModFlags and attributes. At the end class is added to
10074         partial_parts list.
10075         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
10076         required here.
10077         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
10078         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
10079         from the rest of partial classes.
10080         (TypeContainer.GetClassBases): Simplified.
10081         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
10082         DefineType.
10083         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
10084         (TypeContainer.HasExplicitLayout): Uses Flags now.
10085         (PartialContainer): Removed.
10086         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
10087         (StaticClass): Was merged with Class.
10088         (Class.GetClassBases): class and static class bases are verified here.
10089         (Class.TypeAttr): Added static attributes when class is static.
10090         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
10091         (MemberBase): In some cases we need to call parent container for partial
10092         class. It should be eliminated but it's not easy now.
10093
10094         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
10095
10096         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
10097         partial classed to accumulate class comments.
10098         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
10099
10100         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
10101
10102         * driver.cs (MainDriver): Tree.GetDecl was removed.
10103
10104         * modifiers.cs (Modifiers): Add partial modifier.
10105
10106         * tree.cs (Tree.decl): Removed.
10107         (RootTypes): Started to use this class more often for root types
10108         specializations.
10109
10110 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
10111
10112         A fix for #77615
10113
10114         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
10115         external interface does not have an attribute.
10116
10117 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
10118
10119         Another prerequisites for new partial classs implementation.
10120         
10121         * attribute.cs (Attribute.Equal): Implemented.
10122         (Attribute.Emit): Changed as attributes can be applied more than twice.
10123         (Attributes.Emit): Check for duplicate attributes here.
10124
10125         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
10126         as a parameter, clean-up.
10127
10128 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
10129
10130         A fix for #77485
10131
10132         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
10133         contains obsolete attribute check which can in some cases look for base
10134         type of current class which is not initialized yet.
10135         (TypeContainer.BaseType): Replacement of ptype.
10136
10137         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
10138
10139 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
10140
10141         First of prerequisites for new partial classs implemention.
10142         
10143         * attribute.cs (Attributable): Extended by ResolveContext;
10144         Attributes finally have correct context for resolving in all cases.
10145         (AttachTo): Attribute owner is assigned here.
10146
10147         * codegen.cs (IResolveContext): Introduce new interface to hold
10148         all information needed in resolving phase.
10149         (EmitContext): Implements IResolveContext; more clean-up needed here.
10150         
10151         * decl.cs (MemberCore): Implemented IResolveContext.
10152
10153         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
10154         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
10155         parameter.cs, statement.cs, tree.cs, typemanager.cs:
10156         Refactored to use new IResolveContext instead of EmitContext; cleanup
10157
10158 2006-02-06  Miguel de Icaza  <miguel@novell.com>
10159
10160         * codegen.cs (EmitScopeInitFromBlock): check here the
10161         capture_context, there is no need to make two calls to the
10162         EmitContext. 
10163
10164         * anonymous.cs: Add some debugging messages that might help me
10165         track other instances of this problem in the future (the
10166         regression of test 467).
10167
10168         * cs-parser.jay: track the variable block, as we need to initalize
10169         any captured variables declared in this block for the "catch"
10170         portion of the "Try" statement.
10171
10172         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
10173         scope initialization for captured variables. 
10174
10175         Also, move the emit for the variables after the block location has
10176         been marked.
10177
10178 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
10179
10180         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
10181
10182 2006-02-02  Miguel de Icaza  <miguel@novell.com>
10183
10184         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
10185         commit yesterday, the initialization for the roots is necessary.
10186         What is not necessary is the scope activation.
10187
10188 2006-02-02  Raja R Harinath  <rharinath@novell.com>
10189
10190         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
10191         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
10192         CS0206 checks.
10193         (Argument.Resolve): Remove CS0206 checks.
10194
10195 2006-02-01  Miguel de Icaza  <miguel@novell.com>
10196
10197         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
10198         scopes for all the roots, the scopes will now be emitted when the
10199         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
10200
10201         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
10202         code.  This reduces a lot of existing cruft.
10203         
10204         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
10205         that the ScopeInfo is generated as we enter the scope, not at the
10206         time of use, which is what we used to do before.
10207
10208         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
10209         every time a Block is about to be emitted if we have a
10210         CaptureContext. 
10211
10212 2006-02-01  Raja R Harinath  <rharinath@novell.com>
10213
10214         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
10215         (Reset): Update.
10216         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
10217
10218         * typemanager.cs (cons_param_array_attribute): Make private.
10219         (Reset): Set it to null.
10220         (InitCoreHelpers): Don't initialize it.
10221         (ConsParamArrayAttribute): New.  Initialize it as needed.
10222         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
10223
10224 2006-01-31  Miguel de Icaza  <miguel@novell.com>
10225
10226         * expression.cs: There might be errors reported during the
10227         selection of applicable methods.  If there are errors, do not
10228         continue execution as it will lead the compiler to crash.
10229
10230 2006-01-30  Miguel de Icaza  <miguel@novell.com>
10231
10232         * expression.cs: Member access is not allowed on anonymous
10233         methods.  Fixes #77402.
10234
10235 2006-01-30  Raja R Harinath  <rharinath@novell.com>
10236
10237         Fix #77401
10238         * cs-parser.jay (VariableDeclaration): Don't set
10239         current_array_type to null.
10240         (field_declaration, event_declaration, declaration_statement):
10241         Set it to null here.
10242
10243 2006-01-28  Raja R Harinath  <harinath@gmail.com>
10244
10245         * typemanager.cs (GenericParameterPosition): New.
10246         * doc.cs: Use it.
10247
10248 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
10249
10250         * doc.cs : To process "include" elements, first we should create
10251           another list than XmlNodeList, because it could result in node
10252           removal, which could result in that the XmlNodeList gives up
10253           yielding next node.
10254
10255           (Also made code identical to gmcs again.)
10256
10257 2006-01-25  Miguel de Icaza  <miguel@novell.com>
10258
10259         * ecore.cs: Introduce an error report that we were not catching
10260         before, if not silent, we must report the error.  Gonzalo ran into
10261         it.
10262
10263 2006-01-23  Miguel de Icaza  <miguel@novell.com>
10264
10265         A fix for bug: #76957
10266         
10267         * iterators.cs (MoveNextMethod.CreateMethodHost): call
10268         ComputeMethodHost before creating the method, this is a new
10269         requirement. 
10270
10271         * anonymous.cs (AnonymousContainer): Now we track all the scopes
10272         that this method references (RegisterScope).  The actual scope
10273         where the method is hosted is computed with the ComputeMethodHost
10274         before we create the method.
10275
10276         Moved the Deepest routine here.
10277
10278         (AnonymousContainer.ComputeMethodHost): New routine used to
10279         compute the proper ScopeInfo that will host the anonymous method.
10280
10281         (ScopeInfo): Deal with multiple roots.  The problem was that we
10282         did not have a unique root where all ScopeInfos could be hanged
10283         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
10284         of roots.  
10285
10286         Remove AdjustMethodScope which is now computed at the end.  Remove
10287         LinkScope which did a partial link, instead link all ScopeInfos
10288         before code generation from the new "LinkScopes" routine. 
10289
10290         Simplify all the Add* routines as they no longer need to maintain
10291         the tree, they just need to record that they are using variables
10292         from a ScopeInfo.
10293
10294         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
10295         routines to produce the forest of ScopeInfo trees.
10296
10297         * class.cs (TypeContainer.AppendMethod): This is just like
10298         AddMethod, but ensures that an interface implementation method
10299         (IEnumerable.XXX) is not inserted at the beginning of the queue of
10300         methods, but at the end.
10301
10302         We use this functionality to ensure that the generated MoveNext
10303         method in the iterator class is resolved/emitted before the
10304         enumerator methods created.   
10305
10306         This is required because the MoveNext method computes the right
10307         ScopeInfo for the method.  And the other methods will eventually
10308         need to resolve and fetch information computed from the anonymous
10309         method. 
10310
10311 2006-01-21  Raja R Harinath  <harinath@gmail.com>
10312             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
10313
10314         Fix rest of #76995.
10315         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10316         the 'aliases' hash.
10317         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10318         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10319
10320 2006-01-18  Raja R Harinath  <rharinath@novell.com>
10321
10322         Fix #76656, cs0231-2.cs.
10323         * cs-parser.jay (formal_parameter_list): Make error case catch
10324         more issues.
10325         (parenthesized_expression_0): Add CS1026 check.
10326         (invocation_expression): Remove unused { $$ = lexer.Location }.
10327
10328 2006-01-17  Raja R Harinath  <rharinath@novell.com>
10329
10330         Fix #76824.
10331         * cs-parser.jay (statement_expression): Don't list out the
10332         individual statement-expressions.  Convert syntax error into
10333         CS0201 check.
10334
10335 2006-01-16  Raja R Harinath  <rharinath@novell.com>
10336
10337         Fix #76874.
10338         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10339         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
10340         CheckIntermediateModification.
10341         (FieldExpr.DoResolve): Add new two-argument version that
10342         allows us to resolve the InstanceExpression as an lvalue.
10343         The one-argument variant is now just a wrapper.
10344         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10345         Resolve the lhs as an lvalue if the it has a value type.
10346         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10347         from Assign.DoResolve.
10348         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10349         resolved as an lvalue.
10350         (PropertyExpr.DoResolve): Update.
10351         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10352         has a value type.  Move CS1612 check here from
10353         CheckIntermediateModification.
10354         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10355         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
10356         'right_side' of a ResolveLValue on an 'out' argument.
10357         (EmptyExpression.LValueMemberAccess): New.  Used as the
10358         'right_side' of a propagated ResolveLValue on a value type.
10359         (LocalVariableReference.DoResolveBase): Recognize
10360         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10361         Add CS1654 check.
10362         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10363         EmptyExpression.Null.
10364
10365 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
10366
10367         * typemanager.cs : added IsGenericParameter(). In mcs it always
10368           return false.
10369         * doc.cs : for generic parameters, use GenericParameterPosition,
10370           not FullName.
10371
10372 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
10373
10374         * expression.cs: Fix Console.WriteLine ((this = x).foo);
10375
10376 2006-01-12  Miguel de Icaza  <miguel@novell.com>
10377
10378         This fixes the problem where we used ldfld instead of ldflda to
10379         load the "THIS" pointer on captured parameters, when THIS is a
10380         value type.  See bug #77205.
10381         
10382         * iterators.cs (CapturedThisReference.Emit): Pass false to
10383         EmitThis (we do not need the address).
10384
10385         * codegen.cs (EmitThis): it needs to know whether we need the
10386         address of `this' or not.  This is used by value types.  
10387
10388         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10389         every other call passes false.
10390
10391 2006-01-12  Raja R Harinath  <rharinath@novell.com>
10392
10393         Fix #77221.
10394         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10395         GetOverride.
10396         * expression.cs (Invocation.OverloadResolve): Update.
10397         (Invocation.DoResolve): Avoid double resolution of invocation.
10398
10399 2006-01-11  Raja R Harinath  <rharinath@novell.com>
10400
10401         Fix #77180.
10402         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10403         unary negation of floating point types as 0-expr; negation cannot
10404         overflow in floating point types.
10405
10406         Fix #77204.
10407         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10408         on operands of 'void' type.
10409
10410         Fix #77200.
10411         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10412         and ExclusiveOr for boolean constants too.
10413
10414 2006-01-09  Raja R Harinath  <rharinath@novell.com>
10415
10416         Fix #75636.
10417         * expression.cs (Invocation.OverloadResolve): Replace reflected
10418         override methods with their base virtual methods, rather than
10419         skipping over them.
10420         * typemanager.cs (TypeManager.GetOverride): New.
10421
10422 2006-01-05  Jb Evain  <jbevain@gmail.com>
10423
10424         * class.cs (Property.Define, Indexer.Define): do not tag the
10425         properties as SpecialName | RTSpecialName.
10426
10427 2006-01-04  Miguel de Icaza  <miguel@novell.com>
10428
10429         * class.cs (MethodCore.IsDuplicateImplementation): This method was
10430         doing a low-level comparission of parameter types.  It was lacking
10431         a check for __argslist. 
10432
10433 2005-12-30  Miguel de Icaza  <miguel@novell.com>
10434
10435         * expression.cs (ParameterReference.DoResolveBase): Allow
10436         reference parameters if they are local to this block. 
10437
10438         This allows the ref and out parameters of a delegate to be used in
10439         an anonymous method, for example:
10440
10441         delegate void set (out int x);
10442
10443         set s = delegate (out int x){
10444                 x = 0;
10445         };
10446
10447         This is used by functionality introduced late in the C# language.
10448         
10449         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10450         method that take ref and out parameters. 
10451
10452         Fixes #77119 which was a late change in the spec.
10453
10454 2005-12-23  Miguel de Icaza  <miguel@novell.com>
10455
10456         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10457         parent if its the same scope.  Fixes #77060.
10458
10459 2005-12-21  Miguel de Icaza  <miguel@novell.com>
10460
10461         * driver.cs: Report the case of no source files and no -out:
10462         argument provided.
10463
10464 2005-12-20  Raja R Harinath  <rharinath@novell.com>
10465
10466         Fix #77035.
10467         * expression.cs (ComposedCast.GetSignatureForError): Define.
10468
10469 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10470
10471         Fix #76995
10472
10473         * namespace.cs (NamespaceEntry): Add extern_aliases as a
10474         ListDictionary, to contain the ExternAliasEntry entries (in
10475         addition to the NamespaceEntry.aliases hashtable). This field is
10476         shared between the original entry and its doppelganger (bodyless 
10477         copy of it).
10478         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10479         extern_aliases field.
10480         (NamespaceEntry.Lookup): Move the IsImplicit check after the
10481         lookup in extern_aliases.
10482
10483 2005-12-16  Raja R Harinath  <rharinath@novell.com>
10484
10485         Fix #77006.
10486         * class.cs (TypeContainer.Mark_HasEquals): New.
10487         (TypeContainer.Mark_HasGetHashCode): New.
10488         (ClassPart): Override them.
10489         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10490
10491         Fix #77008.
10492         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10493         'parent' argument to the base constructor.
10494
10495         Remove all mention of TypeContainer from decl.cs.
10496         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10497         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10498         (DeclSpace.DeclSpace): Likewise.
10499         (DeclSpace.DefineMembers): Remove unused argument.
10500         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
10501         debugging check -- we don't care if the debug code throws an
10502         InvalidCastException instead of an InternalErrorException.
10503         * class.cs (TypeContainer.DefineMembers): Update to changes.
10504         (TypeContainer.DoDefineMembers): Likewise.
10505         (TypeContainer.GetMethods): Likewise.
10506         (PropertyMember.Define): Likewise.
10507         (MemberBase.Parent): New property that forwards to
10508         MemberCore.Parent, but ensures that we get a TypeContainer.
10509         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10510         (RootContext.PopulateTypes): Likewise.  Remove special case code
10511         for !RootContext.StdLib: DefineMembers is idempotent.
10512
10513 2005-12-14  Miguel de Icaza  <miguel@novell.com>
10514
10515         * convert.cs (ExplicitConversionCore): Check the return value from
10516         ExplicitConversionCore which can return null on failure.  Fixes #76914
10517
10518 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
10519
10520         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10521
10522 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
10523
10524         * doc.cs : The search for referenced namespace was insufficient to
10525           get global one as it used to do. Fixed bug #76965.
10526
10527 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
10528
10529         * doc.cs : check name in cref in the last phase that whether it is
10530           namespace or not.
10531
10532 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10533
10534         * cs-tokenizer.cs : reverted the latest change: it somehow broke
10535           Mono.C5.
10536
10537 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10538
10539         * doc.cs : so it turned out that we cannot skip override check for 
10540           interface members. Fixed bug #76954.
10541
10542 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10543
10544         * cs-tokenizer.cs : fixed bug #75984:
10545           - #warning and #error should not be handled when the source line
10546             is disabled.
10547           - #line is not checked strictly when the source line is disabled.
10548           - #define and #undef is on the other hand checked strictly at any
10549             state.
10550
10551 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
10552
10553         * cs-tokenizer.cs : missing Location (actually, filename) in one of
10554           CS1027 report.
10555
10556 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10559
10560         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10561         event initializers.
10562         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10563         (FieldBase.Initializer): Initializer is now optional.
10564         (EventField.Define): Only event field can have initializer.
10565
10566         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10567
10568         * const.cs (Const): Reuse initializer.
10569
10570         * cs-parser.jay: Updated after FieldBase changes.
10571         Added current_array_type to simplify array initializers.
10572
10573         * ecore.cs (NullCast.IsDefaultValue): Implemented.
10574
10575         * expression.cs, iterators.cs: Updated.
10576
10577         * namespace.cs (NamespaceEntry): Made UsingFound private.
10578
10579 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10580
10581         * parameterCollection.cs: Obsolete, removed.
10582         * parser.cs: Obsolete, removed.
10583
10584 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10585
10586         Fix #76849.
10587         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10588
10589         * enum.cs (Enum.Define): Set obsolete context here.
10590
10591 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10592
10593         * doc.cs :
10594           - FindDocumentedMember() now expects 1) paramList as null
10595             when "we don't have to check the number of parameters" and
10596             2) Type.EmptyTypes when "there is no arguments".
10597           - Introduced FoundMember struct to hold the exact type which was
10598             used to find the documented member (the above change broke
10599             test-xml-044; it might be better just to use DeclaringType than
10600             what MS does, like this change does, but it depends on usage.)
10601
10602 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10603
10604         * doc.cs : documented member might be from DeclaringType for nested
10605           types. Fixed bug #76782.
10606
10607 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
10608
10609         * anonymous.cs: Have the param code handle leaving copies on the
10610         stack etc. Allows anonymous params to take part in the assignment
10611         code (++, +=, etc). Fixes bug #76550
10612
10613         * expression.cs: Handle the prepare_for_load/leave_copy by passing
10614         it down to the anon code.
10615
10616         * iterators.cs: Use dummy var here
10617
10618         * codegen.cs: Handle new vars
10619
10620 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10621
10622         Fix #76849.
10623         * class.cs (MethodData.Define): Set proper Obsolete context.
10624
10625         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10626         obsolete context.
10627         (FieldExpr.DoResolve): Ditto.
10628
10629 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10630
10631         Fix #76849.
10632         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10633         parent is not obsolete.
10634
10635 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
10636
10637         * doc.cs : (FindDocumentedMember) find parameterless members first
10638           and get CS0419 in the early stage. Fixed first case of bug #76727.
10639
10640 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
10641
10642         Fix #76859.
10643         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10644         no error was reported.
10645
10646         *expression.cs (Binary.DoResolve): left can be null.
10647
10648 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
10649
10650         Fix #76783.
10651         * class.cs (MethodData.Emit): Parameters should be labeled first.
10652
10653 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
10654
10655         Fix #76761.
10656         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10657
10658 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
10659
10660         * attribute.cs (AreParametersCompliant): Moved to Parameter.
10661
10662         * class.cs (MethodCore): Parameter clean up.
10663         (IMethodData): Added ParameterInfo.
10664         (MethodData): Parameter clean up.
10665         (Indexer.Define): Parameter clean up.
10666
10667         * anonymous.cs,
10668         * codegen.cs,
10669         * cs-parser.jay,
10670         * decl.cs,
10671         * doc.cs,
10672         * ecore.cs,
10673         * flowanalysis.cs,
10674         * iterators.cs,
10675         * pending.cs,
10676         * statement.cs,
10677         * typemanager.cs: Parameter clean up.
10678
10679         * delegate.cs (Define): Get rid of duplicated code.
10680
10681         * expression.cs (ParameterReference): Removed useless parameters
10682         and simplified.
10683         (Invocation): Ditto.
10684
10685         * parameter.cs (ParamsParameter): New class, params specialization.
10686         (ArglistParameter): Attemp to separate arglist.
10687         (Parameter): Refactored to be reusable and faster.
10688         (Parameter.Modifier): Made understandable.
10689         (Parameters): Changed to be used as a class for `this' assembly
10690         parameters. Refactored to use new specialized classes.
10691
10692         * support.cs (ParameterData): Added Types property.
10693         (InternalParameters): Deleted.
10694
10695 2005-08-20  Martin Baulig  <martin@ximian.com>
10696
10697         Merging this patch from GMCS to fix #75867.
10698
10699         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10700         scope if we don't already have it.
10701
10702 2005-11-17  Martin Baulig  <martin@ximian.com>
10703
10704         * anonymous.cs
10705         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10706         inherit the scope from our parent.  Fixes #76653.
10707
10708 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10709
10710         * doc.cs : the previous patch does not actually fix the bug.
10711           PropertyInfo override check is now implemented and really fixed it.
10712         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10713
10714 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10715
10716         * doc.cs : apply "override filter" also to properties.
10717           Fixed bug #76730.
10718
10719 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10720
10721         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10722           no need to check overrides. For classes, omit those results from 
10723           interfaces since they must exist in the class. Fixed bug #76726.
10724
10725 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10726
10727         * typemanager.cs : (GetFullNameSignature) differentiate indexers
10728           with different parameters. Fixed the second problem in #76685.
10729
10730 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10731
10732         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10733           get expected 'protected' access in CheckValidFamilyAccess()).
10734           Fixed bug #76692.
10735
10736 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10737
10738         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10739           Fixed bug #76705.  CS1569 was incorrectly commented out.
10740
10741 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10742
10743         * doc.cs : use Invocation.IsOverride() to do real override check.
10744         * expression.cs : made Invocation.IsOverride() internal.
10745
10746 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10747
10748         * doc.cs : use TypeManager.FindMembers() instead of (possible)
10749           TypeBuilder.FindMembers() and filter overriden base members out.
10750           Fixed bug #76990.
10751
10752 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10753
10754         * doc.cs : ref/out parameters are represented as '@' (instead of
10755           '&' in type FullName). Fixed bug #76630 (additionally crefs).
10756
10757 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10758
10759         * doc.cs : when there was no '.' in cref to methods in doc comment,
10760           then parameters were missing in the output. Fixed bug #76691.
10761
10762 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10763
10764         * driver.cs : don't output docs when there is an error.
10765           Fixed bug #76693.
10766
10767 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10768
10769         * doc.cs :
10770           Now it should detect indexers. Fixed primary concern in bug #76685.
10771           Fixed CS0419 message to not show the identical member signature in
10772           the message.
10773
10774 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10775
10776         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10777           instead of Type.FindMembers() since it does not handle events.
10778           Fixed bug #71604.
10779
10780 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
10781
10782         * codegen.cs: Fixed typo (speficied -> specified).
10783
10784 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10785
10786         Fix #76369.
10787         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10788
10789 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10790
10791         * attribute.cs: Changed error message.
10792
10793         * cs-tokenizer.cs: One more check.
10794
10795 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10796
10797         * statement.cs (Block.Resolve): Ignore empty statement.
10798
10799 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10800
10801         * report.cs: Made error/warning methods more strict to avoid
10802         their misuse.
10803
10804         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10805         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10806         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10807         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10808
10809 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
10810
10811         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10812         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10813
10814         * class.cs (TypeContainer.IsComImport): New property.
10815         (Constructor.Define): Create proper ctor for ComImport types.
10816
10817         * expression.cs (New.CheckComImport): Fixed.
10818
10819 2005-11-07  Miguel de Icaza  <miguel@novell.com>
10820
10821         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10822         that a parameter has been captured does not mean that we do not
10823         have to do the rest of the processing.  This fixes the second part
10824         of #76592.  If there was another anonymous method capturing
10825         values in the past, the Scope would never be set for the second
10826         method that captured the same parameter.
10827
10828         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10829         properly manipulate the stack.   Second part of fix for #76592.
10830
10831         * expression.cs (New): Add support for invoking "new" on
10832         interfaces that have been flagged with the ComImport attribute and
10833         the CoClass.  Fixes #76637 
10834
10835         * statement.cs (Try.DoEmit): When a variable is captured, do not
10836         try to emit the vi.LocalBuilder variable as it has been captured.
10837         Create a temporary variable and store the results on the
10838         FieldBuilder.  Fixes #76642
10839
10840 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
10841
10842         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10843
10844         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10845
10846         * expression.cs (Binary.DoResolve): Added && optimalization.
10847     
10848         * typemanager.cs (AddUserType): Removed useless argument.
10849
10850 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
10851
10852         * statement.cs (Block.variables): Uses ListDictionary.
10853
10854 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10855
10856         Fix #75969.
10857         * class.cs (PartialContainer.EmitType): Customized to emit
10858         security attributes.
10859         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10860         for partial classes.
10861
10862 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10863
10864         Fix #76599.
10865         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10866         access has to be fixed.
10867         
10868         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10869
10870 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10871
10872         Fix #76590.
10873         * ecore.cs (NullCast.Reduce): Implemented.
10874
10875         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10876         constant type.
10877         
10878         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10879         properly.
10880         (Foreach.Resolve): Catch null properly.
10881
10882 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10883  
10884         * cs-tokenizer.cs: Warning text fix.
10885
10886         * driver.cs: AllWarningNumbers exposed on public interface.
10887
10888         * report.cs (): Reviewed warning numbers.
10889         (IsValidWarning): Use binary search.
10890
10891 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10892  
10893         * driver.cs: Implemeted resource visibility.
10894         (Resources): New class for code sharing between /res: and
10895         /linkres:
10896  
10897 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10898
10899         Fix #76568.
10900         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10901         folding.
10902         
10903         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10904         contants only.
10905         
10906         * ecore.cs (NullCast): Child is contant only.
10907         
10908         * literal.cs (NullLiteral.Reduce): null can be converted to any
10909         reference type.
10910
10911 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10912
10913         * driver.cs: Use Encoding.Default as default code page instead
10914           of ISO-28591.
10915
10916 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10917
10918         Fix #76085.
10919         * expression.cs (Invocation.Error_InvalidArguments): Handle
10920         __arglist parameters.
10921         (Invocation.VerifyArgumentsCompat): Likewise.
10922         * support.cs (ReflectionParameters.GetSignatureForError): Print
10923         __arglist parameters.
10924         (InternalParamters.GetSignatureForError): Likewise.
10925         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10926
10927 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10928
10929         * attribute.cs (GetPropertyValue): Made public.
10930
10931         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10932         Resolve.
10933         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10934         attribute.
10935         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10936         is not defined.
10937         
10938         * driver.cs: Reflect method name change.
10939         
10940         * statement.cs (Try.Resolve): Warn when try has both general
10941         exception handlers.
10942         
10943         * typemanager.cs: runtime_compatibility_attr_type new predefined
10944         type.
10945
10946 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10947
10948         Fix #76419.
10949         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10950         treat it as an empty parameter list.
10951
10952 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10953
10954         Fix #76271.     
10955         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10956         ResolveAsTypeStep silent.
10957         * statement.cs (Block.AddConstant): Mark block as used.
10958         (Block.ResolveMeta): Avoid piling on error messages
10959         if a constant initializer resolution fails.
10960
10961 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10962
10963         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10964         Remove.
10965         (NamespaceEntry.VerifyAllUsing): New.
10966         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10967         behaviour.  Delegates actual resolution of alias to ...
10968         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10969         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10970         Update.
10971         * driver.cs (Driver.MainDriver): Update.
10972         
10973         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10974         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10975         property.
10976         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10977         Remove.
10978         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10979         RootNamespace.DefineNamespacesForAll.
10980
10981 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10982
10983         * typemanager.cs (assemblies, external_aliases, modules)
10984         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10985         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10986         overhead.  Move resposibility ...
10987         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10988         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10989
10990 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10991
10992         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10993         cached_namespaces.  Improve usage.
10994         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10995         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10996         Move from GlobalRootNamespace and simplify.
10997         (RootNamespace.Global): Make instance variable.
10998         (RootNamespace.RootNamespace): Add "alias name" parameter.
10999         (GlobalRootNamespace): Simplify drastically.
11000         (Namespace.Lookup): Don't use GetNamespace.
11001         * typemanager.cs (GetRootNamespace): Rename from
11002         ComputeNamespaceForAlias.
11003         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
11004
11005 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
11006
11007         * anonymous.cs (AnonymousContainer): Don't crash when container
11008         doesn't exist.
11009
11010 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
11011
11012         * expression.cs (Binary.DoResolve): Warn when comparing same
11013         values.
11014
11015 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
11016
11017         Fix #76486.
11018         * expression.cs (Binary.DoResolve): It looks like there are no
11019         convetsion rules in enum context.
11020
11021 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11022
11023         Add support for extern alias qualifiers.
11024         * typemanager.cs: Move some LookupTypeReflection code
11025         to namespace.cs, to have cleaner code. Added some methods
11026         to help us keep track of the extern aliased references.
11027         * driver.cs: Add suport for extern alias assemblies on command
11028         line and check for their warnings/errors. Also keep track of the
11029         extern aliased assemblies.
11030         * namespace.cs: Move the global functionality of Namespace
11031         to GlobalRootNamespace/RootNamespace. Now the global namespace
11032         is GlobalRootNamespace.Globa. Also the code moved from 
11033         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
11034         Finally added LocalAliasEntry (AliasEntry before) and
11035         ExternAliasEntry, to handle alias statements.
11036         * cs-parser.jay: Add support in the grammar for extern alias
11037         statement.
11038         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
11039         Update callings to Namespace (now in GlobalRootNamespace).
11040
11041 2005-10-18  Raja R Harinath  <rharinath@novell.com>
11042
11043         Fix #76371.
11044         * class.cs (TypeContainer.DefineType): Move updating of
11045         topological sort earlier in the code.
11046         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
11047
11048 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
11049
11050         Fix #76273.
11051         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
11052         
11053         * constant.cs (Constant.TryReduce): Moved from Cast class.
11054         (Reduce): Made little bit more OO and fixed missing conversions.
11055         
11056         * ecore.cs (Reduce): Implemented.
11057         (Binary.EnumLiftUp): New method to upgrade values to enum values.
11058         
11059         * literal.cs (Reduce): Implemented.
11060         
11061         * class.cs: Reverted Miguel's wrong commit.
11062
11063 2005-10-14  Miguel de Icaza  <miguel@novell.com>
11064
11065         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
11066
11067 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
11068
11069         * cs-parser.jay, expression.cs : CS0214 was missing error location
11070           for constants. Fixed bug #76404.
11071
11072 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
11073
11074         Fix #76370.
11075         * convert.cs (ExplicitConversionCore): Fixed object->enum
11076         conversion.
11077
11078 2005-10-10  Raja R Harinath  <rharinath@novell.com>
11079
11080         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
11081         InstanceExpression.
11082         (PropertyExpr.EmitCall): Likewise.
11083         * expression.cs (Invocation.EmitArguments): Handle case where
11084         arguments == null.
11085         (Invocation.EmitCall): Avoid allocating temporary variable if
11086         there are no arguments.
11087
11088 2005-10-07  Raja R Harinath  <rharinath@novell.com>
11089
11090         Fix #76323.
11091         * convert.cs (ImplicitConversionStandard): Move conversion of
11092         void* to arbitrary pointer types ...
11093         (ExplicitConversionStandard): .. here.
11094         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
11095         error to always print typenames.
11096
11097 2005-10-07  Raja R Harinath  <rharinath@novell.com>
11098
11099         * convert.cs (GetConversionOperator): Rename from
11100         GetConversionOperators.  Move operator selection code from ...
11101         (UserDefinedConversion): ... here.
11102
11103 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
11104
11105         * convert.cs (ExplicitConversionCore): Removed duplicate enum
11106         conversion.
11107
11108 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
11109
11110         * assign.cs (Assign.DoResolve): Error method changed.
11111
11112         * cfold.cs (DoConstantNumericPromotions): Error method changed.
11113         
11114         * const.cs (ResolveValue): Reset in_transit immediately.
11115         
11116         * constant.cs: Error method changed.
11117         
11118         * convert.cs: Removed useless location parameter.
11119         (ExplicitNumericConversion): Don't do double enum check.
11120         (ExplicitConversionCore): Renamed from ExplicitConversion.
11121         (ExplicitUnsafe): Extracted from ExplicitConversion.
11122         (ExplicitConversion): Uses for error reporting.
11123         
11124         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
11125         error messages.
11126         (ResolveBoolean): Uses common error method.
11127         (CastToDecimal): Get rid of ec.
11128         (CastFromDecimal): Optimized.
11129         (ConvCast): Get rid of ec.
11130         
11131         * enum.cs (ResolveValue): Reset in_transit immediately.
11132         (Emit): Return after first error.
11133         
11134         * expression.cs: Convert changes.
11135         
11136         * literal.cs: Error method changed.
11137         
11138         * statement.cs: Error method changed.
11139
11140 2005-10-03  Raja R Harinath  <rharinath@novell.com>
11141
11142         * support.cs (SeekableStreamReader.Position): Don't error out when
11143         the requested position is just beyond the end of the current
11144         buffered data.
11145
11146 2005-09-28  Raja R Harinath  <rharinath@novell.com>
11147
11148         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
11149         try to keep in sync with the byte count of the underlying Stream.
11150         However, this limits us to a window size of 2048 characters: i.e.,
11151         the maximum lookahead of our lexer/parser can be 2048 characters.
11152
11153 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
11154
11155         Fix #76255.
11156         * driver.cs: Fix compilation files with full root path.
11157
11158 2005-09-25  Miguel de Icaza  <miguel@novell.com>
11159
11160         * report.cs (SymbolRelatedToPreviousError): Format the output so
11161         it does not use an open parenthesis that is never closed. 
11162
11163         * driver.cs: Follow coding guidelines
11164
11165 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
11166
11167         Fix #72930.
11168         * const.cs (Const.ResolveValue): Check for assigning non-null
11169         value to reference type.
11170
11171 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
11172
11173         * anonymous.cs: Implemented ExprClassName.
11174         
11175         * assign.cs (Assign.DoResolve): Don't chrash when type is not
11176         delegate.
11177         
11178         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
11179         check.
11180         
11181         * class.cs (StaticClass.DefineContainerMembers): Report protected
11182         members as error.
11183         
11184         * codegen.cs: if(ed) PRODUCTION.
11185         
11186         * convert.cs (Error_CannotImplicitConversion): Better error
11187         distinction.
11188         
11189         * cs-parser.jay: More error checks.
11190         
11191         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
11192         
11193         * driver.cs (CSCParseOption): Enabled wrong option check.
11194         
11195         * ecore.cs (Expression.ExprClassName): Turned to property.
11196         (MemberExpr.CheckIntermediateModification): For checking boxed
11197         value types     modification.
11198         
11199         * statement.cs (Fixed.Resolve): Expression type must be
11200         convertible to fixed type.
11201         (CollectionForeach.GetEnumeratorFilter,TryType):
11202         Small refactoring for easier error checking.
11203
11204 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
11205
11206         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
11207         attributes.
11208         
11209         * class.cs (GeneratedBaseInitializer): New class for customization
11210         compiler generated initializers.
11211         (MemberBase.DoDefine): Check Obsolete attribute here.
11212         (FieldMember.DoDefine): Ditto.
11213         
11214         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
11215         constants.
11216         
11217         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
11218         (MemberCore.GetObsoleteAttribute): Removed argument.
11219         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
11220         (MemberCore.CheckObsoleteType): New helper.
11221         
11222         * delegate.cs,
11223         * enum.cs,
11224         * statement.cs: Updates after MemberCore changes.
11225         
11226         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
11227         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
11228         
11229         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
11230         obsolete attribute for compiler construct.
11231         (As.DoResolve): Cache result.
11232         
11233         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
11234
11235 2005-09-26  Raja R Harinath  <rharinath@novell.com>
11236
11237         Fix #76133.
11238         * expression.cs (This.VerifyFixed): In a value type T, the type of
11239         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
11240         value type R, 'this' is treated as a value parameter.
11241
11242 2005-09-22  Miguel de Icaza  <miguel@novell.com>
11243
11244         * statement.cs (Lock): Use the TemporaryVariable class instead of
11245         manually using local variables as those do not work when variables
11246         are captured.
11247
11248         * ecore.cs: Moved the TemporaryVariable class from being a nested
11249         class inside Foreach to be a public class that can be employed in
11250         other places. 
11251
11252 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
11253
11254         * cs-parser.jay: interface_accessors replaced by
11255         accessor_declarations.
11256
11257         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
11258         location.
11259         
11260         * statement.cs (GotoCase.Resolve): Convert null constant to
11261         null case.
11262         (SwitchLabel.ResolveAndReduce): Ditto.
11263         (SwitchLabel.NullStringCase): Custom null stamp.
11264         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
11265         
11266         typemanager.cs (CSharpSignature): Don't skip first argument
11267         for full names.
11268
11269 2005-09-18  Miguel de Icaza  <miguel@novell.com>
11270
11271         * driver.cs: Set InEmacs based on the environment variable EMACS. 
11272
11273         * location.cs (InEmacs): in this mode, do not report column
11274         location as it confuses Emacs.
11275
11276 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
11277
11278         * cfold.cs, constant.cs, convert.cs, ecore.cs,
11279         expression.cs, iterators.cs, literal.cs: Store constants and
11280         literals location.
11281         
11282         * class.cs (MemberBase.ShortName): Pass location.
11283         
11284         * cs-parser.jay: Some location fixes.
11285         
11286         * ecore.cs (Expression.Location): Made virtual.
11287
11288 2005-09-05  Miguel de Icaza  <miguel@novell.com>
11289
11290         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
11291         if the underlying types are the same, otherwise we need to produce
11292         code that will do the proper cast.
11293
11294         This was exposed by Marek's constant rewrite which produced
11295         invalid code for the call site:
11296
11297         enum X : long { a }
11298         void Method (X v) {}
11299
11300         Method ((X) 5)
11301
11302         This fixes test-49.cs
11303
11304 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
11305
11306         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11307           Type/Object should be allowed as well. Fixed bug #75968.
11308
11309 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
11310
11311         * expression.cs : (Binary.DoResolve): when one is enum constant and
11312           another is constant 0, then return enum one *as enum type*.
11313           Fixed bug 74846.
11314
11315 2005-09-02  Raja R Harinath  <rharinath@novell.com>
11316
11317         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11318         internal.
11319
11320         Fix #75941.
11321         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11322         flow-branching for LocalVariableReferences in case we were invoked
11323         from a MemberAccess.
11324         * expression.cs (LocalVariableReference.VerifyAssigned): New.
11325         Carved out of ...
11326         (LocalVariableReference.DoResolveBase): ... this.
11327         (MemberAccess.Resolve): Do the check that was disabled during
11328         SimpleNameResolve.
11329
11330 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11331
11332         * class.cs :
11333           (PartialContainer.Create): check abstract/sealed/static strictly
11334           but abstract/sealed can exist only at one side. Fixed bug #75883.
11335
11336 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
11337
11338         Fix #75945.
11339         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11340         specified, don't default to UnmanagedType.I4.
11341
11342 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
11343
11344         * expression.cs : conditional operator should check possibly
11345           incorrect assign expression. Fixed bug #75946.
11346
11347 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11348
11349         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11350           Reverting the change. gmcs is much complex than mcs on this matter.
11351
11352 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
11353
11354         * cs-tokenizer.cs : To read another token ahead of the actual 
11355           consumption, use new SavedToken and cache token instead of moving
11356           back the stream with SeekableStreamReader (it seemed problematic).
11357         * cs-parser.jay,
11358           driver.cs : Thus use StreamReader directly.
11359         * support.cs : Thus removed SeekableStreamReader.
11360
11361 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11362
11363         Fix #75934.
11364         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11365         (ScopeInfo.EmitScopeType): Use it to construct field names from
11366         names of captured locals.
11367
11368         Fix #75929.
11369         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11370         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11371         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
11372         (ExplicitConversion): Remove enum cases already handled by
11373         implicit conversion.  Move implicit conversion check to the beginning.
11374         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11375         * expression.cs (ArrayCreation.EmitDynamicInitializers):
11376         Don't treat System.Enum as a struct.
11377
11378 2005-08-30  Jb Evain  <jbevain@gmail.com>
11379
11380         * attribute.cs: handles as expression in parameters.
11381
11382 2005-08-30  Raja R Harinath  <rharinath@novell.com>
11383
11384         Fix #75802.
11385         * class.cs (TypeContainer.VerifyClsName): Don't use a
11386         PartialContainer when verifying CLS compliance.
11387         (AbstractPropertyEventMethod): Set Parent here, ...
11388         (PropertyMethod): ... not here.
11389
11390 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
11391
11392         * attribute.cs : escaped attribute name should not be allowed to be
11393           resolved (e.g. @class as classAttribute). Fixed bug #75930.
11394
11395 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11396
11397         Fix #75927.
11398         * convert.cs (ImplicitStandardConversionExists): Allow zero also
11399         when converting a long constant to unsigned long.
11400         * expression.cs (Invocation.OverloadResolve): Add sanity check to
11401         detect where IsApplicable and VerifyArgumentsCompat disagree.
11402
11403 2005-08-29  Raja R Harinath  <rharinath@novell.com>
11404         and Carlos Alberto Cortez  <carlos@unixmexico.org>
11405
11406         Fix #75848.
11407         * class.cs (TypeContainer.CanElideInitializer): New helper.
11408         (TypeContainer.EmitFieldInitializers): Use it to determine if we
11409         can safely emitting the initializer of a field.
11410
11411 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11412
11413         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11414           allowed inside a switch (without loop). Fixed bug #75433.
11415
11416 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
11417
11418         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11419         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11420
11421 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11422
11423         * driver.cs : kinda reverting the default encoding changes (not exact 
11424           revert since I noticed that "codepage:reset" might not work fine).
11425
11426 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11427
11428         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11429           Location. Now getter and setter store location correctly.
11430           (errors/cs0111-12.cs now reports the expected location.)
11431
11432 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
11433
11434         * driver.cs : Use default encoding on the environment.
11435           Removed (now that) extra parameter for SeekableStreamReader.
11436         * support.cs : (SeekableStreamReader) third .ctor() argument for
11437           StreamReader is not required (always true). preamble size could
11438           be acquired in simpler and safe way.
11439
11440 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
11441
11442         * cs-parser.jay: report CS0642 at warning level 3
11443           and report CS0642 for an if else statement also
11444           fixes bug #74745. Patch by John Luke (and a bit
11445           modified by me).
11446           Removed extra CS0642 warning check for "while",
11447           "for" and "fixed".
11448         * statement.cs: In Block.Resolve(), CS0642 check
11449           is reimplemented to check a sequence of an empty
11450           statement and a block.
11451
11452           Both fix bug #66777.
11453
11454 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
11455
11456         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11457         detection until I fix it.
11458         
11459         * cs-tokenizer.cs: Changed error message.
11460         
11461         * cs-parser.jay: Fixed 2 error locations.
11462         
11463         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11464         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11465         properties.
11466         
11467         * enum.cs (GetSignatureForError): Fixed.
11468         
11469         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11470         method detection.
11471         
11472         * class.cs,
11473         * typemanager.cs (RegisterProperty): Removed.
11474         
11475         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11476
11477 2005-08-24  Raja R Harinath  <rharinath@novell.com>
11478
11479         Fix #75874.
11480         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11481         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11482
11483 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11484
11485         * expression.cs : tiny fix is required for not warning positive ulong.
11486           See test-441.cs.
11487
11488 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11489
11490         * expression.cs : add CS0652 check for constant and integral
11491           expression. Fixed bug #53974.
11492
11493 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11494
11495         * expression.cs : in DoNumericPromotions(), check if there is implicit
11496           conversion overload for string (to check CS0034). Fixed bug #52492.
11497
11498 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11499
11500         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11501
11502 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11503
11504         * ecore.cs : report location when it is *not* Null.
11505
11506 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11507
11508         * codegen.cs,
11509           ecore.cs,
11510           flowanalysis.cs,
11511           expression.cs:
11512           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11513           correctly. Fixed bug #75721.
11514
11515 2005-08-23  Raja R Harinath  <rharinath@novell.com>
11516
11517         * support.cs (SeekableStreamReader.Position): Avoid an expensive
11518         loop that performs 'min (pos, char_count)'.
11519
11520         Fix #75862.
11521         * expression.cs (Unary.ResolveOperator): Don't discard implicit
11522         converted value in Operator.OnesComplement.
11523
11524 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
11525
11526         * anonymous.cs: If the anon method is pulled into a helper class,
11527         it needs to be `internal' not `private'. Fixes runtime behavior on
11528         msft. bug #75704
11529
11530 2005-08-20  Martin Baulig  <martin@ximian.com>
11531
11532         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11533         scope if we don't already have it.
11534
11535         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11536         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11537         fixes #75867.
11538
11539 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
11540
11541         Fix #75803
11542         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11543         is a partial class.
11544
11545 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
11546
11547         The big constants rewrite
11548         Fix #75746, #75685 and more
11549         As a side effect saved 1MB for MWF ;-)
11550         
11551         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11552         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11553         enum based for corlib compilation.
11554         
11555         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11556         subtractions.
11557         
11558         * class.cs (FixedField.Define): Use ResolveAsConstant.
11559         
11560         * const.cs (IConstant): Interface constants and enums.
11561         (Const.ResolveValue): New method for constant resolvning.
11562         (ExternalConstant): Constants from imported assemblies.
11563         
11564         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11565         conversion; like enums.
11566         (Constant.ToType): Converts this constant to different type.
11567         (Constant.Increment): Adds 1.
11568         
11569         * convert.cs (ImplicitConversionRequired): Simplified.
11570         
11571         * cs-parser.jay: Create EnumMember directly.
11572         
11573         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11574         
11575         * doc.cs (GenerateEnumDocComment): Removed.
11576         
11577         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11578         (ConvertIntLiteral): Removed.
11579         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11580         
11581         * enum.cs (EnumMember): Implement IConstant.
11582         (Enum.IsValidEnumConstant): Removed.
11583         (Enum.GetNextDefaultValue): Removed.
11584         (Enum.FindMembers): Updated.
11585         (Enum.GenerateDocComment): Iterate enum members.
11586         
11587         * expression.cs (Cast.TryReduce): Handle enums correctly.
11588         (New.Constantify): Made public.
11589         (MemberAccess.DoResolve): Removed contant specific if(s).
11590         
11591         * literal.cs (NullLiteral): Implement new abstract methods.
11592         
11593         * statement.cs (GotoCase.Resolve): Use new constant methods.
11594         (SwitchLabel.ResolveAndReduce): Use new constant methods.
11595         
11596         * typemanager.cs (LookupEnum): Removed.
11597         (IsEnumType): Fixed to work with corlib.
11598         (RegisterConstant): Removed.
11599         (LookupConstant): Removed.
11600         (GetConstant): Changed to work with IConstant.
11601
11602 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
11603
11604         * location.cs : Fixed overflown (>255) column number.
11605
11606 2005-08-03  Raja R Harinath  <rharinath@novell.com>
11607
11608         First cut of the qualified-alias-member feature.
11609         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11610         token.
11611         * cs-parser.jay (DOUBLE_COLON): New token.
11612         (namespace_or_type_name): Add rule for recognizing
11613         qualified-alias-members.
11614         (primary_expression): Likewise.
11615         (element_access): Allow QualifiedAliasMember as a possible
11616         type-bearing expression.
11617         (local_variable_type, local_variable_pointer_type): Likewise.
11618         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
11619         aliases in the current and enclosing namespace declarations.
11620         (NamespaceEntry.UsingAlias): Add CS0440 warning.
11621         * decl.cs (MemberName.is_double_colon): New.
11622         (MemberName.MemberName): Add new constructor for alias-member.
11623         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11624         * expression.cs (QualifiedAliasMember): New expression type.
11625
11626 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11627
11628         * location.cs : it borked when no argument was specified.
11629
11630 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11631
11632         * location.cs : tiny ToString() format fix.
11633
11634 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11635
11636         * statement.cs : oops, it was missing.
11637
11638 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11639
11640         A set of fixes for precise line/column location.
11641
11642         * location.cs :
11643           "token" field now holds a file/line "delta", a line number offset 
11644           from the segment, and a column number. See also:
11645           http://lists.ximian.com/pipermail/mono-devel-list/2004-
11646           December/009508.html
11647           Removed static IsNull. Use instance IsNull property instead.
11648         * cs-tokenizer.cs :
11649           For some tokens it stores Location. For Identifier it stores
11650           LocatedToken which is a pair of string name and location.
11651           Column numbers are adjusted only at getChar().
11652         * report.cs :
11653           Use Location.ToString() for reporting (it now contains column).
11654         * cs-parser.jay :
11655           Largely modified to use LocatedToken instead of
11656           string (IDENTIFIER), and to acquire Location from some tokens.
11657         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11658           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11659           codegen.cs :
11660           Now MemberName holds Location. DeclSpace.ctor() receives Location
11661           as a parameter. Removed extra parameters to all derived classes.
11662           Replaced Location.IsNull() with instance property.
11663         * assign.cs, expression.cs :
11664           Added .ctor() overload that omits Location.
11665         * attribute.cs :
11666           Added "nameEscaped" flag that indicates the identifier was escaped
11667           in the source file. This fixes bug #57047.
11668
11669 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
11670
11671         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11672         New method, looking for lo-case imported cls type.
11673
11674         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11675         here.
11676
11677         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11678
11679         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11680
11681         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11682         all_imported_types.
11683         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11684
11685         Optimized to save 3.5 MB for SWF compilation.
11686
11687 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11688
11689         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11690         (PartialContainer.Create): Moved logic AddToContainer.
11691         (PartialContainer.MarkForDuplicationCheck): Shares name.
11692         
11693         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11694         place.
11695         
11696         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11697         initialization.
11698         (Namespace.GetSignatureForError): New method.
11699         
11700         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11701         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11702
11703 2005-08-01  Raja R Harinath  <rharinath@novell.com>
11704
11705         Fix #75669.
11706         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11707         member lookup rather than qualifier_type, since qualifier_type can
11708         be null.
11709
11710 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11711
11712         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11713         enum member.
11714
11715 2005-07-31  Miguel de Icaza  <miguel@novell.com>
11716
11717         * statement.cs: Copy the local exception into the exception
11718         captured local.  Fixes 75674
11719
11720 2005-07-31  Raja R Harinath  <harinath@gmail.com>
11721
11722         Fix #75658.
11723         * expression.cs (Invocation.OverloadResolve): Don't report error
11724         CS1501 if error CS1502 has been reported.
11725         (New.DoResolve): Delegate CS1501 reporting to
11726         Invocation.OverloadResolve.
11727
11728         Fix #75656.
11729         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11730         invariant-meaning-in-block property in an enclosing block if
11731         necessary.
11732
11733 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
11734
11735         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11736         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11737         (Switch.CheckSwitch): Just save 50kb for SWF.
11738
11739 2005-07-27  Martin Baulig  <martin@ximian.com>
11740
11741         * anonymous.cs (CaptureContext.AddField): Added
11742         `AnonymousContainer am' argument; compute its toplevel scope if
11743         it's not already computed.  Fixes #75649.
11744
11745 2005-07-26  Raja R Harinath  <rharinath@novell.com>
11746
11747         Fix #75628.
11748         * class.cs (Constructor.Emit): Reset block to null if the block
11749         resolve fails.
11750
11751 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11752
11753         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11754
11755 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11756
11757         * class.cs (MethodData.Define): Check whether accessor implementing
11758         interface is public.
11759
11760         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11761
11762 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
11763
11764         Fix #57245
11765         * namespace.cs (LookupType): Moved same type check to...
11766         
11767         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11768         with the same name.
11769
11770 2005-07-21  Raja R Harinath  <rharinath@novell.com>
11771
11772         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11773         already found a typebuilder.
11774         * class.cs (MethodCore.IsDuplicateImplementation): Compare
11775         MemberNames, not strings.
11776
11777         * const.cs (Error_ExpressionMustBeConst): 
11778         Rename from Error_EpressionMustBeConst.
11779         * const.cs, class.cs, statement.cd: Update.
11780
11781 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
11782
11783         Fix #65573
11784
11785         * const.cs (Const.LookupConstantValue): Report missing contant expression
11786         everytime.
11787         (Error_EpressionMustBeConstant): Only one error method.
11788
11789         * class.cs, statement.c: Updated.
11790
11791 2005-07-20  Raja R Harinath  <rharinath@novell.com>
11792
11793         * statement.cs (Block.Flags): Add back HasVarargs.
11794         (Block.flags): Make protected.
11795         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11796
11797         * typemanager.cs (types, typecontainers, user_types): Remove.
11798         (UserTypes, TypeContainers): Likewise.
11799         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11800         (CleanUp, Reset): Update.
11801         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
11802         (GetNestedType): Use Type.GetNestedType.
11803         (CoreLookupType): Take two arguments, the namespace and the
11804         basename of the type.  Update to use the Namespace.Lookup
11805         mechanism.
11806         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11807         (RealMemberLookup): Use IsNestedChildOf instead of playing with
11808         string concatenation and substring matches.
11809         * class.cs, enum.cs, delegate.cs: Update to changes.
11810
11811 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
11812
11813         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11814         Expression and made virtual.
11815
11816         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11817         (ImplicitStandardConversionExists): Fixed `byte' typo ?
11818
11819         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11820
11821         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11822         error message.
11823
11824         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11825         change.
11826
11827 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
11828
11829         Fix #57707
11830         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11831         AssemblyCultureAttribute is not used on executable.
11832
11833         * rootcontext.cs,
11834         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11835
11836 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11837
11838         Fix #60638.
11839         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11840         New.  Reports CS0252/CS0253.
11841         Mostly taken from preliminary patch by Duncak Mak.
11842         (Binary.DoResolveOperator): Store results of operator lookup.
11843         Use them to detect if we need to warn about unintended reference
11844         comparisons.
11845
11846 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11847
11848         Fix #72969.
11849         * namespace.cs (Namespace.Lookup): Add back location parameter.
11850         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
11851         * delegate.cs, ecore.cs, expression.cs: Update to changes.
11852
11853         * codegen.cs (EmitContext.DeclSpace): Make readonly.
11854         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11855         (Namespace.LookupType): ... this.
11856         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11857         of namespaces.
11858         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11859         purported to handle pointers.
11860         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11861         CoreLookupType.
11862
11863 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11864
11865         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11866         type as namespace.
11867
11868 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11869
11870         * namespace.cs (Namespace.Lookup): Drop location parameter.
11871         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11872         (NamespaceEntry.Lookup): ... this.
11873         (NamespaceEntry.Error_AmbiguousTypeReference):
11874         Move here from DeclSpace.
11875         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11876         names ...
11877         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11878         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11879         Move to NamespaceEntry.
11880         * delegate.cs, expression.cs: Update to changes.
11881
11882 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11883
11884         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11885         CheckAttributeType and refactored.
11886         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11887         ResolveAsTypeTerminal error handling.
11888         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11889         handling.
11890         (GetSignatureForError): Print errors in same way.
11891
11892         * class.cs,
11893         * codegen.cs: Reflect attribute GetSignatureForError change.
11894
11895         * ecore.cs,
11896         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11897
11898         * namespace.cs (UsingEntry): Refactored to make fields private.
11899
11900         * assign.cs,
11901         statement.cs: Error_UnexpectedKind has extra parameter.
11902
11903 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11904
11905         * ecore.cs (IAlias): Remove.
11906         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11907         that implement the interface.
11908         * namespace.cs (Namespace): Likewise.
11909         (Namespace.declspaces): Renamed from 'defined_names'.
11910         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11911         DeclSpace instead of an IAlias.
11912         * tree.cs (Tree.AddDecl): Update.
11913
11914 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11915
11916         * statement.cs (Block.Flags); Remove HasVarargs.
11917         (Block.HasVarargs): Move to ToplevelBlock.
11918         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11919         (Block.Variables): Make protected.  Initialize variable hashtable
11920         if necessary.
11921         (Block.AddVariable): Update.
11922         (Block.Resolve): Update to changes.
11923         (ToplevelBlock.HasVarargs): New boolean.
11924         (ToplevelBlock.ThisVariable): Move here from Block.
11925         (ToplevelBlock.AddThisVariable): Likewise.
11926         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11927         * expression.cs (This.ResolveBase): Update to changes.
11928         (ArglistAccess.DoResolve): Likewise.
11929
11930 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11931
11932         Fix #75321
11933         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11934
11935         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11936         not used and not used & assigned.
11937         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11938
11939 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11940
11941         Fix #75053
11942         * expression.cs (Is.DoResolve): null is never provided type.
11943
11944 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11945
11946         Fix #52496
11947         * cs-parser.jay: Less strict event error rule to catch more errors.
11948
11949 2005-07-08  Martin Baulig  <martin@ximian.com>
11950
11951         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11952         gettter (allowed) or setter (not allowed).
11953
11954         * class.cs (Accessor): Implement IIteratorContainer.
11955         (Accessor.Yields): New public field.
11956         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11957         per-accessor basis.
11958
11959         * cs-parser.jay
11960         (get_accessor_declaration, set_accessor_declaration): Set the
11961         `yields' flag on the accessor, not the property.
11962         (property_declaration): Do the iterators check on a per-accessor
11963         basis and not for the whole property.
11964
11965 2005-07-08  Martin Baulig  <martin@ximian.com>
11966
11967         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11968         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11969
11970 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11971
11972         Fix #74975
11973         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11974         (ExtractSecurityPermissionSet): Cope with self referencing security
11975         attributes properly.
11976
11977         * driver.cs (SetOutputFile): Made public property OutputFile.
11978
11979 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11980
11981         Fix #75486.
11982         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11983         has_nonstatic_fields.  Make into a FieldBase pointer.
11984         (TypeContainer.AddField): Add CS0282 check.
11985         (TypeContainer.EmitType): Update.
11986
11987 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11988
11989         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11990         compare if they start with __.
11991
11992 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11993
11994         * statement.cs (Switch.SwitchGoverningType): Only look at
11995         UserCasts that don't need implicit standard conversions to one of
11996         the allowed switch types (Fixes test-322.cs).
11997         (LocalInfo.Resolve): Re-enable sanity-test.
11998
11999 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
12000
12001         * cs-tokenizer.cs (consume_identifier): Detect double undescores
12002         
12003         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
12004         
12005         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
12006
12007 2005-07-06  Raja R Harinath  <rharinath@novell.com>
12008
12009         Fix #75472.
12010         * ecore.cs (SimpleName.GetSignatureForError): Add.
12011         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
12012         (MemberAccess.GetSignatureForError): Add.
12013
12014 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
12015  
12016         The big error and warning messages review.
12017         
12018         * anonymous.cs,
12019         * assign.cs,
12020         * attribute.cs,
12021         * class.cs,
12022         * codegen.cs,
12023         * convert.cs,
12024         * cs-parser.jay,
12025         * cs-tokenizer.cs,
12026         * decl.cs,
12027         * delegate.cs,
12028         * doc.cs,
12029         * driver.cs,
12030         * ecore.cs,
12031         * enum.cs,
12032         * expression.cs,
12033         * flowanalysis.cs,
12034         * iterators.cs,
12035         * literal.cs,
12036         * location.cs,
12037         * modifiers.cs,
12038         * namespace.cs,
12039         * parameter.cs,
12040         * pending.cs,
12041         * report.cs,
12042         * rootcontext.cs,
12043         * statement.cs,
12044         * support.cs,
12045         * tree.cs,
12046         * typemanager.cs: Updated.
12047         
12048         * class.cs: (MethodCore.SetYields): Moved here to share.
12049         (PropertyMethod.Define): Moved iterator setup here.
12050         
12051         * iterators.cs: Add orig_method to have full access to parent
12052         container.
12053
12054 2005-07-05  Raja R Harinath  <rharinath@novell.com>
12055
12056         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
12057         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
12058         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
12059         variable of struct type.
12060         * expression.cs (Unary.ResolveOperator): Update to change.
12061         (Indirection.VerifyFixed): Likewise.
12062         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
12063         (ParameterReference.VerifyFixed): Value parameters are fixed.
12064         (This.VerifyFixed): Treat 'this' as a value parameter.
12065         * statement.cs (LocalInfo.IsFixed): Remove.
12066
12067 2005-07-01  Martin Baulig  <martin@ximian.com>
12068
12069         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
12070         `ec.EmitThis ()' to get the correct scope.
12071
12072 2005-07-01  Martin Baulig  <martin@ximian.com>
12073
12074         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
12075         instance is a ParameterReference; fixes #75299.
12076
12077 2005-07-01  Martin Baulig  <martin@ximian.com>
12078
12079         Reverted Marek's latest patch (r46725):
12080         - it contains structural changes which are neither mentioned in
12081           the ChangeLog nor explained anywhere; for example the additional
12082           argument of EmitContext's and Iterator's .ctor's and the
12083           TypeContainer.DefineMembers() change.
12084         - structural changes like this should go in in seperate patches
12085           and not be hidden in a huge patch which just seems to affect
12086           warnings and errors.
12087           a big and hard to understand patch.
12088         - it breaks iterators and causes regressions, for instance in
12089           test-iter-03.cs.      
12090
12091 2005-06-30  Raja R Harinath  <rharinath@novell.com>
12092
12093         Fix #75412.
12094         * expression.cs (Indexers.map): Remove.
12095         (Indexers.Append): Filter out inaccessible setters and getters.
12096         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
12097
12098         Fix #75283.
12099         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
12100         Refactored from ...
12101         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
12102         (FieldExpr.Emit, PropertyExpr.Emit): Update.
12103         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
12104         * expression.cs (Invocation.EmitCall): Add CS0120 check.
12105
12106 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
12107
12108         Fix #75322
12109         * class.cs (FieldBase.GetInitializerExpression): One more field
12110         for backup.
12111
12112 2005-06-28  Miguel de Icaza  <miguel@novell.com>
12113
12114         * pending.cs: Do not define a proxy if the base method is virtual,
12115         it will be picked up by the runtime (bug 75270).
12116
12117 2005-06-08  Martin Baulig  <martin@ximian.com>
12118
12119         The big Iterators rewrite :-)
12120
12121         * iterators.cs: Rewrite this to use the anonymous methods framework.
12122
12123         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
12124         before the TypeContainers; see 2test-21.cs.
12125
12126         * class.cs
12127         (TypeContainer.DefineType): Don't create a new EmitContext if we
12128         already have one (this only happens if we're an Iterator).
12129         (TypeContainer.Define): Also call Define() on all our iterators.
12130         (Method.CreateEmitContext): Added support for iterators.
12131
12132         * anonymous.cs
12133         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
12134         (AnonymousContainer.CreateMethodHost): Moved here from
12135         AnonymousMethod and made abstract.
12136         (AnonymousContainer.CreateScopeType): New abstract method.
12137         (AnonymousContainer.IsIterator): New public property.
12138         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
12139         get the ScopeTypeBuilder rather than manually defining it here. 
12140         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
12141         iterators here.
12142
12143         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
12144         before RootContext.DefineTypes().
12145
12146         * codegen.cs (EmitContext.RemapToProxy): Removed.
12147         (EmitContext.CurrentAnonymousMethod): Changed type from
12148         AnonymousMethod -> AnonymousContainer.
12149         (EmitContext.ResolveTopBlock): Protect from being called twice.
12150         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
12151         (EmitContext.EmitThis): Removed the iterators hacks; use the
12152         anonymous methods framework for that.
12153
12154         * statement.cs
12155         (ToplevelBlock.Container): Make this a property, not a field.
12156         (ToplevelBlock.ReParent): New public method; move the
12157         ToplevelBlock into a new container.
12158         (Foreach.TemporaryVariable): Simplify.
12159
12160 2005-06-05  Martin Baulig  <martin@ximian.com>
12161
12162         * statement.cs (LocalInfo.CompilerGenerated): New flag.
12163         (Block.AddTemporaryVariable): New public method; creates a new
12164         `LocalInfo' for a temporary variable.
12165         (Block.EmitMeta): Create the LocalBuilders for all the temporary
12166         variables here.
12167         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
12168         non-iterator variables.
12169
12170 2005-06-05  Martin Baulig  <martin@ximian.com>
12171
12172         * statement.cs (Foreach.TemporaryVariable): Create the
12173         LocalBuilder in the Emit phase and not in Resolve since in some
12174         situations, we don't have an ILGenerator during Resolve; see
12175         2test-19.cs for an example.
12176
12177 2005-06-04  Martin Baulig  <martin@ximian.com>
12178
12179         **** Merged r45395 from GCS ****
12180
12181         The big Foreach rewrite - Part II.
12182
12183         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
12184         with `PropertyInfo ienumerator_getcurrent'.
12185
12186         * codegen.cs (VariableStorage): Removed.
12187
12188         * statement.cs
12189         (Foreach): Derive from Statement, not ExceptionStatement.
12190         (Foreach.CollectionForeach): New nested class.  Moved all the code
12191         dealing with collection foreach here.
12192         (Foreach.ForeachHelperMethods): Removed.
12193         (Foreach.TemporaryVariable): Implement IMemoryLocation.
12194
12195 2005-05-23  Martin Baulig  <martin@ximian.com>
12196
12197         * statement.cs (Try.DoResolve): Don't create a `finally' if we
12198         don't need to.  Fix #75014.
12199
12200 2005-05-20  Martin Baulig  <martin@ximian.com>
12201
12202         Merged r44808 from GMCS.
12203
12204         * class.cs (TypeContainer.CircularDepException): Removed.
12205         (TypeContainer.DefineType): Removed the `InTransit' stuff.
12206         (TypeContainer.CheckRecursiveDefinition): Check for circular class
12207         (CS0146) and interface (CS0529) dependencies here.
12208
12209 2005-06-21  Raja R Harinath  <rharinath@novell.com>
12210
12211         * expression.cs (Invocation.EmitCall): Fix initialization
12212         'this_call' to reflect current behaviour.  Fix indentation.
12213
12214         * convert.cs (FindMostEncompassedType): Add two trivial special
12215         cases (number_of_types == 0 || number_of_types == 1).
12216         (FindMostEncompasingType): Likewise.
12217
12218 2005-06-17  Raja R Harinath  <rharinath@novell.com>
12219
12220         Some cleanups preparing for the fix of #75283.
12221         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
12222         error testing.
12223         (EventExpr.InstanceResolve): Likewise.
12224         (EventExpr.DoResolve): Remove redundant checks.
12225
12226 2005-06-10  Duncan Mak  <duncan@novell.com>
12227
12228         * cs-tokenizer.cs (process_directives): New flag for controlling
12229         the processing of preprocessor directives.
12230         (x_token): After seeing a '#', return Token.NONE instead of going
12231         to handle_preprocessing_directive() when not processing
12232         directives. This avoids unnecessary processing during the token peek in
12233         is_punct().
12234
12235         This fixes #74939.
12236
12237         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
12238         the existing error reporting methods instead of Report.Error.
12239
12240         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
12241         after Raja's rewrite.
12242
12243 2005-06-08  Miguel de Icaza  <miguel@novell.com>
12244
12245         * class.cs: Small fix.
12246
12247 2005-06-08  Raja R Harinath  <rharinath@novell.com>
12248
12249         Fix #75160.
12250         * class.cs (GetPartialBases): Fix return value check of
12251         part.GetClassBases.
12252
12253 2005-06-07  Raja R Harinath  <rharinath@novell.com>
12254
12255         Ensure that partial classes are registered in their enclosing
12256         namespace.  Initial part of fix of #75160.
12257         * tree.cs (Tree.RecordDecl): Add new namespace argument.
12258         Register declspace with namespace here, not in
12259         DeclSpace.RecordDecl.
12260         * cs-parser.jay: Pass namespace to RecordDecl.
12261         * class.cs (PartialContainer.Create): Likewise.
12262         (ClassPart.DefineType): New sanity-check.  Throws an exception if
12263         called.
12264         * decl.cs (Declspace.RecordDecl): Remove.
12265         * namespace.cs (NamespaceEntry.DefineName): Remove.
12266
12267 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
12268
12269         * rootcontext.cs: Reset TargetExt as well.
12270
12271 2005-06-03  Raja R Harinath  <rharinath@novell.com>
12272
12273         * ecore.cs (Expression.Resolve): Emit CS0654 error when
12274         -langversion:ISO-1.
12275
12276 2005-06-02  Raja R Harinath  <rharinath@novell.com>
12277
12278         Fix #75080, cs0119.cs.
12279         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
12280         of ...
12281         (Expression.Resolve): ... this.  Use it.  Remove bogus code
12282         allowing ExprClass.Type and ExprClass.Namespace for
12283         ResolveFlags.VariableOrValue.
12284         (Expression.Resolve) [1-argument variant]: Change default resolve
12285         flags based on language version.
12286         (Expression.Error_UnexpectedKind): Use a simple string array
12287         rather than an ArrayList.
12288         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
12289         not ExprClass.Type.
12290         (TypeOfVoid.DoResolve): Likewise.
12291         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
12292         flags argument -- it always has the same value.
12293
12294 2005-05-31  Raja R Harinath  <rharinath@novell.com>
12295
12296         Fix #75081.
12297         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
12298         Use it in the error message.
12299         * assign.cs, expression.cs, statement.cs: Update.
12300
12301 2005-05-30  Raja R Harinath  <rharinath@novell.com>
12302
12303         Fix #75088.
12304         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
12305         the "almostMatchedMember" case too.
12306         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12307         that failed the accessibility checks to 'almost_match'.
12308
12309 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
12310
12311         * attribute.cs: Use internal MethodBuilder methods to set
12312         ExactSpelling and SetLastError on PInvoke methods, instead
12313         of passing them via charset.  Fixes #75060.
12314
12315 2005-05-27  Raja R Harinath  <rharinath@novell.com>
12316
12317         * parameter.cs (Parameter): Remove TODO comment.
12318         (Parameter.DefineParameter): Remove Location parameter.
12319         (Parameters.LabelParameters): Likewise.
12320         * class.cs (Constructor.Emit): Update to change.
12321         (MethodData.Emit): Likewise.
12322         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
12323         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12324
12325 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
12326
12327         * parameter.cs,
12328           Removed Parameters.Location and added Parameter.Location instead.
12329           Removed Location parameter from Emit() and GetSignature().
12330         * anonymous.cs,
12331           class.cs,
12332           cs-parser.jay,
12333           delegate.cs,
12334           iterators.cs,
12335           statement.cs :
12336           Modified all related calls.
12337
12338 2005-05-26  Raja R Harinath  <rharinath@novell.com>
12339
12340         Improve user-defined conversion handling.
12341         * convert.cs (GetConversionOperators): Rewrite.  Return only the
12342         applicable operators.
12343         (AddConversionOperators): New.  Helper for GetConversionOperators.
12344         (FindMostEncompassedType, FindMostEncompassingType): Verify that
12345         there is only one most encompassed/encompassing type.
12346         (FindMostSpecificSource, FindMostSpecificTarget): Remove
12347         "applicable operator" handling.
12348         (UserConversion): Move cache here from GetConversionOperators.
12349         Directly cache the chosen operator, rather than the whole
12350         MethodGroup.
12351         (ExplicitNumericConversion): Fix buggy implementation of Decimal
12352         case.  Allow conversion of decimal to sbyte and byte too.
12353         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12354         New static methods.  Used to avoid allocating EmptyExpressions in
12355         convert.cs.
12356
12357 2005-05-24  Duncan Mak  <duncan@novell.com>
12358
12359         * ecore.cs (CastFromDecimal): New class for casting a decimal to
12360         another class, used in Convert.ExplicitNumericConversion.
12361         (CastToDecimal): New class, similar to above, but casts to
12362         System.Decimal, used in Convert.ImplicitNumericConversion and also
12363         in explicit convesion from double/float to decimal.
12364
12365         * convert.cs (ImplicitNumericConversion): Handle implicit
12366         conversions to System.Decimal.
12367         (ExplicitNumericConversion): handle explicit conversions to
12368         System.Decimal.
12369
12370         This fixes #68711.
12371         
12372 2005-05-20  Miguel de Icaza  <miguel@novell.com>
12373
12374         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12375         know the type at this stage, just break through.   Fixes #75008 
12376
12377 2005-05-19  Martin Baulig  <martin@ximian.com>
12378
12379         * delegate.cs
12380         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12381         to disable error reporting.
12382
12383         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12384         here since we don't want to report an error; see the new test-336.cs.
12385
12386 2005-05-19  Raja R Harinath  <rharinath@novell.com>
12387
12388         * statement.cs (ToplevelBlock.GetParameterReference)
12389         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12390         Move here from class Block.
12391         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12392         * expression.cs (ParameterReference.DoResolveBase): Likewise.
12393
12394 2005-05-18  Martin Baulig  <martin@ximian.com>
12395
12396         Fix #74978.
12397
12398         * flowanalysis.cs
12399         (FlowBranching.Reachability): Add non-static public And() and Or()
12400         methods.
12401         (FlowBranchingSwitch): New class; do the `break_origins' thing
12402         like in FlowBranchingLoop.
12403         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12404         reachability, not just locals and parameters.
12405         (FlowBranching.MergeChild): Remove some of the hacks for loop and
12406         switch; MergeBreakOrigins() now takes care of that.
12407
12408 2005-05-18  Martin Baulig  <martin@ximian.com>
12409
12410         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12411         a loop and may leave it, reset the barrier; fixes #74974.
12412
12413 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
12414         
12415         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12416         is back.
12417         
12418         * cs-parser.jay: Catch more lexical errors.
12419         
12420         * report.cs: Add one more Error method.
12421         
12422         * rootcontext.cs,
12423         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12424
12425 2005-05-17  Martin Baulig  <martin@ximian.com>
12426
12427         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12428         #70970. 
12429
12430 2005-05-16  Raja R Harinath  <rharinath@novell.com>
12431
12432         Fix test-382.cs.  Emit values of decimal constants.
12433         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12434         Carved out of ...
12435         (TypeContainer.AddField): ... this.
12436         (TypeContainer.EmitFieldInitializers): Allow the list of fields
12437         with initializers to include 'Const's.
12438         (ClassPart.RegisterFieldForInitialization): Forward to
12439         PartialContainer.
12440         * const.cs (Const.Const): Pass initializer to base class.
12441         (Const.Define): In case of decimal constants, register them for
12442         initialization in a static constructor.
12443
12444 2005-05-14  Martin Baulig  <martin@ximian.com>
12445
12446         * statement.cs (Block.Resolve): Correctly handle unreachable code;
12447         do not call ResolveUnreachable() on unreachable statements in
12448         here, see the comment in the source code.
12449
12450 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12451
12452         Fix #74934.
12453         * expression.cs (BinaryResolveOperator): If one of the operands of
12454         an equality comparison is 'null' and the other is a pointer type,
12455         convert the null to a NullPointer.
12456         * convert.cs (ImplicitReferenceConversion): If the expression is a
12457         NullLiteral and the target type is a pointer type, return a
12458         NullPointer instead.
12459         (ImplicitConversionStandard): Likewise.
12460
12461 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
12462         
12463         * cs-parser.jay: Set readonly context based on special constructs.
12464         
12465         * expression.cs (LocalVariableReference.DoResolveBase): Improved
12466         readonly variable error handling.
12467         
12468         * rootcontext.cs (EmitCode): Don't verify members when error
12469         occurred.
12470         
12471         * statement.cs (LocalInfo): Add reaodnly context information.
12472         (SetReadOnlyContext, GetReadOnlyContext): New methods.
12473
12474 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12475
12476         * statement.cs (Block.Resolve): Revert change below.  Modify fix
12477         for #74041 to initialize 'resolved' to false only for explicit
12478         blocks.  Fixes #74873.
12479
12480 2005-05-12  Raja R Harinath  <harinath@gmail.com>
12481
12482         Fix #74920.
12483         * typemanager.cs (unmanaged_enclosing_types): New.
12484         (IsUnmanagedType): Avoid infloops by using
12485         'unmanaged_enclosing_types' to talk with recursive invocations.
12486
12487 2005-05-13  Martin Baulig  <martin@ximian.com>
12488
12489         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12490         instance variable, not a local.  Fix #74873.
12491         (Block.ResolveUnreachable): Set it to true here.
12492
12493 2005-05-11  Duncan Mak  <duncan@novell.com>
12494
12495         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12496         continuing to process for 'arg'.
12497         (handle_preprocessing_directive): Check the argument of the #endif
12498         directive and report error CS1025 if there are any trailing
12499         characters.
12500
12501         According to the C# spec, having even whitespace after the #endif
12502         directive is illegal; however, because we call arg.TrimEnd ()
12503         beforehand, we have the same behavior as csc, allowing whitespace
12504         after the directive.
12505
12506         Fixes #74892.
12507
12508 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
12509
12510         Fix #74863.
12511         
12512         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12513         (Constructor.GetObsoleteAttribute): Implemented correctly.
12514
12515 2005-05-10  Martin Baulig  <martin@ximian.com>
12516
12517         * support.cs (ReflectionParameters.ParameterModifier): Use
12518         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12519         and `ParameterAttributes.In'.  Fixes #74884.
12520
12521 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
12522
12523         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12524         
12525         * expression.cs (Argument.GetParameterModifier): Turned to property.
12526         (Invocation.Error_InvalidArguments): Add more descriptive errors.
12527         
12528         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12529         its C# equivalent.
12530         
12531 2005-05-09  Raja R Harinath  <rharinath@novell.com>
12532
12533         Fix #74852.
12534         * decl.cs (MemberCache.AddMethods): Register override methods,
12535         rather than non-override methods.
12536         * typemanager.cs (RegisterOverride): New.
12537         (IsOverride): Update.
12538
12539 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
12540
12541         Fix #73105.
12542         
12543         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12544         recursive declaration.
12545         
12546         * statement.cs (Block.ResolveMeta): Report any error in resolving.
12547         
12548 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
12549
12550         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12551         
12552         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12553
12554 2005-05-05  Raja R Harinath  <rharinath@novell.com>
12555
12556         Fix #74797.
12557         * decl.cs (DeclSpace.FamilyAccessible): 
12558         Use TypeManager.IsNestedFamilyAccessible.
12559
12560         Fix reopened #64812.
12561         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12562         internal'.
12563
12564 2005-05-04  Raja R Harinath  <rharinath@novell.com>
12565             Abin Thomas  <projectmonokochi@rediffmail.com>
12566             Anoob V E  <projectmonokochi@rediffmail.com>
12567             Harilal P R  <projectmonokochi@rediffmail.com>
12568
12569         Fix #64812.
12570         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12571         allow access to all static members.
12572
12573 2005-05-04  Martin Baulig  <martin@ximian.com>
12574
12575         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12576
12577 2005-05-04  Martin Baulig  <martin@ximian.com>
12578
12579         Fix #74655.
12580
12581         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12582         section at the end; make things work if `default' is not the last
12583         section.        
12584
12585 2005-05-04  Martin Baulig  <martin@ximian.com>
12586
12587         Fix #70400.
12588
12589         * statement.cs (Switch): Replaced the `got_default' field with a
12590         `default_section' one.
12591         (Switch.CheckSwitch): Set `default_section' here.
12592         (Switch.Resolve): If we're a constant switch and the constant is
12593         not found, use the default section.
12594
12595 2005-05-03  Martin Baulig  <martin@ximian.com>
12596
12597         * expression.cs (ArrayAccess.EmitGetLength): New public method.
12598
12599         * statement.cs (Foreach.ArrayForeach): New nested class.
12600         (Foreach.TemporaryVariable): New nested class.
12601         (Foreach.EmitArrayForeach): Removed; this is now in the new
12602         ArrayForeach class.
12603
12604 2005-05-03  Raja R Harinath  <rharinath@novell.com>
12605
12606         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
12607         more conservative.
12608         (VerifyPendingMethods): Revert change below.
12609
12610         * typemanager.cs (IsOverride, RegisterNonOverride): New.
12611         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12612         that used to trigger warning -28.  Remove warning -28.
12613         * expression.cs (Invocation.OverloadResolve): Use
12614         TypeManager.IsOverride to distinguish override methods.
12615
12616         Fix #74773.
12617         * pending.cs (VerifyPendingMethods): If a base type implements the
12618         requested interface, don't bother checking individual methods of
12619         the base type.  As a side-effect, this prevents the creation of
12620         unnecessary proxies.
12621
12622 2005-05-02  Martin Baulig  <martin@ximian.com>
12623
12624         Fix #70182.
12625
12626         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12627         Also `And' the locals if the old vector is null.
12628         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12629         null; in this case we basically reset all the variables.        
12630
12631 2005-05-02  Martin Baulig  <martin@ximian.com>
12632
12633         Fix #74529.
12634
12635         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12636         Added `FlowBranching branching' argument; always `and' the
12637         variables instead of `or'ing them unless we're an infinite loop.
12638
12639         * statement.cs (While.Resolve): Create a new sibling unless we're
12640         infinite.       
12641
12642 2005-05-02  Martin Baulig  <martin@ximian.com>
12643
12644         Fix #70140.
12645
12646         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12647         arguments; use it instead of creating a new TopLevelBlock.
12648         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12649         our ConstructorInitializer.
12650
12651         * statement.cs
12652         (TopLevelBlock.TopLevelBranching): New public property.
12653         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12654         and create our `TopLevelBranching'.
12655
12656         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12657         anonymous method host, use `block.TopLevelBranching' rather than
12658         creating a new branching.
12659
12660 2005-04-20  Miguel de Icaza  <miguel@novell.com>
12661
12662         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12663         a ScopeInfo, if any of the current children is a child of the new
12664         entry, move those children there.
12665
12666 2005-04-30  Martin Baulig  <martin@ximian.com>
12667
12668         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12669         at the beginning of a SwitchSection.  Fix #73335.
12670
12671 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
12672
12673         Fix #74378
12674         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12675         
12676         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12677         (FieldExpr.DoResolve): Obsolete members are ignored for field
12678         initializers.
12679         
12680 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
12681
12682         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12683         of arrays detection.
12684
12685         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12686         verification.
12687         (Field.VerifyClsCompliance): Volatile fields are not compliant.
12688
12689         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12690         arrays report.
12691
12692 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
12693
12694         * cs-parser.jay: Use the prefered version of -unsafe in error
12695         message.
12696
12697 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
12698
12699         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12700         circumstances.
12701
12702 2005-04-20  John Luke  <john.luke@gmail.com>
12703
12704         * driver.cs: fix typo in error message, --outout to --output
12705
12706 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
12707
12708         * codegen.cs (InRefOutArgumentResolving): New field.
12709         
12710         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12711         fields outside contructor.
12712         
12713         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12714         
12715 2005-04-19  Miguel de Icaza  <miguel@novell.com>
12716
12717         * anonymous.cs (CaptureContext.EmitParameterInstance): The
12718         parameter code was not completed ever, so it was not as up-to-date
12719         as local variables.  Must finish it.
12720
12721         The bug fix was to compare the Toplevel of the block, not the
12722         current block.  Thanks for Ben for pointing this out. 
12723
12724 2005-04-19  Raja R Harinath  <rharinath@novell.com>
12725
12726         * decl.cs (AddMethods): Use the declaring type of the problem
12727         method to determine if we want to squash a warning.
12728
12729 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
12730
12731         * attribute.cs: Removed debug output.
12732
12733         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12734         
12735         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12736         Report.Stderr.
12737         
12738 2005-04-18  Raja R Harinath  <rharinath@novell.com>
12739
12740         Fix #74481.
12741         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12742         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12743         all null comparisons against reference types.
12744
12745 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
12746
12747         Fix# 74565
12748         * class.cs (TypeContainer.CircularDepException) New nested
12749         exception class.
12750         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12751         (TypeContainer.DefineType): Removed error, reset InTransit before
12752         exit.
12753         (Class.DefineType): Throw exception when is in Transit.
12754         Catch exception and report error.
12755         (Struct.DefineType): Throw exception when is in Transit.
12756         Catch exception and report error.
12757         (Interface.DefineType): Throw exception when is in Transit.
12758         Catch exception and report error.
12759
12760         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12761         handle nested exception handlers.
12762
12763         * flowanalysis.cs (InTryWithCatch): New method, search for try with
12764         a catch.
12765
12766         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12767         InFinally and InCatch storage.
12768
12769         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12770         (Catch.Resolve): Set and Restore ec.InCatch.
12771         (Try.Resolve): Set and Restore ec.InFinally.
12772         (Try.HasCatch): True when try has catch.
12773
12774 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
12775
12776         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12777           for the same event member, so exclude such cases from warning 419.
12778           Fixed bug #74633.
12779
12780 2005-04-16  Miguel de Icaza  <miguel@novell.com>
12781
12782         * expression.cs (Binary.ResolveOperator): Apply patch from John
12783         Luke to fix bug 59864: operators &, | and ^ on enumerations
12784         require that the same enum type on both sides.
12785
12786         * driver.cs: Add warnings to old flag usage, this is to assist
12787         people who produce Makefiles and hope that the Makefiles will be
12788         used on Windows.
12789
12790         * class.cs (TypeContainer.EmitType): Moved the definition of the
12791         special $PRIVATE$ field from the resolve phase to the Emit phase.
12792         During resolve we do not know if we are a struct with
12793         HasExplicitLayout, we know this only after the attributes for the
12794         type are emitted.
12795
12796         Set the FieldOffset to zero on the dummy field that we create for
12797         the class.   Fixes 74590.
12798
12799 2005-04-16  Raja R Harinath  <rharinath@novell.com>
12800
12801         Fix #73834.
12802         * ecore.cs (PropertyExpr.resolved): New.
12803         (DoResolve): Use it to handle a case of double resolution here.
12804         Handle a case of identical-name-and-type-name.
12805         * expression.cs (ArrayCreation.CheckIndices): Avoid double
12806         resolution by storing the results of expression resolution back
12807         into the "probes" array.
12808
12809 2005-04-15  Raja R Harinath  <rharinath@novell.com>
12810
12811         Fix cs0208-7.cs and cs0208-8.cs.
12812         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12813         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
12814         error reporting to point out the reason a struct is not unmanaged.
12815
12816 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12817
12818         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
12819           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12820
12821 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12822
12823         Fix #74528.
12824         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12825         IdenticalNameAndTypeName here.
12826         (EventExpr.InstanceResolve): Likewise.
12827
12828 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
12829
12830         C# 2.0 DefaultCharSetAttribute implementation
12831         
12832         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12833         which allows us to set GlobalNamespace for every resolve.
12834         (Attribute.ResolveArguments): Cut from Resolve.
12835         (Attribute.GetCharSetValue): Returns CharSet named argument.
12836         (Attribute.DefinePInvokeMethod): Gets default charset from
12837         module settings.
12838         (GlobalAttribute.ResolveAsTypeStep): Override.
12839         (GlobalAttribute.ResolveArguments): Override.
12840         
12841         * class.cs (TypeAttr): Is protected.
12842         
12843         * codegen.cs (ModuleClass.DefaultCharSet): New member.
12844         (ModuleClass.DefaultCharSetType): New memeber.
12845         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12846         
12847         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12848         charset from module.
12849         
12850         * delegate.cs (TypeAttr): Override.
12851         (Delegate.DefineType): Use this TypeAttr.
12852         
12853         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12854         at very early stage (before types are defined) to resolve model
12855         module attributes. It will probably not work with corlib but it
12856         should be ok.
12857         
12858         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12859         charset from module.
12860         
12861         * typemanager.cs (default_charset_type): New type.
12862
12863 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12864
12865         * decl.cs (MemberCache.AddMethods): Don't warn if
12866         System.Object.Finalize has buggy MethodAttributes.
12867
12868         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12869         removed below.
12870
12871 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12872
12873         * doc.cs : detect ambiguous reference to overloaded members.
12874           Fixed bug #71603. MS 1.1 csc does not detect it.
12875
12876 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12877
12878         * doc.cs : delegates must not be referenced with parameters.
12879           Fixed bug #71605.
12880
12881 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12882
12883         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12884
12885 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12886
12887         * driver.cs (MainDriver): Stop processing if the CLS stage found
12888         errors. 
12889
12890         (CompilerCallableEntryPoint.InvokeCompiler): Always
12891         reset after execution;   Take a TextWriter argument for the
12892         output.
12893
12894         * report.cs: Use the error stream instead of hardcoding stderr. 
12895
12896 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12897
12898         * class.cs: Reduce code paths to test, too small of an
12899         optimization to make it worth the extra testing.  Always perform
12900         it. 
12901
12902 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12903
12904         Fix #74510.
12905         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12906         operators that had errors reported on them.
12907
12908 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12909
12910         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12911         argument types.
12912         (Attribute.Resolve): Add named argument type checking.
12913         
12914         * class.cs (FixedField.Define): Use IsPrimitiveType
12915         
12916         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12917         
12918         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12919         unsafe parameter types.
12920         
12921         * statement.cs (Using.ResolveExpression): Add better error description.
12922         
12923         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12924         
12925 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12926
12927         Fix #74484.
12928         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12929         AttributeUsageAttribute in the emitcontext of the attribute class,
12930         not in the emitcontext of the attributable entity it was attached to.
12931         * cs-parser.jay: Use 'current_class', not 'current_container',
12932         when creating a GlobalAttribute.
12933
12934 2005-04-08  Alp Toker  <alp@atoker.com>
12935
12936         * pending.cs: The fix to #58413 failed to compile methods implementing
12937         interfaces with/without params modifiers and vice versa, even though
12938         params modifiers aren't part of the signature. Make the modifier check
12939         less strict as in csc.
12940
12941 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12942             Anoob V E  <projectmonokochi@rediffmail.com>
12943             Harilal P R  <projectmonokochi@rediffmail.com>
12944
12945         Fix #58413.
12946         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12947         modifiers of pending methods.
12948         (PendingImplementation.PendingImplementation): Initialize it.
12949         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12950         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12951         with ParameterData.  Add check for modifiers.
12952         * class.cs (MethodData.Define): Update to changes.
12953
12954 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12955
12956         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12957
12958 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12959
12960         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12961         property.
12962         
12963         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12964         
12965         * rootcontext.cs,
12966         * typemanager.cs: Registered RequiredAttributeAttribute.
12967         
12968 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12969
12970         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12971         Warning CS0169 is back at level 3.
12972         (IMethodData.SetMemberIsUsed): New method.
12973         
12974         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12975         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12976         
12977         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12978
12979         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12980         contants.
12981         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12982         is used.
12983         
12984         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12985         is used.
12986         
12987         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12988         to avoid the problems with nested types.
12989
12990 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12991             Anoob V.E  <projectmonokochi@rediffmail.com>
12992             Harilal P.R  <projectmonokochi@rediffmail.com>
12993             Raja R Harinath  <rharinath@novell.com>
12994
12995         Fix #73820.
12996         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12997         attribute.
12998         * typemanager (GetConstructor): Make public.
12999
13000 2005-04-05  John Luke  <john.luke@gmail.com>
13001             Raja R Harinath  <rharinath@novell.com>
13002
13003         Fix #62232.
13004         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
13005         struct too.  Return false quicker in a few cases.
13006         (VerifyUnManaged): Use it.
13007
13008 2005-04-05  Raja R Harinath  <rharinath@novell.com>
13009
13010         Fix #74041.
13011         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
13012         not 'unreachable_seen'.
13013
13014 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
13015
13016         * attribute.cs (Attribute.GetValue): Removed unused.
13017         
13018         * codegen.cs (CodeGen.TrimExt): Removed unused.
13019         
13020         * cs-parser.jay (output): Removed unused.
13021         
13022         * cs-tokenizer.cs (hex_digits): Removed unused.
13023         
13024         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
13025         
13026         * expression.cs (Indirection.LoadExprValue): Removed unused.
13027         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
13028         
13029         * iterators.cs (Iterator.param_types): Removed unused.
13030         
13031         * statement.cs (Goto.block): Removed unused.
13032         (ToplevelBlock.did): Removed unused.
13033         (Switch.ResolveConstantSwitch): Removed unused.
13034
13035 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
13036
13037         * rootcontext.cs: Allow mcs to bootstrap with the compilation
13038         resetting thingy.
13039
13040 2005-04-01  Raja R Harinath  <rharinath@novell.com>
13041
13042         Fix #74232 and cs0208-3.cs.
13043         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
13044         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
13045         unmanaged type.  Don't use FieldBuilders when 't' is a
13046         TypeBuilder.  Use ModFlags and MemberType fields.
13047         * class.cs (MemberBase.member_type): Rename from MemberType.
13048         (MemberBase.MemberType): New property.  Determines member_type on
13049         demand.
13050         (MemberBase.DoDefine): Don't initialize MemberType here.
13051         (FieldMember.Define): Likewise.
13052
13053 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
13054
13055         Fix #74241
13056         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
13057         Attributes are emitted there.
13058         
13059 2005-04-01  Raja R Harinath  <rharinath@novell.com>
13060
13061         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
13062         keyword in 'partial enum' too.
13063         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
13064         is not allowed).
13065         Report from Kamil Skalski <nazgul@omega.pl>.
13066
13067         Fix #74309.
13068         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
13069         have partial containers too.
13070
13071         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
13072         in block' checks to Block.CheckInvariantMeaningInBlock.
13073         * statement.cs (Block.GetKnownVariableInfo): Make private.
13074         (Block.IsVariableUsedInChildBlock): Remove.
13075         (Block.IsVariableUsedInBlock): Likewise.
13076         (Block.CheckInvariantMeaningInBlock): New.  Show location of
13077         conflicting declaration.
13078         (Block.AddVariable): Make error messages less long-winded and more
13079         specific.  Show location of conflicting declaration.
13080         * parameter.cs (Parameters.Location): New readonly property.
13081
13082 2005-03-31  Raja R Harinath  <rharinath@novell.com>
13083
13084         Clean up semantics of invoking ResolveMemberAccess.
13085         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
13086         can have an instance, ensure that we pass in a non-TypeExpression
13087         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
13088         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
13089         argument.  Update to changes and simplify.
13090         (FieldExpr.Emitinstance): Remove CS0120 check.
13091         (PropertyExpr.EmitInstance): Likewise.
13092         * expression.cs (Argument.Resolve): Likewise.
13093         (Invocation.DoResolve): Update to changes in semantics of
13094         InstanceExpression.
13095
13096 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
13097
13098         Fix #74241
13099         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
13100         customization.
13101         
13102         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
13103
13104 2005-03-31  Raja R Harinath  <rharinath@novell.com>
13105
13106         Fix difference in behaviour with commandline invocation.
13107         * driver.cs (Driver.Reset): New.
13108         (CompilerCallableEntryPoint): Call it.
13109
13110         * statement.cs (If.Resolve): Avoid spurious "uninitialized
13111         variable" warnings if the boolean expression failed to resolve.
13112
13113 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
13114
13115         * attribute.cs: Fix the union of several permissions when some of them
13116         are unrestricted (so the result isn't an unrestricted permission set).
13117         Fix #74036.
13118
13119 2005-03-30  Raja R Harinath  <rharinath@novell.com>
13120
13121         * ecore.cs (MemberExpr): New class.  Convert from interface
13122         IMemberExpr.
13123         (MemberExpr.ResolveMemberAccess): Refactor and move here from
13124         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
13125         error checks.
13126         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
13127         (MethodGroupExpr.IsExplicitImpl): Remove.
13128         (Expression.GetFieldFromEvent): Remove.
13129         (SimpleName.MemberStaticCheck): Remove.
13130         (SimpleName.DoSimpleNameResolve): Update to changes.
13131         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
13132         (MemberAccess.IdenticalNameAndTypeName): Remove.
13133         (MemberAccess.error176): Move to MemberExpr.
13134         (MemberAccess.DoResolve): Update to changes.
13135         (BaseAccess.DoResolve): Likewise.
13136
13137 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
13138
13139         C# 2.0 Conditional attribute class implementation
13140         
13141         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
13142         Analyzes class whether it has attribute which has ConditionalAttribute
13143         and its condition is not defined.
13144         
13145         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
13146         (Class.IsExcluded): New method. Search for at least one defined
13147         condition in ConditionalAttribute of attribute class.
13148
13149 2005-03-30  Raja R Harinath  <rharinath@novell.com>
13150
13151         * ecore.cs (PropertyExpr): Derive from Expression, not
13152         ExpressionStatement.
13153         (PropertyExpr.EmitStatement): Remove.
13154
13155 2005-03-29  Raja R Harinath  <rharinath@novell.com>
13156
13157         Fix #74060.
13158         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
13159         internal field "value__" of an enum be private.  The examples for
13160         "value__" that I found on MSDN all used FieldAttributes.Private.
13161
13162         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
13163         Don't mention IL method attribute names.
13164
13165         Fix #47991.  Remove a TODO.
13166         * statement.cs (Block.Toplevel): Make into a field.
13167         (Block.Parameters): Move into ToplevelBlock.
13168         (Block.known_variables): Rename from child_variable_names.
13169         (Block.Block): Remove variants that take Parameters.  Initialize
13170         'Toplevel' with the immediately surrounding toplevel block.
13171         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
13172         LocalInfo parameter.
13173         (Block.GetKnownVariableInfo): New.
13174         (Block.IsVariableNameUsedInChildBlock): Update.
13175         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
13176         the block, even though it may not be in scope.
13177         (Block.AddVariable): Remove Parameters parameter.  Use
13178         Toplevel.Parameters instead.
13179         (Block.AddConstant): Remove Parameters parameter.
13180         (Block.GetParameterReference): Update to use Toplevel.Parameters.
13181         (Block.IsParamaterReference): Likewise.
13182         (Block.IsLocalParameter): Likewise.  Simplify a lot.
13183         (ToplevelBlock.Parameters): New.  Moved from Block.
13184         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
13185         initialize Parameters to a non-null value.
13186         * cs-parser.jay: Update to changes.
13187         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
13188         simple names that mean different things in the same block.  Use
13189         Block.IsVariableNameUsedInBlock.
13190
13191 2005-03-28  Raja R Harinath  <rharinath@novell.com>
13192
13193         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
13194         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
13195         GetTypeHandle.  It is possible for a reflected type to derive from
13196         a TypeBuilder (e.g., int[] derives from the TypeBuilder
13197         System.Array during mscorlib compilation).
13198         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
13199         contain a method_hash, don't create one either.  Don't create a
13200         deep copy of the base cache's method_hash.
13201         (MemberCache.SetupCache): Rename back from DeepCopy.
13202         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
13203         already initialized.  If we see an override function, add its
13204         underlying base virtual function to the member_hash too.
13205
13206         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
13207
13208 2005-03-26  Raja R Harinath  <harinath@acm.org>
13209
13210         Fix #73038.
13211         * assign.cs (Assign.DoResolve): When the RHS of an assignment
13212         fails to resolve, ensure that the LHS is still resolved as an
13213         lvalue.
13214
13215 2005-03-25  Raja R Harinath  <harinath@acm.org>
13216
13217         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
13218         ec.ContainerType.
13219         (Enum.current_ec): Remove.
13220         (Enum.LookupEnumValue): Remove EmitContext argument.
13221         Just uses the one created during DefineType.
13222         (Enum.FindMembers): Update.
13223         * expression.cs (MemberAccess.DoResolve): Update.
13224
13225 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
13226
13227         * assign.cs (Assign.DoResolve): Check for CS1717 when
13228         source and target are same (uses Equals).
13229
13230         * expression.cs (LocalVariableReference, ParameterReference,
13231         This): Implemented Equals, GetHashCode.
13232
13233         * statement.cs (Block.GetParameterReference): Removed useless
13234         local variable.
13235
13236 2005-03-22  Raja R Harinath  <rharinath@novell.com>
13237
13238         Fix cs0128.cs
13239         * statement.cs (Block.AddVariable): Ensure that we skip implicit
13240         blocks before deciding whether the error is cs0136 or cs0128.
13241
13242         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
13243         (using_alias_directive, using_namespace_directive): Pass
13244         MemberName, not an expression to Namespace.UsingAlias and
13245         Namespace.Using.
13246         (MakeName): Use the MemberName of the namespace.
13247         * namespace.cs (Namespace.MemberName): New.
13248         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
13249         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
13250         Likewise.
13251         * decl.cs (MemberName.Name): Make readonly.
13252         (MemberName.FromDotted): New "constructor".
13253         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
13254         (MemberCore.Name): Compute from MemberName on demand.
13255         (MemberCore.SetMemberName): Provide a way to change the
13256         MemberName.
13257         (MemberCore.AddToContainer): Don't take a fullname parameter.
13258         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
13259         fully qualified name of the container to the member name.
13260         (TypeContainer.AddToTypeContainer): Use a fully qualified name
13261         only if the type is a member of the root container.
13262         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
13263         MemberName.Left rather than searching for an embedded ".".
13264         (PartialContainer.CreatePart): Update to changes in RootContext.
13265         (MemberBase.ShortName): Turn into a property.  Use
13266         MemberCore.SetMemberName.
13267         (MemberBase.ExplicitInterfaceName): Remove.
13268         (MemberBase.UpdateMemberName): Remove.
13269         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
13270         (PropertyBase.SetMemberName): New override.
13271         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
13272         (Tree.GetDecl): New.
13273         (Tree.AllDecls): Rename from Decls.
13274         * attribute.cs, enum.cs, report.cs: Update to changes.
13275         * driver.cs (MainDriver): Use MemberName.FromDotted on
13276         RootContext.MainClass.
13277
13278 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
13279
13280         * class.cs (FixedField.Define): Check for CS1664 and more sanity
13281         checks.
13282
13283         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
13284
13285 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
13286
13287         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
13288         property accessor modifiers.
13289
13290         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
13291         fixed buffer attribute (CS1716).
13292         (PropertyMethod.HasCustomAccessModifier): When property accessor
13293         has custom modifier.
13294
13295         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
13296         modifiers.
13297         (PropertyExpr.DoResolveLValue): Add CS0272.
13298
13299 2005-03-17  Miguel de Icaza  <miguel@novell.com>
13300
13301         * convert.cs: When converting to a pointer, use the proper Conv.U
13302         or Conv.I depending on the source data type.
13303
13304         * cs-tokenizer.cs: Make the size for large decimal constants,
13305         fixes #72957.
13306
13307 2005-03-17  Martin Baulig  <martin@ximian.com>
13308
13309         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13310         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
13311
13312 2005-03-17  Martin Baulig  <martin@ximian.com>
13313
13314         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13315         to bool so we can return an error condition.
13316         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13317         returned an error.
13318
13319 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
13320
13321         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13322         attributes.
13323
13324 2005-03-16  Raja R Harinath  <rharinath@novell.com>
13325
13326         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13327         Refactor to avoid traversing the list of assemblies, and to avoid
13328         string concatenation.
13329         * typemanager.cs (guid_attr_type): Remove.
13330         (negative_hits, pointers, references): Remove hashes.
13331         (type_hash): New.
13332         (GetConstructedType): New.  Uses type_hash to handle constructed
13333         types (arrays, references, pointers).
13334         (GetReferenceType, GetPointerType): Use it.
13335         (GetNestedType): New.  Uses type_hash to handle nested types of
13336         reflected types.
13337         (LookupType, LookupTypeDirect): Remove.
13338         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
13339         'types' hash and LookupTypeReflection directly.
13340         (params_string, params_object): Use GetConstructedType.
13341         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
13342         top-level types.
13343         (Namespace.Lookup): Use cached_types.
13344         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13345         provided by old TypeManager.LookupType.
13346         * rootcontext.cs (MakeFQN): Remove.
13347         * decl.cs (DeclSpace.MakeFQN): Likewise.
13348         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13349         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13350         TypeManager.GetConstructedType.
13351         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13352
13353 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
13354
13355         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13356         indexers.
13357
13358         * cs-parser.jay: Reports CS1527 for any namespace element.
13359
13360         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13361         Added CS0407.
13362
13363         * expression.cs (ParameterReference.IsAssigned): Changed error to
13364         CS0269.
13365         (Error_WrongNumArguments): Moved CS0245 detection here.
13366
13367         * statement.cs (Return.Resolve): Add CS1622 report.
13368
13369 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
13370
13371         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13372
13373 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
13374
13375         * attribute.cs expression.cs: Get rid of some allocations.
13376
13377 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
13378
13379         * doc.cs : just eliminate the latest change.
13380
13381 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13382
13383         * doc.cs : commented out the latest change. It breaks xml-030.cs
13384
13385 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13386
13387         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13388           fail. So invoke CreateType() in FindDocumentedType().
13389
13390 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
13391
13392         * cs-tokenizer.cs : added IsKeyword().
13393         * doc.cs : Detect keyword incorrectly used as identifier.
13394           Allow identifiers prefixed by @.
13395
13396 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
13397
13398         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13399         It caused exception in namespace resolving (again!).
13400         
13401         * class.cs (Class.ctor): Removed exit.
13402         (PropertyMethod.ctor): ditto.
13403         
13404         * codegen.cs (Codegen.Reset): Reset static data.
13405         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13406         
13407         * cs-tokenizer.cs (Cleanup): Removed.
13408         
13409         * driver.cs (GetSystemDir): Rewrote to one line command.
13410         It caused problem with unloaded dynamic modules.
13411         (UnixParseOption): Removed Exit.
13412         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13413         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13414         Now can be mcs used as library.
13415         
13416         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13417         empty location.
13418         
13419         * location.cs (Reset): Reset static data.
13420         
13421         * namespace.cs (Reset): Reset static data.
13422         
13423         * report.cs (Report.Reset): Reset static data.
13424         
13425         * rootcontext.cs (RootContext.Reset): Reset static data.
13426         
13427         * tree.cs (RootTypes.ctor): Use Location.Null
13428         
13429         * typemanager.cs (TypeManager.Reset): Reset static data.
13430         (CoreLookupType): Removed Exit.
13431         (TypeHandle.Reset): Reset static data.
13432         
13433 2005-03-10  Raja R Harinath  <rharinath@novell.com>
13434
13435         Fix #73516.
13436         * typemanager.cs (ComputeNamespaces): Import namespaces from
13437         referenced modules too.
13438
13439 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13440
13441         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13442         than '.'.
13443
13444 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13445
13446         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13447         enclosing DeclSpace.  This ensures that a name-lookup populates
13448         more caches and there are fewer 'TypeExpression's.  Carve out
13449         nested type lookup into ...
13450         (LookupNestedTypeInHierarchy): ... this.
13451
13452 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13453
13454         Clean up a few partial-class semantics.  
13455         Fixes test-357.cs and cs1618-2.cs.
13456         * cs-parser.jay (struct_declaration): Use 'current_class' as
13457         parent of newly-created struct.  Remove call to Register ().
13458         Use 'pop_current_class' to complete handing the current struct.
13459         (interface_declaration): Likewise.
13460         (class_declaration): Likewise.
13461         (enum_declaration): Use 'current_class' as parent of newly created
13462         enum.
13463         (delegate_declaration): Likewise.
13464         (pop_current_class): New function.  This is used to handle closing
13465         up the 'current_class' and 'current_container', and pointing them
13466         to the enclosing class/container.
13467         (CSharpParser): Initialize 'current_class' too.
13468         * decl.cs (MemberCore): Add check for invariant: a partial
13469         container is not a parsed entity, and thus does not enclose any
13470         parsed members.
13471         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13472         (DeclSpace.BaseTypeExpr): Use it.
13473         (DeclSpace.LookupType): Add check for invariant.
13474         * class.cs (TypeContainer): Add check for invariant: a nested
13475         class should have the same NamespaceEntry as its enclosing class.
13476         (TypeContainer.EmitFieldInitializers): Make virtual.
13477         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13478         MemberCore.
13479         (TypeContainer.Register): Remove.
13480         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13481         null.  Use TypeResolveEmitContext for resolving base types and
13482         interfaces.  Move initialization of Parts.TypeBuilder here from
13483         ...
13484         (TypeContainer.DefineNestedTypes): ... here.
13485         (PartialContainer): Take a Namespace not a NamespaceEntry.
13486         (PartialContainer.Create): Don't use Register.  Call the
13487         appropriate Add... function directly.
13488         (ClassPart): Take both the PartialContainer and the enclosing
13489         class as constructor arguments.
13490         (ClassPart.EmitFieldInitializers): Override.
13491         (ClassPart.PartFindNestedTypes): Remove.
13492         (FieldBase.GetInitializerExpression): Resolve the initializer
13493         expression in the emit context of the enclosing class.
13494         * tree.cs (RootTypes): Remove Register ().
13495         
13496 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
13497
13498         * cs-parser.jay: Removed CS0134.
13499         
13500         * driver.cs: Removed CS1901.
13501         
13502         * expression.cs (SizeOf.DoResolve): Don't report CS0233
13503         for predefined types.
13504
13505 2005-03-07  Duncan Mak  <duncan@novell.com>
13506
13507         * codegen.cs (Save):  Catch UnauthorizedAccessException as
13508         well. Fixes bug #73454.
13509
13510 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
13511
13512         * cs-tokenizer.cs (xtoken): Add CS1035.
13513         
13514         * class.cs (MethodData.Define): Add CS0683.
13515         (FieldMember.ctor): Add CS0681.
13516
13517 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13518
13519         * ecore.cs (SimpleName.DoResolve): Rename from
13520         SimpleName.DoResolveAllowStatic.
13521         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13522         Pass 'intermediate' flag to MemberStaticCheck.
13523         (SimpleName.MemberStaticCheck): Skip "static check" only in case
13524         of "intermediate" lookups via MemberAccess.
13525         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
13526         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13527
13528 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13529
13530         Fix #73394.
13531         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13532         slipped in because of variable names that are identical to a
13533         builtin type's BCL equivalent ('string String;', 'int Int32;').
13534         (PropertyExpr.EmitInstance): Likewise.
13535
13536 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
13537
13538         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13539         
13540         * report.cs (warning_ignore_table): Made public.
13541
13542 2005-03-04  Raja R Harinath  <rharinath@novell.com>
13543
13544         Fix #73282.
13545         * class.cs (MethodData.Emit): Pass 'container' to
13546         container.GetObsoleteAttribute instead of 'container.Parent'.
13547
13548 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
13549
13550         * cs-parser.jay: Add 1534 error test.
13551
13552         * iterators.cs (Yield.CheckContext): Add error 1629.
13553         (Iterator.ctor): Save unsafe modifier.
13554         (MoveNextMethod.DoEmit): Restore unsafe context.
13555
13556         * namespace.cs (UsingAlias): Better error message.
13557
13558 2005-03-03  Dan Winship  <danw@novell.com>
13559
13560         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13561         the warning message [#73219]
13562
13563 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13564
13565         Fix compile with MCS 1.0.0.0.
13566         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13567         w_restore to not depend on string constant folding.
13568
13569 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13570
13571         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
13572         CS0246 check to users who passed 'silent = false'.
13573         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13574         check.
13575         (SimpleName.SimpleNameResolve): Update.
13576         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13577         (MemberAccess.IdenticalNameAndTypeName): Update.
13578         * doc.cs (FindDocumentedTypeNonArray): Update.
13579
13580 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
13581
13582         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13583         * parameters.cs (ComputeAndDefineParameters): Remove.
13584         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13585         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13586         Use GetParameterInfo.
13587
13588 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
13589
13590         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13591
13592 2005-03-02  Raja R Harinath  <rharinath@novell.com>
13593
13594         Unify DeclSpace.LookupType and DeclSpace.FindType.
13595         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
13596         is in charge of defining nested types on demand.
13597         (DeclSpace.LookupType): Use it when the current_type is a
13598         TypeBuilder.  Use LookupTypeDirect for reflected types.
13599         (DeclSpace.FindType): Remove.
13600         (DeclSpace.LookupInterfaceOrClass): Likewise.
13601         (DeclSpace.DefineTypeAndParents): Likewise.
13602         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13603         DeclSpace.LookupType.
13604         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13605         * typemanager.cs (LookupType): Simplify.
13606         (AddUserType): Remove type from negative_hits.
13607         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13608         * class.cs (TypeContainer.FindMembers): Move handling of nested
13609         types ...
13610         (TypeContainer.FindMembers_NestedTypes): ... here.
13611         (TypeContainer.FindNestedType): Implement override.
13612         (ClassPart.FindNestedType): Delegate to PartialContainer.
13613         (ClassPart.PartFindNestedType): Looks up the nested types of the
13614         part alone.
13615
13616 2005-03-02  Martin Baulig  <martin@ximian.com>
13617
13618         * class.cs (TypeContainer.DoDefineMembers): We also need a default
13619         static constructor in static classes.
13620
13621 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
13622
13623         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13624         sizeParamIndex is not specified.
13625
13626 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
13627
13628         Fix #73117
13629         * report.cs (WarningMessage.IsEnabled): Missing null check.
13630
13631 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13632
13633         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13634         in the fields and not in the properties.
13635
13636 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
13637
13638         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
13639         fields as well.
13640
13641 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13642
13643         * attribute.cs: Small refactoring (improved robustness).
13644         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13645         (ValidateGuid): Removed.
13646         (Resolve): Removed referenced to above mentioned.
13647         (GetAttributeUsage): Made private and changed to work without
13648         class assistance.
13649         (GetIndexerAttributeValue): Don't crash.
13650         (GetConditionalAttributeValue): Ditto.
13651         (GetClsCompliantAttributeValue): Ditto.
13652         (ExtractSecurityPermissionSet): All attributes exceptions are
13653         error 648.
13654         (GetPropertyValue): New helper.
13655         (GetMethodImplOptions): New method.
13656         (DefinePInvokeMethod): Reuse common code. Implemented handling of
13657         some missing properties.
13658         
13659         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13660         (Method.ApplyAttributeBuilder): Updated.
13661         
13662         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13663         exception.
13664
13665 2005-02-28  Raja R Harinath  <rharinath@novell.com>
13666
13667         Fix #73052.
13668         * report.cs (Report.SymbolRelatedToPreviousError): Handle
13669         non-simple types (array, pointer, reference).
13670
13671 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13672
13673         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13674
13675         * class.cs (MethodCore.IsDuplicateImplementation): Special error
13676         for operators.
13677         (Method.CheckBase): Catch wrong destructor here.
13678         (MethodData.Define): Add errors 550, 668.
13679
13680         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13681
13682         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13683
13684         * pending.cs (VerifyPendingMethods): Add error 551.
13685
13686         * typemanager.cs (CSharpName): Next error report helper.
13687
13688 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
13689
13690         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13691         attributes. Removed useless attribute double check.
13692         It saves almost 2MBs for corlib.
13693
13694 2005-02-25  Raja R Harinath  <rharinath@novell.com>
13695
13696         Fix #72924.
13697         * statement.cs (ExpressionStatement.Resolve): Make robust to being
13698         called twice in case of error.
13699
13700 2005-02-23  Chris Toshok  <toshok@ximian.com>
13701
13702         Fix compiler portions of #72827.
13703         * statement.cs (Block.Emit): call Begin/EndScope on the
13704         EmitContext instead of the ILGenerator.
13705
13706         * codegen.cs (EmitContext.BeginScope): new method, call
13707         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13708         we have one.)
13709         (EmitContext.BeginScope): same, but EndScope and CloseScope
13710
13711         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13712         offset and call the superclass's OpenScope(int) with it.
13713         (SymbolWriter.CloseScope): get the current il
13714         offset and call superclass's CloseScope(int) with it.
13715
13716 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
13717
13718         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13719         CS1677 for out and ref as well.
13720
13721         * class.cs (Method.Define): Add error CS1599 detection.
13722         
13723         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13724         
13725         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13726         
13727         * delegate.cs (Delegate.Define): Add error CS1599 detection.
13728         
13729         * support.cs.cs (ModifierDesc): New helper method.
13730
13731 2005-02-23  Raja R Harinath  <rharinath@novell.com>
13732             Abin Thomas  <projectmonokochi@rediffmail.com>
13733             Anoob V E  <projectmonokochi@rediffmail.com>
13734             Harilal P R  <projectmonokochi@rediffmail.com>
13735
13736         Fix #57851, #72718.
13737         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13738         MemberLookup (used for error reporting) actually returns a result.
13739         Fix error report number (122, not 112).
13740
13741 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
13742             Anoob V E  <projectmonokochi@rediffmail.com>
13743             Harilal P R  <projectmonokochi@rediffmail.com>
13744
13745         Fix #71134.
13746         * pending.cs (PendingImplementation.GetAbstractMethods):
13747         Find NonPublic members too.
13748
13749 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
13750
13751         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13752         Fixed error 217.
13753         
13754         * class.cs (MethodCore.CheckMethodAgainstBase):
13755         Add error 239 report.
13756
13757 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13758
13759         Fix #68955.
13760         * expression.cs (Invocation.IsApplicable): Make public.
13761         (Invocation.IsParamsMethodApplicable): Likewise.
13762         * delegate.cs (Delegate.VerifyApplicability): Don't use
13763         Invocation.VerifyArgumentCompat for parameter applicability
13764         testing.  Use Invocation.IsApplicable and
13765         Invocation.IsParamsMethodApplicable.
13766
13767 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13768
13769         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13770         
13771         * class.cs (Operator.Define): Add error 217 report.
13772         
13773 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13774
13775         * namespace.cs (UsingEntry.Resolve): Undo change below.
13776
13777 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13778
13779         Fix #72756.
13780         * ecore.cs (Expression.MemberLookupFailed): Add argument to
13781         disable the error message when the extended MemberLookup also
13782         fails.
13783         (Expression.MemberLookupFinal): Update.
13784         (SimpleName.DoSimpleNameResolve): Update.
13785         * expression.cs (MemberAccess.ResolveNamespaceOrType):
13786         Don't use MemberLookupFinal.
13787         (New.DoResolve): Update.
13788         (BaseAccess.CommonResolve): Update.
13789
13790 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13791
13792         Fix #72732.
13793         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13794         occured previously, don't resolve again.
13795
13796 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13797
13798         Fix #69949
13799         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13800         argument. Call ResolveAttributeUsage for unresolved.
13801         when types doesn't match ctor arguments.
13802         
13803         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13804         for nested attribute classes.
13805         (Class.attribute_usage): Removed.
13806         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13807         for attribute class.
13808         
13809         * ecore.cs (IsAttribute): Removed.
13810         
13811         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13812         
13813         * rootcontext.cs (RegisterAttribute): Removed, attributes are
13814         now normal types.
13815         (attribute_types): Removed.
13816         (EmitCode): Global attributes are emited as the latest.
13817
13818 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
13819
13820         * class.cs (EmitFieldInitializers): Don't emit field initializer
13821         for default values when optimilization is on.
13822         
13823         * constant.cs (Constant.IsDefaultValue): New property.
13824         
13825         * driver.cs: Add /optimize handling.
13826         
13827         * constant.cs,
13828         * ecore.cs,
13829         * literal.cs: Implement new IsDefaultValue property.
13830         
13831         * rootcontext.cs (Optimize): New field, holds /optimize option.
13832
13833 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13834
13835         Fix crasher in re-opened #72347.
13836         * namespace.cs (Namespace.Lookup): Return null if
13837         DeclSpace.DefineType returns null.
13838
13839         Fix #72678.
13840         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13841
13842 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13843
13844         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
13845         now returns null if it cannot resolve to an lvalue.
13846         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13847         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13848         returned null.  Remove check for SimpleName.
13849         (EventExpr.DoResolveLValue): New.
13850         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13851         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
13852         error from ...
13853         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
13854         avoid CS0131 error.
13855         (Unary.ResolveOperator): Move CS0211 check ...
13856         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
13857         CS0131 error.
13858         (Unary.DoResolveLValue): Simplify.
13859         (AddressOf.DoResolveLValue): New.
13860         (ArrayAccess.DoResolveLValue): New.
13861
13862 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13863
13864         * attribute.cs (Attribute.Resolve): Add arguments casting for
13865         when types doesn't match ctor arguments.
13866
13867 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13868
13869         Fix parts of #63202.
13870         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13871         lookup of operator in base type.  Ensure that all checks happen
13872         when the operator resolves to an "op_..." method.
13873
13874 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13875
13876         Fix #71992.
13877         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13878         'ignore_cs0104' parameter.  Pass it to ...
13879         (NamespaceEntry.Lookup): ... this.
13880         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13881         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13882         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13883         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13884         Update.  Request that cs0104 errors be ignored.
13885         (ComposedCast.ResolveAsTypeStep): Update.
13886
13887 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13888
13889         Fix #59209.
13890         * expression.cs (Invocation.BetterFunction): Remove support for
13891         comparing virtual functions and their overrides.
13892         (Invocation.IsOverride): New.
13893         (Invocation.OverloadResolve): Don't consider 'override' functions
13894         during candidate selection.  Store them in a lookaside list.
13895         If the selected method is a 'virtual' function, use the list to
13896         find any overrides that are closer to the LHS type.
13897
13898 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13899
13900         * expression.cs (New.DoResolve): Add complex core type reduction.
13901         (New.Constantify): Converts complex core type syntax like 'new int ()'
13902         to simple constant.
13903         
13904 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13905
13906         * decl.cs (EntryType.EntryType): New constructor to create an
13907         updated copy of a cache entry.
13908         (MemberCache.AddMethods): Use it.
13909         (MemberCache.ClearDeclaredOnly): Remove.
13910         (MemberCache.MemberCache): Update.
13911
13912 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13913
13914         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13915         variable.  This one is represents the actual low-level declaration
13916         of the method, as opposed to the semantic level `IsStatic'.   
13917
13918         An anonymous method which is hosted into a static method might be
13919         actually an instance method.  IsStatic would reflect the
13920         container, while MethodIsStatic represents the actual code
13921         generated.
13922
13923         * expression.cs (ParameterReference): Use the new MethodIsStatic
13924         instead of IsStatic.
13925
13926         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13927         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13928         set on the current EmitContext. 
13929
13930         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13931         resolve our casted expression as an LValue.  This triggers the
13932         proper LValue processing that is later required by Assign.
13933
13934         This fixes 72347.
13935
13936         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13937
13938 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13939
13940         C# 2.0 Fixed buffer implementation
13941
13942         * anonymous.cs: Update after RegisterHelperClass renaming.
13943
13944         * attribute.cs (AttributeTester.fixed_buffer_cache):
13945         Cache of external fixed buffers.
13946         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13947         implementation if field is fixed buffer else null.
13948
13949         * class.cs
13950         (TypeContainer.AddField): Accept FieldMember instead of Field.
13951         (FieldBase.IsFieldClsCompliant): Extracted code from
13952         VerifyClsCompliance descendant customization.
13953         (FixedField): New class handles fixed buffer fields.
13954         (FixedFieldExternal): Keeps information about imported fixed
13955         buffer.
13956         (IFixedField): Make access to internal or external fixed buffer
13957         same.
13958
13959         * cs-parser.jay: Add fixed buffer parsing.
13960
13961         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13962         buffer.
13963
13964         * expression.cs (Indirection): Extended implementation to accept
13965         fixed buffer field.
13966         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13967         (ElementAccess.MakePointerAccess): Get type as parameter.
13968         (DoResolve): Add fixed buffer field expression conversion.
13969         (DoResolveLValue): Ditto.
13970         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13971         (ArrayPtr): Derives from FixedBufferPtr.
13972         (ArrayPtr.Emit): Add extra emit for array elements.
13973
13974         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13975
13976         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13977         for compiler generated types.
13978         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13979
13980         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13981         and consume less memory.
13982         (Fixed.Resolve): Add fixed buffer case.
13983
13984         * typemanager.cs (compiler_generated_attr_ctor,
13985         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13986         (HasElementType): Add our own implementation to work on every
13987         runtime.
13988
13989 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13990
13991         * anonymous.cs (CaptureContext): Track whether `this' has been
13992         referenced.   
13993
13994         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13995         only captured `this' if it was implicitly done (instance
13996         methods/variables were used). 
13997
13998         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13999         `this' must be captured.
14000
14001 2005-01-30  Miguel de Icaza  <miguel@novell.com>
14002  
14003         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
14004         is null it means that there has been no need to capture anything,
14005         so we just create a sibling.
14006
14007         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
14008
14009         Just a partial fix.  The other half is fairly elusive.
14010         
14011 2005-02-10  Raja R Harinath  <rharinath@novell.com>
14012
14013         Fix #52586, cs0121-4.cs.
14014         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
14015         and return a hashtable.
14016         (MemberCache.ClearDeclaredOnly): New.
14017         (MemberCache.MemberCache): Update to change.  Make a deep copy of
14018         the method_hash of a base type too.
14019         (MemberCache.AddMethods): Adapt to having a deep copy of the base
14020         type methods.  Overwrite entries with the same MethodHandle so
14021         that the ReflectedType is correct.  The process leaves in base
14022         virtual functions and their overrides as distinct entries.
14023         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
14024         matters since it was boxed in a ArrayList before.
14025         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
14026         modifier.
14027         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
14028         case of a virtual function and its override (choose the overload
14029         as better).
14030         (Invocation.OverloadResolve): Avoid 'override' members during
14031         'applicable_type' calculation.
14032
14033 2005-02-09  Raja R Harinath  <rharinath@novell.com>
14034
14035         Combine two near-redundant caches.
14036         * typemanager.cs (method_params): Rename from method_internal_params.
14037         (TypeManager.GetParameterData): New.  Replace
14038         Invocation.GetParameterData.
14039         (TypeManager.LookupParametersByBuilder): Remove.
14040         * expression.cs (Invocation.method_parameter_cache): Remove.
14041         (Invocation.GetParameterData): Remove.
14042         Update to changes.
14043         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
14044         Update to changes.
14045
14046 2005-02-08  Raja R Harinath  <rharinath@novell.com>
14047
14048         Fix #72015.
14049         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
14050         TypeManager.multicast_delegate_type is null, resolve it by looking
14051         up "System.MulticastDelegate".
14052         * rootcontext.cs (RootContext.ResolveCore): Simplify.
14053
14054 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
14055             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
14056             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
14057
14058         Fix cs0164.cs.
14059         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
14060         (LabeledStatement.AddReference): New.  Set 'referenced'.
14061         (Goto.Resolve): Use it.
14062
14063 2005-02-05  John Luke  <john.luke@gmail.com>
14064
14065         * driver.cs: remove duplicate -doc line in Usage ()
14066
14067 2005-02-04  Raja R Harinath  <rharinath@novell.com>
14068
14069         * location.cs (Location.AddFile): Fix CS2002 error report.
14070
14071 2005-02-02  Martin Baulig  <martin@ximian.com>
14072
14073         * delegate.cs (Delegate.DefineType): Report an internal error if
14074         TypeManager.multicast_delegate_type is null.  See bug #72015 for
14075         details.        
14076
14077 2005-02-02  Raja R Harinath  <rharinath@novell.com>
14078
14079         Fix a crasher in a variant of #31984.
14080         * const.cs (Constant.CheckBase): New override that defers the
14081         new-or-override check in case the base type hasn't been populated
14082         yet.
14083         (Constant.Define): Ensure the new-or-override check is performed.
14084
14085 2005-02-01  Duncan Mak  <duncan@ximian.com>
14086
14087         * const.cs (LookupConstantValue): Check that `ce' is not null
14088         before calling GetValue ().
14089
14090 2005-02-01  Raja R Harinath  <rharinath@novell.com>
14091
14092         Fix test-334.cs (#69519).
14093         * cs-parser.jay (using_alias_directive): Pass in an expression to
14094         NamespaceEntry.UsingAlias.
14095         (using_namespace_directive): Pass in an expression to
14096         NamespaceEntry.Using.
14097         (namespace_name): Don't flatten to a string.
14098         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
14099         (NamespaceEntry.AliasEntry.Resolve): Lookup using
14100         ResolveAsTypeStep.
14101         (NamespaceEntry.UsingEntry): Likewise.
14102         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
14103         changes.
14104         (NamespaceEntry.LookupForUsing): Remove.
14105         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
14106         names.
14107         (NamespaceEntry.Lookup): Remove support for dotted names.
14108
14109 2005-02-01  Raja R Harinath  <rharinath@novell.com>
14110
14111         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
14112         split into two.
14113         (NamespaceEntry.ImplicitParent): Compute on demand.
14114         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
14115         parallels the current.
14116         (NamespaceEntry.LookupForUsing): Use it.
14117         (NamespaceEntry.Lookup): If the current namespace-entry is
14118         implicit, don't search aliases and using tables.
14119
14120 2005-02-01  Raja R Harinath  <rharinath@novell.com>
14121
14122         Fix #31984.
14123         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
14124         BaseCache here.
14125         (TypeContainer.BaseCache): Compute on demand.
14126         (TypeContainer.FindMembers): Define constants and types if they're
14127         not already created.
14128         (FieldMember.Define): Move resetting of ec.InUnsafe before error
14129         check.
14130         * const.cs (Constant.Define): Make idempotent.
14131
14132 2005-01-29  Miguel de Icaza  <miguel@novell.com>
14133
14134         * pending.cs: Produce better code (no nops produced by using Ldarg
14135         + value).
14136         
14137         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
14138         i - 1' it should be arg + 1.
14139
14140         Fixes bug #71819.
14141
14142 2005-01-28  Raja R Harinath  <rharinath@novell.com>
14143
14144         * attribute.cs (Attribute.CheckAttributeType): Make private
14145         non-virtual.
14146         (Attribute.ResolveType): Make virtual.
14147         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
14148         handling of RootContext.Tree.Types.
14149
14150 2005-01-27  Raja R Harinath  <rharinath@novell.com>
14151
14152         Update attribute-handling to use the SimpleName/MemberAccess
14153         mechanisms.
14154         * cs-parser.jay (attribute): Pass in an expression to the
14155         constructors of Attribute and GlobalAttribute.
14156         * attribute.cs (Attribute): Take an expression for the name.
14157         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
14158         passed in attribute name expression.
14159         (Attribute.CheckAttributeType): Use it.
14160         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
14161         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
14162         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
14163         argument to prevent error messages if the lookup fails.
14164
14165 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
14166
14167         * expression.cs (Indirection): Implemented IVariable interface
14168         to support indirection in AddressOf operator.
14169         (PointerArithmetic.Emit): Add optimalization for case where
14170         result can be precomputed.
14171
14172 2005-01-26  Martin Baulig  <martin@ximian.com>
14173
14174         * class.cs (TypeContainer.AttributeTargets): Return the correct
14175         AttributeTargets depending on our `Kind' instead of throwing an
14176         exception; fixes #71632.
14177
14178 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
14179
14180         Fix #71257
14181         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
14182         constant members.
14183
14184 2005-01-25  Raja R Harinath  <rharinath@novell.com>
14185
14186         Fix #71602.
14187         * expression.cs (MemberAccess.DoResolve): Don't complain with
14188         cs0572 when the LHS of a member access has identical name and type
14189         name.
14190
14191 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
14192
14193         Fix #71651, #71675
14194         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
14195         CreatePermission.
14196         Create custom PermissionSet only for PermissionSetAttribute.
14197
14198 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
14199
14200         Fix #71649
14201         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
14202         delegates in static class.
14203
14204 2005-01-24  Martin Baulig  <martin@ximian.com>
14205
14206         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14207         merging an implicit block, just use its reachability.
14208
14209         * statement.cs (Block.Resolve): Make the unreachable code check
14210         work wrt. implicit blocks; see test-337 from #63842.
14211
14212 2005-01-21  Alp Toker  <alp@atoker.com>
14213  
14214         * cs-parser.jay: destructor_declaration's container is PartialContainer
14215         not Class when partial types are used, so use Kind prop instead of
14216         'is'.
14217         
14218 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
14219
14220         * cs-parser.jay: Improve error reporting when an interface
14221         declares new types.
14222
14223 2005-01-20  Dick Porter  <dick@ximian.com>
14224
14225         * support.cs: SeekableStreamReader fix from Sandor Dobos
14226         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
14227         chars are read.  Fixes bug 70369.
14228
14229 2005-01-20  Raja R Harinath  <rharinath@novell.com>
14230
14231         * cs-parser.jay (catch_clause): Simplify current_block handling
14232         somewhat.
14233
14234 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * convert.cs (ImplicitStandardConversionExists): Synchronize the
14237         code with ImplicitStandardConversion to handle the implicit
14238         conversion of method groups into valid delegate invocations. 
14239
14240         The problem is that in parameter handling we were using this code
14241         path.  Fixes bug #64698
14242
14243 2005-01-19  Raja R Harinath  <rharinath@novell.com>
14244
14245         * cs-parser.jay: Fix several infelicities.
14246         - Avoid assigning to the parser value stack.  Code like 
14247           '$3 = null' is unclean.  Synthesize a value for the code block
14248           instead. 
14249         - Avoid using oob_stack for storing location information.  Use ...
14250         (_mark_): ... this.  New (empty) rule.  Saves the current location
14251         in $$.
14252         (foreach_statement): Avoid using oob_stack for current_block
14253         handling.  Use technique used in for_statement and
14254         using_statement.  Synthesize a value for the code block to store
14255         additional intermediate information.
14256
14257 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
14260         of a different type is only allowed to private fields of a
14261         containing type, not on fields of a base class.
14262
14263         See test-174.cs and error cs0122-9.cs
14264
14265 2005-01-13  Raja R Harinath  <rharinath@novell.com>
14266
14267         Fix test-335.cs (bug #58126).
14268         * cs-parser.jay (argument): Split out non-expression parts of the
14269         rule into 'non_simple_argument'.
14270         (invocation_expression): Support parenthesized invocations with
14271         multiple arguments, and with single non-simple arguments.
14272
14273 2005-01-13  Raja R Harinath  <rharinath@novell.com>
14274
14275         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
14276         places.
14277
14278 2005-01-12  Raja R Harinath  <rharinath@novell.com>
14279
14280         Fix cs0038-1.cs, cs1640-6.cs.
14281         * ecore.cs (Expression.Resolve): Remove special-case for
14282         SimpleName in error-handling.
14283         (Expression.almostMatchedMembers): Relax access permission to
14284         protected.
14285         (Expression.MemberLookupFailed): Handle duplicates in
14286         almostMatchedMembers list.
14287         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
14288         * expression.cs (New.DoResolve): Report CS1540 for more cases.
14289         * typemanager.cs (GetFullNameSignature): Use the MethodBase
14290         overload if the passed in MemberInfo is a MethodBase.
14291
14292 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
14293
14294         Fix #70749
14295         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
14296         for non-CAS & merge permission sets properly.
14297
14298 2005-01-11  Raja R Harinath  <rharinath@novell.com>
14299
14300         Improve standard-compliance of simple name and member access 
14301         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
14302         * ecore.cs (FullNamedExpression): New abstract base class 
14303         for Namespaces and TypeExpressions.
14304         (ResolveFlags.SimpleName): Remove.
14305         (SimpleName): Remove support for dotted names.
14306         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
14307         DeclSpace.FindType and DeclSpace.LookupType.
14308         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14309         (Expression.ExprClassName): Make member function.
14310         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14311         a namespace.  Remove creation of dotted "SimpleName"s.
14312         (MemberAccess.DoResolve): Likewise.
14313         * decl.cs (DeclSpace.Cache): Make private.
14314         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14315         (DeclSpace.FindType): Update.
14316         (DeclSpace.LookupType): Move here from RootContext.  Return a 
14317         FullNamedExpression.
14318         * namespace.cs (Namespace): Derive from FullNamedExpression
14319         so that it can be part of expression resolution.
14320         (Namespace.Lookup): Return an FullNamedExpression.
14321         (NamespaceEntry.LookupAlias): Lookup aliases only in current
14322         namespace.
14323         * rootcontext.cs (NamespaceLookup): Remove.
14324         (LookupType): Move to DeclSpace.
14325         * attribute.cs (CheckAttributeType): Update.
14326         * doc.cs (FindDocumentedType): Remove allowAlias argument.
14327         (FindDocumentedTypeNonArray): Likewise.
14328
14329 2005-01-11  Raja R Harinath  <rharinath@novell.com>
14330
14331         Fix cs0509.cs, cs1632.cs.
14332         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14333         is the same as IsInterface.
14334         (TypeContainer.GetClassBases): Likewise.
14335         * statement.cs (LabeledStatement.ig): New field.
14336         (LabeledStatement.LabelTarget): Save ILGenerator which created the
14337         label.
14338         (LabeledStatement.DoEmit): Check that the label was created with
14339         the same ILGenerator.
14340
14341 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14342
14343         Fix #71058
14344         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14345         accessors to its properties.
14346
14347         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14348         from accessors to property.
14349         
14350 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
14351
14352         Fix #70722
14353         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14354         only for overrides.
14355         
14356 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
14357
14358         * attribute.cs: Check for null and empty strings.  
14359
14360         I have lost another battle to Paolo.
14361
14362 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
14363
14364         Fix #70942
14365         * class.cs (PropertyMethod): Set Parent field in ctors.
14366         (SetMethod.InternalParameters): Add unsafe switch hack.
14367         Override MarkForDuplicationCheck where it is appropriate.
14368
14369         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14370         It says whether container allows members with the same name.
14371         Base default is no.
14372         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14373         Removed is_method parameter.
14374
14375 2005-01-06  Duncan Mak  <duncan@ximian.com>
14376
14377         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14378         because the previous change led to incorrect reporting of CS1032
14379         ("Cannot define/undefine preprocessor symbols after first token in
14380         file"). Instead of using `tokens_seen' as the only flag that
14381         triggers CS1040, introduce `comments_seen'. This new flag is used
14382         to signify having seen comments on the current line, so it is
14383         unset after a newline.
14384
14385 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14386
14387         * doc.cs : When searching for a type, find nested type too.
14388           This fixes bug #71040.
14389
14390 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
14391
14392         * doc.cs :
14393           - Warn missing member comment on those classes which also does not
14394             have doc comments. Fixed bug #71041.
14395           - Don't warn missing doc comment on default constructor.
14396             Fixed bug #71042.
14397
14398 2005-01-06  Duncan Mak  <duncan@ximian.com>
14399
14400         * cs-tokenizer.cs (xtoken): After handling traditional C-style
14401         comments, set `tokens_seen' to true. This allows us to detect
14402         misplaced preprocessor directives (i.e. not at the beginning of
14403         the a line, nor after whitespaces). In that case, report error
14404         CS1040. This fixes bug #56460.
14405
14406         * cs-parser.jay (interface_member_declaration): Add checks for
14407         IsExplicitImpl, and report CS0541 error if an interface member is
14408         defined as an explicit interface declaration.
14409
14410 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
14411
14412         Fix #70817
14413         * class.cs (PropertyMethod): Set Parent field in ctors.
14414         (SetMethod.InternalParameters): Add unsafe switch hack.
14415         
14416         * decl.cs (MemberCore.Parent): Cannot be readonly.
14417
14418 2005-01-06  Raja R Harinath  <rharinath@novell.com>
14419
14420         * decl.cs (DeclSpace.ResolveType): Remove.
14421         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14422         Merge in code from ...
14423         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
14424         * class.cs, enum.cs: Update to changes.
14425
14426 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * anonymous.cs: Ensure that we init the scope of our parent if it
14429         has not been initialized yet.
14430
14431 2004-12-30  Duncan Mak  <duncan@ximian.com>
14432
14433         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14434         if field.FieldBuilder is null. Fixes #70758.
14435
14436         * convert.cs: Fixed some typos and updated some of the comments.
14437         (ImplicitStandardConversionExists):
14438         (TryImplicitIntConversion): If `target_type' is an interface and
14439         the type of `ic' implements this interface, return true or a new
14440         BoxedCast instead of null. This fixes #70468.
14441
14442 2004-12-29  Duncan Mak  <duncan@ximian.com>
14443
14444         * expression.cs (Argument.Emit): Check that Expr is
14445         IMemoryLocation before casting to it, and report CS1510 otherwise.
14446
14447         This fixes #70402.
14448
14449 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
14450
14451         * statement.cs (Block.ThisVariable): remove the recursion here, to
14452         make the --profile more sane.
14453
14454 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
14455
14456         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14457         assembly, by JB Evain.
14458
14459 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14460
14461         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
14462           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14463         "parent" refers to enclosing type/class.  "base" refers to superclass.
14464
14465 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14466
14467         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14468         Ensure that we only have GlobalAttributes.
14469         * attribute.cs (Attribute.Emit): Make non-virtual.
14470         (GlobalAttribute.Emit): Remove.
14471         (Attribute.Resolve): Make virtual.
14472         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
14473         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14474         the argument. Don't create one.
14475         (Attribute.GetObsoleteAttribute): Likewise.
14476         (Attribute.GetClsCompliantAttributeValue): Likewise.
14477         * class.cs, decl.cs: Update to changes.
14478
14479 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
14480
14481         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14482         
14483         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14484         
14485         * statement.cs (Foreach.Resolve): Add error 186 report.
14486
14487 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
14488
14489         * expression.cs (Conditional.DoResolve): Add warning 429.
14490         
14491         * statement.cs (If.Resolve): Add warning 665.
14492
14493 2004-12-16  Raja R Harinath  <rharinath@novell.com>
14494
14495         New invariant: RootContext.Tree.Types.NamespaceEntry == null
14496         except when in the parser, and in GlobalAttribute.
14497         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14498         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14499         RootContext.Tree.Types.NamespaceEntry once work is done.
14500         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
14501         and resets RootContext.Tree.Types.NamespaceEntry.
14502
14503 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
14504
14505         * cs-parser.jay: Don't create a block for every variable.
14506
14507 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * location.cs: Provide extra information.
14510
14511         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14512         variables from the captured environment, it is the ldarg_0.
14513
14514 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14515
14516         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14517         find a conclusion.
14518         
14519         * class.cs: Changed warning level for 169 to avoid developer
14520         displeasure from warning flooding. It will be changed back when they
14521         fix most of current BCL warnings.
14522         
14523         * RootContext.cs: Pushed default WarningLevel to 3.
14524         
14525         * statement.cs: Removed unused variable.
14526
14527 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14528
14529         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14530         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14531         Add error 502 report.
14532         (StaticClass.DefineType): Add error 441 report.
14533         (Class.AllowedModifiersProp): New virtual property as temporary
14534         extension to AllowedModifiers.
14535         (Class.DefineType): Add error 418 report. Moved ModFlags check here
14536         to share implementation with StaticClass and don't call virtual
14537         methods from ctor.
14538         
14539         * driver.cs (MainDriver): Add error 1558 test.
14540
14541         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14542         report. Moved error 36 test here.
14543
14544         * statement.cs (Throw.Resolve): Add error 724 report.
14545
14546         * typemanager.cs: Add out_attribute_type core type.
14547         
14548 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
14549
14550         * class.cs (TypeContainer.VerifyClsCompliance): Add error
14551         3018 report.
14552         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14553
14554         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14555         3017 report.
14556         
14557         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14558
14559         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
14560         Add error 3023 report.
14561         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14562
14563         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14564         implementation.
14565
14566 2004-12-12  John Luke  <john.luke@gmail.com>
14567
14568         * driver.cs (AddArgs): take -- into account when
14569         adding arguments, fixes bug 65710 
14570
14571 2004-12-12  Martin Baulig  <martin@ximian.com>
14572
14573         * expression.cs (Unary.TryReduceNegative): Added support for
14574         SByteConstant and ByteConstant.
14575         (Unary.Reduce): Check error values from TryReduceNegative().
14576
14577 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
14578
14579         * attributes.cs (Attribute.Resolve): Avoid multiple error report
14580         and report exception as error 182.
14581
14582 2004-12-10  Raja R Harinath  <rharinath@novell.com>
14583
14584         * driver.cs (Main): Fix message when there are warnings.
14585
14586 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
14587
14588         * delegate.cs: Fixed my fix from yesterday, sorry about that.
14589
14590 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
14591
14592         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
14593         Reduced number of warnings.
14594         
14595         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14596
14597 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
14598
14599         * driver.cs: Removed message.
14600
14601         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14602
14603 2004-12-08    <vargaz@freemail.hu>
14604
14605         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14606
14607 2004-12-08  Martin Baulig  <martin@ximian.com>
14608
14609         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14610         instead of a CS3002 for properties and indexer.
14611
14612 2004-12-08  Martin Baulig  <martin@ximian.com>
14613
14614         * decl.cs (MemberName.ToString): Make this work again.
14615
14616 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
14617
14618         * attribute.cs (Resolve): Add error 591 detection.
14619
14620         * class.cs (FieldMember.Define): Add error 1547 detection.
14621         (Indexer.Define): Add error 620 detection.
14622         (Operator.Define): Add error 590 detection.
14623
14624         * ecore.cs: Missing argument for error 79.
14625
14626         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14627         detection.
14628
14629 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
14630
14631         Fix #70106
14632         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14633         only.
14634
14635 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
14636
14637         * cs-parser.jay : handle doc comments on implicit/explicit operators.
14638           Some operator comments were suppressed.
14639         * doc.cs : Implicit/explicit operator name in doc comments are like
14640           "op_Explicit(type)~returnType", so added suffix handling.
14641
14642 2004-12-07  Martin Baulig  <martin@ximian.com>
14643
14644         * decl.cs
14645         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14646         (MemberCore.GetClsCompliantAttributeValue): Likewise.
14647         (DeclSpace.ec): New protected field; store the EmitContext here.
14648         (DeclSpace.EmitContext): New public property; moved here from
14649         `TypeContainer'.
14650         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14651         EmitContext.
14652
14653         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14654         (Enum.Emit): Don't create a new EmitContext.
14655
14656         * delegate.cs (Delegate.DefineType): Always create the
14657         EmitContext.
14658
14659         * iterators.cs (Iterators.DefineIterator): Create a new
14660         EmitContext and store it in `ec'.
14661
14662 2004-08-24  Martin Baulig  <martin@ximian.com>
14663
14664         * typemanager.cs
14665         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14666         this for accessibility checks.
14667         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14668         IsNestedFamilyAccessible.
14669         (TypeManager.IsSubclassOf): New method, do what the name actually
14670         says.   
14671
14672 2004-12-06  Raja R Harinath  <rharinath@novell.com>
14673
14674         Fix crash on cs0657-17.cs.
14675         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14676         Use RootContext.Tree.Types, not 'new RootTypes ()'.
14677         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14678         the case where the NamespaceEntry gets overwritten.
14679
14680 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
14681
14682         Fixed #69195, #56821
14683         * ecore.cs (ResolveBoolean): Tiny refactoring.
14684
14685         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14686         of right expression resolving when left is false constant and
14687         operator is LogicalAnd OR true constant and operator is LogicalOr.
14688
14689         * statement.cs (ResolveUnreachable): Always reports warning.
14690
14691 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * class.cs: Distinguish between 1721 and 1722 (just a little help
14694         for the programmer).
14695
14696 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * delegate.cs: Only allow this on new versions of the language. 
14699
14700 2004-12-02  Duncan Mak  <duncan@ximian.com>
14701
14702         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14703         Expression class.
14704         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14705         here as a static method. Take an additional bool out parameter
14706         `must_do_cs1540_check' for signaling to InstanceResolve.
14707         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14708         member field from PropertyExpr class and made it an argument of
14709         the method instead.
14710         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14711         check for MarshalByRefObject, and report CS0122 instead of CS1540.
14712         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14713         and `remove_accessor' as well as InstanceResolve: report CS0122
14714         where applicable.
14715
14716         Fixes #70129.
14717
14718 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14719
14720         Fix test-327.cs, test-328.cs, and put in early infrastructure
14721         for eventually fixing #52697.
14722         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14723         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14724         from other methods.
14725         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14726         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14727         (VerifyUsing, error246): Update.
14728         * rootcontext.cs (RootContext.NamespaceLookup): Just use
14729         'NamespaceEntry.LookupNamespaceOrType'.
14730
14731 2004-12-03  Martin Baulig  <martin@ximian.com>
14732
14733         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14734         method as our child, call AnonymousMethod.Compatible() on it.
14735
14736 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14737
14738         Disable XML documentation support in 'basic' profile.
14739         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14740         Redirect XmlElement to System.Object.
14741         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14742         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14743         * mcs.exe.sources: Add doc-bootstrap.cs.
14744         * doc-bootstrap.cs: New file.  Contains empty stub implementation
14745         of doc.cs.
14746
14747 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
14748
14749         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14750           comments are allowed.
14751
14752 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14753
14754         * delegate.cs: Add checks for subtypes in paramaters and return values
14755         in VerifyMethod () to add support for Covariance/Contravariance
14756         in delegates.
14757         
14758 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * report.cs: Remove extra closing parenthesis.
14761
14762         * convert.cs (Error_CannotImplicitConversion): If the name of the
14763         types are the same, provide some extra information.
14764
14765         * class.cs (FieldBase): Use an unused bit field from the field to
14766         encode the `has_offset' property from the FieldMember.  This saves
14767         a couple of Ks on bootstrap compilation.
14768
14769         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14770         method as our child, return the AnonymousMethod resolved
14771         expression.
14772
14773         * expression.cs (New.DoResolve): Allow return values from
14774         NewDelegate to also include AnonymousMethods.
14775
14776         Fixes #70150.
14777
14778 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
14779
14780         Fix bug #70102
14781         * attribute.cs (Resolve): Improved implementation of params
14782         attribute arguments.
14783
14784         * support.cs (ParameterData): Add HasParams to be faster.
14785
14786 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
14787
14788         all things are for /doc support:
14789
14790         * doc.cs: new file that supports XML documentation generation.
14791         * mcs.exe.sources: added doc.cs.
14792         * driver.cs:
14793           Handle /doc command line option.
14794           Report error 2006 instead of 5 for missing file name for /doc.
14795           Generate XML documentation when required, after type resolution.
14796         * cs-tokenizer.cs:
14797           Added support for picking up documentation (/// and /** ... */),
14798           including a new XmlCommentState enumeration.
14799         * cs-parser.jay:
14800           Added lines to fill Documentation element for field, constant,
14801           property, indexer, method, constructor, destructor, operator, event
14802           and class, struct, interface, delegate, enum.
14803           Added lines to warn incorrect comment.
14804         * rootcontext.cs :
14805           Added Documentation field (passed only when /doc was specified).
14806         * decl.cs:
14807           Added DocComment, DocCommentHeader, GenerateDocComment() and
14808           OnGenerateDocComment() and some supporting private members for
14809           /doc feature to MemberCore.
14810         * class.cs:
14811           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14812         * delegate.cs:
14813           Added overriden DocCommentHeader.
14814         * enum.cs:
14815           Added overriden DocCommentHeader and GenerateDocComment().
14816
14817 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
14818
14819         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14820         unwrapping the enumeration values, chain to
14821         DoConstantNumericPromotions again, so we can promote things to the
14822         fundamental types (takes care of enums that are bytes, sbytes).
14823
14824         Fixes bug #62054.
14825
14826 2004-12-01  Raja R Harinath  <rharinath@novell.com>
14827
14828         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14829         Fix long-standing bug in type-lookup.  Use FindType instead of
14830         LookupType when ec.ResolvingTypeTree.
14831         (Attribute.ResolveType, Attribute.Resolve)
14832         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14833         Update to changes.
14834         (Attributes.Search): Remove internal version.  Update.
14835         (Attributes.SearchMulti): Update.
14836         (Attributes.GetClsCompliantAttribute): Remove.
14837         (Attributes.GetIndexerNameAttribute): Remove.
14838         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14839         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14840         * class.cs (Indexer.Define): Likewise.
14841
14842 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
14843
14844         Fix bug #68790
14845         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14846         MarshallByReference members access.
14847
14848         * expression.cs: Use CheckMarshallByRefAccess;
14849         Better error CS0197 message.
14850
14851         * report.cs: Print whole related error message.
14852
14853 2004-11-30  Raja R Harinath  <rharinath@novell.com>
14854
14855         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14856         the current directory to help debugging.
14857
14858 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14859
14860         * class (GetClassBases): Better error 60 report.
14861         (EventProperty): Disabled warning 67 detection.
14862
14863 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14864
14865         Fix bug #60324
14866         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14867
14868         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14869         precise values.
14870
14871 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14872
14873         Fix bug #49488
14874         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14875
14876         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14877
14878 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14879
14880         * attribute.cs (Attribute.Resolve): Refine error reporting and
14881         report a cs0117 if the identifier does not exist, to distinguish
14882         from 0617 which is a miss-use of the actual identifier.
14883
14884         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14885         between cs0070 and cs0079.
14886
14887         * class.cs (MemberBase.DoDefine): When reporting a wrong
14888         accessibility level, we use MethodCore to compare instead of
14889         Method (this was a regression in some refactoring effort).
14890
14891         So now we correctly report cs0056 again.
14892
14893         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14894         testing the target_type (which was known to be object_type) and
14895         not the source type (which is anonymous_method).
14896
14897         Fixed reporting of error cs1660.
14898
14899         * expression.cs (UserCast.Source): Expose the underlying cast.
14900
14901         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14902         allowed types to find a match to int32 first (most common).
14903
14904         In addition, it ignores any ImplicitUserConversions that did an
14905         internal implicit conversion (as the switch statement allows only
14906         one integral conversion to exist).
14907
14908         * class.cs (PartialContainer.Create): rename `name' to
14909         `member_name' for clarity.  Then replace the string calls with a
14910         call to MemberName.GetPartialName, as now using
14911         MemberName.ToString is an error (this is due to the side effects
14912         it had, that were fixed in the past).
14913
14914         This will restore the error reporting on a number of partial class
14915         errors that were missusing this (and getting an exception as a
14916         results, which is now just a plain textual warning, because
14917         yyparse debug output would crash otherwise).
14918
14919 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14920
14921         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14922
14923 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14924
14925         * rootcontext.cs (LookupType): Make sure to cache lookups that
14926         don't give us a negative result. This saves about 5% of corlib
14927         compilation time.
14928
14929 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14930
14931         * report.cs (AbstractMessage.Print): messages are sent to stderr
14932
14933         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14934         non-interface in the list of interfaces (at this point, either
14935         parent was properly set, or a base class is being listed in the
14936         interfaces section).
14937
14938         This flags error 1722, and resolves the crash from bug 69259.
14939
14940 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14941
14942         * statement.cs (Using.EmitExpressionFinally): make this work right
14943         for valuetypes. Fixes 69926.
14944
14945 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14948         converted to an enum" here, before we try to change the underlying
14949         type.  This code exists, but it is a different code path than the
14950         one used while encoding constants.
14951
14952         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14953         old bug: when converting from the null literal to a pointer,
14954         return an EmptyCast, not the NullLiteral.
14955
14956         This fixes #69921, the recent null_type changes probably made this
14957         bug more prominent.
14958
14959         (ImplicitReferenceConversionExists): In addition, resynchronized
14960         the code here, so it matches the same code in
14961         ImplicitReferenceConversionExists for the `from any class-type S
14962         to any interface-type T'.
14963         
14964
14965 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14966
14967         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14968
14969 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14970
14971         * cs-parser.jay: Use verbosity accordingly. 
14972
14973 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14974
14975         * expression.cs (Unary.ResolveOperator): Do not report warning;
14976         AddressOf reads from variable.
14977         
14978         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14979
14980 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14981
14982         Fix bug #69462
14983
14984         * attribute.cs (Attributable): Removed CheckTargets.
14985         (Attributes.Emit): Explicit attribute targets are tested here.
14986
14987         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14988         not enabled for interfaces.
14989
14990         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14991         (GetAssemblyName): Ouch next bug there.
14992
14993 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14994
14995         * expression.cs: Error 275 added.
14996         
14997 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14998
14999         Fix bug #69177 (Implemented decimal constant support)
15000
15001         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
15002         (BinaryFold): Add DecimalConstant.
15003
15004         * const.cs (Define): Decimal constant 
15005         (is not constant.
15006         (ChangeType): Add decimal type handling.
15007         (LookupConstantValue): Don't set value for decimal type but
15008         emit DecimalConstantAttribute. Needed for constant optimization.
15009
15010         * constant.cs (ToDecimal): New method.
15011         (ConvertToDecimal): New method.
15012         (IntConstant): Implemented ConvertToDecimal.
15013         (DecimalConstant.Emit): Emit optimized version for decimals in
15014         int range.
15015
15016         * expression.cs (ResolveOperator): Changed order of constant
15017         reduction to work correctly with native types which have
15018         overloaded operators.
15019         (ResolveMemberAccess): Extract constant value from attribute
15020         for decimal type.
15021
15022         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
15023
15024         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
15025         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
15026         (ChangeType): Decimal is special.
15027         (TypeToCoreType): Add decimal type.
15028
15029 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
15030
15031         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
15032         decimal types.
15033
15034 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
15035
15036         * class.cs (EventField.ApplyAttributeBuilder): Fix error
15037         test cs1667-5.cs.
15038
15039 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
15040
15041         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
15042
15043         * pending.cs (PendingImplementation): Grab only interfaces.
15044
15045 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
15046
15047         * statement.cs (ForeachHelperMethods): Add location member and
15048         error 202 detection.
15049
15050 2004-11-19  Raja R Harinath  <rharinath@novell.com>
15051
15052         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
15053         automatically handled by executable.make.
15054         (PROGRAM): Make profile-specific.
15055
15056 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
15057
15058         * expression.cs (DoResolveBase): Fixed wrong warning for out
15059         variables.
15060
15061 2004-11-18  Martin Baulig  <martin@ximian.com>
15062
15063         Merged latest changes into gmcs.  Please keep this comment in
15064         here, it makes it easier for me to see what changed in MCS since
15065         the last time I merged.
15066
15067 2004-11-17  Raja R Harinath  <rharinath@novell.com>
15068
15069         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
15070         (TypeHandle.GetMemberCache): New.
15071         (TypeHandle.TypeHandle): Update.
15072         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
15073         (TypeManager.LookupParentInterfacesCache):
15074         Rename from LookupInterfaceCache.  Optimize slightly.
15075         (TypeManager.MemberLookup_FindMembers): Update.
15076         * decl.cs (MemberCache.MemberCache): Set Container to null in the
15077         multi-type variant.
15078         (AddCacheContents): Rename from AddHashtable.
15079         * class.cs (TypeContainer.parent_container): Remove.
15080         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
15081         (TypeContainer.DoDefineMembers): Don't initialize it.
15082         Update to name changes.
15083         
15084 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
15085
15086         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
15087         that factors the code to check access modifiers on override.  
15088
15089         (PropertyBase): Use the code here.
15090
15091         Patch from Lluis S'anchez, fixes bug #69361.
15092
15093 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
15094
15095         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
15096         routine that is used to report the use of a captured variable
15097         whose address has been taken.
15098
15099         There are two checks: one when variables are being captured and
15100         the other check is when the address of a variable is taken. 
15101         
15102         (because an anonymous methods might be resolved before *or* after
15103         the address has been taken) and 
15104
15105         * expression.cs (Conditional.DoResolve): Remove the special
15106         casing that Martin added to trueExpr and falseExpr being both
15107         NullLiteral.  We get the right behavior now just by introducing
15108         the null_type into the compiler. 
15109
15110         * convert.cs (ExplicitConversion): Change the code to use
15111         null_type instead of testing `expr is NullLiteral'.
15112         (ImplicitConversionStandard): use null_type too.
15113         (ImplicitReferenceConversionExists): use null_type too.
15114         (ImplicitReferenceConversion): use null_type too.
15115
15116         * literal.cs: The type of `NullLiteral' is now null_type instead
15117         of object_type. 
15118         (Resolve): Set the type here.
15119
15120         * typemanager.cs: Introduce null_type.
15121
15122 2004-11-17  Martin Baulig  <martin@ximian.com>
15123
15124         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
15125         direction, like FindMembers() does.  Fixes #69546, testcase is in
15126         test-315.cs.    
15127
15128 2004-11-16  Martin Baulig  <martin@ximian.com>
15129
15130         This is based on a patch from Marek Safar, see bug #69082.
15131         Fixes bugs #63705 and #67130.
15132
15133         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
15134         method; create a MemberCache for an interface type and cache the
15135         result.
15136
15137         * decl.cs (IMemberContainer.ParentContainer): Removed.
15138         (IMemberContainer.ParentCache): New property.
15139         (MemberCache.SetupCacheForInterface): Removed.
15140         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
15141         to create a cache for an interface's "parent".
15142
15143         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
15144         interfaces too.
15145
15146 2004-11-16  Martin Baulig  <martin@ximian.com>
15147
15148         Merged back from gmcs; these changes already went into gmcs a
15149         couple of weeks ago.
15150
15151         * typemanager.cs
15152         (TypeManager.AddUserType): Removed the `ifaces' argument.
15153         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
15154         `TypeExpr []'.
15155         (TypeManager.AddUserInterface): Removed.
15156         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
15157         `TypeExpr []'.
15158         (TypeManager.GetInterfaces): Likewise.
15159         (TypeManager.GetExplicitInterfaces): Likewise.
15160
15161         * ecore.cs (TypeExpr.GetInterfaces): Removed.
15162
15163         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
15164         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
15165
15166 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
15167
15168         * statement.cs: Avoid adding bools to a hashtable.
15169
15170 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
15171
15172         * expression.cs (Invocation.OverloadResolve): Flag error if we are
15173         calling an unsafe method from a safe location.
15174
15175 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
15176
15177         Fix #69167
15178         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
15179
15180 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
15181
15182         * namespace.cs (VerifyUsing): use GetPartialName instead of
15183         ToString. 
15184
15185 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
15186
15187         * statement.cs (Return.Resolve): Fix regression in typo: if
15188         `in_exc', we have to request a NeedReturnLabel, this was a typo
15189         introduced in the anonymous method check-in.  Fixes #69131.
15190
15191         * Indexers were using the ShortName when defining themselves,
15192         causing a regression in the compiler bootstrap when applying the
15193         patch from 2004-11-02 (first part), now they use their full name
15194         and the bug is gone.
15195
15196 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
15197
15198         * driver.cs: Strip the path from the names of embedded resources. Fixes
15199         #68519.
15200
15201 2004-11-04  Raja R Harinath  <rharinath@novell.com>
15202
15203         Fix error message regression: cs0104-2.cs.
15204         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
15205         (AliasEntry.Resolve): Update.
15206         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
15207         'silent' flag.
15208         (RootContext.LookupType): Update.
15209
15210 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
15211
15212         * cs-parser.jay: Add support for handling accessor modifiers
15213         * class: Add support port accessor modifiers and error checking,
15214         define PropertyMethod.Define as virtual (not abstract anymore)
15215         * ecore.cs: Add checking for proeprties access with access modifiers
15216         * iterators.cs: Modify Accessor constructor call based in the modified
15217         constructor
15218 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
15219
15220         * expression.cs (StringConcat): Handle being called twice,
15221         as when we have a concat in a field init with more than two
15222         ctors in the class
15223
15224 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
15225
15226         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
15227         special case explicit implementations, we should always produce
15228         the .property or .event declaration.
15229         
15230         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
15231         since it will not return correct data if people use this
15232         unresolved in the presence of using statements (see test-313).
15233
15234         * class.cs (MethodData.Define): If we are an explicit interface
15235         implementation, set the method name to the full name of the
15236         interface plus the name of the method.  
15237
15238         Notice that using the method.MethodName.GetFullName() does not
15239         work, as it will only contain the name as declared on the source
15240         file (it can be a shorthand in the presence of using statements)
15241         and not the fully qualifed type name, for example:
15242
15243         using System;
15244
15245         class D : ICloneable {
15246                 object ICloneable.Clone ()  {
15247                 }
15248         }
15249
15250         Would produce a method called `ICloneable.Clone' instead of
15251         `System.ICloneable.Clone'.
15252
15253         * namespace.cs (Alias.Resolve): Use GetPartialName.
15254         
15255 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
15256
15257         * cs-parser.jay: Add error 1055 report.
15258
15259 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * assign.cs (Assign.DoResolve): Only do the transform of
15262         assignment into a New if the types are compatible, if not, fall
15263         through and let the implicit code deal with the errors and with
15264         the necessary conversions. 
15265
15266 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
15267
15268         * cs-parser.jay: Add error 1031 report.
15269
15270         * cs-tokenizer.cs: Add location for error 1038.
15271
15272 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15273
15274         * cs-parser.jay: Add error 1016 report.
15275
15276 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15277
15278         * cs-parser.jay: Add errors 1575,1611 report.
15279
15280 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15281
15282         * cs-parser.jay: Add error 1001 report.
15283
15284 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15285
15286         Fix #68850
15287         * attribute.cs (GetMarshal): Add method argument for
15288         caller identification.
15289
15290         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
15291         agument for GetMarshal and RuntimeMissingSupport.
15292
15293 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
15294
15295         * attribute.cs (ExtractSecurityPermissionSet): Removed
15296         TypeManager.code_access_permission_type.
15297
15298         * typemanager.cs: Removed TypeManager.code_access_permission_type.
15299
15300 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * expression.cs (LocalVariableReference.DoResolveLValue): Check
15303         for obsolete use of a variable here.   Fixes regression on errors
15304         cs0619-25 and cs0619-26.
15305
15306 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
15307
15308         Fix #62358, implemented security attribute encoding.
15309
15310         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15311         Tests permitted SecurityAction for assembly or other types.
15312         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15313         data from SecurityPermissionAttribute to PermisionSet class.
15314
15315         * class.cs (ApplyAttributeBuilder): Added special handling
15316         for System.Security.Permissions.SecurityAttribute based types.
15317
15318         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15319         special handling for System.Security.Permissions.SecurityAttribute
15320         based types.
15321
15322         * enum.cs (ApplyAttributeBuilder): Added special handling
15323         for System.Security.Permissions.SecurityAttribute based types.
15324
15325         * parameter.cs (ApplyAttributeBuilder): Added special handling
15326         for System.Security.Permissions.SecurityAttribute based types.
15327
15328         * rootcontext.cs: Next 2 core types.
15329
15330         * typemanager.cs (TypeManager.security_permission_attr_type):
15331         Built in type for the SecurityPermission Attribute.
15332         (code_access_permission_type): Build in type.
15333
15334 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
15335
15336         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15337         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15338         all of this information into
15339         EmitContext.EmitCapturedVariableInstance.
15340         
15341         * codegen.cs (EmitCapturedVariableInstance): move here the
15342         funcionality of emitting an ldarg.0 in the presence of a
15343         remapping.   This centralizes the instance emit code.
15344
15345         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15346         then emit a load of this: it means that we have reached the
15347         topmost ScopeInfo: the one that contains the pointer to the
15348         instance of the class hosting the anonymous method.
15349
15350         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15351         captures to the topmost CaptureContext.
15352
15353 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * expression.cs (LocalVariableReference): Move the knowledge about
15356         the iterators into codegen's EmitCapturedVariableInstance.
15357
15358 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15361         all code paths return a value from an anonymous method (it is the
15362         same as the 161 error, but for anonymous methods).
15363
15364 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
15365
15366         The introduction of anonymous methods in the compiler changed
15367         various ways of doing things in the compiler.  The most
15368         significant one is the hard split between the resolution phase
15369         and the emission phases of the compiler.
15370
15371         For instance, routines that referenced local variables no
15372         longer can safely create temporary variables during the
15373         resolution phase: they must do so from the emission phase,
15374         since the variable might have been "captured", hence access to
15375         it can not be done with the local-variable operations from the runtime.
15376         
15377         * statement.cs 
15378
15379         (Block.Flags): New flag `IsTopLevel' to indicate that this block
15380         is a toplevel block.
15381
15382         (ToplevelBlock): A new kind of Block, these are the blocks that
15383         are created by the parser for all toplevel method bodies.  These
15384         include methods, accessors and anonymous methods.
15385
15386         These contain some extra information not found in regular blocks:
15387         A pointer to an optional CaptureContext (for tracking captured
15388         local variables and parameters).  A pointer to the parent
15389         ToplevelBlock.
15390         
15391         (Return.Resolve): Catch missmatches when returning a value from an
15392         anonymous method (error 1662).
15393         Invoke NeedReturnLabel from the Resolve phase instead of the emit
15394         phase.
15395
15396         (Break.Resolve): ditto.
15397
15398         (SwitchLabel): instead of defining the labels during the
15399         resolution phase, we now turned the public ILLabel and ILLabelCode
15400         labels into methods called GetILLabelCode() and GetILLabel() that
15401         only define the label during the Emit phase.
15402
15403         (GotoCase): Track the SwitchLabel instead of the computed label
15404         (its contained therein).  Emit the code by using
15405         SwitchLabel.GetILLabelCode ().
15406
15407         (LocalInfo.Flags.Captured): A new flag has been introduce to track
15408         whether the Local has been captured or not.
15409
15410         (LocalInfo.IsCaptured): New property, used to tell whether the
15411         local has been captured.
15412         
15413         * anonymous.cs: Vastly updated to contain the anonymous method
15414         support.
15415
15416         The main classes here are: CaptureContext which tracks any
15417         captured information for a toplevel block and ScopeInfo used to
15418         track the activation frames for various local variables.   
15419
15420         Each toplevel block has an optional capture context associated
15421         with it.  When a method contains an anonymous method both the
15422         toplevel method and the anonymous method will create a capture
15423         context.   When variables or parameters are captured, they are
15424         recorded on the CaptureContext that owns them, for example:
15425
15426         void Demo () {
15427              int a;
15428              MyDelegate d = delegate {
15429                  a = 1;
15430              }
15431         }
15432
15433         Here `a' will be recorded as captured on the toplevel
15434         CapturedContext, the inner captured context will not have anything
15435         (it will only have data if local variables or parameters from it
15436         are captured in a nested anonymous method.
15437
15438         The ScopeInfo is used to track the activation frames for local
15439         variables, for example:
15440
15441         for (int i = 0; i < 10; i++)
15442                 for (int j = 0; j < 10; j++){
15443                    MyDelegate d = delegate {
15444                         call (i, j);
15445                    }
15446                 }
15447
15448         At runtime this captures a single captured variable `i', but it
15449         captures 10 different versions of the variable `j'.  The variable
15450         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15451         recorded on a child.  
15452
15453         The toplevel ScopeInfo will also track information like the `this'
15454         pointer if instance variables were referenced (this is necessary
15455         as the anonymous method lives inside a nested class in the host
15456         type of the method). 
15457
15458         (AnonymousMethod): Expanded to track the Toplevel, implement
15459         `AnonymousMethod.Compatible' to tell whether an anonymous method
15460         can be converted to a target delegate type. 
15461
15462         The routine now also produces the anonymous method content
15463
15464         (AnonymousDelegate): A helper class that derives from
15465         DelegateCreation, this is used to generate the code necessary to
15466         produce the delegate for the anonymous method that was created. 
15467
15468         * assign.cs: API adjustments for new changes in
15469         Convert.ImplicitStandardConversionExists.
15470
15471         * class.cs: Adjustments to cope with the fact that now toplevel
15472         blocks are of type `ToplevelBlock'. 
15473
15474         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15475         insteda of standard blocks.
15476
15477         Flag errors if params arguments are passed to anonymous methods.
15478
15479         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15480         `CurrentAnonymousMethod' which points to the current Anonymous
15481         Method.  The variable points to the AnonymousMethod class that
15482         holds the code being compiled.  It is set in the new EmitContext
15483         created for the anonymous method.
15484
15485         (EmitContext.Phase): Introduce a variable and an enumeration to
15486         assist in enforcing some rules about when and where we are allowed
15487         to invoke certain methods (EmitContext.NeedsReturnLabel is the
15488         only one that enfonces this right now).
15489
15490         (EmitContext.HaveCaptureInfo): new helper method that returns
15491         whether we have a CapturedContext initialized.
15492
15493         (EmitContext.CaptureVariable): New method used to register that a
15494         LocalInfo must be flagged for capturing. 
15495
15496         (EmitContext.CapturedParameter): New method used to register that a
15497         parameters must be flagged for capturing. 
15498         
15499         (EmitContext.CapturedField): New method used to register that a
15500         field must be flagged for capturing. 
15501
15502         (EmitContext.HaveCapturedVariables,
15503         EmitContext.HaveCapturedFields): Return whether there are captured
15504         variables or fields. 
15505
15506         (EmitContext.EmitMethodHostInstance): This is used to emit the
15507         instance for the anonymous method.  The instance might be null
15508         (static methods), this (for anonymous methods that capture nothing
15509         and happen to live side-by-side with the current method body) or a
15510         more complicated expression if the method has a CaptureContext.
15511
15512         (EmitContext.EmitTopBlock): Routine that drives the emission of
15513         code: it will first resolve the top block, then emit any metadata
15514         and then emit the code.  The split is done so that we can extract
15515         any anonymous methods and flag any captured variables/parameters.
15516         
15517         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15518         during this phase, the ILGenerator should not be used as labels
15519         and local variables declared here might not be accessible to any
15520         code that is part of an anonymous method.  
15521
15522         Exceptions to this include the temporary variables that are
15523         created by some statements internally for holding temporary
15524         variables. 
15525         
15526         (EmitContext.EmitMeta): New routine, in charge of emitting all the
15527         metadata for a cb
15528
15529         (EmitContext.TemporaryReturn): This method is typically called
15530         from the Emit phase, and its the only place where we allow the
15531         ReturnLabel to be defined other than the EmitMeta.  The reason is
15532         that otherwise we would have to duplicate a lot of logic in the
15533         Resolve phases of various methods that today is on the Emit
15534         phase. 
15535
15536         (EmitContext.NeedReturnLabel): This no longer creates the label,
15537         as the ILGenerator is not valid during the resolve phase.
15538
15539         (EmitContext.EmitThis): Extended the knowledge in this class to
15540         work in anonymous methods in addition to iterators. 
15541
15542         (EmitContext.EmitCapturedVariableInstance): This emits whatever
15543         code is necessary on the stack to access the instance to a local
15544         variable (the variable will be accessed as a field).
15545
15546         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15547         EmitContext.EmitAddressOfParameter): Routines to support
15548         parameters (not completed at this point). 
15549         
15550         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
15551         will also remove the parameters.
15552
15553         * convert.cs (Convert): Define a `ConstantEC' which points to a
15554         null.  This is just to prefity some code that uses
15555         ImplicitStandardConversion code and do not have an EmitContext
15556         handy.
15557
15558         The idea is to flag explicitly that at that point in time, it is
15559         known that the conversion will not trigger the delegate checking
15560         code in implicit conversions (which requires a valid
15561         EmitContext). 
15562
15563         Everywhere: pass new EmitContext parameter since
15564         ImplicitStandardConversionExists now requires it to check for
15565         anonymous method conversions. 
15566
15567         (Convert.ImplicitStandardConversionExists): If the type of an
15568         expression is the anonymous_method_type, and the type is a
15569         delegate, we invoke the AnonymousMethod.Compatible method to check
15570         whether an implicit conversion is possible. 
15571
15572         (Convert.ImplicitConversionStandard): Only do implicit method
15573         group conversions if the language level is not ISO_1.
15574
15575         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15576         MethodInfo for the Invoke method.  used by Delegate and
15577         AnonymousDelegate.
15578
15579         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15580         method conversions if the target type is a delegate.
15581
15582         Removed extra debugging nops.
15583
15584         (LocalVariableReference): Turn the `local_info' into a public
15585         field. 
15586
15587         Add `prepared' field, the same hack used for FieldExprs to cope
15588         with composed assignments, as Local variables do not necessarily
15589         operate purely on the stack as they used to: they can be captured
15590         fields. 
15591
15592         Add `temp' for a temporary result, like fields.
15593
15594         Refactor DoResolve and DoResolveLValue into DoResolveBase.
15595
15596         It now copes with Local variables that are captured and emits the
15597         proper instance variable to load it from a field in the captured
15598         case. 
15599
15600         (ParameterReference.DoResolveBase): During the resolve phase,
15601         capture parameters if we are in an anonymous method.
15602
15603         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15604         anonymous method, use the EmitContext helper routines to emit the
15605         parameter reference.
15606
15607         * iterators.cs: Set RemapToProxy to true/false during the
15608         EmitDispose class.
15609
15610         * parameters.cs (GetParameterByName): New helper method. 
15611
15612         * typemanager.cs (anonymous_method_type) a new type that
15613         represents an anonyous method.  This is always an internal type,
15614         used as a fencepost to test against the anonymous-methodness of an
15615         expression. 
15616         
15617 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
15618
15619         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15620         561 report.
15621         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15622
15623 2004-10-18  Martin Baulig  <martin@ximian.com>
15624
15625         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15626         `Type' directly, but call ResolveType() on it.
15627         (Catch.Resolve): Likewise.
15628         (Foreach.Resolve): Likewise.
15629
15630 2004-10-18  Martin Baulig  <martin@ximian.com>
15631
15632         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15633         `Type' directly, but call ResolveType() on it.
15634         (Probe.DoResolve): Likewise.
15635         (ArrayCreation.LookupType): Likewise.
15636         (TypeOf.DoResolve): Likewise.
15637         (SizeOf.DoResolve): Likewise.
15638
15639 2004-10-18  Martin Baulig  <martin@ximian.com>
15640
15641         * expression.cs (Invocation.BetterFunction): Put back
15642         TypeManager.TypeToCoreType().
15643
15644 2004-10-18  Raja R Harinath  <rharinath@novell.com>
15645
15646         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15647         the ResolveType.
15648
15649 2004-10-18  Martin Baulig  <martin@ximian.com>
15650
15651         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
15652         `Type' directly, but call ResolveType() on it.
15653
15654 2004-10-18  Martin Baulig  <martin@ximian.com>
15655
15656         * class.cs (FieldMember.Define): Don't access the TypeExpr's
15657         `Type' directly, but call ResolveType() on it.
15658         (MemberBase.DoDefine): Likewise.
15659
15660         * expression.cs (New.DoResolve): Don't access the TypeExpr's
15661         `Type' directly, but call ResolveType() on it.
15662         (ComposedCast.DoResolveAsTypeStep): Likewise.
15663
15664         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15665         `Type' directly, but call ResolveType() on it.
15666
15667 2004-10-17  John Luke  <john.luke@gmail.com>
15668
15669         * class.cs (Operator.GetSignatureForError): use CSharpName
15670
15671         * parameter.cs (Parameter.GetSignatureForError): Returns
15672         correct name even if was not defined.
15673
15674 2004-10-13  Raja R Harinath  <rharinath@novell.com>
15675
15676         Fix #65816.
15677         * class.cs (TypeContainer.EmitContext): New property.
15678         (DefineNestedTypes): Create an emitcontext for each part.
15679         (MethodCore.DoDefineParameters): Use container's emitcontext.
15680         Pass type array to InternalParameters.
15681         (MemberBase.DoDefine): Use container's emitcontext.
15682         (FieldMember.Define): Likewise.
15683         (Event.Define): Likewise.
15684         (SetMethod.GetParameterInfo): Change argument to EmitContext.
15685         Pass type array to InternalParameters.
15686         (SetIndexerMethod.GetParameterInfo): Likewise.
15687         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15688         * delegate.cs (Define): Pass emitcontext to
15689         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
15690         array to InternalParameters.
15691         * expression.cs (ParameterReference.DoResolveBase): Pass
15692         emitcontext to GetParameterInfo.
15693         (ComposedCast.DoResolveAsTypeStep): Remove check on
15694         ec.ResolvingTypeTree.
15695         * parameter.cs (Parameter.Resolve): Change argument to
15696         EmitContext.  Use ResolveAsTypeTerminal.
15697         (Parameter.GetSignature): Change argument to EmitContext.
15698         (Parameters.ComputeSignature): Likewise.
15699         (Parameters.ComputeParameterTypes): Likewise.
15700         (Parameters.GetParameterInfo): Likewise.
15701         (Parameters.ComputeAndDefineParameterTypes): Likewise.
15702         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
15703         * support.cs (InternalParameters..ctor): Remove variant that takes
15704         a DeclSpace.
15705         * typemanager.cs (system_intptr_expr): New.
15706         (InitExpressionTypes): Initialize it.
15707
15708 2004-10-12  Chris Toshok  <toshok@ximian.com>
15709
15710         * cs-parser.jay: fix location for try_statement and catch_clause.
15711
15712 2004-10-11  Martin Baulig  <martin@ximian.com>
15713
15714         * report.cs: Don't make --fatal abort on warnings, we have
15715         -warnaserror for that.
15716
15717 2004-10-07  Raja R Harinath  <rharinath@novell.com>
15718
15719         More DeclSpace.ResolveType avoidance.
15720         * decl.cs (MemberCore.InUnsafe): New property.
15721         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
15722         with newly created EmitContext.
15723         (FieldMember.Define): Likewise.
15724         * delegate.cs (Delegate.Define): Likewise.
15725         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15726         only if normal name-lookup fails.
15727         (TypeExpr.DoResolve): Enable error-checking.
15728         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15729         (SizeOf.DoResolve): Likewise.
15730         (ComposedCast.DoResolveAsTypeStep): Likewise.
15731         (StackAlloc.DoResolve): Likewise.
15732         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15733         (Block.Unsafe): New property.
15734         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15735         (Unsafe): Set 'unsafe' flag of contained block.
15736         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15737         (Fixed.Resolve): Likewise.
15738         (Catch.Resolve): Likewise.
15739         (Using.ResolveLocalVariableDecls): Likewise.
15740         (Foreach.Resolve): Likewise.
15741
15742 2004-10-05  John Luke <john.luke@gmail.com>
15743
15744         * cs-parser.jay: add location to error CS0175
15745
15746 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * ecore.cs (Expression.Constantity): Add support for turning null
15749         into a constant.
15750
15751         * const.cs (Const.Define): Allow constants to be reference types
15752         as long as the value is Null.
15753
15754 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
15755
15756         * namespace.cs (NamespaceEntry.Using): No matter which warning
15757         level is set, check if this namespace name has already been added.
15758
15759 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
15760
15761         * expression.cs: reftype [!=]= null should always use br[true,false].
15762         # 67410
15763
15764 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
15765
15766         Fix #67108
15767         * attribute.cs: Enum conversion moved to 
15768         GetAttributeArgumentExpression to be applied to the all
15769         expressions.
15770
15771 2004-10-01  Raja R Harinath  <rharinath@novell.com>
15772
15773         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15774         * class.c (TypeContainer.DefineType): Flag error if
15775         base types aren't accessible due to access permissions.
15776         * decl.cs (DeclSpace.ResolveType): Move logic to
15777         Expression.ResolveAsTypeTerminal.
15778         (DeclSpace.ResolveTypeExpr): Thin layer over
15779         Expression.ResolveAsTypeTerminal.
15780         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15781         Refactor code into NestedAccess.  Use it.
15782         (DeclSpace.NestedAccess): New.
15783         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15784         argument to silence errors.  Check access permissions.
15785         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15786         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15787         (Cast.DoResolve): Likewise.
15788         (New.DoResolve): Likewise.
15789         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15790         (TypeOf.DoResolve): Likewise.
15791
15792         * expression.cs (Invocation.BetterConversion): Return the Type of
15793         the better conversion.  Implement section 14.4.2.3 more faithfully.
15794         (Invocation.BetterFunction): Make boolean.  Make correspondence to
15795         section 14.4.2.2 explicit.
15796         (Invocation.OverloadResolve): Update.
15797         (Invocation): Remove is_base field.
15798         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
15799         (Invocation.Emit): Likewise.
15800
15801 2004-09-27  Raja R Harinath  <rharinath@novell.com>
15802
15803         * README: Update to changes.
15804
15805 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
15806
15807         * cs-parser.jay: Reverted 642 warning fix.
15808
15809 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15810
15811         Fix bug #66615
15812         * decl.cs (FindMemberWithSameName): Indexer can have more than
15813         1 argument.
15814
15815 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15816
15817         * expression.cs (LocalVariableReference.DoResolveLValue):
15818         Do not report warning 219 for out values.
15819         (EmptyExpression.Null): New member to avoid extra allocations.
15820
15821 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15822
15823         * cs-parser.jay: Fix wrong warning 642 report.
15824
15825         * cs-tokenizer.cs (CheckNextToken): New helper;
15826         Inspect next character if is same as expected.
15827
15828 2004-09-23  Martin Baulig  <martin@ximian.com>
15829
15830         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15831         (Convert.ImplicitReferenceConversionExists): Likewise.
15832
15833 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15834
15835         * class.cs (Operator.Define): Add error 448 and 559 report.
15836
15837 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15838
15839         * class.cs (MemberBase.IsTypePermitted): New protected
15840         method for checking error CS0610.
15841
15842 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15843
15844         * class.cs (TypeContainer.HasExplicitLayout): New property
15845         Returns whether container has StructLayout attribute set Explicit.
15846         (FieldMember): New abstract class for consts and fields.
15847         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15848         (Field): Reuse FieldMember.
15849
15850         * const.cs (Const): Reuse FieldMember.
15851
15852         * rootcontext.cs: EmitConstants call moved to class.
15853
15854 2004-09-22  Martin Baulig  <martin@ximian.com>
15855
15856         Thanks to Peter Sestoft for this bug report.
15857
15858         * expression.cs (Conditional): If both the `trueExpr' and the
15859         `falseExpr' is a NullLiteral, return a NullLiteral.
15860
15861 2004-09-22  Martin Baulig  <martin@ximian.com>
15862
15863         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15864         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15865         for the "get_Current" call.
15866
15867 2004-09-22  Martin Baulig  <martin@ximian.com>
15868
15869         Marek and me just fixed one of our oldest bugs: #28562 :-)
15870
15871         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15872
15873         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15874         we're an EnumConstant, just return that.
15875         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15876         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15877         to get the value which'll actually be written into the attribute.
15878         However, we have to use GetValue() to access the attribute's value
15879         in the compiler.        
15880
15881 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15882
15883         * constant.cs (Constant.IsNegative): New abstract property
15884         IsNegative.
15885
15886         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15887         (StackAlloc.DoResolve): Reused IsNegative.
15888
15889 2004-09-21  Martin Baulig  <martin@ximian.com>
15890
15891         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15892         if we're used in an iterator, we may be called from different
15893         methods.
15894
15895         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15896         we actually have an exception block.
15897
15898 2004-09-20  John Luke <jluke@cfl.rr.com>
15899
15900         * class.cs, cs-parser.jay: Improve the error report for 1520:
15901         report the actual line where the error happens, not where the
15902         class was declared.
15903
15904         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15905         Pass location information that was available elsewhere.
15906
15907 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15908
15909         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15910         runtime to delay sign assemblies.
15911
15912 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15913
15914         * cs-parser.jay: Do not report the stack trace, this is barely
15915         used nowadays.
15916
15917 2004-08-22  John Luke  <john.luke@gmail.com>
15918  
15919         * driver.cs : check that a resource id is not already used
15920         before adding it, report CS1508 if it is, bug #63637
15921
15922 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15923
15924         * ecore.cs: Removed dead code.
15925
15926 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15927
15928         * class.cs: Do not report warning CS0067 on the interfaces.
15929
15930 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15931
15932         * cs-parser.jay: Add error 504 report.
15933
15934 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15935
15936         * rootcontext.cs: WarningLevel is 4 by default now.
15937
15938         * statement.cs (Fixed.Resolve): Do not null
15939         VariableInfo.
15940
15941 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15942
15943         Fixed bug #55780
15944         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15945         deep search when property is not virtual.
15946         (PropertyExpr.ResolveAccessors): Make one call for both
15947         accessors.
15948
15949 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15950
15951         Fixed bug #65766
15952         * statement.cs: Error 152 report constains also location.
15953
15954 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15955
15956         Fixed bug #65766
15957         * const.cs: Explicitly set constant as static.
15958
15959 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15960
15961         Fixed bug #64226
15962         * cs-parser.jay: Add error 1017 report.
15963
15964 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15965
15966         Fixed bug #59980, #64224
15967         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15968
15969         * typemanager.cs (IsSpecialMethod): Simplified
15970
15971 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15972
15973         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15974         condition with better params.
15975
15976 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15977
15978         Fixed bug #65238
15979         * attribute.cs (Resolve): Property has to have both
15980         accessors.
15981
15982 2004-09-14  Martin Baulig  <martin@ximian.com>
15983
15984         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15985
15986 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15987
15988         Fixed bug #61902
15989         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15990         called and is obsolete then this member suppress message
15991         when call is inside next [Obsolete] method or type.
15992
15993         * expression.cs: Use TestObsoleteMethodUsage member.
15994
15995 2004-09-14  Martin Baulig  <martin@ximian.com>
15996
15997         * cs-parser.jay: Sync a bit with the GMCS version.
15998
15999 2004-09-14  Martin Baulig  <martin@ximian.com>
16000
16001         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
16002         (CSharpParser.yacc_verbose_flag): New public field.
16003
16004         * genericparser.cs: Removed.
16005
16006 2004-09-14  Raja R Harinath  <rharinath@novell.com>
16007
16008         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
16009
16010 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
16011
16012         * class.cs (MethodCore.CheckBase): Fix bug #65757.
16013
16014 2004-09-10  Martin Baulig  <martin@ximian.com>
16015
16016         Backported my MemberName changes from GMCS into MCS.
16017
16018         - we are now using a special `MemberName' class instead of using
16019         strings; in GMCS, the `MemberName' also contains the type
16020         arguments.
16021
16022         - changed the grammar rules a bit:
16023           * the old `member_name' is now a `namespace_or_type_name':
16024             The rule is that we use `namespace_or_type_name' everywhere
16025             where we expect either a "member name" (GetEnumerator) or a
16026             "member name" with an explicit interface name
16027             (IEnumerable.GetEnumerator).
16028             In GMCS, the explicit interface name may include type arguments
16029             (IEnumerable<T>.GetEnumerator).
16030           * we use `member_name' instead of just `IDENTIFIER' for
16031             "member names":
16032             The rule is that we use `member_name' wherever a member may
16033             have type parameters in GMCS.       
16034
16035         * decl.cs (MemberName): New public class.
16036         (MemberCore.MemberName): New public readonly field.
16037         (MemberCore.ctor): Take a `MemberName' argument, not a string.
16038         (DeclSpace): Likewise.
16039
16040         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
16041         * enum.cs (Enum.ctor): Likewise.
16042
16043         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
16044         MemberName.     
16045         (AliasEntry.ctor): Take a MemberName, not an Expression.
16046         (AliasEntry.UsingAlias): Likewise.
16047
16048         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
16049         (IMethodData.MemberName): Changed type from string to MemberName.
16050         (MemberBase.ExplicitInterfaceName): Likewise.
16051         (AbstractPropertyEventMethod.SetupName): Make this private.
16052         (AbstractPropertyEventMethod.ctor): Added `string prefix'
16053         argument; compute the member name here.
16054         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
16055         on the `member.MemberName' and the `prefix'.
16056
16057         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
16058         not `type_name'.
16059         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
16060         thus, we get a `MemberName' instead of a `string'.  These
16061         declarations may have type parameters in GMCS.
16062         (interface_method_declaration, delegate_declaration): Likewise.
16063         (class_declaration, interface_declaration): Likewise.
16064         (method_header): Use `namespace_or_type_name' instead of
16065         `member_name'.  We may be an explicit interface implementation.
16066         (property_declaration, event_declaration): Likewise.
16067         (member_name): This is now just an `IDENTIFIER', not a
16068         `namespace_or_type_name'.
16069         (type_name, interface_type): Removed.
16070         (namespace_or_type_name): Return a MemberName, not an Expression.
16071         (primary_expression): Use `member_name' instead of `IDENTIFIER';
16072         call GetTypeExpression() on the MemberName to get an expression.
16073         (IndexerDeclaration.interface_type): Changed type from string to
16074         MemberName.
16075         (MakeName): Operate on MemberName's instead of string's.
16076
16077 2004-09-13  Raja R Harinath  <rharinath@novell.com>
16078
16079         Fix bug #55770.
16080         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
16081         (NamespaceEntry.Lookup): Add new argument to flag if we want the
16082         lookup to avoid symbols introduced by 'using'.
16083         * rootcontext.cs (NamespaceLookup): Update.
16084
16085 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
16086
16087         * class.cs (TypeContainer.DoDefineMembers): Do not call
16088         DefineDefaultConstructor for static classes.
16089
16090 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
16091
16092         * attribute.cs (Attribute.Resolve): Add error 653 report.
16093
16094         * class.cs (Class.ApplyAttributeBuilder): Add error 641
16095         report.
16096         (Method.ApplyAttributeBuilder): Add error 685 report.
16097         (Operator.Define): Add error 564 report.
16098
16099         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
16100
16101         * expression.cs (Invocation.DoResolve): Add error
16102         245 and 250 report.
16103
16104         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
16105         error 674 report.
16106
16107 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
16108
16109         * class.cs (ConstructorInitializer.Resolve):
16110         Wrong error number (515->516).
16111
16112 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
16113
16114         * class.cs (Indexer.Define): Add error 631 report.
16115
16116 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
16117
16118         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
16119
16120 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
16121
16122         * expression.cs (Probe.DoResolve): Add error CS0241 report.
16123
16124 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
16125
16126         * cs-parser.jay: Added error CS0241 report.
16127
16128 2004-09-10  Raja R Harinath  <rharinath@novell.com>
16129
16130         * cs-parser.jay (fixed_statement): Introduce a scope for the
16131         declaration in the 'fixed' statement.
16132
16133 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
16134
16135         * cs-parser.jay: Added CS0230 error report.
16136
16137 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
16138
16139         * cs-parser.jay: Added errors CS0231 and CS0257 report.
16140
16141 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
16142
16143         * expression.cs (Argument.Resolve): Added error CS0192 and
16144         CS0199 report.
16145
16146 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
16147
16148         C# 2.0 #pragma warning feature
16149
16150         * cs-tokenizer.cs (PreProcessPragma): New method; 
16151         Handles #pragma directive.
16152
16153         * report.cs (WarningRegions): New class; Support
16154         class for #pragma warning directive. It tests whether
16155         warning is enabled for a given line.
16156
16157 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
16158
16159         * const.cs: Add more descriptive error report, tahnks to
16160         Sebastien. 
16161
16162 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
16163
16164         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
16165
16166 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
16167
16168         * expression.cs: Apply patch from Ben: Remove dead code from
16169         ArrayCreation, and remove the TurnintoConstant call in const.cs,
16170         as that code just threw an exception anwyays.
16171
16172         * const.cs: Remove the call to the turnintoconstant, for details
16173         see bug: #63144
16174         
16175         * literal.cs: The type of the null-literal is the null type;  So
16176         we use a placeholder type (literal.cs:System.Null, defined here)
16177         for it.
16178
16179         * expression.cs (Conditional.DoResolve): Remove some old code that
16180         is no longer needed, conversions have been fixed.
16181
16182         (ArrayCreationExpression.DoResolve): Return false if we fail to
16183         resolve the inner expression.
16184
16185 2004-09-07  Raja R Harinath  <rharinath@novell.com>
16186
16187         Fix test-290.cs.
16188         * cs-parser.jay (delegate_declaration): Record a delegate
16189         declaration as a type declaration.
16190         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
16191
16192 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
16193
16194         * parameter.cs: Do not crash if the type can not be resolved. 
16195
16196         * expression.cs: Report errors with unsafe pointers, fixes #64896
16197
16198 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
16199
16200         * expression.cs: Pointer arith always needs to do a conv.i
16201         if the operand is a long. fix 65320
16202
16203 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
16204
16205         Fixed cs0619-37.cs, cs0619-38.cs
16206
16207         * enum.cs (GetObsoleteAttribute): Removed.
16208
16209         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
16210         on Enum member is double staged. The first is tested member
16211         and then enum.
16212
16213 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
16214
16215         Fixed #56986, #63631, #65231
16216
16217         * class.cs: (TypeContainer.AddToMemberContainer): New method,
16218         adds member to name container.
16219         (TypeContainer.AddToTypeContainer): New method, adds type to
16220         name container.
16221         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
16222         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
16223         AddOperator): Simplified by reusing AddToMemberContainer.
16224         (TypeContainer.UserDefinedStaticConstructor): Changed to property
16225         instead of field.
16226         (Method.CheckForDuplications): Fixed implementation to test all
16227         possibilities.
16228         (MemberBase): Detection whether member is explicit interface
16229         implementation is now in constructor.
16230         (MemberBase.UpdateMemberName): Handles IndexerName.
16231         (Accessor): Changed to keep also location information.
16232         (AbstractPropertyEventMethod): Is derived from MemberCore.
16233         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
16234         will be emited or not.
16235         (PropertyBase.AreAccessorsDuplicateImplementation):
16236         Tests whether accessors are not in collision with some method.
16237         (Operator): Is derived from MethodCore to simplify common
16238         operations.
16239
16240         * decl.cs (Flags.TestMethodDuplication): Test for duplication
16241         must be performed.
16242         (DeclSpace.AddToContainer): Adds the member to defined_names
16243         table. It tests for duplications and enclosing name conflicts.
16244
16245         * enum.cs (EnumMember): Clean up to reuse the base structures
16246
16247 2004-09-03  Martin Baulig  <martin@ximian.com>
16248
16249         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
16250         into TypeContainer, to make partial classes work again.
16251
16252 2004-09-03  Martin Baulig  <martin@ximian.com>
16253
16254         * rootcontext.cs (RootContext.V2): Removed.
16255
16256 2004-03-23  Martin Baulig  <martin@ximian.com>
16257
16258         * expression.cs (Invocation.OverloadResolve): Added `bool
16259         may_fail' argument and use it instead of the Location.IsNull() hack.
16260
16261 2004-09-03  Martin Baulig  <martin@ximian.com>
16262
16263         Merged latest changes into gmcs.  Please keep this comment in
16264         here, it makes it easier for me to see what changed in MCS since
16265         the last time I merged.
16266
16267 2004-09-03  Raja R Harinath  <rharinath@novell.com>
16268
16269         Fix #61128.
16270         * expression.cs (BetterConversion): Don't allow either conversion 
16271         to be null.  Remove redundant implicit conversion test when 'q ==
16272         null' -- when this function is invoked, we already know that the
16273         implicit conversion exists.
16274         (BetterFunction): Assume that 'best' is non-null.  Remove
16275         redundant reimplementation of IsApplicable when 'best' is null.
16276         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
16277         number of arguments.
16278         (IsAncestralType): Extract from OverloadResolve.
16279         (OverloadResolve): Make robust to the MethodGroupExpr being
16280         unsorted.  Implement all the logic of Section 14.5.5.1, and
16281         support overloading of methods from multiple applicable types.
16282         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
16283
16284         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
16285         (RealError, Warning): Append type of report to related symbol.
16286
16287 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
16288
16289         * enum.cs: Fixed CLS-Compliance checks for enum members.
16290         Error tests cs3008-8.cs, cs3014-8.cs
16291
16292 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
16293
16294         Fixed bug #62342, #63102
16295         * class.cs: ImplementIndexer uses member.IsExplicitImpl
16296         like ImplementMethod.
16297
16298 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
16299
16300         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16301         Fixed bug #65170.
16302
16303 2004-09-02  Martin Baulig  <martin@ximian.com>
16304
16305         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16306         TypeManager.GetArgumentTypes() rather than calling GetParameters()
16307         on the MethodBase.
16308
16309 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
16310
16311         C# 2.0 Static classes implemented
16312
16313         * class.cs (TypeContainer): instance_constructors,
16314         initialized_fields, initialized_static_fields,
16315         default_constructor, base_inteface_types are protected to be
16316         accessible from StaticClass.
16317         (TypeContainer.DefineDefaultConstructor): New virtual method
16318         for custom default constructor generating
16319         (StaticClass): New class to handle "Static classes" feature.
16320
16321         * cs-parser.jay: Handle static keyword on class like instance
16322         of StaticClass.
16323
16324         * driver.cs: Added "/langversion" command line switch with two
16325         options (iso-1, default).
16326
16327 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
16328
16329         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16330
16331 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
16332
16333         * delegate.cs: Style.
16334
16335 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16336
16337         * delegate.cs: Add seperate instance expr field for miguel.
16338
16339 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16340
16341         * PointerArithmetic (Resolve): make sure we are not doing
16342         pointer arith on void*. Also, make sure we are resolved
16343         by not setting eclass until resolve.
16344
16345         All callers: Make sure that PointerArithmetic gets resolved.
16346
16347 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16348
16349         * ArrayCreation (LookupType): If the type does not resolve 
16350         to an array, give an error.
16351
16352 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
16353
16354         * statement.cs (Try.Resolve): Fixed bug #64222
16355
16356 2004-08-27  Martin Baulig  <martin@ximian.com>
16357
16358         * class.cs
16359         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16360         crash here.     
16361
16362 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16363
16364         * ecore.cs (Constantify): Get underlying type via
16365         System.Enum.GetUnderlyingType to avoid StackOverflow on the
16366         Windows in special cases.
16367
16368 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
16369
16370         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16371         for obtaining also private methods.
16372         (GetRemoveMethod): Used GetRemoveMethod (true)
16373         for obtaining also private methods.
16374
16375 2004-08-24  Martin Baulig  <martin@ximian.com>
16376
16377         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16378         MethodAttributes.HideBySig for operators.
16379
16380 2004-08-23  Martin Baulig  <martin@ximian.com>
16381
16382         Back to the old error reporting system :-)
16383
16384         * report.cs (Message): Removed.
16385         (Report.MessageData, ErrorData, WarningData): Removed.
16386         (Report.Error, Warning): Back to the old system.
16387
16388 2004-08-23  Martin Baulig  <martin@ximian.com>
16389
16390         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16391
16392         * class.cs (TypeContainer.ParentContainer): New public virtual
16393         method; replaces the explicit interface implementation.
16394         (ClassPart.ParentContainer): Override.
16395
16396 2004-08-23  Martin Baulig  <martin@ximian.com>
16397
16398         * statement.cs (Switch): Added support for constant switches; see
16399         #59428 or test-285.cs.
16400
16401 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16402
16403         Fixed bug #62740.
16404         * statement.cs (GetEnumeratorFilter): Removed useless
16405         logic because C# specs is strict. GetEnumerator must be
16406         public.
16407
16408 2004-08-22  Martin Baulig  <martin@ximian.com>
16409
16410         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16411         a switch and may break, reset the barrier.  Fixes #59867.
16412
16413 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
16414
16415         CLS-Compliance speed up (~5% for corlib)
16416
16417         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16418         New method. Tests container for CLS-Compliant names
16419
16420         * class.cs (TypeContainer.VerifyClsName): New method.
16421         Checks whether container name is CLS Compliant.
16422         (Constructor): Implements IMethodData.
16423
16424         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16425         low-case table for CLS Compliance test.
16426         (MemberCache.VerifyClsParameterConflict): New method.
16427         Checks method parameters for CS3006 error.
16428
16429         * enum.cs (EnumMember): Is derived from MemberCore.
16430         (Enum.VerifyClsName): Optimized for better performance.
16431
16432 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16433
16434         * report.cs: Renamed Error_T to Error and changed all
16435         references.
16436
16437 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
16438
16439         * class.cs (TypeContainer.IndexerArrayList): New inner class
16440         container for indexers.
16441         (TypeContainer.DefaultIndexerName): New constant for default
16442         indexer name. Replaced all "Item" with this constant.
16443         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16444
16445         * typemanager.cs (TypeManager.default_member_ctor): Cache here
16446         DefaultMemberAttribute constructor.
16447
16448 2004-08-05  Martin Baulig  <martin@ximian.com>
16449
16450         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16451         Fix bug #59429.
16452
16453 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
16454
16455         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16456         multi platforms problem.
16457
16458         * compiler.csproj: Included shared files.
16459
16460 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16461
16462         Fix bug 60333, 55971 in the more general way
16463         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16464         Added arg_type argument for constant conversion.
16465         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16466
16467 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16468
16469         Fix bug #59760
16470         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
16471         OperatorArrayList, MethodCoreArrayList for typecontainer
16472         containers. Changed class member types to these new types.
16473         (MethodArrayList.DefineMembers): Added test for CS0659.
16474
16475 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * cfold.cs: Synchronize the folding with the code in expression.cs
16478         Binary.DoNumericPromotions for uint operands.
16479
16480         * attribute.cs: Revert patch from Raja, it introduced a regression
16481         while building Blam-1.2.1 (hard to isolate a test case).
16482
16483 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16484
16485         Fix for #55382
16486         * class.cs:
16487         (TypeContainer.Define): Renamed to DefineContainerMembers because of
16488         name collision.
16489         (MethodCore.parent_method): New member. The method we're overriding
16490         if this is an override method.
16491         (MethodCore.CheckBase): Moved from Method class and made common.
16492         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16493         private.
16494         (MethodCore.CheckForDuplications): New abstract method. For custom
16495         member duplication search in a container
16496         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16497         method and its return type.
16498         (Event.conflict_symbol): New member. Symbol with same name in the
16499         parent class.
16500
16501         * decl.cs:
16502         (MemberCache.FindMemberWithSameName): New method. The method
16503         is looking for conflict with inherited symbols.
16504
16505 2004-08-04  Martin Baulig  <martin@ximian.com>
16506
16507         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16508
16509         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16510
16511 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16512
16513         * report.cs (Message): New enum for better error, warning reference in
16514         the code.
16515         (MessageData): New inner abstract class. It generally handles printing of
16516         error and warning messages.
16517         Removed unused Error, Warning, Message methods.
16518
16519 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16520
16521         Fix for cs0592-8.cs test
16522         * attribute.cs
16523         (Attributable.ValidAttributeTargets): Made public.
16524         (Attribute.ExplicitTarget): New member for explicit target value.
16525         (Attribute.CheckTargets): Now we translate explicit attribute
16526         target to Target here.
16527
16528 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
16529
16530         * ecore.cs (MethodGroupExpr): new IsBase property.
16531
16532         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16533
16534         * delegate.cs (DelegateCreation): store a MethodGroupExpr
16535         rather than an instance expr.
16536
16537         (DelegateCreation.Emit): Use the method group rather than
16538         the instance expression. Also, if you have base.Foo as the
16539         method for a delegate, make sure to emit ldftn, not ldftnvirt.
16540
16541         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
16542
16543         (NewDelegate.DoResolve): Only check for the existance of Invoke
16544         if the method is going to be needed. Use MethodGroupExpr.
16545
16546         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
16547
16548         * expression.cs: For pointer arith., make sure to use
16549         the size of the type, not the size of the pointer to
16550         the type.
16551
16552 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16553
16554         Fix for #60722
16555         * class.cs (Class): Added error CS0502 test.
16556
16557 2004-08-03  John Luke  <jluke@cfl.rr.com>
16558             Raja R Harinath  <rharinath@novell.com>
16559
16560         Fix for #60997.
16561         * attribute.cs (Attribute.complained_before): New flag.
16562         (Attribute.ResolveType, Attribute.Resolve),
16563         (Attribute.DefinePInvokeMethod): Set it.
16564         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16565         
16566 2004-08-03  Martin Baulig  <martin@ximian.com>
16567
16568         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16569         use a user-defined operator; we still need to do numeric
16570         promotions in case one argument is a builtin type and the other
16571         one has an implicit conversion to that type.  Fixes #62322.
16572
16573 2004-08-02  Martin Baulig  <martin@ximian.com>
16574
16575         * statement.cs (LocalInfo.Flags): Added `IsThis'.
16576         (LocalInfo.IsThis): New public property.
16577         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16578
16579 2004-08-01  Martin Baulig  <martin@ximian.com>
16580
16581         * class.cs (TypeContainer.GetClassBases): Don't set the default
16582         here since we may get called from GetPartialBases().
16583         (TypeContainer.DefineType): If GetClassBases() didn't return a
16584         parent, use the default one.
16585
16586 2004-07-30  Duncan Mak  <duncan@ximian.com>
16587
16588         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16589
16590 2004-07-30  Martin Baulig  <martin@ximian.com>
16591
16592         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16593
16594         * class.cs (SourceMethod): New public class, derive from the
16595         symbol writer's ISourceMethod.
16596         (Method): Use the new symbol writer API.
16597
16598         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16599         as argument and use the new symbol writer.
16600
16601         * location.cs
16602         (SourceFile): Implement the symbol writer's ISourceFile.
16603         (Location.SymbolDocument): Removed.
16604         (Location.SourceFile): New public property.
16605
16606         * symbolwriter.cs: Use the new symbol writer API.
16607
16608 2004-07-30  Raja R Harinath  <rharinath@novell.com>
16609
16610         * Makefile (install-local): Remove.  Functionality moved to
16611         executable.make.
16612
16613 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
16614
16615         * Makefile: Install mcs.exe.config file together with mcs.exe.
16616         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16617         correct runtime version.
16618         
16619 2004-07-25  Martin Baulig  <martin@ximian.com>
16620
16621         * class.cs
16622         (TypeContainer.RegisterOrder): Removed, this was unused.
16623         (TypeContainer, interface_order): Removed.
16624         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16625         TypeContainer as argument since we can also be called with a
16626         `PartialContainer' for a partial class/struct/interface.
16627         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16628         of checking whether we're an `Interface' - we could be a
16629         `PartialContainer'.
16630         (PartialContainer.Register): Override; call
16631         AddClass()/AddStruct()/AddInterface() on our parent.
16632
16633         * cs-parser.jay (interface_member_declaration): Add things to the
16634         `current_container', not the `current_class'.
16635
16636         * rootcontext.cs (RegisterOrder): The overloaded version which
16637         takes an `Interface' was unused, removed.
16638
16639         * typemanager.cs (TypeManager.LookupInterface): Return a
16640         `TypeContainer', not an `Interface'.
16641         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16642         contain a `PartialContainer' for an interface, so check it's
16643         `Kind' to figure out what it is.
16644
16645 2004-07-25  Martin Baulig  <martin@ximian.com>
16646
16647         * class.cs (Class.DefaultTypeAttributes): New public constant.
16648         (Struct.DefaultTypeAttributes): Likewise.
16649         (Interface.DefaultTypeAttributes): Likewise.
16650         (PartialContainer.TypeAttr): Override this and add the
16651         DefaultTypeAttributes.
16652
16653 2004-07-25  Martin Baulig  <martin@ximian.com>
16654
16655         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16656         we can just use the `Parent' field instead.
16657
16658 2004-07-25  Martin Baulig  <martin@ximian.com>
16659
16660         * class.cs (TypeContainer.Emit): Renamed to EmitType().
16661
16662 2004-07-25  Martin Baulig  <martin@ximian.com>
16663
16664         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16665         our parts before defining any methods.
16666         (TypeContainer.VerifyImplements): Make this virtual.
16667         (ClassPart.VerifyImplements): Override and call VerifyImplements()
16668         on our PartialContainer.
16669
16670 2004-07-25  Martin Baulig  <martin@ximian.com>
16671
16672         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16673
16674         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16675         argument, we can just use the `Parent' field instead.
16676
16677         * class.cs
16678         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
16679         (MemberBase.DoDefine): Likewise.
16680
16681 2004-07-24  Martin Baulig  <martin@ximian.com>
16682
16683         * decl.cs (MemberCore.Parent): New public field.
16684         (DeclSpace.Parent): Moved to MemberCore.
16685
16686         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16687         (MemberBase.ctor): Added TypeContainer argument, pass it to our
16688         parent's .ctor.
16689         (FieldBase, Field, Operator): Likewise.
16690         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16691         (EventField, Event): Likewise.
16692
16693 2004-07-23  Martin Baulig  <martin@ximian.com>
16694
16695         * class.cs (PartialContainer): New public class.
16696         (ClassPart): New public class.
16697         (TypeContainer): Added support for partial classes.
16698         (TypeContainer.GetClassBases): Splitted some of the functionality
16699         out into GetNormalBases() and GetPartialBases().
16700
16701         * cs-tokenizer.cs (Token.PARTIAL): New token.
16702         (Tokenizer.consume_identifier): Added some hacks to recognize
16703         `partial', but only if it's immediately followed by `class',
16704         `struct' or `interface'.
16705
16706         * cs-parser.jay: Added support for partial clases.
16707
16708 2004-07-23  Martin Baulig  <martin@ximian.com>
16709
16710         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16711         a `DeclSpace' and also made it readonly.
16712         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16713         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16714         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16715
16716         * cs-parser.jay: Pass the `current_class', not the
16717         `current_container' (at the moment, this is still the same thing)
16718         to a new Method, Property, Event, Indexer or Constructor.
16719
16720 2004-07-23  Martin Baulig  <martin@ximian.com>
16721
16722         * cs-parser.jay (CSharpParser): Added a new `current_class' field
16723         and removed the `current_interface' one.
16724         (struct_declaration, class_declaration, interface_declaration):
16725         Set `current_class' to the newly created class/struct/interface;
16726         set their `Bases' and call Register() before parsing their body.
16727
16728 2004-07-23  Martin Baulig  <martin@ximian.com>
16729
16730         * class.cs (Kind): New public enum.
16731         (TypeContainer): Made this class abstract.
16732         (TypeContainer.Kind): New public readonly field.
16733         (TypeContainer.CheckDef): New public method; moved here from
16734         cs-parser.jay.
16735         (TypeContainer.Register): New public abstract method.
16736         (TypeContainer.GetPendingImplementations): New public abstract
16737         method.
16738         (TypeContainer.GetClassBases): Removed the `is_class' and
16739         `is_iface' parameters.
16740         (TypeContainer.DefineNestedTypes): Formerly known as
16741         DoDefineType().
16742         (ClassOrStruct): Made this class abstract.
16743
16744         * tree.cs (RootTypes): New public type. 
16745
16746 2004-07-20  Martin Baulig  <martin@ximian.com>
16747
16748         * tree.cs (Tree.RecordNamespace): Removed.
16749         (Tree.Namespaces): Removed.
16750
16751         * rootcontext.cs (RootContext.IsNamespace): Removed.
16752
16753         * cs-parser.jay (namespace_declaration): Just create a new
16754         NamespaceEntry here.
16755
16756 2004-07-20  Martin Baulig  <martin@ximian.com>
16757
16758         * statement.cs (ExceptionStatement): New abstract class.  This is
16759         now used as a base class for everyone who's using `finally'.
16760         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16761         our local variables before using them.
16762
16763         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16764         virtual method.  This is used by Yield.Resolve() to "steal" an
16765         outer block's `finally' clauses.
16766         (FlowBranchingException): The .ctor now takes an ExceptionStatement
16767         argument.
16768
16769         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16770         version which takes an ExceptionStatement.  This version must be
16771         used to create exception branchings.
16772
16773         * iterator.cs
16774         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16775         (Iterator.EmitMoveNext): Added exception support; protect the
16776         block with a `fault' clause, properly handle 'finally' clauses.
16777         (Iterator.EmitDispose): Run all the `finally' clauses here.
16778
16779 2004-07-20  Martin Baulig  <martin@ximian.com>
16780
16781         * iterator.cs: This is the first of a set of changes in the
16782         iterator code.  Match the spec more closely: if we're an
16783         IEnumerable, then GetEnumerator() must be called.  The first time
16784         GetEnumerator() is called, it returns the current instance; all
16785         subsequent invocations (if any) must create a copy.
16786
16787 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * expression.cs: Resolve the constant expression before returning
16790         it. 
16791
16792 2004-07-19  Martin Baulig  <martin@ximian.com>
16793
16794         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16795         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16796         the return type of the new EmitContext.
16797
16798 2004-07-18  Martin Baulig  <martin@ximian.com>
16799
16800         * class.cs (Property.Define): Fix iterators.
16801
16802         * iterators.cs (Iterator.Define): Moved the
16803         `container.AddInterator (this)' call here from the .ctor; only do
16804         it if we resolved successfully.
16805
16806 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
16807
16808         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16809         `true' for preprocessing directives that we parse.  The return
16810         value indicates whether we should return to regular tokenizing or
16811         not, not whether it was parsed successfully.
16812
16813         In the past if we were in: #if false ... #line #endif, we would
16814         resume parsing after `#line'.  See bug 61604.
16815
16816         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16817         building: IsEnumType should return true only for enums, not for
16818         enums or System.Enum itself.  This fixes #61593.
16819
16820         Likely what happened is that corlib was wrong: mcs depended on
16821         this bug in some places.  The bug got fixed, we had to add the
16822         hack, which caused bug 61593.
16823
16824         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16825         that was a workaround for the older conditions.
16826
16827 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
16828
16829         * assign.cs: IAssignMethod has a new interface, as documented
16830         inline. All assignment code now uses this new api.
16831
16832         * ecore.cs, expression.cs: All classes which implement
16833         IAssignMethod now use the new interface.
16834
16835         * expression.cs (Invocation): add a hack to EmitCall so that
16836         IndexerAccess can be the target of a compound assignment without
16837         evaluating its arguments twice.
16838
16839         * statement.cs: Handle changes in Invocation api.
16840
16841 2004-07-16  Martin Baulig  <martin@ximian.com>
16842
16843         * iterators.cs: Rewrote this.  We're now using one single Proxy
16844         class for both the IEnumerable and the IEnumerator interface and
16845         `Iterator' derives from Class so we can use the high-level API.
16846
16847         * class.cs (TypeContainer.AddIterator): New method.
16848         (TypeContainer.DoDefineType): New protected virtual method, which
16849         is called from DefineType().
16850         (TypeContainer.DoDefineMembers): Call DefineType() and
16851         DefineMembers() on all our iterators.
16852         (TypeContainer.Emit): Call Emit() on all our iterators.
16853         (TypeContainer.CloseType): Call CloseType() on all our iterators.
16854
16855         * codegen.cs (EmitContext.CurrentIterator): New public field.
16856
16857 2004-07-15  Martin Baulig  <martin@ximian.com>
16858
16859         * typemanager.cs
16860         (TypeManager.not_supported_exception_type): New type.   
16861
16862 2004-07-14  Martin Baulig  <martin@ximian.com>
16863
16864         * iterators.cs: Use real error numbers.
16865
16866 2004-07-14  Martin Baulig  <martin@ximian.com>
16867
16868         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16869         requires this to be a System.Collection.IEnumerable and not a
16870         class implementing that interface.
16871         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16872
16873 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16874
16875         * class.cs: Fixed previous fix, it broke some error tests.
16876
16877 2004-07-12  Martin Baulig  <martin@ximian.com>
16878
16879         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16880         Fixes #61293.
16881
16882 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * assign.cs (LocalTemporary): Add new argument: is_address,If
16885         `is_address' is true, then the value that we store is the address
16886         to the real value, and not the value itself.
16887         
16888         * ecore.cs (PropertyExpr): use the new local temporary
16889         stuff to allow us to handle X.Y += z (where X is a struct)
16890
16891 2004-07-08  Martin Baulig  <martin@ximian.com>
16892
16893         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16894         not always return, just like we're doing in Using.Resolve().
16895
16896 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * cs-parser.jay (fixed_statement): flag this as Pinned.
16899
16900 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * typemanager.cs (TypeManager): Removed MakePinned method, this
16903         mechanism is replaced with the .NET 2.x compatible mechanism of
16904         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16905
16906         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16907         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16908         `IsFixed' property which has a different meaning.
16909
16910 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16911
16912         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16913         visible from inside a nested class, not just the names of the
16914         immediately enclosing class.
16915         Fix for bug #60730.
16916
16917 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16918
16919         * expression.cs (BetterConversion): Remove buggy special-case
16920         handling of "implicit constant expression conversions".  At this
16921         point, we already know that the conversion is possible -- we're
16922         only checking to see which is better.
16923
16924 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16925
16926         * cs-parser.jay: Added error CS0210 test.
16927
16928 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16929
16930         * cs-parser.jay: Added error CS0134 test.
16931
16932 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16933
16934         Fix bug #52507
16935         * cs-parser.jay: Added error CS0145 test.
16936
16937 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16938
16939         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16940
16941 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16942         
16943         * expression.cs (StackAlloc.Resolve): The argument may not
16944         be a constant; deal with this case.
16945         
16946 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16947
16948         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16949         GetIndexerAttributeValue.
16950         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16951
16952         * class.cs (Indexer.Define): Added error tests for CS0415,
16953         CS0609.
16954
16955 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16956
16957         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16958         property code.
16959
16960 2004-06-23  Martin Baulig  <martin@ximian.com>
16961
16962         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16963         neither return nor throw, reset the barrier as well.  Fixes #60457.
16964
16965 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16966
16967         * class.cs : EventAttributes is now set to None by default.
16968           This fixes bug #60459.
16969
16970 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16971
16972         Fix bug #60219
16973         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16974         Don't throw exception but return null (it's sufficient now).
16975
16976 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16977
16978         * typemanager.cs (GetArgumentTypes): Faster implementation.
16979
16980 2004-06-18  Martin Baulig  <martin@ximian.com>
16981
16982         * attribute.cs (Attribute.Resolve): Check whether we're an
16983         EmptyCast which a Constant child.  Fixes #60333.
16984
16985 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16986
16987         * statement.cs (EmitCollectionForeach): Account for the fact that
16988         not all valuetypes are in areas which we can take the address of.
16989         For these variables, we store to a temporary variable. Also, make
16990         sure that we dont emit a `callvirt' on a valuetype method.
16991
16992 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16993
16994         * expression.cs (StackAlloc.DoReSolve): Added test for
16995         negative parameter (CS0247).
16996
16997 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16998
16999         Fix bug #59792
17000         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
17001
17002 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
17003
17004         Fix bug #59781
17005         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
17006         ulong.
17007
17008 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
17009
17010         Fix bug #58254 & cs1555.cs, cs1556.cs
17011         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
17012
17013 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
17014
17015         * cs-parser.jay: Added error CS1669 test for indexers.
17016
17017 2004-06-11  Martin Baulig  <martin@ximian.com>
17018
17019         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
17020         call this twice: for params and varargs methods.
17021
17022 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
17023
17024         * class.cs:
17025         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
17026
17027 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
17028
17029         * attribute.cs (Attribute.GetValidTargets): Made public.
17030
17031         * class.cs: 
17032         (AbstractPropertyEventMethod): New class for better code sharing.
17033         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
17034         CS1667 report.
17035         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
17036
17037 2004-06-11  Raja R Harinath  <rharinath@novell.com>
17038
17039         Fix bug #59477.
17040         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
17041         that the call to Resolve is part of a MemberAccess.
17042         (Expression.Resolve): Use it for SimpleName resolution.
17043         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
17044         Add 'intermediate' boolean argument.
17045         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
17046         error message when the SimpleName can be resolved ambiguously
17047         between an expression and a type.
17048         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
17049         public.
17050         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
17051         call on the left-side.
17052
17053 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
17054
17055         * class.cs:
17056         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
17057
17058 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
17059
17060         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
17061
17062 2004-06-11  Martin Baulig  <martin@ximian.com>
17063
17064         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
17065         varargs methods if applicable.
17066
17067 2004-06-11  Martin Baulig  <martin@ximian.com>
17068
17069         * expression.cs (Invocation.EmitCall): Don't use
17070         `method.CallingConvention == CallingConventions.VarArgs' since the
17071         method could also have `CallingConventions.HasThis'.
17072
17073 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
17074
17075         * class.cs (Event.GetSignatureForError): Implemented.
17076         Fixed crash in error test cs3010.cs
17077
17078 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
17079
17080         * cs-tokenizer.cs: Change the way we track __arglist to be
17081         consistent with the other keywords.
17082
17083 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
17086         tomorrow.
17087
17088 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
17089
17090         * codegen.cs: Check that all referenced assemblies have a strongname
17091         before strongnaming the compiled assembly. If not report error CS1577.
17092         Fix bug #56563. Patch by Jackson Harper.
17093         * typemanager.cs: Added a method to return all referenced assemblies.
17094         Fix bug #56563. Patch by Jackson Harper.
17095
17096 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
17097
17098         * class.cs:
17099         (Method.ApplyAttributeBuilder): Moved and added conditional
17100         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
17101
17102         * delegate.cs:
17103         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
17104
17105 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
17106
17107         Fixed #59640
17108         * class.cs: (EventField.attribute_targets): Changed default target.
17109
17110 2004-06-08  Martin Baulig  <martin@ximian.com>
17111
17112         * expression.cs (Invocation.EmitCall): Enable varargs methods.
17113
17114 2004-06-08  Martin Baulig  <martin@ximian.com>
17115
17116         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
17117
17118 2004-06-07  Martin Baulig  <martin@ximian.com>
17119
17120         Added support for varargs methods.
17121
17122         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
17123         keyword.
17124
17125         * cs-parser.jay: Added support for `__arglist'.
17126
17127         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
17128
17129         * expression.cs (Argument.AType): Added `ArgList'.
17130         (Invocation): Added support for varargs methods.
17131         (ArglistAccess): New public class.
17132         (Arglist): New public class.
17133
17134         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
17135
17136         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
17137         a method's top-level block if the method has varargs.
17138
17139         * support.cs (ReflectionParameters, InternalParameters): Added
17140         support for varargs methods.    
17141
17142 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
17143
17144         * class.cs: Provide location in indexer error report.
17145
17146         * driver.cs: Use standard names.
17147
17148         * namespace.cs: Catch the use of using after a namespace has been
17149         declared also on using aliases.
17150
17151 2004-06-03  Raja R Harinath  <rharinath@novell.com>
17152
17153         Bug #50820.
17154         * typemanager.cs (closure_private_ok, closure_invocation_type)
17155         (closure_qualifier_type, closure_invocation_assembly)
17156         (FilterWithClosure): Move to ...
17157         (Closure): New internal nested class.
17158         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
17159         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
17160         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
17161         (MemberLookup, MemberLookupFailed): Use it.
17162         * expression.cs (New.DoResolve): Treat the lookup for the
17163         constructor as being qualified by the 'new'ed type.
17164         (Indexers.GetIndexersForTypeOrInterface): Update.
17165
17166 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
17167
17168         * attribute.cs
17169         (GetConditionalAttributeValue): New method. Returns
17170         condition of ConditionalAttribute.
17171         (SearchMulti): New method.  Returns all attributes of type 't'.
17172         Use it when attribute is AllowMultiple = true.
17173         (IsConditionalMethodExcluded): New method.
17174
17175         * class.cs
17176         (Method.IsExcluded): Implemented. Returns true if method has conditional
17177         attribute and the conditions is not defined (method is excluded).
17178         (IMethodData): Extended interface for ConditionalAttribute support.
17179         (PropertyMethod.IsExcluded): Implemented.
17180
17181         * decl.cs
17182         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
17183
17184         * expression.cs
17185         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
17186         on the method.
17187
17188 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
17189
17190         * expression.cs (ArrayCreationExpression): Make this just an
17191         `expression'. It can't be a statement, so the code here was
17192         dead.
17193
17194 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
17195
17196         Fixed #59072
17197         * typemanager.cs (GetFullNameSignature): New method for
17198         MethodBase types.
17199
17200 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
17201
17202         Fixed #56452
17203         * class.cs (MemberBase.GetSignatureForError): New virtual method.
17204         Use this method when MethodBuilder is null.
17205         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
17206         Added test for error CS0626 (MONO reports error for this situation).
17207         (IMethodData.GetSignatureForError): Extended interface.
17208
17209 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
17210
17211         * attribute.cs
17212         (AttributeTester.GetObsoleteAttribute): Returns instance of
17213         ObsoleteAttribute when type is obsolete.
17214
17215         * class.cs
17216         (TypeContainer.VerifyObsoleteAttribute): Override.
17217         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
17218         (MethodCode.VerifyObsoleteAttribute): Override.
17219         (MemberBase.VerifyObsoleteAttribute): Override.
17220
17221         * decl.cs
17222         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
17223         and report proper error.
17224
17225         *delegate.cs
17226         Delegate.VerifyObsoleteAttribute): Override.
17227
17228         * ecore.cs
17229         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
17230         and report proper error.
17231         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
17232
17233         * enum.cs
17234         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
17235         and enum member.
17236
17237         * expression.cs
17238         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
17239         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
17240         Added test for ObsoleteAttribute.
17241
17242         * statement.cs
17243         (Catch): Derived from Statement.
17244
17245 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
17246  
17247         Fixed bug #59071 & cs0160.cs
17248  
17249         * statement.cs (Try.Resolve): Check here whether order of catch
17250         clauses matches their dependencies.
17251
17252 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
17255         caused a regression: #59343.  Referencing nested classes from an
17256         assembly stopped working.
17257
17258 2004-05-31  Martin Baulig  <martin@ximian.com>
17259
17260         MCS is now frozen for beta 2.
17261
17262 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17263
17264         * convert.cs: add a trivial cache for overload operator resolution.
17265
17266 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17267
17268         * decl.cs: If possible, use lookuptypedirect here. We can only do
17269         this if there is no `.' after the namespace. Avoids using
17270         LookupType, which does lots of slow processing.
17271         (FindNestedType) New method, does what it says :-).
17272         * namespace.cs: use LookupTypeDirect.
17273         * rootcontext.cs: use membercache, if possible.
17274         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
17275
17276 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17277
17278         * expression.cs:
17279         According to the spec, 
17280
17281         In a member access of the form E.I, if E is a single identifier,
17282         and if the meaning of E as a simple-name (§7.5.2) is a constant,
17283         field, property, localvariable, or parameter with the same type as
17284         the meaning of E as a type-name (§3.8), then both possible
17285         meanings of E are permitted.
17286
17287         We did not check that E as a simple-name had the same type as E as
17288         a type name.
17289
17290         This trivial check gives us 5-7% on bootstrap time.
17291
17292 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
17293
17294         * expression.cs (Invocation.OverloadResolve): Avoid the
17295         use of hashtables and boxing here by allocating on demand.
17296
17297 2004-05-30  Martin Baulig  <martin@ximian.com>
17298
17299         * rootcontext.cs (RootContext.LookupType): Don't cache things if
17300         we're doing a silent lookup.  Don't try to lookup nested types in
17301         TypeManager.object_type (thanks to Ben Maurer).
17302
17303 2004-05-30  Martin Baulig  <martin@ximian.com>
17304
17305         Committing a patch from Ben Maurer.
17306
17307         * rootcontext.cs (RootContext.LookupType): Cache negative results.
17308
17309 2004-05-29  Martin Baulig  <martin@ximian.com>
17310
17311         * class.cs (IMethodData.ShouldIgnore): New method.
17312
17313         * typemanager.cs (TypeManager.MethodFlags): Don't take a
17314         `Location' argument, we don't need it anywhere.  Use
17315         `IMethodData.ShouldIgnore ()' instead of
17316         `MethodData.GetMethodFlags ()'.
17317         (TypeManager.AddMethod): Removed.
17318         (TypeManager.AddMethod2): Renamed to AddMethod.
17319
17320 2004-05-29  Martin Baulig  <martin@ximian.com>
17321
17322         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17323
17324         * convert.cs (Convert.ImplicitReferenceConversion): If we're
17325         converting from a class type S to an interface type and we already
17326         have an object on the stack, don't box it again.  Fixes #52578.
17327
17328 2004-05-29  Martin Baulig  <martin@ximian.com>
17329
17330         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17331         Added support for `params' parameters.  Fixes #59267.
17332
17333 2004-05-29  Martin Baulig  <martin@ximian.com>
17334
17335         * literal.cs (NullPointer): Provide a private .ctor which sets
17336         `type' to TypeManager.object_type.  Fixes #59048.
17337
17338 2004-05-29  Martin Baulig  <martin@ximian.com>
17339
17340         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17341         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
17342
17343         * ecore.cs (EventExpr.instance_expr): Make the field private.
17344
17345 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
17346
17347         Fixed bug #50080 & cs0214-2.cs
17348         * expression.cs (Cast.DoResolve): Check unsafe context here.
17349         
17350         * statement.cs (Resolve.DoResolve): Likewise.
17351
17352 2004-05-26  Martin Baulig  <martin@ximian.com>
17353
17354         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17355
17356         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17357         (RootContext.LookupType): Pass down the `silent' flag.
17358
17359 2004-05-25  Martin Baulig  <martin@ximian.com>
17360
17361         * expression.cs
17362         (MethodGroupExpr.IdenticalTypeName): New public property.
17363         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17364         expression actually refers to a type.
17365
17366 2004-05-25  Martin Baulig  <martin@ximian.com>
17367
17368         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17369         for #56176 and made it actually work.
17370
17371 2004-05-25  Martin Baulig  <martin@ximian.com>
17372
17373         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17374         (FieldExpr, PropertyExpr): Override and implement
17375         CacheTemporaries.  Fixes #52279.
17376
17377 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * location.cs: In the new compiler listing a file twice is a
17380         warning, not an error.
17381
17382 2004-05-24  Martin Baulig  <martin@ximian.com>
17383
17384         * enum.cs (Enum.DefineType): For the `BaseType' to be a
17385         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
17386
17387 2004-05-24  Martin Baulig  <martin@ximian.com>
17388
17389         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17390         walking the `using' list.  Fixes #53921.
17391
17392 2004-05-24  Martin Baulig  <martin@ximian.com>
17393
17394         * const.cs (Const.LookupConstantValue): Added support for
17395         EmptyCast's; fixes #55251.
17396
17397 2004-05-24  Martin Baulig  <martin@ximian.com>
17398
17399         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17400         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17401         which does the CS0135 check.  The reason is that we first need to
17402         check whether the variable actually exists.
17403
17404 2004-05-24  Martin Baulig  <martin@ximian.com>
17405
17406         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17407         than RootContext.LookupType() to find the explicit interface
17408         type.  Fixes #58584.
17409
17410 2004-05-24  Raja R Harinath  <rharinath@novell.com>
17411
17412         * Makefile: Simplify.  Use executable.make.
17413         * mcs.exe.sources: New file.  List of sources of mcs.exe.
17414
17415 2004-05-24  Anders Carlsson  <andersca@gnome.org>
17416
17417         * decl.cs:
17418         * enum.cs:
17419         Use the invariant culture when doing String.Compare for CLS case
17420         sensitivity.
17421         
17422 2004-05-23  Martin Baulig  <martin@ximian.com>
17423
17424         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17425         don't have any dots.  Fixes #52622, added cs0246-8.cs.
17426
17427         * namespace.cs (NamespaceEntry.Lookup): Likewise.
17428         
17429 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17430
17431         * class.cs (MemberBase.Define): Reuse MemberType member for 
17432         resolved type. Other methods can use it too.
17433
17434 2004-05-23  Martin Baulig  <martin@ximian.com>
17435
17436         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17437         the variable also exists in the current block (otherwise, we need
17438         to report a CS0103).  Fixes #58670.
17439
17440 2004-05-23  Martin Baulig  <martin@ximian.com>
17441
17442         * flowanalysis.cs (Reachability.Reachable): Compute this
17443         on-the-fly rather than storing it as a field.
17444
17445 2004-05-23  Martin Baulig  <martin@ximian.com>
17446
17447         * flowanalysis.cs (Reachability.And): Manually compute the
17448         resulting `barrier' from the reachability.      
17449        
17450 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17451
17452         Fix bug #57835
17453         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17454         instance of ObsoleteAttribute when symbol is obsolete.
17455
17456         * class.cs
17457         (IMethodData): Extended interface for ObsoleteAttribute support.
17458
17459 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17460
17461         * attribute.cs: Fix bug #55970
17462
17463 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17464
17465         Fix bug #52705
17466         * attribute.cs
17467         (GetObsoleteAttribute): New method. Creates the instance of
17468         ObsoleteAttribute.
17469         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17470         ObsoleteAttribute when member is obsolete.
17471         (AttributeTester.Report_ObsoleteMessage): Common method for
17472         Obsolete error/warning reporting.
17473
17474         * class.cs
17475         (TypeContainer.base_classs_type): New member for storing parent type.
17476
17477         * decl.cs
17478         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17479         for this MemberCore.
17480
17481 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17482
17483         * attribute.cs, const.cs: Fix bug #58590
17484
17485 2004-05-21  Martin Baulig  <martin@ximian.com>
17486
17487         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17488         out parameters if the end of the method is unreachable.  Fixes
17489         #58098. 
17490
17491 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17492
17493         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17494         Hari was right, why extra method.
17495
17496 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17497
17498         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17499
17500 2004-05-20  Martin Baulig  <martin@ximian.com>
17501
17502         Merged this back from gmcs to keep the differences to a minumum.
17503
17504         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17505         instead of a Declspace.
17506         (Attribute.ResolveType): Likewise.
17507         (Attributes.Search): Likewise.
17508         (Attributes.Contains): Likewise.
17509         (Attributes.GetClsCompliantAttribute): Likewise.
17510
17511         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17512         argument.
17513         (MethodData.ApplyAttributes): Take an EmitContext instead of a
17514         DeclSpace.
17515
17516 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
17517
17518         Fix bug #58688 (MCS does not report error when the same attribute
17519         is assigned twice)
17520
17521         * attribute.cs (Attribute.Emit): Distinction between null and default.
17522
17523 2004-05-19  Raja R Harinath  <rharinath@novell.com>
17524
17525         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17526         of a top-level attribute without an attribute target.
17527         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
17528         Make non-static.
17529         (Attribute.Conditional_GetConditionName), 
17530         (Attribute.Obsolete_GetObsoleteMessage): Update.
17531         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
17532         part of ScanForIndexerName.
17533         (Attribute.CanIgnoreInvalidAttribute): New function.
17534         (Attribute.ScanForIndexerName): Move to ...
17535         (Attributes.ScanForIndexerName): ... here.
17536         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17537         (Attributes.Search): New internal variant that can choose not to
17538         complain if types aren't resolved.  The original signature now
17539         complains.
17540         (Attributes.GetClsCompliantAttribute): Use internal variant, with
17541         complaints suppressed.
17542         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17543         only if it not useful.
17544         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17545         top-level for attributes that are shared between the assembly
17546         and a top-level class.
17547         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17548         * class.cs: Update to reflect changes.
17549         (DefineIndexers): Fuse loops.
17550         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
17551         a couple more variants of attribute names.
17552
17553 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
17554
17555         Fix bug #52585 (Implemented explicit attribute declaration)
17556
17557         * attribute.cs:
17558         (Attributable.ValidAttributeTargets): New abstract method. It gets
17559         list of valid attribute targets for explicit target declaration.
17560         (Attribute.Target): It holds target itself.
17561         (AttributeSection): Removed.
17562         (Attribute.CheckTargets): New method. It checks whether attribute
17563         target is valid for the current element.
17564
17565         * class.cs:
17566         (EventProperty): New class. For events that are declared like
17567         property (with add and remove accessors).
17568         (EventField): New class. For events that are declared like field.
17569         class.cs
17570
17571         * cs-parser.jay: Implemented explicit attribute target declaration.
17572
17573         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
17574         Override ValidAttributeTargets.
17575
17576         * parameter.cs:
17577         (ReturnParameter): Class for applying custom attributes on 
17578         the return type.
17579         (ParameterAtribute): New class. Class for applying custom
17580         attributes on the parameter type.
17581
17582 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17585         definitions. 
17586
17587         (Method): Allow UNSAFE here.
17588
17589         * modifiers.cs: Support unsafe reporting.
17590
17591 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
17592
17593         * decl.cs: Fix bug #58478.
17594
17595 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17596
17597         * statement.cs: When checking for unreachable code on an EmptyStatement,
17598         set the location. Fixes bug #58488.
17599
17600 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
17601
17602         * driver.cs: Add -pkg handling.
17603
17604         From Gonzalo: UseShelLExecute=false
17605
17606 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
17607
17608         * attribute.cs:
17609         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17610         for attribute.
17611         (Attribute.IsClsCompliaceRequired): Moved to base for better
17612         accesibility.
17613         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17614         when attribute is AttributeUsageAttribute.
17615         (Attribute.GetValidTargets): Simplified.
17616         (Attribute.GetAttributeUsage): New method returns AttributeUsage
17617         attribute for this type.
17618         (Attribute.ApplyAttributes): Method renamed to Emit and make
17619         non-static.
17620         (GlobalAttributeSection): New class for special handling of global
17621         attributes (assembly, module).
17622         (AttributeSection.Emit): New method.
17623
17624         * class.cs: Implemented Attributable abstract methods.
17625         (MethodCore.LabelParameters): Moved to Parameter class.
17626         (Accessor): Is back simple class.
17627         (PropertyMethod): Implemented Attributable abstract class.
17628         (DelegateMethod): Implemented Attributable abstract class.
17629         (Event): New constructor for disctintion between normal Event
17630         and Event with accessors.
17631
17632         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17633
17634         * codegen.cs, const.cs, decl.cs, delegate.cs:
17635         (CommonAssemblyModulClass): Implemented Attributable abstract class
17636         and simplified.
17637
17638         * enum.cs: Implement IAttributeSupport interface.
17639         (EnumMember): New class for emum members. Implemented Attributable
17640         abstract class
17641
17642         * parameter.cs:
17643         (ParameterBase): Is abstract.
17644         (ReturnParameter): New class for easier [return:] attribute handling.
17645
17646         * typemanager.cs: Removed builder_to_attr.
17647
17648 2004-05-11  Raja R Harinath  <rharinath@novell.com>
17649
17650         Fix bug #57151.
17651         * attribute.cs (Attribute.GetPositionalValue): New function.
17652         * class.cs (TypeContainer.VerifyMembers): New function.
17653         (TypeContainer.Emit): Use it.
17654         (ClassOrStruct): New base class for Class and Struct.
17655         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
17656         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17657         class.
17658         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17659         then each non-static field should have a FieldOffset attribute.
17660         Otherwise, none of the fields should have a FieldOffset attribute.
17661         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
17662         and FieldOffset attributes.
17663         * typemanager.cs (TypeManager.struct_layout_attribute_type)
17664         (TypeManager.field_offset_attribute_type): New core types.
17665         (TypeManager.InitCoreTypes): Initialize them.
17666
17667 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
17668
17669         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17670         Return correct type.
17671         From bug #58270.
17672
17673 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
17674
17675         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17676         be implicitly converted to ulong.
17677         
17678         * expression.cs: The logic for allowing operator &, | and ^ worked
17679         was wrong, it worked before because we did not report an error in
17680         an else branch.  Fixes 57895.
17681
17682         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17683         allow volatile fields to be reference types.
17684
17685 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * driver.cs: Add support for /debug-
17688
17689 2004-05-07  Raja R Harinath  <rharinath@novell.com>
17690
17691         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
17692         Add a 'complain' parameter to silence errors.
17693         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
17694         silently overlooked type-resolutions.
17695         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17696         to reflect changes.
17697         (Attributes.Search): New function.
17698         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17699         (Attributes.GetAttributeFullName): Remove hack.
17700         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
17701         Update to reflect changes.
17702         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17703         Use Attributes.Search instead of nested loops.
17704
17705 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
17706
17707         * decl.cs:
17708         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17709         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17710         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17711
17712         * report.cs: (Report.Warning): Renamed to Warning_T because of
17713         parameter collision.
17714
17715 2004-05-05  Raja R Harinath  <rharinath@novell.com>
17716
17717         * expression.cs (MemberAccess.ResolveMemberAccess):
17718         Exit with non-zero status after Report.Error.
17719         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17720         Likewise.
17721         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17722
17723 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17724
17725         * support.cs: Don't hang when the file is empty.
17726
17727 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17728
17729         * support.cs: In SeekableStreamReader, compute the preamble size of the
17730           underlying stream. Position changes should take into account that initial
17731           count of bytes.
17732
17733 2004-05-03  Todd Berman  <tberman@sevenl.net>
17734
17735         * driver.cs: remove unused GetSysVersion function.
17736
17737 2004-05-03  Todd Berman  <tberman@sevenl.net>
17738
17739         * driver.cs: Remove the hack from saturday, as well as the hack
17740         from jackson (LoadAssemblyFromGac), also adds the CWD to the
17741         link_paths to get that bit proper.
17742
17743 2004-05-01  Todd Berman  <tberman@sevenl.net>
17744
17745         * driver.cs: Try a LoadFrom before a Load, this checks the current
17746         path. This is currently a bug in mono that is be fixed, however, this
17747         provides a workaround for now. This will be removed when the bug
17748         is fixed.
17749
17750 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
17751
17752         * CryptoConvert.cs: Updated to latest version. Fix issue with 
17753         incomplete key pairs (#57941).
17754
17755 2004-05-01  Todd Berman  <tberman@sevenl.net>
17756
17757         * driver.cs: Remove '.' from path_chars, now System.* loads properly
17758         from the GAC
17759
17760 2004-04-30  Jackson Harper  <jackson@ximian.com>
17761
17762         * codegen.cs: Open keys readonly.
17763         
17764 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17765
17766         * typemanager.cs: don't report cyclic struct layout when a struct
17767         contains 2 or more fields of the same type. Failed for Pango.AttrShape
17768         which has 2 Pango.Rectangle fields.
17769
17770 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17771
17772         * expression.cs: Handle IntPtr comparisons with IL code
17773         rather than a method call.
17774
17775 2004-04-29  Martin Baulig  <martin@ximian.com>
17776
17777         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
17778         the list of PropertyInfo's in class hierarchy and find the
17779         accessor.  Fixes #56013.
17780
17781 2004-04-29  Martin Baulig  <martin@ximian.com>
17782
17783         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17784
17785 2004-04-29  Martin Baulig  <martin@ximian.com>
17786
17787         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17788
17789         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17790
17791 2004-04-29  Martin Baulig  <martin@ximian.com>
17792
17793         * class.cs (ConstructorInitializer.Resolve): Check whether the
17794         parent .ctor is accessible.  Fixes #52146.
17795
17796 2004-04-29  Martin Baulig  <martin@ximian.com>
17797
17798         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17799
17800         * statement.cs (Using.EmitLocalVariableDecls): Use
17801         TypeManager.idisposable_type, not typeof (IDisposable).
17802         (Foreach.EmitCollectionForeach): Added support for valuetypes.
17803
17804 2004-04-29  Martin Baulig  <martin@ximian.com>
17805
17806         * class.cs (Event.Define): Don't emit the field and don't set
17807         RTSpecialName and SpecialName for events on interfaces.  Fixes
17808         #57703. 
17809
17810 2004-04-29  Raja R Harinath  <rharinath@novell.com>
17811
17812         Refactor Attribute.ApplyAttributes.
17813         * attribute.cs (Attributable): New base class for objects that can
17814         have Attributes applied on them.
17815         (Attribute): Make AttributeUsage fields public.
17816         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17817         (Attribute.IsInternalCall): New property.
17818         (Attribute.UsageAttr): Convert to a public read-only property.
17819         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17820         (Attribute.ResolveType, Attribute.Resolve)
17821         (Attribute.ScanForIndexerName): Update to reflect changes.
17822         (Attribute.CheckAttributeTarget): Re-format.
17823         (Attribute.ApplyAttributes): Refactor, to various
17824         Attributable.ApplyAttributeBuilder methods.
17825         * decl.cs (MemberCore): Make Attributable.
17826         * class.cs (Accessor): Make Attributable.
17827         (MethodData.ApplyAttributes): Use proper attribute types, not
17828         attribute names.
17829         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17830         (TypeContainer.ApplyAttributeBuilder)
17831         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17832         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
17833         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17834         (Operator.ApplyAttributeBuilder): New factored-out methods.
17835         * const.cs (Const.ApplyAttributeBuilder): Likewise.
17836         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17837         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17838         * parameter.cs (ParameterBase): New Attributable base class
17839         that can also represent Return types.
17840         (Parameter): Update to the changes.
17841
17842 2004-04-29  Jackson Harper  <jackson@ximian.com>
17843
17844         * driver.cs: Prefer the corlib system version when looking for
17845         assemblies in the GAC. This is still a hack, but its a better hack
17846         now.
17847         
17848 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
17849
17850         * decl.cs, enum.cs: Improved error 3005 reporting.
17851   
17852         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17853         (related_symbols): New private member for list of symbols
17854         related to reported error/warning.
17855         
17856         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17857
17858 2004-04-29  Martin Baulig  <martin@ximian.com>
17859
17860         * ecore.cs (Expression.Constantify): If we're an enum and
17861         TypeManager.TypeToCoreType() doesn't give us another type, use
17862         t.UnderlyingSystemType.  Fixes #56178.  
17863
17864 2004-04-29  Martin Baulig  <martin@ximian.com>
17865
17866         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17867         interfaces and for each interface, only add members directly
17868         declared in that interface.  Fixes #53255.
17869
17870 2004-04-28  Martin Baulig  <martin@ximian.com>
17871
17872         * expression.cs (ConditionalLogicalOperator): Use a temporary
17873         variable for `left' to avoid that we evaluate it more than once;
17874         bug #52588.
17875
17876 2004-04-28  Martin Baulig  <martin@ximian.com>
17877
17878         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17879         `void[]' (CS1547).
17880
17881 2004-04-28  Martin Baulig  <martin@ximian.com>
17882
17883         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17884         void (CS1547).
17885
17886         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17887         whether the type is not void (CS1547).
17888
17889 2004-04-28  Martin Baulig  <martin@ximian.com>
17890
17891         * expression.cs (Unary.DoResolveLValue): Override this and report
17892         CS0131 for anything but Operator.Indirection.
17893
17894 2004-04-28  Martin Baulig  <martin@ximian.com>
17895
17896         Committing a patch from Ben Maurer; see bug #50820.
17897
17898         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17899         check for classes.
17900
17901         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17902         classes.        
17903
17904 2004-04-28  Martin Baulig  <martin@ximian.com>
17905
17906         Committing a patch from Ben Maurer; see bug #50820.
17907
17908         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17909         check for classes.
17910
17911         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17912         classes.        
17913
17914 2004-04-28  Martin Baulig  <martin@ximian.com>
17915
17916         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17917         (Block.AddLabel): Call DoLookupLabel() to only search in the
17918         current block.
17919
17920 2004-04-28  Martin Baulig  <martin@ximian.com>
17921
17922         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17923         comparing StringConstants and NullLiterals in Equality and Inequality.
17924
17925 2004-04-28  Jackson Harper  <jackson@ximian.com>
17926
17927         * driver.cs: Attempt to load referenced assemblies from the
17928         GAC. This is the quick and dirty version of this method that
17929         doesnt take into account versions and just takes the first
17930         canidate found. Will be good enough for now as we will not have more
17931         then one version installed into the GAC until I update this method.
17932
17933 2004-04-28  Martin Baulig  <martin@ximian.com>
17934
17935         * typemanager.cs (TypeManager.CheckStructCycles): New public
17936         static method to check for cycles in the struct layout.
17937
17938         * rootcontext.cs (RootContext.PopulateTypes): Call
17939         TypeManager.CheckStructCycles() for each TypeContainer.
17940         [Note: We only need to visit each type once.]
17941
17942 2004-04-28  Martin Baulig  <martin@ximian.com>
17943
17944         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17945
17946         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17947         success and added `out object value'.  Use a `bool resolved' field
17948         to check whether we've already been called rather than
17949         `ConstantValue != null' since this breaks for NullLiterals.
17950
17951 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17952
17953         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17954         setting of this flag, since the 'set' method may be non-public.
17955
17956 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17957
17958         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17959         check on current_vector.Block.
17960
17961 2004-04-27  Martin Baulig  <martin@ximian.com>
17962
17963         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17964         a field initializer.  Fixes #56459.
17965
17966 2004-04-27  Martin Baulig  <martin@ximian.com>
17967
17968         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17969         we're not attempting to use an indexer.  Fixes #52154.
17970
17971 2004-04-27  Martin Baulig  <martin@ximian.com>
17972
17973         * statement.cs (Return): Don't create a return label if we don't
17974         need it; reverts my change from January 20th.  Thanks to Ben
17975         Maurer for this.
17976
17977 2004-04-27  Martin Baulig  <martin@ximian.com>
17978
17979         According to the spec, `goto' can only leave a nested scope, but
17980         never enter it.
17981
17982         * statement.cs (Block.LookupLabel): Only lookup in the current
17983         block, don't recurse into parent or child blocks.
17984         (Block.AddLabel): Check in parent and child blocks, report
17985         CS0140/CS0158 if we find a duplicate.
17986         (Block): Removed this indexer for label lookups.
17987         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17988         this already does the error reporting for us.
17989
17990         * flowanalysis.cs
17991         (FlowBranching.UsageVector.Block): New public variable; may be null.
17992         (FlowBranching.CreateSibling): Added `Block' argument.
17993         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17994         label for the target of a `goto' and check whether we're not
17995         leaving a `finally'.
17996
17997 2004-04-27  Martin Baulig  <martin@ximian.com>
17998
17999         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
18000         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
18001         just for returns).
18002
18003 2004-04-27  Martin Baulig  <martin@ximian.com>
18004
18005         * statement.cs (Block.AddLabel): Also check for implicit blocks
18006         and added a CS0158 check.
18007
18008 2004-04-27  Martin Baulig  <martin@ximian.com>
18009
18010         * flowanalysis.cs (FlowBranchingLoop): New class.
18011         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
18012         UsageVector's instead of an ArrayList.
18013         (FlowBranching.Label): Likewise.
18014         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
18015         (FlowBranching.AddBreakVector): New method.
18016
18017 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * attribute.cs: Small regression fix: only convert the type if we
18020         the type is different, fixes System.Drawing build.
18021
18022 2004-04-27  Martin Baulig  <martin@ximian.com>
18023
18024         * attribute.cs (Attribute.Resolve): If we have a constant value
18025         for a named field or property, implicity convert it to the correct
18026         type.
18027
18028 2004-04-27  Raja R Harinath  <rharinath@novell.com>
18029
18030         * statement.cs (Block.Block): Implicit blocks share
18031         'child_variable_names' fields with parent blocks.
18032         (Block.AddChildVariableNames): Remove.
18033         (Block.AddVariable): Mark variable as "used by a child block" in
18034         every surrounding block.
18035         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
18036         been used in a child block, complain about violation of "Invariant
18037         meaning in blocks" rule.
18038         * cs-parser.jay (declare_local_variables): Don't use
18039         AddChildVariableNames.
18040         (foreach_statement): Don't create an implicit block: 'foreach'
18041         introduces a scope.
18042
18043 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * convert.cs (ImplicitNumericConversion): 0 is also positive when
18046         converting from 0L to ulong.  Fixes 57522.
18047
18048 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
18049
18050         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
18051         derived class hides via 'new' keyword field from base class (test-242.cs).
18052         TODO: Handle this in the more general way.
18053         
18054         * class.cs (CheckBase): Ditto.
18055
18056 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
18057
18058         * decl.cs (caching_flags): New member for storing cached values
18059         as bit flags.
18060         (MemberCore.Flags): New enum where bit flags for caching_flags
18061         are defined.
18062         (MemberCore.cls_compliance): Moved to caching_flags.
18063         (DeclSpace.Created): Moved to caching_flags.
18064
18065         * class.cs: Use caching_flags instead of DeclSpace.Created
18066         
18067 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
18070         if we are only a derived class, not a nested class.
18071
18072         * typemanager.cs: Same as above, but do this at the MemberLookup
18073         level (used by field and methods, properties are handled in
18074         PropertyExpr).   Allow for the qualified access if we are a nested
18075         method. 
18076
18077 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
18078
18079         * class.cs: Refactoring.
18080         (IMethodData): New inteface; Holds links to parent members
18081         to avoid member duplication (reduced memory allocation).
18082         (Method): Implemented IMethodData interface.
18083         (PropertyBase): New inner classes for get/set methods.
18084         (PropertyBase.PropertyMethod): Implemented IMethodData interface
18085         (Event): New inner classes for add/remove methods.
18086         (Event.DelegateMethod): Implemented IMethodData interface.
18087
18088         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
18089         EmitContext (related to class.cs refactoring).
18090
18091 2004-04-21  Raja R Harinath  <rharinath@novell.com>
18092
18093         * delegate.cs (Delegate.VerifyApplicability): If the number of
18094         arguments are the same as the number of parameters, first try to
18095         verify applicability ignoring  any 'params' modifier on the last
18096         parameter.
18097         Fixes #56442.
18098
18099 2004-04-16  Raja R Harinath  <rharinath@novell.com>
18100
18101         * class.cs (TypeContainer.AddIndexer): Use
18102         'ExplicitInterfaceName' to determine if interface name was
18103         explicitly specified.  'InterfaceType' is not initialized at this time.
18104         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
18105         Indexers array is already in the required order.  Initialize
18106         'IndexerName' only if there are normal indexers.
18107         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
18108         (TypeContainer.Emit): Emit DefaultMember attribute only if
18109         IndexerName is initialized.
18110         Fixes #56300.
18111
18112 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
18113
18114         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
18115         Fixes #57007
18116
18117 2004-04-15  Raja R Harinath  <rharinath@novell.com>
18118
18119         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
18120         attributes.
18121         Fix for #56456.
18122
18123         * attribute.cs (Attribute.Resolve): Check for duplicate named
18124         attributes.
18125         Fix for #56463.
18126
18127 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
18128
18129         * iterators.cs (MarkYield): track whether we are in an exception,
18130         and generate code accordingly.  Use a temporary value to store the
18131         result for our state.
18132
18133         I had ignored a bit the interaction of try/catch with iterators
18134         since their behavior was not entirely obvious, but now it is
18135         possible to verify that our behavior is the same as MS .NET 2.0
18136
18137         Fixes 54814
18138
18139 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * iterators.cs: Avoid creating temporaries if there is no work to
18142         do. 
18143
18144         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
18145         Enumerations, use TypeManager.EnumToUnderlying and call
18146         recursively. 
18147
18148         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
18149         bug #57013
18150
18151         (This.Emit): Use EmitContext.EmitThis to emit our
18152         instance variable.
18153
18154         (This.EmitAssign): Ditto.
18155
18156         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
18157         codepaths, we will move all the functionality into
18158         Mono.CSharp.This 
18159
18160         (FieldExpr.EmitAssign): Ditto.
18161
18162         This fixes several hidden bugs that I uncovered while doing a code
18163         review of this today.
18164
18165         * codegen.cs (EmitThis): reworked so the semantics are more clear
18166         and also support value types "this" instances.
18167
18168         * iterators.cs: Changed so that for iterators in value types, we
18169         do not pass the value type as a parameter.  
18170
18171         Initialization of the enumerator helpers is now done in the caller
18172         instead of passing the parameters to the constructors and having
18173         the constructor set the fields.
18174
18175         The fields have now `assembly' visibility instead of private.
18176
18177 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
18178
18179         * expression.cs (Argument.Resolve): Check if fields passed as ref
18180         or out are contained in a MarshalByRefObject.
18181
18182         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
18183         another compiler type.
18184
18185 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
18186
18187         * class.cs (Indexer.Define): use the new name checking method.
18188         Also, return false on an error.
18189         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
18190         (is_identifier_[start/part]_character): make static.
18191
18192 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * expression.cs (Binary.ResolveOperator): Do no append strings
18195         twice: since we can be invoked more than once (array evaluation)
18196         on the same concatenation, take care of this here.  Based on a fix
18197         from Ben (bug #56454)
18198
18199 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
18200
18201         * codegen.cs: Fix another case where CS1548 must be reported (when 
18202         delay-sign isn't specified and no private is available #56564). Fix
18203         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
18204         error when MCS is used on the MS runtime and we need to delay-sign 
18205         (which seems unsupported by AssemblyBuilder - see #56621).
18206
18207 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
18208
18209         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
18210         (TypeManager.ComputeNamespaces): Faster implementation for
18211         Microsoft runtime.
18212
18213         * compiler.csproj: Updated AssemblyName to mcs.
18214
18215 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
18216
18217         * rootcontext.cs: Add new types to the boot resolution.
18218
18219         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
18220         MulticastDelegate is not allowed.
18221
18222         * typemanager.cs: Add new types to lookup: System.TypedReference
18223         and ArgIterator.
18224
18225         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
18226         check for TypedReference or ArgIterator, they are not allowed. 
18227
18228         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
18229         makes us properly catch 1510 in some conditions (see bug 56016 for
18230         details). 
18231
18232 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
18233
18234         * CryptoConvert.cs: update from corlib version
18235         with endian fixes.
18236
18237 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * class.cs (Indexer.Define): Check indexername declaration
18240
18241 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
18242
18243         * attribute.cs (IsClsCompliant): Fixed problem with handling
18244         all three states (compliant, not-compliant, undetected).
18245
18246 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
18247
18248         * attribute.cs (Attribute): Location is now public.
18249         (Resolve): Store resolved arguments (pos_values) in attribute class.
18250         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
18251         (GetClsCompliantAttributeValue): New method that gets
18252         CLSCompliantAttribute value.
18253         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
18254         if exists else null.
18255         (AttributeTester): New class for CLS-Compliant verification routines.
18256
18257         * class.cs (Emit): Add CLS-Compliant verification.
18258         (Method.GetSignatureForError): Implemented.
18259         (Constructor.GetSignatureForError): Implemented
18260         (Constructor.HasCompliantArgs): Returns if constructor has
18261         CLS-Compliant arguments.
18262         (Constructor.Emit): Override.
18263         (Construcor.IsIdentifierClsCompliant): New method; For constructors
18264         is needed to test only parameters.
18265         (FieldBase.GetSignatureForError): Implemented.
18266         (TypeContainer): New member for storing base interfaces.
18267         (TypeContainer.FindMembers): Search in base interfaces too.
18268
18269         * codegen.cs (GetClsComplianceAttribute): New method that gets
18270         assembly or module CLSCompliantAttribute value.
18271         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
18272         for assembly.
18273         (ModuleClass.Emit): Add error 3012 test.
18274
18275         * const.cs (Emit): Override and call base for CLS-Compliant tests.
18276
18277         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
18278         state for all decl types.
18279         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
18280         if CLS-Compliant tests are required.
18281         (IsClsCompliaceRequired): New method. Analyze whether code
18282         must be CLS-Compliant.
18283         (IsExposedFromAssembly): New method. Returns true when MemberCore
18284         is exposed from assembly.
18285         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
18286         value or gets cached value.
18287         (HasClsCompliantAttribute): New method. Returns true if MemberCore
18288         is explicitly marked with CLSCompliantAttribute.
18289         (IsIdentifierClsCompliant): New abstract method. This method is
18290         used to testing error 3005.
18291         (IsIdentifierAndParamClsCompliant): New method. Common helper method
18292         for identifier and parameters CLS-Compliant testing.
18293         (VerifyClsCompliance): New method. The main virtual method for
18294         CLS-Compliant verifications.
18295         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
18296         null. I don't know why is null (too many public members !).
18297         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
18298         and get value of first CLSCompliantAttribute that found.
18299
18300         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
18301         (VerifyClsCompliance): Override and add extra tests.
18302
18303         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
18304         clscheck- disable CLS-Compliant verification event if assembly is has
18305         CLSCompliantAttribute(true).
18306
18307         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18308         ApllyAttribute is now called in emit section as in the other cases.
18309         Possible future Emit integration.
18310         (IsIdentifierClsCompliant): New override.
18311         (VerifyClsCompliance): New override.
18312         (GetEnumeratorName): Returns full enum name.
18313
18314         * parameter.cs (GetSignatureForError): Implemented.
18315
18316         * report.cs (WarningData): New struct for Warning message information.
18317         (LocationOfPreviousError): New method.
18318         (Warning): New method. Reports warning based on the warning table.
18319         (Error_T): New method. Reports error based on the error table.
18320
18321         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18322         verifications are done here.
18323
18324         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18325
18326         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18327         CLSCompliantAttribute.
18328         (all_imported_types): New member holds all imported types from other
18329         assemblies.
18330         (LoadAllImportedTypes): New method fills static table with exported types
18331         from all referenced assemblies.
18332         (Modules): New property returns all assembly modules.
18333
18334 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18337         throwing a parser error.
18338
18339         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18340         which removes the hardcoded get_/set_ prefixes for properties, as
18341         IL allows for the properties to be named something else.  
18342
18343         Bug #56013
18344
18345         * expression.cs: Do not override operand before we know if it is
18346         non-null.  Fix 56207
18347
18348 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18349
18350         * typemanager.cs: support for pinned variables.
18351
18352 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18353
18354         * decl.cs, typemanager.cs: Avoid using an arraylist
18355         as a buffer if there is only one result set.
18356
18357 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
18358
18359         * expression.cs: Make sure you cant call a static method
18360         with an instance expression, bug #56174.
18361
18362 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
18363
18364         * class.cs (IsDuplicateImplementation): Improve error reporting to
18365         flag 663 (method only differs in parameter modifier).
18366
18367         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18368         in preprocessor directives.
18369
18370         * location.cs (LookupFile): Allow for the empty path.
18371
18372         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
18373         better approach for some of that patch, but its failing with the
18374         CharSet enumeration.  For now try/catch will do.
18375
18376         * typemanager.cs: Do not crash if a struct does not have fields.
18377         Fixes 56150.
18378
18379 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18380
18381         * expression.cs: cs0213, cant fix a fixed expression.
18382         fixes 50231.
18383
18384 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18385
18386         * cs-parser.jay: detect invalid embeded statements gracefully.
18387         bug #51113.
18388
18389 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18390
18391         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18392         As a regex:
18393         s/
18394         the invocation type may not be a subclass of the tye of the item/
18395         The type of the item must be a subclass of the invocation item.
18396         /g
18397
18398         Fixes bug #50820.
18399
18400 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
18401
18402         * attribute.cs: Added methods to get a string and a bool from an
18403         attribute. Required to information from AssemblyKeyFileAttribute,
18404         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18405         * codegen.cs: Modified AssemblyName creation to include support for
18406         strongnames. Catch additional exceptions to report them as CS1548.
18407         * compiler.csproj: Updated include CryptoConvert.cs.
18408         * compiler.csproj.user: Removed file - user specific configuration.
18409         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
18410         Mono.Security assembly. The original class is maintained and tested in
18411         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18412         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18413         like CSC 8.0 (C# v2) supports.
18414         * Makefile: Added CryptoConvert.cs to mcs sources.
18415         * rootcontext.cs: Added new options for strongnames.
18416
18417 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
18418
18419         * driver.cs: For --expect-error, report error code `2'
18420         if the program compiled with no errors, error code `1' if
18421         it compiled with an error other than the one expected.
18422
18423 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
18424
18425         * compiler.csproj: Updated for Visual Studio .NET 2003.
18426         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18427         * compiler.sln: Updated for Visual Studio .NET 2003.
18428
18429 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
18430
18431         * expression.cs: Fix bug #47234. We basically need to apply the
18432         rule that we prefer the conversion of null to a reference type
18433         when faced with a conversion to 'object' (csc behaviour).
18434
18435 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18436
18437         * statement.cs: Shorter form for foreach, eliminates
18438         a local variable. r=Martin.
18439
18440 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18441
18442         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18443         checks if we can use brtrue/brfalse to test for 0.
18444         * expression.cs: use the above in the test for using brtrue/brfalse.
18445         cleanup code a bit.
18446
18447 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18448
18449         * expression.cs: Rewrite string concat stuff. Benefits:
18450
18451         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18452         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18453         rather than a concat chain.
18454
18455         * typemanager.cs: Add lookups for more concat overloads.
18456
18457 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18458
18459         * expression.cs: Emit shorter il code for array init.
18460
18461         newarr
18462         dup
18463         // set 1
18464
18465         // set 2
18466
18467         newarr
18468         stloc.x
18469
18470         ldloc.x
18471         // set 1
18472
18473         ldloc.x
18474         // set 2
18475
18476 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
18477
18478         * statement.cs: Before, two switch blocks would be merged if the
18479         total size of the blocks (end_item - begin_item + 1) was less than
18480         two times the combined sizes of the blocks.
18481
18482         Now, it will only merge if after the merge at least half of the
18483         slots are filled.
18484
18485         fixes 55885.
18486
18487 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
18488
18489         * class.cs : csc build fix for GetMethods(). See bug #52503.
18490
18491 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
18492
18493         * expression.cs: Make sure fp comparisons work with NaN.
18494         This fixes bug #54303. Mig approved this patch a long
18495         time ago, but we were not able to test b/c the runtime
18496         had a related bug.
18497
18498 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
18501
18502 2004-03-19  Martin Baulig  <martin@ximian.com>
18503
18504         * class.cs (MemberCore.IsDuplicateImplementation): Report the
18505         error here and not in our caller.
18506
18507 2004-03-19  Martin Baulig  <martin@ximian.com>
18508
18509         * interface.cs: Completely killed this file.
18510         (Interface): We're now a TypeContainer and live in class.cs.
18511
18512         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18513         argument; we're now also called for interfaces.
18514         (TypeContainer.DefineMembers): Allow this method being called
18515         multiple times.
18516         (TypeContainer.GetMethods): New public method; formerly known as
18517         Interface.GetMethod().  This is used by PendingImplementation.
18518         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18519         it's now private and non-static.
18520         (Interface): Moved this here; it's now implemented similar to
18521         Class and Struct.
18522         (Method, Property, Event, Indexer): Added `bool is_interface'
18523         argument to their .ctor's.
18524         (MemberBase.IsInterface): New public field.
18525
18526         * cs-parser.jay: Create normal Method, Property, Event, Indexer
18527         instances instead of InterfaceMethod, InterfaceProperty, etc.
18528         (opt_interface_base): Removed; we now use `opt_class_base' instead.
18529         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18530
18531 2004-03-19  Martin Baulig  <martin@ximian.com>
18532
18533         * class.cs (MethodCore.IsDuplicateImplementation): New private
18534         method which does the CS0111 checking.
18535         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18536         Use IsDuplicateImplementation().
18537
18538 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18539
18540         * decl.cs (FindMemberToOverride): New method to find the correct
18541         method or property to override in the base class.
18542         * class.cs
18543             - Make Method/Property use the above method to find the
18544               version in the base class.
18545             - Remove the InheritableMemberSignatureCompare as it is now
18546               dead code.
18547
18548         This patch makes large code bases much faster to compile, as it is
18549         O(n) rather than O(n^2) to do this validation.
18550
18551         Also, it fixes bug 52458 which is that nested classes are not
18552         taken into account when finding the base class member.
18553
18554         Reviewed/Approved by Martin.
18555
18556 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
18557
18558         * interface.cs: In all interface classes removed redundant
18559         member initialization.
18560
18561 2004-03-16  Martin Baulig  <martin@ximian.com>
18562
18563         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18564
18565 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * decl.cs (DefineTypeAndParents): New helper method to define a
18568         type's containers before the type itself is defined;  This is a
18569         bug exposed by the recent changes to Windows.Forms when an
18570         implemented interface was defined inside a class that had not been
18571         built yet.   
18572
18573         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18574
18575         (Check): Loop correctly to report errors modifiers
18576         (UNSAFE was not in the loop, since it was the same as TOP).
18577
18578         * interface.cs: Every interface member now takes a ModFlags,
18579         instead of a "is_new" bool, which we set on the base MemberCore. 
18580
18581         Every place where we called "UnsafeOk" in the interface, now we
18582         call the proper member (InterfaceMethod.UnsafeOK) instead to get
18583         the unsafe settings from the member declaration instead of the
18584         container interface. 
18585
18586         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
18587
18588         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18589         `set_indexer_name' to the pending bits (one per type).
18590
18591         We fixed a bug today that was picking the wrong method to
18592         override, since for properties the existing InterfaceMethod code
18593         basically ignored the method name.  Now we make sure that the
18594         method name is one of the valid indexer names.
18595
18596 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
18597  
18598         * support.cs (SeekableStreamReader): Keep track of stream byte
18599         positions and don't mix them with character offsets to the buffer.
18600
18601         Patch from Gustavo Giráldez
18602
18603 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
18604
18605         * interface.cs (InterfaceSetGetBase): Removed double member
18606         initialization, base class does it as well.
18607
18608 2004-03-13  Martin Baulig  <martin@ximian.com>
18609
18610         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18611         when compiling corlib.
18612
18613 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * convert.cs (ExplicitConversion): We were reporting an error on
18616         certain conversions (object_type source to a value type, when the
18617         expression was `null') before we had a chance to pass it through
18618         the user defined conversions.
18619
18620         * driver.cs: Replace / and \ in resource specifications to dots.
18621         Fixes 50752
18622
18623         * class.cs: Add check for duplicate operators.  Fixes 52477
18624
18625 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
18626
18627         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18628         that are in the middle of the statements, not only at the end.
18629         Fixes #54987
18630
18631         * class.cs (TypeContainer.AddField): No longer set the
18632         `HaveStaticConstructor' flag, now we call it
18633         `UserDefineStaticConstructor' to diferentiate the slightly
18634         semantic difference.
18635
18636         The situation is that we were not adding BeforeFieldInit (from
18637         Modifiers.TypeAttr) to classes that could have it.
18638         BeforeFieldInit should be set to classes that have no static
18639         constructor. 
18640
18641         See:
18642
18643         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18644
18645         And most importantly Zoltan's comment:
18646
18647         http://bugzilla.ximian.com/show_bug.cgi?id=44229
18648
18649         "I think beforefieldinit means 'it's ok to initialize the type sometime 
18650          before its static fields are used', i.e. initialization does not need
18651          to be triggered by the first access to the type. Setting this flag
18652          helps the JIT to compile better code, since it can run the static
18653          constructor at JIT time, and does not need to generate code to call it
18654          (possibly lots of times) at runtime. Unfortunately, mcs does not set
18655          this flag for lots of classes like String. 
18656          
18657          csc sets this flag if the type does not have an explicit static 
18658          constructor. The reasoning seems to be that if there are only static
18659          initalizers for a type, and no static constructor, then the programmer
18660          does not care when this initialization happens, so beforefieldinit
18661          can be used.
18662          
18663          This bug prevents the AOT compiler from being usable, since it 
18664          generates so many calls to mono_runtime_class_init that the AOT code
18665          is much slower than the JITted code. The JITted code is faster, 
18666          because it does not generate these calls if the vtable is type is
18667          already initialized, which is true in the majority of cases. But the
18668          AOT compiler can't do this."
18669
18670 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
18671
18672         * class.cs (MethodData.Emit): Refactor the code so symbolic
18673         information is generated for destructors;  For some reasons we
18674         were taking a code path that did not generate symbolic information
18675         before. 
18676
18677 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18678
18679         * class.cs: Create a Constructor.CheckBase method that
18680         takes care of all validation type code. The method
18681         contains some code that was moved from Define.
18682
18683         It also includes new code that checks for duplicate ctors.
18684         This fixes bug #55148.
18685
18686 2004-03-09  Joshua Tauberer <tauberer@for.net>
18687
18688         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18689         a { ... }-style array creation invokes EmitStaticInitializers
18690         which is not good for reference-type arrays.  String, decimal
18691         and now null constants (NullCast) are not counted toward
18692         static initializers.
18693
18694 2004-03-05  Martin Baulig  <martin@ximian.com>
18695
18696         * location.cs (SourceFile.HasLineDirective): New public field;
18697         specifies whether the file contains or is referenced by a "#line"
18698         directive.
18699         (Location.DefineSymbolDocuments): Ignore source files which
18700         either contain or are referenced by a "#line" directive.        
18701
18702 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
18703
18704         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18705         direct access to our parent, so check the method inline there.
18706
18707 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18708
18709         * expression.cs (Invocation.EmitCall): Miguel's last commit
18710         caused a regression. If you had:
18711
18712             T t = null;
18713             t.Foo ();
18714
18715         In Foo the implict this would be null.
18716
18717 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * expression.cs (Invocation.EmitCall): If the method is not
18720         virtual, do not emit a CallVirt to it, use Call.
18721
18722         * typemanager.cs (GetFullNameSignature): Improve the method to
18723         cope with ".ctor" and replace it with the type name.
18724
18725         * class.cs (ConstructorInitializer.Resolve): Now the method takes
18726         as an argument the ConstructorBuilder where it is being defined,
18727         to catch the recursive constructor invocations.
18728
18729 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18732         routines to check if a type is an enumerable/enumerator allow
18733         classes that implement the IEnumerable or IEnumerator interfaces.
18734
18735         * class.cs (Property, Operator): Implement IIteratorContainer, and
18736         implement SetYields.
18737
18738         (Property.Define): Do the block swapping for get_methods in the
18739         context of iterators.   We need to check if Properties also
18740         include indexers or not.
18741
18742         (Operator): Assign the Block before invoking the
18743         OperatorMethod.Define, so we can trigger the Iterator code
18744         replacement. 
18745
18746         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
18747         Property and Operator classes are not created when we parse the
18748         declarator but until we have the block completed, so we use a
18749         singleton SimpleIteratorContainer.Simple to flag whether the
18750         SetYields has been invoked.
18751
18752         We propagate this setting then to the Property or the Operator to
18753         allow the `yield' to function.
18754
18755 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
18756
18757         * codegen.cs: Implemented attribute support for modules.
18758         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18759         Assembly/Module functionality.
18760
18761         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18762         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18763         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18764
18765 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
18766
18767         * interface.cs (FindMembers): The operation is performed on all base
18768         interfaces and not only on the first. It is required for future CLS Compliance patch.
18769
18770 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18771
18772         * statement.cs, codegen.cs:
18773         This patch deals with patterns such as:
18774
18775         public class List : IEnumerable {
18776
18777                 public MyEnumerator GetEnumerator () {
18778                         return new MyEnumerator(this);
18779                 }
18780
18781                 IEnumerator IEnumerable.GetEnumerator () {
18782                         ...
18783                 }
18784                 
18785                 public struct MyEnumerator : IEnumerator {
18786                         ...
18787                 }
18788         }
18789
18790         Before, there were a few things we did wrong:
18791         1) we would emit callvirt on a struct, which is illegal
18792         2) we emited ldarg when we needed to emit ldarga
18793         3) we would mistakenly call the interface methods on an enumerator
18794         type that derived from IEnumerator and was in another assembly. For example:
18795
18796         public class MyEnumerator : IEnumerator
18797
18798         Would have the interface methods called, even if there were public impls of the
18799         method. In a struct, this lead to invalid IL code.
18800
18801 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
18802
18803         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18804           renamed to Emit.
18805
18806         * delegate.cs (Define): Fixed crash when delegate type is undefined.
18807
18808 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * cs-parser.jay: Fix small regression: we were not testing V2
18811         compiler features correctly.
18812
18813         * interface.cs: If the emit context is null, then create one
18814
18815 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
18816
18817         * decl.cs (GetSignatureForError): New virtual method to get full name
18818           for error messages.
18819
18820         * attribute.cs (IAttributeSupport): New interface for attribute setting.
18821           Now it is possible to rewrite ApplyAttributes method to be less if/else.
18822
18823         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18824           Duplicated members and code in these classes has been removed.
18825           Better encapsulation in these classes.
18826
18827 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
18828
18829         * assign.cs (Assign.DoResolve): When dealing with compound
18830         assignments, there is a new rule in ECMA C# 2.4 (might have been
18831         there before, but it is documented here) that states that in:
18832
18833         a op= b;
18834
18835         If b is of type int, and the `op' is a shift-operator, then the
18836         above is evaluated as:
18837
18838         a = (int) a op b 
18839
18840         * expression.cs (Binary.ResolveOperator): Instead of testing for
18841         int/uint/long/ulong, try to implicitly convert to any of those
18842         types and use that in pointer arithmetic.
18843
18844         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18845         method to print information for from the type, not from the
18846         null-method we were given.
18847
18848 2004-02-01  Duncan Mak  <duncan@ximian.com>
18849
18850         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18851         parsing for cmd, fixes bug #53694.
18852
18853 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
18854
18855         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18856         in the member name duplication tests. Property and operator name duplication
18857         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18858
18859 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18860
18861         * interface.cs (PopulateMethod): Fixed crash when interface method
18862         returns not existing type (error test cs0246-3.cs).
18863
18864 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18865
18866         * cs-parser.jay (interface_accessors): Re-write actions to also
18867         store attributes attached to get and set methods. Fix spelling
18868         while at it.
18869
18870         (inteface_property_declaration): Modify accordingly.
18871
18872         (InterfaceAccessorInfo): New helper class to store information to pass
18873         around between rules that use interface_accessors.
18874
18875         * interface.cs (Emit): Apply attributes on the get and set
18876         accessors of properties and indexers too.
18877
18878         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18879         right MethodBuilder when applying attributes to the get and set accessors.
18880
18881 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18882
18883         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18884
18885 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18886
18887         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18888
18889 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18890
18891         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18892         changes that treat `yield' specially when present before `break'
18893         or `return' tokens.
18894
18895         * cs-tokenizer.cs: yield is no longer a keyword.
18896
18897 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18898
18899         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18900         setting for default constructors.
18901         For default constructors are almost every time set wrong Modifier. The
18902         generated IL code has been alright. But inside mcs this values was
18903         wrong and this was reason why several of my CLS Compliance tests
18904         failed.
18905
18906 2004-01-22  Martin Baulig  <martin@ximian.com>
18907
18908         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18909         not a QualifiedIdentifier.  This is what `type_name_expression'
18910         was previously doing.
18911         (type_name_expression): Removed; the code is now in
18912         `namespace_or_type_name'.
18913         (qualified_identifier): Removed, use `namespace_or_type_name'
18914         instead.
18915         (QualifiedIdentifier): Removed this class.      
18916
18917 2004-01-22  Martin Baulig  <martin@ximian.com>
18918
18919         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18920         not a string as alias name.
18921
18922 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18925         #52730 bug, and instead compute correctly the need to use a
18926         temporary variable when requesting an address based on the
18927         static/instace modified of the field and the constructor.
18928  
18929 2004-01-21  Martin Baulig  <martin@ximian.com>
18930
18931         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18932         class and namespace before looking up aliases.  Fixes #52517.
18933
18934 2004-01-21  Martin Baulig  <martin@ximian.com>
18935
18936         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18937         assinged in a 'try'; fixes exception4.cs.
18938
18939 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18940         * class.cs : Implemented parameter-less constructor for TypeContainer
18941
18942         * decl.cs: Attributes are now stored here. New property OptAttributes
18943
18944         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18945
18946         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18947
18948 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18949
18950         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18951           (CSharpSignature): New method for indexer and property signature.
18952
18953 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18954
18955         * pending.cs (IsVirtualFilter): Faster implementation.
18956
18957 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18958
18959         * typemanager.cs: Avoid inclusion of same assembly more than once.
18960
18961 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18962
18963         * cs-parser.jay: Fixed problem where the last assembly attribute
18964           has been applied also to following declaration (class, struct, etc.)
18965           
18966 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18967
18968         * class.cs: Added error CS0538, CS0539 reporting.
18969         Fixed crash on Microsoft runtime when field type is void.
18970
18971         * cs-parser.jay: Added error CS0537 reporting.
18972
18973         * pending.cs: Added error CS0535 reporting.
18974         Improved error report for errors CS0536, CS0534.
18975
18976 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18977
18978         Merge a few bits from the Anonymous Method MCS tree.
18979
18980         * statement.cs (ToplevelBlock): New class for toplevel methods,
18981         will hold anonymous methods, lifted variables.
18982
18983         * cs-parser.jay: Create toplevel blocks for delegates and for
18984         regular blocks of code. 
18985
18986 2004-01-20  Martin Baulig  <martin@ximian.com>
18987
18988         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18989         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18990         and `NeedExplicitReturn'; added `IsLastStatement'.
18991         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18992         have a `ReturnLabel' or we're not unreachable.
18993
18994         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18995         child's reachability; don't just override ours with it.  Fixes
18996         #58058 (lluis's example).
18997         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18998         InFinally(), InLoop(), InSwitch() and
18999         BreakCrossesTryCatchBoundary() methods.
19000
19001         * statement.cs (Return): Do all error checking in Resolve().
19002         Unless we are the last statement in a top-level block, always
19003         create a return label and jump to it.
19004         (Break, Continue): Do all error checking in Resolve(); also make
19005         sure we aren't leaving a `finally'.
19006         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
19007         statement in a top-level block.
19008         (Block.Flags): Added `IsDestructor'.
19009         (Block.IsDestructor): New public property.
19010
19011 2004-01-20  Martin Baulig  <martin@ximian.com>
19012
19013         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
19014
19015 2004-01-20  Martin Baulig  <martin@ximian.com>
19016
19017         * statement.cs (Statement.ResolveUnreachable): New public method.
19018         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
19019         (Block.Resolve): Resolve unreachable statements.
19020
19021 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
19022
19023         * expression.cs: We need to fix the case where we do
19024         not have a temp variable here.
19025
19026         * assign.cs: Only expression compound assignments need
19027         temporary variables.
19028
19029 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
19030
19031         * flowanalysis.cs: Reduce memory allocation in a few ways:
19032           - A block with no variables should not allocate a bit
19033             vector for itself.
19034           - A method with no out parameters does not need any tracking
19035             for assignment of the parameters, so we need not allocate
19036             any data for it.
19037           - The arrays:
19038                 public readonly Type[] VariableTypes;
19039                 public readonly string[] VariableNames;
19040             Are redundant. The data is already stored in the variable
19041             map, so we need not allocate another array for it.
19042           - We need to add alot of checks for if (params | locals) == null
19043             due to the first two changes.
19044
19045 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
19046
19047         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
19048         implement IMemoryLocation, we store a copy on a local variable and
19049         take the address of it.  Patch from Benjamin Jemlich
19050
19051         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
19052         to use a special "type_name_expression" rule which reduces the
19053         number of "QualifiedIdentifier" classes created, and instead
19054         directly creates MemberAccess expressions.
19055
19056 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
19057
19058         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
19059         that fixes #52853.  Null literal assignment to ValueType
19060
19061         * class.cs (MethodData.Emit): Instead of checking the name of the
19062         method to determine if its a destructor, create a new derived
19063         class from Method called Destructor, and test for that.  
19064
19065         * cs-parser.jay: Create a Destructor object instead of a Method.  
19066
19067         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
19068
19069         Fixes: 52933
19070
19071 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
19072
19073         * expression.cs (Binary.ResolveOperator): Perform an implicit
19074         conversion from MethodGroups to their delegate types on the
19075         Addition operation.
19076
19077         * delegate.cs: Introduce a new class DelegateCreation that is the
19078         base class for `NewDelegate' and `ImplicitDelegateCreation',
19079         factor some code in here.
19080
19081         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
19082         conversion from MethodGroups to compatible delegate types. 
19083
19084         * ecore.cs (Expression.Resolve): Do not flag error 654
19085         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
19086         we allow conversions from MethodGroups to delegate types now.
19087
19088         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
19089         assignments in v2 either.
19090
19091 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
19092
19093         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
19094         static read-only fields in ctors.
19095
19096         Applied patch from Benjamin Jemlich 
19097
19098         * expression.cs (UnaryMutator): Avoid leaking local variables. 
19099
19100 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * cs-tokenizer.cs (IsCastToken): Allow the various native types
19103         here to return true, as they can be used like this:
19104
19105                 (XXX) int.MEMBER ()
19106
19107         Fixed 49836 and all the other dups
19108
19109 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
19110
19111         * driver.cs: Implement /win32res and /win32icon.
19112
19113 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * cs-parser.jay: Add a rule to improve error handling for the
19116         common mistake of placing modifiers after the type.
19117
19118 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
19119
19120         * cs-parser.jay (interface_event_declaration): Catch
19121         initialization of events on interfaces, and report cs0068
19122
19123         * cs-parser.jay (interface_event_declaration): Catch
19124         initialization of events. 
19125
19126         * ecore.cs: Better report missing constructors.
19127
19128         * expression.cs (Binary.ResolveOperator): My previous bug fix had
19129         the error reporting done in the wrong place.  Fix.
19130
19131         * expression.cs (Binary.ResolveOperator): Catch the 
19132         operator + (E x, E y) error earlier, and later allow for implicit
19133         conversions in operator +/- (E e, U x) from U to the underlying
19134         type of E.
19135
19136         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
19137         52596, if the container class is abstract, the default constructor
19138         is protected otherwise its public (before, we were always public).
19139
19140         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
19141         fixed statement.
19142
19143         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
19144         Jemlich that fixes bug #52597, MCS was generating invalid code for
19145         idisposable structs.   Thanks to Ben for following up with this
19146         bug as well.
19147
19148 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * driver.cs: Allow assemblies without code to be generated, fixes
19151         52230.
19152
19153 2004-01-07  Nick Drochak <ndrochak@gol.com>
19154
19155         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
19156
19157 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * cs-parser.jay: Add rules to improve error reporting if fields or
19160         methods are declared at the namespace level (error 116)
19161
19162         * Add rules to catch event add/remove
19163
19164 2004-01-04  David Sheldon <dave-mono@earth.li>
19165
19166   * expression.cs: Added matching ")" to error message for 
19167   CS0077
19168
19169 2004-01-03 Todd Berman <tberman@gentoo.org>
19170
19171         * ecore.cs, attribute.cs:
19172         Applying fix from #52429.
19173
19174 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19175
19176         * ecore.cs, expression.cs, statement.cs:
19177         Total rewrite of how we handle branching. We
19178         now handle complex boolean expressions with fewer
19179         jumps. As well if (x == 0) no longer emits a ceq.
19180
19181         if (x is Foo) is much faster now, because we generate
19182         better code.
19183
19184         Overall, we get a pretty big improvement on our benchmark
19185         tests. The code we generate is smaller and more readable.
19186
19187         I did a full two-stage bootstrap. The patch was reviewed
19188         by Martin and Miguel.
19189
19190 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19191
19192         * cs-parser.jay: Make primary_expression not take a QI.
19193         we dont need this because the member_access rule covers
19194         us here. So we replace the rule with just IDENTIFIER.
19195
19196         This has two good effects. First, we remove a s/r conflict.
19197         Second, we allocate many fewer QualifiedIdentifier objects.
19198
19199 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19200
19201         * attribute.cs: Handle MarshalAs attributes as pseudo, and
19202         set the correct information via SRE. This prevents
19203         hanging on the MS runtime. Fixes #29374.
19204
19205 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
19206
19207         * convert.cs: correctly handle conversions to value types
19208         from Enum and ValueType as unboxing conversions.
19209
19210         Fixes bug #52569. Patch by Benjamin Jemlich.
19211
19212 2004-01-02  Ravi Pratap  <ravi@ximian.com>
19213
19214         * expression.cs (BetterConversion): Prefer int -> uint
19215         over int -> ulong (csc's behaviour). This fixed bug #52046.
19216
19217 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19218
19219         * decl.cs (MemberCache.FindMembers): now returns a
19220         MemberInfo [].
19221
19222         * typemanager.cs: In general, go with with ^^.
19223         (CopyNewMethods): take an IList.
19224         (RealMemberLookup): Only allocate an arraylist
19225         if we copy from two sets of methods.
19226
19227         This change basically does two things:
19228         1) Fewer array lists allocated due to CopyNewMethods.
19229         2) the explicit cast in MemberList costed ALOT.
19230
19231 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
19232
19233         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
19234         a hashtable to avoid needless string allocations when an identifier is
19235         used more than once (the common case).
19236
19237 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19238
19239         * pending.cs: MS's TypeBuilder.GetInterfaces ()
19240         is broken, it will not return anything. So, we
19241         have to use the information we have in mcs to
19242         do the task.
19243
19244         * typemanager.cs: Add a cache for GetInterfaces,
19245         since this will now be used more often (due to ^^)
19246
19247         (GetExplicitInterfaces) New method that gets the
19248         declared, not effective, interfaces on a type
19249         builder (eg, if you have interface IFoo, interface
19250         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
19251         { IBar }.
19252
19253         This patch makes MCS able to bootstrap itself on
19254         Windows again.
19255
19256 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19257
19258         * expression.cs: Remove the Nop's that Miguel put
19259         in by mistake.
19260
19261 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19262
19263         * report.cs, codegen.cs: Give the real stack trace to
19264         the error when an exception is thrown.
19265
19266 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19267
19268         * decl.cs: only allocate hashtables for ifaces if 
19269         it is an iface!
19270
19271 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
19272
19273         * expression.cs: fix the error from cs0121-2.cs
19274         (a parent interface has two child interfaces that
19275         have a function with the same name and 0 params
19276         and the function is called through the parent).
19277
19278 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
19279
19280         * class.cs, rootcontext.cs, typmanager.cs: do not
19281         leak pointers.
19282
19283 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
19284
19285         * codegen.cs: remove stack for the ec flow branching.
19286         It is already a linked list, so no need.
19287
19288 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
19289
19290         * Makefile: Allow custom profiler here.
19291
19292 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
19293
19294         * typemanager.cs (LookupType):
19295           - Use a static char [], because split takes
19296             a param array for args, so it was allocating
19297             every time.
19298           - Do not store true in a hashtable, it boxes.
19299
19300 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
19301
19302         * flowanalysis.cs: bytify common enums.
19303
19304 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19305
19306         * modifiers.cs: Add a new set of flags for the
19307         flags allowed on explicit interface impls.
19308         * cs-parser.jay: catch the use of modifiers in
19309         interfaces correctly.
19310         * class.cs: catch private void IFoo.Blah ().
19311
19312         All related to bug #50572.
19313
19314 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19315
19316         * decl.cs: Rewrite the consistant accessability checking.
19317         Accessability is not linear, it must be implemented in
19318         a tableish way. Fixes #49704.
19319
19320 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
19321
19322         * expression.cs: Handle negation in a checked context.
19323         We must use subtraction from zero. Fixes #38674.
19324
19325 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19326
19327         * class.cs: Ignore static void main in DLLs.
19328         * rootcontext.cs: Handle the target type here,
19329         since we are have to access it from class.cs
19330         * driver.cs: account for the above.
19331
19332 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
19333
19334         * report.cs: Give line numbers and files if available.
19335
19336 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
19337
19338         * driver.cs: Implement /addmodule.
19339
19340         * typemanager.cs:  Change 'modules' field so it now contains Modules not
19341         ModuleBuilders.
19342
19343 2003-12-20  Martin Baulig  <martin@ximian.com>
19344
19345         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19346         (FieldBase.IsAssigned): Removed this field.
19347         (FieldBase.SetAssigned): New public method.
19348         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19349
19350 2003-12-20  Martin Baulig  <martin@ximian.com>
19351
19352         * expression.cs (LocalVariableReference.DoResolve): Don't set
19353         `vi.Used' if we're called from DoResolveLValue().
19354
19355         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19356         returns the usage vector it just merged into the current one -
19357         pass this one to UsageWarning().
19358         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19359         of the `EmitContext', don't call this recursively on our children.
19360
19361 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
19362
19363         * driver.cs: Implement /target:module.
19364
19365 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
19366
19367         * support.cs (CharArrayHashtable): New helper class.
19368
19369         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
19370         char arrays, not strings, so we can avoid creating a string in
19371         consume_identifier if the identifier is a keyword.
19372
19373 2003-12-16  Martin Baulig  <martin@ximian.com>
19374
19375         * statement.cs (LocalInfo.Assigned): Removed this property.
19376         (LocalInfo.Flags): Removed `Assigned'.
19377         (LocalInfo.IsAssigned): New public method; takes the EmitContext
19378         and uses flow analysis.
19379         (Block.UsageWarning): Made this method private.
19380         (Block.Resolve): Call UsageWarning() if appropriate.
19381
19382         * expression.cs (LocalVariableReference.DoResolve): Always set
19383         LocalInfo.Used here.
19384
19385 2003-12-13  Martin Baulig  <martin@ximian.com>
19386
19387         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19388         any value here; we're now using flow analysis to figure out
19389         whether a statement/block returns a value.
19390
19391 2003-12-13  Martin Baulig  <martin@ximian.com>
19392
19393         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19394         working again.
19395         (FlowBranching.MergeFinally): Don't call
19396         `branching.CheckOutParameters()' here, this is called in
19397         MergeTopBlock().
19398         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19399         when adding the `finally' vector.       
19400
19401 2003-12-13  Martin Baulig  <martin@ximian.com>
19402
19403         * flowanalysis.cs
19404         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19405         actually work and also fix #48962.
19406
19407 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
19408
19409         * decl.cs: Do not check System.Object for nested types,
19410         since we know it does not have any. Big bang for buck:
19411
19412         BEFORE:
19413            Run 1:   8.35 seconds
19414            Run 2:   8.32 seconds
19415            corlib:  17.99 seconds
19416         AFTER:
19417            Run 1:   8.17 seconds
19418            Run 2:   8.17 seconds
19419            corlib:  17.39 seconds
19420
19421 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
19422
19423         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19424         time we are returning 0 members, so we save alot here.
19425
19426 2003-12-11  Martin Baulig  <martin@ximian.com>
19427
19428         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19429         `MergeChild()', also just take the `FlowBranching' as argument;
19430         call Merge() on it and return the result.
19431         (FlowBranching.Merge): We don't need to do anything if we just
19432         have one sibling.
19433
19434 2003-12-11  Martin Baulig  <martin@ximian.com>
19435
19436         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19437         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
19438         Maurer for this idea.
19439
19440 2003-12-11  Martin Baulig  <martin@ximian.com>
19441
19442         * flowanalysis.cs (MergeResult): This class is now gone; we now
19443         use the `UsageVector' for this.  The reason for this is that if a
19444         branching just has one sibling, we don't need to "merge" them at
19445         all - that's the next step to do.
19446         (FlowBranching.Merge): We now return a `UsageVector' instead of a
19447         `MergeResult'.
19448
19449 2003-12-11  Martin Baulig  <martin@ximian.com>
19450
19451         Reworked flow analyis and made it more precise and bug-free.  The
19452         most important change is that we're now using a special `Reachability'
19453         class instead of having "magic" meanings of `FlowReturns'.  I'll
19454         do some more cleanups and optimizations and also add some more
19455         documentation this week.
19456
19457         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19458         largely reworked this class.
19459         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19460         the new `Reachability' class instead of having "magic" values here.
19461         (FlowBranching): We're now using an instance of `Reachability'
19462         instead of having separate `Returns', `Breaks' etc. fields.
19463
19464         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19465         based on flow analysis; ignore the return value of block.Emit ().
19466
19467 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
19468
19469         * driver.cs typemanager.cs: Find the mono extensions to corlib even
19470         if they are private.
19471
19472 2003-12-09  Martin Baulig  <martin@ximian.com>
19473
19474         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19475         call them directly on the UsageVector.
19476
19477 2003-12-09  Martin Baulig  <martin@ximian.com>
19478
19479         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19480         Changed return type from `FlowReturns' to `Reachability'.
19481
19482 2003-12-09  Martin Baulig  <martin@ximian.com>
19483
19484         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19485         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19486         `Reachable' fields with a single `Reachability' one.
19487
19488 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19489
19490         * class.cs (FindMembers): Remove foreach's.
19491
19492         Bootstrap times:
19493
19494         BEFORE
19495                 Run 1:   8.74 seconds
19496                 Run 2:   8.71 seconds
19497
19498         AFTER
19499                 Run 1:   8.64 seconds
19500                 Run 2:   8.58 seconds
19501
19502
19503 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19504
19505         * cs-parser.jay:
19506         * gen-treedump.cs:
19507         * statement.cs:
19508         This patch does a few things:
19509                 1. EmptyStatement is now a singleton, so it is never reallocated.
19510                 2. All blah is EmptyStatement constructs have been changed to
19511                    blah == EmptyStatement.Value, which is much faster and valid
19512                    now that EmptyStatement is a singleton.
19513                 3. When resolving a block, rather than allocating a new array for
19514                    the non-empty statements, empty statements are replaced with
19515                    EmptyStatement.Value
19516                 4. Some recursive functions have been made non-recursive.
19517         Mainly the performance impact is from (3), however (1) and (2) are needed for
19518         this to work. (4) does not make a big difference in normal situations, however
19519         it makes the profile look saner.
19520
19521         Bootstrap times:
19522
19523         BEFORE
19524         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19525         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19526         Total memory allocated: 56397 KB
19527
19528         AFTER
19529         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19530         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19531         Total memory allocated: 55666 KB
19532
19533 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19534
19535         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19536         than the hashtable in a hashtable version
19537
19538         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19539         we always end up concating a string. This results in a huge perf
19540         loss, because many strings have to be tracked by the GC. In this
19541         patch, we first use a hashtable that works with two keys, so that
19542         the strings do not need to be concat'ed.
19543
19544         Bootstrap times:
19545         BEFORE
19546                 Run 1:   8.74 seconds
19547                 Run 2:   8.71 seconds
19548
19549         AFTER
19550                 Run 1:   8.65 seconds
19551                 Run 2:   8.56 seconds
19552
19553 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19554
19555         * Makefile: Add a new target `do-time' that does a quick and simple
19556         profile, leaving easy to parse output.
19557
19558 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
19559
19560         * codegen.cs (Init): Create the dynamic assembly with 
19561         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19562
19563 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19564
19565         * support.cs: Make the PtrHashtable use only one
19566         instance of its comparer.
19567
19568 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
19569
19570         * typemanager.cs: Fix lookup of GetNamespaces.
19571
19572 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * expression.cs: Removed redundant line.
19575
19576         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19577         ArrayLists, use for loops with bounds.  
19578
19579         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19580         arraylist.
19581
19582         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19583         arraylists, use for loop with bounds.
19584
19585         The above three changes give us a 0.071 second performance
19586         improvement out of 3.294 seconds down to 3.223.  On my machine
19587         the above changes reduced the memory usage by 1,387 KB during
19588         compiler bootstrap.
19589
19590         * cs-parser.jay (QualifiedIdentifier): New class used to represent
19591         QualifiedIdentifiers.  Before we created a new string through
19592         concatenation, and mostly later on, the result would be
19593         manipulated by DecomposeQI through string manipulation.
19594
19595         This reduced the compiler memory usage for bootstrapping from
19596         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19597         compile times in 0.05 seconds.
19598
19599 2003-11-28  Dick Porter  <dick@ximian.com>
19600
19601         * support.cs: Do string compares with the Invariant culture.
19602
19603         * rootcontext.cs: 
19604         * gen-treedump.cs: 
19605         * expression.cs: 
19606         * driver.cs: 
19607         * decl.cs: 
19608         * codegen.cs: 
19609         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19610         the comparison is done with the Invariant culture.
19611
19612 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19615         GetEnumerator method.
19616
19617         (ProbeCollectionType): Iterate starting at the most specific type
19618         upwards looking for a GetEnumerator
19619
19620         * expression.cs: Shift count can be up to 31 for int/uint and 63
19621         for long/ulong.
19622
19623 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * statement.cs (Block.LookupLabel): Also look for the label on the
19626         children blocks.  Use a hash table to keep track of visited
19627         nodes. 
19628
19629         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19630         we actually did transform the other operand, otherwise fall back
19631         to the common codepath that casts to long.
19632
19633         * cs-tokenizer.cs: Use the same code pattern as the int case.
19634         Maybe I should do the parsing myself, and avoid depending on the
19635         Parse routines to get this done.
19636
19637 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
19638
19639         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19640         which fixes bug 51347.  This time test it.
19641
19642         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19643         attributes for example can not tell the difference between these.
19644         The difference was only a syntax feature of the language. 
19645
19646         * attribute.cs: Apply attributes to delegates.
19647
19648         * delegate.cs: Call the apply attributes method.
19649
19650 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19653         comparing 0 vs Byte.MinValue, not the value
19654
19655         (ImplicitConversionRequired): When reporting a conversion error,
19656         use error 31 to print out the constant error instead of the
19657         simpler 29.
19658
19659         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19660         which fixes bug 51347.
19661
19662 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
19663
19664         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
19665         which fixes the -warnaserror command line option.
19666
19667 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
19668
19669         * cfold.cs (DoNumericPromotions): During constant folding of
19670         additions on UIntConstant, special case intconstants with
19671         IntConstants like we do on the expression binary operator. 
19672
19673 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
19674
19675         * convert.cs (ImplicitReferenceConversion): We were missing a case
19676         (System.Enum are not value types or class types, so we need to
19677         classify them separatedly).
19678
19679         * driver.cs: We do not support error 2007.
19680
19681 2003-11-12 Jackson Harper <jackson@ximian.com>
19682
19683         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19684         system directory. Also use the full file name so users can
19685         libraries names mscorlib-o-tron.dll in a non system dir.
19686
19687 2003-11-10  Martin Baulig  <martin@ximian.com>
19688
19689         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19690         (TypeManager.InitCoreTypes): Initialize them here, but instead of
19691         calling `ResolveType()' on them, directly assign their `Type'.
19692
19693 2003-11-08  Martin Baulig  <martin@ximian.com>
19694
19695         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19696         return value and the `out parent' parameter.
19697         (TypeContainer.DefineType): Moved the CS0644 check into
19698         GetClassBases().  Don't pass the interface types to the
19699         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19700         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19701
19702         * ecore.cs (TypeExpr.IsAttribute): New property.
19703         (TypeExpr.GetInterfaces): New method.
19704
19705         * interface.cs (Interface.GetInterfaceTypeByName): Return a
19706         TypeExpr instead of a Type.
19707         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19708         (Interface.DefineType): Don't pass the interface types to the
19709         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19710         them later and then call `TypeBulider.AddInterfaceImplementation()'.
19711
19712         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19713         instead of a `Type[]'.
19714         (TypeManager.RegisterBuilder): Likewise.
19715         (TypeManager.AddUserInterface): Likewise.
19716         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19717         `Type[]' and also return a `TypeExpr[]'.
19718         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19719
19720 2003-11-08  Martin Baulig  <martin@ximian.com>
19721
19722         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19723         Expression.     
19724
19725 2003-11-08  Martin Baulig  <martin@ximian.com>
19726
19727         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19728         TypeManager.ResolveExpressionTypes().
19729
19730         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19731         instead of an Expression.
19732         (TypeExpr): This is now an abstract base class for `TypeExpression'.
19733         (TypeExpression): New public class; formerly known as `TypeExpr'.
19734
19735         * expression.cs (ComposedCast): Derive from TypeExpr.
19736
19737         * typemanager.cs (TypeManager.system_*_expr): These are now
19738         TypExpr's instead of Expression's.
19739         (TypeManager.ResolveExpressionTypes): New public static function;
19740         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19741         of them.        
19742
19743 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * expression.cs (New.DoResolve): Do not dereference value that
19746         might be a null return.
19747
19748         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19749         sure that the constant value has the right type.  Fixes an
19750         unreported bug, similar to 50425.
19751
19752         * const.cs (Const.LookupConstantValue): Call
19753         ImplicitStandardConversionExists before doing a conversion to
19754         avoid havng the TypeManager.ChangeType do conversions.
19755
19756         Reduced the number of casts used
19757
19758         (Const.ChangeType): New routine to enable reuse of the constant
19759         type changing code from statement.
19760
19761         * typemanager.cs (ChangeType): Move common initialization to
19762         static global variables.
19763
19764         Fixes #50425.
19765
19766         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19767         every value type to go through, even if it was void.  Fix that. 
19768
19769         * cs-tokenizer.cs: Use is_identifier_start_character on the start
19770         character of the define, and the is_identifier_part_character for
19771         the rest of the string.
19772
19773 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
19774
19775         * expression.cs (UnaryMutator.EmitCode): When I updated
19776         LocalVariableReference.DoResolve, I overdid it, and dropped an
19777         optimization done on local variable references.
19778
19779 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * ecore.cs: Convert the return from Ldlen into an int.
19782
19783 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
19784
19785         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19786         the accessibility, this is a special case for toplevel non-public
19787         classes (internal for instance).
19788
19789 2003-10-20  Nick Drochak <ndrochak@gol.com>
19790
19791         * ecore.cs: Fix typo and build.  Needed another right paren.
19792
19793 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
19796         `internal' case regular and protected, but not allowing protected
19797         to be evaluated later.  Bug 49840
19798
19799 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19802         to kb.Nlast, and not the kb.nFirst to isolate the switch
19803         statement.
19804
19805         Extract the underlying type, so enumerations of long/ulong are
19806         treated like long/ulong.
19807
19808 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * expression.cs (New): Overload the meaning of RequestedType to
19811         track the possible creation of the NewDelegate type, since
19812         DoResolve is invoked more than once for new constructors on field
19813         initialization.
19814
19815         See bugs: #48800 and #37014
19816
19817         * cs-parser.jay (declare_local_constants): Take an arraylist
19818         instead of a single constant.
19819
19820         (local_constant_declaration): It should take a
19821         constant_declarators, not a constant_declarator.  Fixes 49487
19822
19823         * convert.cs: Fix error report.
19824
19825 2003-10-13 Jackson Harper <jackson@ximian.com>
19826
19827         * typemanager.cs (TypeToCoreType): Add float and double this fixes
19828         bug #49611
19829
19830 2003-10-09  Martin Baulig  <martin@ximian.com>
19831
19832         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19833         to the .ctor.
19834         (MethodCore.DoDefineParameters): Removed the TypeContainer
19835         argument; use the DeclSpace which was passed to the .ctor instead.
19836         (MethodCore.CheckParameter): Take a DeclSpace instead of a
19837         TypeContainer; we only need a DeclSpace here.
19838
19839 2003-10-09  Martin Baulig  <martin@ximian.com>
19840
19841         * class.cs (MethodData): Added additional `DeclSpace ds' argument
19842         to the .ctor.
19843         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19844         EmitContext's .ctor.    
19845
19846 2003-10-09  Martin Baulig  <martin@ximian.com>
19847
19848         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19849         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19850         AsAccessible(), moved them as well.
19851
19852         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19853
19854 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19855
19856         * cs-parser.jay : Renamed yyName to yyNames related to jay.
19857
19858 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19859
19860         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19861         generation for >=, as spotted by Paolo, bug 48679.  
19862         Patch from David Waite.
19863
19864         * cs-tokenizer.cs: Add handling for #pragma.
19865
19866         * cs-parser.jay: Allow for both yield and yield return in the
19867         syntax.  The anti-cobolization of C# fight will go on!
19868
19869         * class.cs (TypeBuilder.DefineType): Catch error condition here
19870         (Parent.DefineType erroring out and returning null).
19871
19872         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19873         coping with enumerations variables, we were mistakenly processing
19874         them as a regular value type instead of built-in types.  Fixes the
19875         bug #48063
19876
19877         * typemanager.cs (IsBuiltinOrEnum): New method.
19878
19879 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19880
19881         * cs-parser.jay: Upgrade: yield now needs the return clause.
19882
19883 2003-09-19  Martin Baulig  <martin@ximian.com>
19884
19885         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19886         `MemberCache parent' argument.  Normally, an interface doesn't
19887         have a parent type except System.Object, but we use this in gmcs
19888         for generic type parameters.
19889
19890 2003-09-18  Martin Baulig  <martin@ximian.com>
19891
19892         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19893         on `type.IsInterface'; don't check whether the type has a parent
19894         to determine whether it's an interface.
19895
19896 2003-09-15  Martin Baulig  <martin@ximian.com>
19897
19898         * class.cs (TypeContainer.DefineType): Added an error flag to
19899         avoid reporting duplicate CS0146's ("class definition is
19900         circular.").
19901
19902         * driver.cs (Driver.MainDriver): Abort if
19903         RootContext.ResolveTree() reported any errors.
19904
19905 2003-09-07  Martin Baulig  <martin@ximian.com>
19906
19907         * report.cs (Error, Warning): Added overloaded versions which take
19908         a `params object[] args' and call String.Format().
19909
19910 2003-09-07  Martin Baulig  <martin@ximian.com>
19911
19912         * decl.cs (DeclSpace..ctor): Don't call
19913         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19914         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19915         (DeclSpace.RecordDecl): New method.
19916
19917         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19918
19919 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19920
19921         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19922         value attributes to be applied to ParameterBuilders.
19923
19924         * class.cs (MethodCore.LabelParameters): Make static and more
19925         generic so that it can be used from other places - like interface
19926         methods, for instance.
19927
19928         * interface.cs (Interface.Emit): Call LabelParameters before
19929         emitting attributes on the InterfaceMethod.
19930
19931 2003-08-26  Martin Baulig  <martin@ximian.com>
19932
19933         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19934         resolving aliases; fixes #47927.
19935
19936 2003-08-26  Martin Baulig  <martin@ximian.com>
19937
19938         * statement.cs (Using.DoResolve): This is internally emitting a
19939         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19940         do not always return.  Fixes #47681.
19941
19942 2003-08-26  Martin Baulig  <martin@ximian.com>
19943
19944         * decl.cs (MemberCore): Moved WarningNotHiding(),
19945         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19946         into MemberBase.
19947         (AdditionResult): Make this nested in DeclSpace.
19948         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19949         argument; call NamespaceEntry.Define() unless we're nested in a
19950         class or struct.
19951
19952         * namespace.cs (Namespace.DefineName): New public function.  This
19953         is called from DeclSpace's .ctor to add 
19954         (Namespace.Lookup): Include DeclSpaces in the lookup.
19955
19956         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19957
19958         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19959
19960 2003-08-25  Martin Baulig  <martin@ximian.com>
19961
19962         * convert.cs (Convert.ExplicitReferenceConversion): When
19963         converting from an interface type to a class, unbox if the target
19964         type is a struct type.  Fixes #47822.
19965
19966 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19967
19968         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19969         #47854.
19970
19971 2003-08-22  Martin Baulig  <martin@ximian.com>
19972
19973         * class.cs (TypeManager.DefineType): When defining a nested type,
19974         call DefineType() on our parent; fixes #47801.
19975
19976 2003-08-22  Martin Baulig  <martin@ximian.com>
19977
19978         * class.cs (MethodData.Define): While checking if a method is an
19979         interface implementation, improve the test a bit more to fix #47654.
19980
19981 2003-08-22  Martin Baulig  <martin@ximian.com>
19982
19983         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19984         correctly; fixes #47722.
19985
19986 2003-08-22  Martin Baulig  <martin@ximian.com>
19987
19988         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19989         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19990
19991         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19992
19993 2003-08-22  Martin Baulig  <martin@ximian.com>
19994
19995         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19996         can only be assigned in static constructors.  Fixes #47161.
19997
19998 2003-08-22  Martin Baulig  <martin@ximian.com>
19999
20000         Rewrote and improved the flow analysis code.
20001
20002         * flowbranching.cs (FlowBranching): Make this class abstract.
20003         (FlowBranching.CreateBranching): New static function to create a
20004         new flow branching.
20005         (FlowBranchingBlock, FlowBranchingException): New classes.
20006         (FlowBranching.UsageVector.Type): New public readonly field.
20007         (FlowBranching.UsageVector.Breaks): Removed the setter.
20008         (FlowBranching.UsageVector.Returns): Removed the setter.
20009         (FlowBranching.UsageVector): Added Break(), Return(),
20010         NeverReachable() and Throw() methods to modify the reachability.
20011         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
20012         done by FlowBranching.Merge().
20013         (FlowBranching.UsageVector.MergeChild): New method; merges the
20014         merge result into the current vector.
20015         (FlowBranching.Merge): New abstract method to merge a branching.
20016
20017 2003-08-12  Martin Baulig  <martin@ximian.com>
20018
20019         * expression.cs (Indirection.CacheTemporaries): Create the
20020         LocalTemporary with the pointer type, not its element type.
20021
20022 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
20023
20024         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
20025         token was a keyword or not.
20026
20027         Add `error' options where an IDENTIFIER was expected;  Provide
20028         CheckToken and CheckIdentifierToken convenience error reporting
20029         functions. 
20030
20031         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
20032
20033         * decl.cs: Rename `NamespaceEntry Namespace' public field into
20034         NameSpaceEntry NameSpaceEntry.
20035
20036         (LookupInterfaceOrClass): Avoid creating a full qualified name
20037         from namespace and name: avoid doing lookups when we know the
20038         namespace is non-existant.   Use new Tree.LookupByNamespace which
20039         looks up DeclSpaces based on their namespace, name pair.
20040
20041         * driver.cs: Provide a new `parser verbose' to display the
20042         exception thrown during parsing.  This is turned off by default
20043         now, so the output of a failure from mcs is more graceful.
20044
20045         * namespace.cs: Track all the namespaces defined in a hashtable
20046         for quick lookup.
20047
20048         (IsNamespace): New method
20049
20050 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
20053         we know that we need to concatenate (full typename can never be
20054         null). 
20055
20056         * class.cs: ditto.
20057
20058         * statement.cs: Use a bitfield;  Do not initialize to null things
20059         which are done by the constructor by default.
20060
20061         * cs-parser.jay: bug fix, parameter was 4, not 3.
20062
20063         * expression.cs: Just use the property;
20064
20065         * statement.cs: No need for GetVariableInfo method.
20066
20067 2003-08-08  Martin Baulig  <martin@ximian.com>
20068
20069         * flowanalysis.cs (FlowReturns): This is now nested in the
20070         `FlowBranching' class.
20071         (MyBitVector): Moved this here from statement.cs.
20072         (FlowBranching.SiblingType): New enum type.
20073         (FlowBranching.CreateSibling): Added `SiblingType' argument.
20074
20075 2003-08-07  Martin Baulig  <martin@ximian.com>
20076
20077         * flowanalysis.cs (FlowBranchingType): This is now nested in the
20078         `FlowBranching' class and called `BranchingType'.
20079
20080 2003-08-07  Martin Baulig  <martin@ximian.com>
20081
20082         * flowanalysis.cs: Moved all the control flow analysis code into
20083         its own file.
20084
20085 2003-08-07  Martin Baulig  <martin@ximian.com>
20086
20087         * assign.cs (Assign.DoResolve): `target' must either be an
20088         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
20089         #37319.
20090
20091 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
20092
20093         * expression.cs (BinaryMethod): This kind of expression is created by the
20094         Binary class if it determines that the operator has to be handled
20095         by a method.
20096
20097         (BinaryDelegate): This kind of expression is created if we are
20098         dealing with a + or - operator on delegates.
20099
20100         (Binary): remove method, argumetns, and DelegateOperator: when
20101         dealing with methods, 
20102
20103         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
20104
20105         * statement.cs (Block): use bitfields for the three extra booleans
20106         we had in use.   Remove unused topblock parameter.
20107
20108         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
20109
20110         * assign.cs: Drop extra unneeded tests.
20111
20112 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
20115
20116         * statement.cs (Foreach): Use VariableStorage instead of
20117         LocalBuilders.   
20118
20119         * codegen.cs (VariableStorage): New class used by clients that
20120         require a variable stored: locals or fields for variables that
20121         need to live across yield.
20122
20123         Maybe provide a convenience api for EmitThis+EmitLoad?
20124
20125         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
20126         these bad boys.
20127
20128 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
20131         RemapParameterLValue): New methods that are used to turn a
20132         precomputed FieldInfo into an expression like this:
20133
20134                 instance.FieldInfo
20135
20136         The idea is to use this instead of making LocalVariableReference
20137         have more than one meaning.
20138
20139         * cs-parser.jay: Add error production to BASE.
20140
20141         * ecore.cs: Deal with TypeManager.GetField returning null, which
20142         is now a valid return value.
20143
20144         (FieldExprNoAddress): New expression for Fields whose address can
20145         not be taken.
20146
20147         * expression.cs (LocalVariableReference): During the resolve
20148         phases, create new expressions if we are in a remapping context.
20149         Remove code that dealt with remapping here.
20150
20151         (ParameterReference): same.
20152
20153         (ProxyInstance): New expression, like the `This' expression, but
20154         it is born fully resolved.  We know what we are doing, so remove
20155         the errors that are targeted to user-provided uses of `this'.
20156
20157         * statement.cs (Foreach): our variable is now stored as an
20158         Expression;  During resolution, follow the protocol, dont just
20159         assume it will return this.
20160
20161 2003-08-06  Martin Baulig  <martin@ximian.com>
20162
20163         * support.cs (SeekableStreamReader.cs): New public class.
20164
20165         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
20166         SeekableStreamReader instead of the normal StreamReader.
20167
20168 2003-08-04  Martin Baulig  <martin@ximian.com>
20169
20170         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
20171         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
20172         deambiguate casts and delegate invocations.
20173         (parenthesized_expression): Use the new tokens to ensure this is
20174         not a cast of method invocation.
20175
20176         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
20177         when reading a `)' and Deambiguate_CloseParens () was previously
20178         called.
20179
20180         * expression.cs (ParenthesizedExpression): New class.  This is
20181         just used for the CS0075 test.
20182         (Binary.DoResolve): Check for CS0075.   
20183
20184 2003-07-29  Ravi Pratap  <ravi@ximian.com>
20185
20186         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
20187         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
20188         reference comparison.
20189
20190         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
20191         examine the ReturnType for equality - this is necessary in the
20192         cases of implicit and explicit operators whose signature also
20193         includes the return type.
20194
20195 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
20196
20197         * namespace.cs: Cache the result of the namespace computation,
20198         instead of computing it every time.
20199
20200 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
20201
20202         * decl.cs: Use a global arraylist that we reuse over invocations
20203         to avoid excesive memory consumption.  Reduces memory usage on an
20204         mcs compile by one meg (45 average).
20205
20206         * typemanager.cs (LookupTypeReflection): In .NET pointers are
20207         private, work around that.
20208
20209 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * literal.cs (IntLiteral): Define Zero and One static literals. 
20212
20213         * cs-parser.jay (integer_literal): use static literals to reduce
20214         memory usage for the most used literals (0, 1 and -1).  211kb
20215         reduced in memory usage.
20216
20217         Replace all calls to `new ArrayList' with `new
20218         ArrayList(4)' which is a good average number for most allocations,
20219         and also requires only 16 bytes of memory for its buffer by
20220         default. 
20221
20222         This reduced MCS memory usage in seven megabytes for the RSS after
20223         bootstrapping.
20224
20225 2003-07-28  Ravi Pratap  <ravi@ximian.com>
20226
20227         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
20228         handle params methods the correct way by forming only one
20229         applicable set with params and normal methods in them. Earlier we
20230         were looking at params methods only if we found no normal methods
20231         which was not the correct thing to do.
20232
20233         (Invocation.BetterFunction): Take separate arguments indicating
20234         when candidate and the best method are params methods in their
20235         expanded form.
20236
20237         This fixes bugs #43367 and #46199.
20238
20239         * attribute.cs: Documentation updates.
20240
20241         (CheckAttribute): Rename to CheckAttributeTarget.
20242         (GetValidPlaces): Rename to GetValidTargets.
20243
20244         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
20245         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
20246
20247         Fixes bug #44468.
20248
20249 2003-07-28  Martin Baulig  <martin@ximian.com>
20250
20251         * class.cs (TypeContainer.DefineMembers): Use the base type's full
20252         name when looking up the base class of a nested class.  Fixes #46977.
20253
20254 2003-07-26  Martin Baulig  <martin@ximian.com>
20255
20256         * expression.cs (Indexers.Indexer): New nested struct; contains
20257         getter, setter and the indexer's type.
20258         (Indexers.Properties): This is now an ArrayList of
20259         Indexers.Indexer's.
20260         (IndexerAccess.DoResolveLValue): Correctly set the type if the
20261         indexer doesn't have any getters.
20262
20263         * assign.cs (Assign.DoResolve): Also do the implicit conversions
20264         for embedded property and indexer assignments.
20265
20266 2003-07-26  Martin Baulig  <martin@ximian.com>
20267
20268         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
20269         preprocessor directive is not the first non-whitespace character
20270         on a line.
20271
20272 2003-07-26  Martin Baulig  <martin@ximian.com>
20273
20274         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
20275         namespace parsing, follow the spec more closely.
20276
20277         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
20278         NamespaceEntry.Lookup().
20279
20280 2003-07-25  Martin Baulig  <martin@ximian.com>
20281
20282         * MethodCore.cs (OverridesSomething): New public field; it's set
20283         from TypeContainer.DefineMembers if this method overrides
20284         something (which doesn't need to be a method).  Fix #39462.
20285
20286 2003-07-25  Ravi Pratap  <ravi@ximian.com>
20287
20288         * typemanager.cs (GetMembers): Ensure that the list of members is
20289         reversed. This keeps things in sync.
20290
20291         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
20292         find an AttributeUsage attribute.
20293
20294         * expression.cs (Invocation.OverloadResolve): Perform the check
20295         which disallows Invoke to be directly called on a Delegate.
20296
20297         (Error_InvokeOnDelegate): Report error cs1533.
20298
20299 2003-07-25  Martin Baulig  <martin@ximian.com>
20300
20301         * expression.cs (Indexers.GetIndexersForType): Only look in the
20302         interface hierarchy if the requested type is already an
20303         interface.  Fixes #46788 while keeping #46502 fixed.
20304
20305 2003-07-25  Martin Baulig  <martin@ximian.com>
20306
20307         * class.cs (TypeContainer.DefineMembers): Check whether all
20308         readonly fields have been assigned and report warning CS0649 if
20309         not.
20310
20311         * statement.cs (LocalInfo.IsFixed): Always return true if this is
20312         a valuetype.
20313
20314 2003-07-24  Ravi Pratap  <ravi@ximian.com>
20315
20316         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20317         returned from GetMethods to make things consistent with the
20318         assumptions MCS makes about ordering of methods.
20319
20320         This should comprehensively fix bug #45127 and it does :-)
20321
20322         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20323         ordering is actually reverse.
20324
20325         * Clean up some debug messages I left lying around.
20326
20327         * interface.cs (Populate*): Get rid of code which emits attributes
20328         since the stage in which we emit attributes is the 'Emit' stage,
20329         not the define stage.
20330
20331         (Emit): Move attribute emission for interface members here.
20332
20333 2003-07-22  Ravi Pratap  <ravi@ximian.com>
20334
20335         * expression.cs (Invocation.OverloadResolve): Follow the spec more
20336         closely: we eliminate methods in base types when we have an
20337         applicable method in a top-level type.
20338
20339         Please see section 14.5.5.1 for an exact description of what goes
20340         on. 
20341
20342         This fixes bug #45127 and a host of other related to corlib compilation.
20343
20344         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20345         array is the method corresponding to the top-level type (this is
20346         because of the changes made to icall.c) so we change this
20347         accordingly.
20348
20349         (MethodGroupExpr.Name): This too.
20350
20351         * typemanager.cs (GetElementType): New method which does the right
20352         thing when compiling corlib. 
20353
20354         * everywhere: Make use of the above in the relevant places.
20355
20356 2003-07-22  Martin Baulig  <martin@ximian.com>
20357
20358         * cs-parser.jay (invocation_expression): Moved
20359         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20360         `cast_expression', but create a InvocationOrCast which later
20361         resolves to either an Invocation or a Cast.
20362
20363         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20364         method; call this before EmitStatement() to make sure that this
20365         expression can be used as a statement.
20366
20367         * expression.cs (InvocationOrCast): New class; resolves to either
20368         an Invocation or a Cast.
20369
20370         * statement.cs (StatementExpression): Call ResolveStatement() on
20371         the ExpressionStatement before emitting it.
20372
20373 2003-07-21  Martin Baulig  <martin@ximian.com>
20374
20375         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20376         `ref' and `out' attributes match; fixes #46220.
20377         (MemberAccess.ResolveMemberAccess): You can't reference a type
20378         through an expression; fixes #33180.
20379         (Indexers.GetIndexersForType): Don't return the indexers from
20380         interfaces the class implements; fixes #46502.
20381
20382 2003-07-21  Martin Baulig  <martin@ximian.com>
20383
20384         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20385         CS0661 checks; fixes bug #30442.
20386
20387 2003-07-21  Martin Baulig  <martin@ximian.com>
20388
20389         * decl.cs (AdditionResult): Added `Error'.
20390
20391         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20392
20393         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20394         makes cs0031.cs actually work.
20395
20396 2003-07-20  Martin Baulig  <martin@ximian.com>
20397
20398         * namespace.cs: Fixed that bug which caused a crash when compiling
20399         the debugger's GUI.
20400
20401 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
20402
20403         * typemanager.cs (LookupTypeReflection): Never expose types which
20404         are NotPublic, NestedPrivate, NestedAssembly, or
20405         NestedFamANDAssem.  We used to return these, and later do a check
20406         that would report a meaningful error, but the problem is that we
20407         would not get the real match, if there was a name override.
20408
20409 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
20410
20411         * namespace.cs (Namespace, Name): Do not compute the namespace
20412         name dynamically, compute it in the constructor.  This reduced
20413         memory usage by 1697 KB.
20414
20415         * driver.cs: Use --pause to pause at the end.
20416
20417 2003-07-17  Peter Williams  <peter@newton.cx>
20418
20419         * Makefile: Change the name of the test target so that it doesn't
20420         conflict with the recursive test target.
20421
20422 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
20423
20424         * expression.cs (LocalVariableReference.Emit, EmitAssign,
20425         AddressOf): Do not use EmitThis, that was wrong, use the actual
20426         this pointer.
20427
20428 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * class.cs (MethodData.Define): While checking if a method is an
20431         interface implementation, improve the test: If we are not public
20432         (use new test here: use the computed MethodAttributes directly,
20433         instead of the parsed modifier flags) check if the `implementing'
20434         method comes from an interface or not.
20435
20436         * pending.cs (VerifyPendingMethods): Slightly better error
20437         message.
20438
20439         * makefile: add test target that does the mcs bootstrap.
20440
20441 2003-07-16  Ravi Pratap  <ravi@ximian.com>
20442
20443         * interface.cs (Define): Do nothing here since there are no
20444         members to populate etc. Move the attribute emission out of here
20445         since this was just totally the wrong place to put it. Attribute
20446         application happens during the 'Emit' phase, not in the 'Define'
20447         phase.
20448
20449         (Emit): Add this method and move the attribute emission here
20450
20451         * rootcontext.cs (EmitCode): Call the Emit method on interface
20452         types too.
20453
20454 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20455
20456         * expression.cs (OverloadResolve): Report error only if Location
20457         is not 'Null' which means that there was a probe going on.
20458
20459 2003-07-14  Martin Baulig  <martin@ximian.com>
20460
20461         * expression.cs (ConditionalLogicalOperator): New public class to
20462         implement user defined conditional logical operators.
20463         This is section 14.11.2 in the spec and bug #40505.
20464
20465 2003-07-14  Martin Baulig  <martin@ximian.com>
20466
20467         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20468
20469 2003-07-14  Martin Baulig  <martin@ximian.com>
20470
20471         * codegen.cs (EmitContext.InFixedInitializer): New public field.
20472
20473         * ecore.cs (IVariable.VerifyFixed): New interface method.
20474
20475         * expression.cs (Unary.ResolveOperator): When resolving the `&'
20476         operator, check whether the variable is actually fixed.  Fixes bug
20477         #36055.  Set a variable definitely assigned when taking its
20478         address as required by the spec.
20479
20480         * statement.cs (LocalInfo.IsFixed): New field.
20481         (LocalInfo.MakePinned): Set `IsFixed' to true.
20482
20483 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20484
20485         * attribute.cs (Attribute.Resolve): While doing a Member lookup
20486         for .ctors, ensure that we only ask for members declared in the
20487         attribute type (BindingFlags.DeclaredOnly).
20488
20489         Fixes bug #43632.
20490
20491         * expression.cs (Error_WrongNumArguments): Report error 1501
20492         correctly the way CSC does.
20493
20494 2003-07-13  Martin Baulig  <martin@ximian.com>
20495
20496         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20497         lookup on the fully qualified name, to make things like "X.X" work
20498         where "X.X" is a fully qualified type name, but we also have a
20499         namespace "X" in the using list.  Fixes #41975.
20500
20501 2003-07-13  Martin Baulig  <martin@ximian.com>
20502
20503         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20504         function. If we're a CompoundAssign, we need to create an embedded
20505         CompoundAssign, not an embedded Assign.
20506         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20507         Fixes #45854.
20508
20509 2003-07-13  Martin Baulig  <martin@ximian.com>
20510
20511         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20512         work to fix bug #46088.
20513
20514 2003-07-13  Ravi Pratap <ravi@ximian.com>
20515
20516         * class.cs (Operator.Emit): Do not emit attributes here - it is
20517         taken care of by the Method class that we delegate too. This takes
20518         care of bug #45876.
20519
20520 2003-07-10  Martin Baulig  <martin@ximian.com>
20521
20522         * expression.cs (TypeOfVoid): New class.
20523         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
20524
20525 2003-07-10  Martin Baulig  <martin@ximian.com>
20526
20527         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20528         bug #35957.
20529
20530 2003-07-10  Martin Baulig  <martin@ximian.com>
20531
20532         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20533         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20534
20535         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20536
20537         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20538
20539 2003-07-10  Martin Baulig  <martin@ximian.com>
20540
20541         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20542         of decimal.  Fixes #42850.
20543
20544         NOTE: I also fixed the created byte blob, but this doesn't work on
20545         the MS runtime and csc never produces any byte blobs for decimal
20546         arrays.
20547
20548 2003-07-10  Martin Baulig  <martin@ximian.com>
20549
20550         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20551         structs; fixes #32068.
20552         (Block.AddChildVariableNames): Fixed #44302.
20553
20554 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20555
20556         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20557
20558 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20559
20560         * attribute.cs: And this test is onger needed.
20561
20562 2003-07-08  Martin Baulig  <martin@ximian.com>
20563
20564         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20565         inaccessible types.  Fixes #36313.
20566
20567         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20568
20569         * namespace.cs (NamespaceEntry): Create implicit entries for all
20570         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20571         implicit entries for N1.N2 and N1.
20572
20573 2003-07-08  Martin Baulig  <martin@ximian.com>
20574
20575         Rewrote the handling of namespaces to fix a lot of the issues
20576         wrt. `using' aliases etc.
20577
20578         * namespace.cs (Namespace): Splitted this class into a
20579         per-assembly `Namespace' and a per-file `NamespaceEntry'.
20580
20581         * typemanager.cs (TypeManager.IsNamespace): Removed.
20582         (TypeManager.ComputeNamespaces): Only compute namespaces from
20583         loaded assemblies here, not the namespaces from the assembly we're
20584         currently compiling.
20585
20586 2003-07-08  Martin Baulig  <martin@ximian.com>
20587
20588         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20589
20590 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20591
20592         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20593         already fixed it.  
20594
20595         I thought about the memory savings here, but LookupTypeReflection
20596         is used under already very constrained scenarios.  Compiling
20597         corlib or mcs only exposes one hit, so it would not really reduce
20598         any memory consumption.
20599
20600 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20601
20602         * typemanager.cs: fixes bug #45889 by only adding public types from
20603         other assemblies to the list of known types.
20604
20605 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20608         on the type we resolved.
20609
20610 2003-07-05  Martin Baulig  <martin@ximian.com>
20611
20612         * pending.cs (PendingImplementation.ParentImplements): Don't
20613         create the proxy if the parent is abstract.
20614
20615         * class.cs (TypeContainer.DefineIndexers): Process explicit
20616         interface implementations first.  Fixes #37714.
20617
20618 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
20619
20620         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20621         defined recursively;  but since we modify the input parameters
20622         (left is set to `this' temporarily), we reset this value if the
20623         left_is_explicit is false, which gives the original semantics to
20624         the code.  
20625
20626         * literal.cs (NullPointer): new class used to represent a null
20627         literal in a pointer context.
20628
20629         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20630         type is a pointer, use a NullPointer object instead of a
20631         NullLiteral.   Closes 43687
20632
20633         (ExplicitConversion): Convert pointer values using
20634         the conv opcode to the proper type.
20635
20636         * ecore.cs (New): change ValueTypeVariable property into a method,
20637         that returns whether the valuetype is suitable for being used.
20638
20639         * expression.cs (Binary.DoNumericPromotions): Only return if we
20640         the int constant was a valid uint, and we can return both left and
20641         right as uints.  If not, we continue processing, to trigger the
20642         type conversion.  This fixes 39018.
20643
20644         * statement.cs (Block.EmitMeta): During constant resolution, set
20645         the CurrentBlock property on the emitcontext, so that we resolve
20646         constants propertly.
20647
20648 2003-07-02  Martin Baulig  <martin@ximian.com>
20649
20650         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20651         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20652
20653         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20654         than emitting it here.
20655
20656         * statement.cs: Fixed some more flow analysis bugs.
20657
20658 2003-07-02  Martin Baulig  <martin@ximian.com>
20659
20660         * class.cs (MethodData.Define): When implementing interface
20661         methods, set Final unless we're Virtual.
20662
20663         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20664         check work for interface methods.
20665
20666 2003-07-01  Martin Baulig  <martin@ximian.com>
20667
20668         * ecore.cs (EmitContext.This): Replaced this property with a
20669         GetThis() method which takes a Location argument.  This ensures
20670         that we get the correct error location for a CS0188.
20671
20672 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
20673
20674         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20675         ImplicitStandardConversion.
20676
20677         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20678
20679 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
20680
20681         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20682         optimization.
20683
20684 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
20685
20686         * class.cs (Constructor.Define): Turn off initlocals for unsafe
20687         constructors.
20688
20689         (MethodData.Define): Turn off initlocals for unsafe methods.
20690
20691 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
20692
20693         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20694         complete;  Fixes #37521.
20695
20696         * delegate.cs: Use Modifiers.TypeAttr to compute the
20697         TypeAttributes, instead of rolling our own.  This makes the flags
20698         correct for the delegates.
20699
20700 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * class.cs (Constructor.Define): Set the private flag for static
20703         constructors as well.
20704
20705         * cs-parser.jay (statement_expression): Set the return value to
20706         null, to avoid a crash when we catch an error.
20707
20708 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * cs-parser.jay: Applied patch from Jackson that adds support for
20711         extern and unsafe modifiers to destructor declarations.
20712
20713         * expression.cs: Report error 21 if the user is trying to index a
20714         System.Array.
20715
20716         * driver.cs: Add an error message, suggested by the bug report.
20717
20718         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20719         if we do not have a ": this ()" constructor initializer.  Fixes 45149
20720
20721 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
20722
20723         * namespace.cs: Add some information to reduce FAQs.
20724
20725 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20728         underlying enumeration types.  Fixes #43915.
20729
20730         * expression.cs: Treat ushort/short as legal values to be used in
20731         bitwise operations.
20732
20733 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20734
20735         * delegate.cs: transfer custom attributes for paramenters from
20736         the delegate declaration to Invoke and BeginInvoke.
20737
20738 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20739
20740         * attribute.cs: handle custom marshalers and emit marshal info
20741         for fields, too.
20742
20743 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
20744
20745         * makefile.gnu: Added anonymous.cs to the compiler sources.
20746
20747 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
20748
20749         * iterators.cs: Change the name of the proxy class to include two
20750         underscores.
20751
20752         * cs-parser.jay: Update grammar to include anonymous methods.
20753
20754         * anonymous.cs: new file.
20755
20756 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * class.cs (Field.Define): Add missing test for pointers and
20759         safety. 
20760
20761 2003-05-27  Ravi Pratap  <ravi@ximian.com>
20762
20763         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20764         we use the stobj opcode.
20765
20766         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20767         since it wasn't the correct fix. 
20768
20769         It still is puzzling that we are required to use stobj for IntPtr
20770         which seems to be a ValueType.
20771
20772 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
20773
20774         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20775         during regular simple name resolution.   Now, the trick is that
20776         instead of returning for processing the simplename, we do a
20777         TypeManager.LookupType (ie, a rooted lookup as opposed to a
20778         contextual lookup type).   If a match is found, return that, if
20779         not, return for further composition.
20780
20781         This fixes long-standing 30485.
20782
20783         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20784         using the address to initialize an object, do an Stobj instead of
20785         using the regular Stelem.
20786
20787         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20788         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20789         Because if we are a BaseIndexerAccess that value will be true.
20790         Fixes 43643.
20791
20792         * statement.cs (GotoCase.Resolve): Return after reporting an
20793         error, do not attempt to continue. 
20794
20795         * expression.cs (PointerArithmetic.Emit): If our operand is a
20796         long, convert our constants to match the operand before
20797         multiplying.  Convert to I type before adding.   Fixes 43670.
20798
20799 2003-05-14  Ravi Pratap  <ravi@ximian.com>
20800
20801         * enum.cs (ImplicitConversionExists) : Rename to
20802         ImplicitEnumConversionExists to remove ambiguity. 
20803
20804         * ecore.cs (NullCast): New type of cast expression class which
20805         basically is very similar to EmptyCast with the difference being
20806         it still is a constant since it is used only to cast a null to
20807         something else
20808         (eg. (string) null)
20809
20810         * convert.cs (ImplicitReferenceConversion): When casting a null
20811         literal, we return a NullCast.
20812
20813         * literal.cs (NullLiteralTyped): Remove - I don't see why this
20814         should be around anymore.
20815
20816         The renaming (reported was slightly wrong). Corrections:
20817
20818         ConvertImplicitStandard -> ImplicitConversionStandard
20819         ConvertExplicitStandard -> ExplicitConversionStandard
20820
20821         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20822         before passing them in !
20823
20824         * convert.cs (ImplicitConversionStandard): When comparing for
20825         equal expr and target types, ensure that expr is not a
20826         NullLiteral.
20827
20828         In general, we must not be checking (expr_type ==
20829         target_type) in the top level conversion methods
20830         (ImplicitConversion, ExplicitConversion etc). This checking is
20831         done in the methods that they delegate to.
20832
20833 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
20834
20835         * convert.cs: Move Error_CannotConvertType,
20836         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20837         ImplicitNumericConversion, ImplicitConversionExists,
20838         ImplicitUserConversionExists, StandardConversionExists,
20839         FindMostEncompassedType, FindMostSpecificSource,
20840         FindMostSpecificTarget, ImplicitUserConversion,
20841         ExplicitUserConversion, GetConversionOperators,
20842         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20843         TryImplicitIntConversion, Error_CannotConvertImplicit,
20844         ConvertImplicitRequired, ConvertNumericExplicit,
20845         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20846         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20847         its own file.
20848
20849         Perform the following renames:
20850
20851         StandardConversionExists -> ImplicitStandardConversionExists
20852         ConvertImplicit -> ImplicitConversion
20853         ConvertImplicitStandard -> ImplicitStandardConversion
20854         TryImplicitIntConversion -> ImplicitIntConversion
20855         ConvertImplicitRequired -> ImplicitConversionRequired
20856         ConvertNumericExplicit -> ExplicitNumericConversion
20857         ConvertReferenceExplicit -> ExplicitReferenceConversion
20858         ConvertExplicit -> ExplicitConversion
20859         ConvertExplicitStandard -> ExplicitStandardConversion
20860
20861 2003-05-19  Martin Baulig  <martin@ximian.com>
20862
20863         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20864         (TypeInfo): Added support for structs having structs as fields.
20865
20866         * ecore.cs (FieldExpr): Implement IVariable.
20867         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20868         VariableInfo for the field.
20869
20870 2003-05-18  Martin Baulig  <martin@ximian.com>
20871
20872         * expression.cs (This.DoResolve): Report a CS0027 if we're
20873         emitting a field initializer.
20874
20875 2003-05-18  Martin Baulig  <martin@ximian.com>
20876
20877         * expression.cs (This.ResolveBase): New public function.
20878         (This.DoResolve): Check for CS0188.
20879
20880         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20881         This.Resolve().
20882
20883         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20884         `instance_expression' to null if we don't have any non-static
20885         methods.
20886
20887 2003-05-18  Martin Baulig  <martin@ximian.com>
20888
20889         Reworked the way how local variables and parameters are handled by
20890         the flow analysis code.
20891
20892         * statement.cs (TypeInfo, VariableMap): New public classes.
20893         (VariableInfo): New public class.  This is now responsible for
20894         checking whether a variable has been assigned.  It is used for
20895         parameters and local variables.
20896         (Block.EmitMeta): Take the InternalParameters as argument; compute
20897         the layout of the flow vectors here.
20898         (Block.LocalMap, Block.ParameterMap): New public properties.
20899         (FlowBranching): The .ctor doesn't get the InternalParameters
20900         anymore since Block.EmitMeta() now computes the layout of the flow
20901         vector.
20902         (MyStructInfo): This class is now known as `StructInfo' and nested
20903         in `TypeInfo'; we don't access this directly anymore.
20904
20905         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20906         property and removed IsAssigned(), IsFieldAssigned(),
20907         SetAssigned() and SetFieldAssigned(); we now call them on the
20908         VariableInfo so we don't need to duplicate this code everywhere.
20909
20910         * expression.cs (ParameterReference): Added `Block block' argument
20911         to the .ctor.
20912         (LocalVariableReference, ParameterReference, This): The new
20913         VariableInfo class is now responsible for all the definite
20914         assignment stuff.
20915
20916         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20917         IsParameterAssigned, SetParameterAssigned): Removed.
20918
20919 2003-05-18  Martin Baulig  <martin@ximian.com>
20920
20921         * typemanager.cs (InitCoreTypes): Try calling
20922         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20923         the 3-args-version.  Corlib now also needs our `void_type'.
20924         (GetMethod): Added overloaded version which takes an optional
20925         `bool report_errors' to allow lookups of optional methods.
20926
20927 2003-05-12  Martin Baulig  <martin@ximian.com>
20928
20929         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20930         only used for locals and not for parameters.
20931
20932 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * support.cs (InternalParameters.ParameterType): Return the
20935         ExternalType of the parameter.
20936
20937         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20938         they were unused.
20939
20940 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * class.cs (MethodData.Define): Do not set the `newslot' on
20943         interface members, if they are also flagged as "override".
20944
20945         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20946         better code for ++i and i++.  This only works for static fields
20947         and local variables.
20948
20949         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20950         want to pull the DeclSpace out of the builder_to_declspace instead
20951         of the TypeBuilder (like in TypeContainer.FindMembers).
20952
20953         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20954         instead of LookupTypeContainer.  Fixes the crash on .NET for
20955         looking up interface members.
20956
20957         * const.cs: Create our own emit context during the Definition
20958         stage, so that constants are evaluated in the proper context, when
20959         a recursive definition happens.
20960
20961 2003-05-11  Martin Baulig  <martin@ximian.com>
20962
20963         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20964         new block for a switch section.
20965         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20966         the adding/lookup in the switch block.  Fixes #39828.
20967
20968 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20969
20970         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20971         functionality: I needed to convert the data after I had performed
20972         the add/sub operation into the operands type size.
20973
20974         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20975         pass the type for the box operation, otherwise the resulting
20976         object would have been of type object.
20977
20978         (BoxedCast): Add constructor to specify the type to box as.
20979
20980 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20981
20982         * iterators.cs: I was reusing the `count' variable inadvertently,
20983         take steps to not allow this to happen.
20984
20985 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20988         by creating an array at the point where the params starts and
20989         putting all those arguments there, then adjusting the size of the
20990         array.
20991
20992 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20993
20994         * expression.cs (New.AddressOf): Implement interface
20995         IMemoryLocation.  This is used when the `new' operator is used in
20996         the context of an invocation to a method on a value type.
20997
20998         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20999         example. 
21000
21001         * namespace.cs: Also check the using aliases here.
21002
21003         * driver.cs: Move the test for using validity after the types have
21004         been entered, so we do a single pass that also includes the using
21005         aliases. 
21006
21007         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
21008         in the regular case.   CreateSiblingForFinally is doing extra
21009         error checking.
21010
21011         * attribute.cs (GetAttributeArgumentExpression): Store the result
21012         on an out value, and use the return value to indicate failure
21013         instead of using null (which is a valid return for Constant.GetValue).
21014
21015         * statement.cs: Perform the analysis flow for the increment
21016         portion after the statement, because this will be the real flow of
21017         execution.  Fixes #42385
21018
21019         * codegen.cs (EmitContext.EmitArgument,
21020         EmitContext.EmitStoreArgument): New helper functions when the
21021         RemapToProxy flag is set.
21022
21023         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
21024         function.
21025
21026         Add support for remapping parameters. 
21027
21028         * iterators.cs: Propagate parameter values;  Store parameter
21029         values in the proxy classes.
21030
21031 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
21034         need a proxy reference;  I do not know what I was thinking
21035
21036         * cs-parser.jay (constructor_initializer): catch another error,
21037         and display nice message.
21038
21039         (field_declaration): catch void field declaration
21040         to flag a better error. 
21041
21042         * class.cs (MemberBase.CheckBase): Report an error instead of a
21043         warning if a new protected member is declared in a struct. 
21044         (Field.Define): catch the error of readonly/volatile.
21045
21046         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
21047
21048         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
21049         volatile variable is taken
21050
21051 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
21052
21053         * statement.cs (Fixed.Resolve): Report an error if we are not in
21054         an unsafe context.
21055
21056 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
21057
21058         * typemanager.cs: reuse the code that handles type clashes for
21059         delegates and enumerations.
21060
21061         * class.cs (Report28): Always report.
21062
21063         * expression.cs (EncodeAsAttribute): Allow nulls here.
21064
21065 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
21066
21067         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
21068         the functionality for testing whether an expression is valid for
21069         an attribute here.  Also handle the case of arrays of elements
21070         being stored. 
21071
21072         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
21073         encoding a linear array into an array of objects that are suitable
21074         to be passed to an CustomAttributeBuilder.
21075
21076         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
21077
21078         * ecore.cs: (FieldExpr): Handle field remapping here.
21079
21080         * iteratators.cs: Pass the instance variable (if the method is an
21081         instance method) to the constructors, so we can access the field
21082         variables on the class.
21083
21084         TODO: Test this with structs.  I think the THIS variable on
21085         structs might have to be a pointer, and not a refenrece
21086
21087 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
21088
21089         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
21090         local variables to fields in a proxy class.
21091
21092         * iterators.cs (PopulateProxy): Rename our internal fields to
21093         <XXX>.  
21094         Create a <THIS> field if we are an instance method, so we can
21095         reference our parent container variables.
21096         (MapVariable): Called back from the EmitContext code to enter a
21097         new variable to field mapping into the proxy class (we just create
21098         a FieldBuilder).
21099
21100         * expression.cs
21101         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
21102         for using the remapped locals to fields.
21103
21104         I placed the code here, because that gives the same semantics to
21105         local variables, and only changes the Emit code.
21106
21107         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
21108         statements inside iterators.
21109         (VariableInfo): Add a FieldBuilder for the cases when we are
21110         remapping local variables to fields in a proxy class
21111
21112         * ecore.cs (SimpleNameResolve): Avoid testing two times for
21113         current_block != null.
21114
21115         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
21116         not cope with strings, as it has been moved to the
21117         TableSwitchEmit.  Fixed bug in switch generation.
21118
21119         * expression.cs (New.DoResolve): Provide more context for the user
21120         when reporting an error.
21121
21122         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
21123         pointers. 
21124
21125         * expression.cs (MemberAccess.DoResolve): When we get a type back,
21126         check the permissions for it.  Note than in a type-resolution
21127         context the check was already present in DeclSpace.ResolveType,
21128         but was missing from the MemberAccess.
21129
21130         (ArrayCreation.CheckIndices): warn if the user has
21131         more nested levels of expressions, but there are no more
21132         dimensions specified.  Avoids crash on bug 41906.
21133
21134 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * statement.cs (Block): replace Implicit bool, for a generic
21137         flags.   
21138         New flag: `Unchecked'.  This is used during the EmitMeta phase
21139         (which is out-of-line with the regular Resolve/Emit process for a
21140         statement, as this is done ahead of time, but still gets a chance
21141         to call constant resolve).
21142
21143         (Block.Flags): new enum for adding a new flag.
21144
21145         (Block.EmitMeta): track the state of unchecked.
21146
21147         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
21148         to enable constant resolution to work there as well.
21149
21150 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
21151
21152         * typemanager.cs (ienumerable_type): Also look up
21153         System.Collections.IEnumerable. 
21154
21155 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
21156
21157         TODO: Test more than one conditional per method.
21158
21159         * class.cs (Indexer.Define): Report the location where the user is
21160         referencing the unsupported feature.
21161
21162         (MethodData): Overload the use of `conditionals' to
21163         minimize the creation of needless ArrayLists.   This saves roughly
21164         212kb on my machine.
21165
21166         (Method): Implement the new IIteratorContainer interface.
21167         (Method.SetYields): Implement the method by setting the ModFlags
21168         to contain METHOD_YIELDS.
21169
21170         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
21171         which just got set to null.
21172
21173         * iterators.cs: New file.
21174
21175         (Yield, YieldBreak): New statements.
21176
21177         * statement.cs (Return.Resolve): Flag an error if we are used in
21178         an iterator method.
21179
21180         * codegen.cs (InIterator): New flag set if the code is being
21181         compiled in an iterator method.
21182
21183         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
21184         internal modifier, and we just use it to avoid adding extra
21185         fields, as this is seldom used.  
21186
21187         * cs-parser.jay: Add yield_statement (yield and yield break).
21188
21189         * driver.cs: New flag -v2 to turn on version 2 features. 
21190
21191         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
21192         hashtable when v2 is enabled.
21193
21194 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
21197         there is already a namespace defined with this name.
21198
21199         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
21200         people upgraded their corlibs.
21201
21202         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
21203         always use fully qualified types, no need to use the compiler
21204         front end.
21205
21206         (TypeManager.IsNamespace): Use binarysearch.
21207
21208         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
21209         AddDelegate): I did not quite use the new IsValid API properly: I
21210         have to pass the short-name and the fullname.  I was passing only
21211         the basename instead of the fullname sometimes. 
21212
21213         (TypeContainer.DefineType): call NamespaceClash.
21214
21215         * interface.cs (Interface.DefineType): use NamespaceClash before
21216         defining the type.
21217
21218         * delegate.cs (Delegate.DefineType): use NamespaceClash before
21219         defining the type.
21220
21221         * enum.cs: (Enum.DefineType): use NamespaceClash before
21222         defining the type.
21223
21224         * typemanager.cs (: 3-line patch that gives us some tasty 11%
21225         speed increase.  First, use the negative_hits cache when we get a
21226         negative.  Second, add the type with its full original name
21227         instead of the new . and + encoded name (reflection uses + to
21228         separate type from a nested type).  Use LookupTypeReflection
21229         directly which bypasses the type->name hashtable (that we already
21230         know does not contain the type.
21231
21232         * decl.cs (DeclSpace.ResolveTypeExpr): track the
21233         location/container type. 
21234
21235         * driver.cs: When passing utf8, use directly the UTF8Encoding.
21236
21237 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
21238
21239         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
21240
21241         * delegate.cs (NewDelegate.Resolve): Test whether an instance
21242         method is being referenced in the method group from a static
21243         context, and report error 120 if so.
21244
21245         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
21246         Error118. 
21247
21248         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
21249         is created, we create the A namespace).
21250
21251         * cs-parser.jay: A namespace also introduces a DeclarationFound.
21252         Fixes #41591
21253
21254 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
21257         invocation to ModuleBuilder.GetType with the same values will
21258         return a new type instance, so we need to cache its return
21259         values. 
21260
21261         * expression.cs (Binary.ResolveOperator): Only allow the compare
21262         operators on enums if they are of the same type.
21263
21264         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
21265         types of ValueType on their own case.  Before we were giving them
21266         the same treatment as objects.
21267
21268         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
21269         fullname.  Short name is used to compare against container name.
21270         Fullname is used to check against defined namespace names.
21271
21272         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
21273         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
21274
21275         (Method.CheckBase): Call parent.
21276         (MemberBase.CheckBase): Check for protected members on sealed
21277         classes.
21278         (PropertyBase.CheckBase): Call parent.
21279         (Field.Define): Call parent.
21280
21281         * report.cs: Negative error codes are now mapped to 8000 - code,
21282         so that the display is render more nicely.
21283
21284         * typemanager.cs: Do not use try/catch, instead report a regular
21285         error. 
21286
21287         (GetPointerType, GetReferenceType): These methods provide
21288         mechanisms to obtain the T* and T& from a T.  We had the code
21289         previously scattered around the code base, and it also used
21290         TypeManager.LookupType that would go through plenty of caches.
21291         This one goes directly to the type source.
21292
21293         In some places we did the Type.GetType followed by
21294         ModuleBuilder.GetType, but not in others, so this unifies the
21295         processing as well.
21296
21297         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
21298         statements now that we have namespace information.
21299
21300         * typemanager.cs (IsNamespace): New method, returns whether the
21301         string presented is a namespace or not.
21302
21303         (ComputeNamespaces): New public entry point, computes the list of
21304         available namespaces, using the GetNamespaces API call in Mono, or
21305         the slower version in MS.NET.   
21306
21307         Now before we start the semantic analysis phase, we have a
21308         complete list of namespaces including everything that the user has
21309         provided.
21310
21311         Deleted old code to cache namespaces in .nsc files.
21312
21313 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21316         class/struct location definition Location for the implicit
21317         constructor location.
21318
21319         (Operator.Define): Use the location of the operator for the
21320         implicit Method definition.
21321
21322         (Constructor.Emit): use the constructor location for the implicit
21323         base initializer constructor.
21324
21325         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
21326         and the Expression class now contains two new methods:
21327
21328         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
21329         isolate type lookup from the rest of the resolution process.
21330
21331         Since we use Expressions to hold type definitions due to the way
21332         we parse the input we have historically overloaded Resolve to
21333         perform the Type lookups if a special flag is passed.  Now this is
21334         eliminated and two methods take their place. 
21335
21336         The differences in the two methods between xStep and xTerminal is
21337         that xStep is involved in our current lookup system that uses
21338         SimpleNames to compose a name, while xTerminal is used just to
21339         catch the case where the simplename lookup failed.
21340
21341 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
21342
21343         * expression.cs (ResolveMemberAccess): Remove redundant code.
21344         TypeExpr expressions are always born fully resolved.
21345
21346         * interface.cs (PopulateMethod): Do not lookup the types twice.
21347         We were doing it once during SemanticAnalysis and once during
21348         PopulateMethod.
21349
21350         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21351         in local variable type definitions, were being returned as a
21352         SimpleName (we decomposed everything into a string), that is
21353         because primary_expression was being used instead of a type in the
21354         grammar (reduce/reduce conflicts).
21355
21356         The part that was wrong is that we converted the expression into a
21357         string (an oversimplification in one hand, compounded with primary
21358         expressions doing string concatenation).
21359
21360         So things like:
21361
21362         A.B.C [] x;
21363
21364         Would return "A.B.C[]" as a SimpleName.  This stopped things like
21365         using clauses from working on this particular context.  And a type
21366         was being matched directly against "A.B.C[]".
21367
21368         We now use the correct approach, and allow for ComposedCast to be
21369         part of the unary expression.  So the "A.B.C []" become a composed
21370         cast of "A.B.C" (as a nested group of MemberAccess with a
21371         SimpleName at the end) plus the rank composition "[]". 
21372
21373         Also fixes 35567
21374
21375 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
21376
21377         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21378         for the access level checking.
21379
21380         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
21381         `TypeContainer container', because I kept getting confused when I
21382         was debugging this code.
21383
21384         * expression.cs (Indexers): Instead of tracking getters/setters,
21385         we now track them in parallel.  We create one arraylist less, but
21386         most importantly it is possible now for the LValue code to find a
21387         matching get for a set.
21388
21389         (IndexerAccess.DoResolveLValue): Update the code.
21390         GetIndexersForType has been modified already to extract all the
21391         indexers from a type.  The code assumed it did not.
21392
21393         Also make the code set the correct return type for the indexer.
21394         This was fixed a long time ago for properties, but was missing for
21395         indexers.  It used to be void_type.
21396
21397         (Binary.Emit): Test first for doubles instead of
21398         floats, as they are more common.
21399
21400         (Binary.EmitBranchable): Use the .un version of the branch opcodes
21401         when dealing with floats and the <=, >= operators.  This fixes bug
21402         #39314 
21403
21404         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21405         to load the array value by emitting a load on the foreach variable
21406         type.  This was incorrect.  
21407
21408         We now emit the code to load an element using the the array
21409         variable type, and then we emit the conversion operator.
21410
21411         Fixed #40176
21412
21413 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
21414
21415         * attribute.cs: Avoid allocation of ArrayLists in the common case.
21416
21417 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
21418
21419         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21420         test for protection before we test for signatures. 
21421
21422         (MethodSignature.ToString): implement.
21423
21424         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21425         to the case where we reduced into a LongConstant.
21426
21427         * decl.cs (CheckAccessLevel): If the type is an array, we can not
21428         depend on whether the information is acurrate, because the
21429         Microsoft runtime will always claim that the array type is public,
21430         regardless of the real state.
21431
21432         If the type is a pointer, another problem happens: the type is
21433         reported as non-public in Microsoft.  
21434
21435         In both cases we have to call CheckAccessLevel recursively with
21436         the underlying type as the argument to be tested.
21437
21438 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
21439
21440         * assign.cs (Assign.Emit): If we are dealing with a compound
21441         assignment expression, we should use the code path that stores the
21442         intermediate result in a temporary value.  This fixes #40903.
21443
21444         *expression.cs (Indirection.ToString): Provide ToString method for
21445         debugging. 
21446
21447 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
21448
21449         * class.cs: Null out fields holding references to Block objects so
21450         they can be garbage collected.
21451
21452         * expression.cs (OverloadResolve): Remove unused local.
21453
21454 2003-04-07  Martin Baulig  <martin@ximian.com>
21455
21456         * codegen.cs (EmitContext.CurrentFile): New public field.
21457         (EmitContext.Mark): Use the CurrentFile to check whether the
21458         location is in the correct file.
21459         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21460
21461 2003-04-07  Martin Baulig  <martin@ximian.com>
21462
21463         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21464
21465         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21466         location.  [FIXME: The location argument which gets passed to this
21467         method is sometimes wrong!]
21468
21469 2003-04-07  Nick Drochak <ndrochak@gol.com>
21470
21471         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21472
21473 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
21474
21475         * expression.cs (Indirection.EmitAssign): We were using the
21476         temporary, but returning immediately instead of continuing the
21477         EmitAssing flow.
21478
21479 2003-04-06  Martin Baulig  <martin@ximian.com>
21480
21481         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21482         if it's a nested child, but also deriving from the outer class.
21483         See test 190.cs.
21484
21485         * typemanager.cs (IsNestedChildOf): Make this work if it's a
21486         nested child, but also deriving from the outer class.  See
21487         test-190.cs.
21488         (FilterWithClosure): We may access private members of the outer
21489         class if we're a nested child and deriving from the outer class.
21490         (RealMemberLookup): Only set `closure_private_ok' if the
21491         `original_bf' contained BindingFlags.NonPublic.
21492
21493 2003-04-05  Martin Baulig  <martin@ximian.com>
21494
21495         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21496
21497 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
21498
21499         * class.cs (Event.Define): Do not allow abstract events to have
21500         initializers. 
21501
21502 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21505         block in event declarations.
21506
21507         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21508         value type, get its address.
21509
21510         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21511         leaving a class on the stack instead of a boolean value (int
21512         0/1).  Change the code so we compare against null, and then the
21513         result against zero.
21514
21515         * class.cs (TypeContainer.GetClassBases): We were checking for the
21516         parent class being sealed too late.
21517
21518         * expression.cs (Binary.Emit): For <= and >= when dealing with
21519         floating point values, use cgt.un and clt.un instead of cgt and
21520         clt alone.
21521
21522 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
21523
21524         * statement.cs: Apply the same optimization as MS: skip the 
21525         GetEnumerator returning an IEnumerator, and use the one returning a 
21526         CharEnumerator instead. This allows us to avoid the try-finally block 
21527         and the boxing.
21528
21529 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
21530
21531         * cs-parser.jay: Attributes cannot be applied to
21532                          namespaces. Fixes #40473
21533
21534 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21535
21536         * class.cs:
21537         (Add*): check if the name is valid using the full name for constants,
21538         fields, properties and events.
21539
21540 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
21541
21542         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21543         char constants to be part of the enumeration.
21544
21545         * expression.cs (Conditional.DoResolve): Add support for operator
21546         true. Implements the missing functionality from 14.12
21547
21548         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21549         operator true/false as required by the spec.
21550
21551         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21552         implicit conversion to boolean.
21553
21554         * statement.cs (Statement.ResolveBoolean): A boolean expression is
21555         also one where the type implements `operator true'. 
21556
21557         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21558         get an expression that will invoke operator true based on an
21559         expression.  
21560
21561         (GetConversionOperators): Removed the hack that called op_True
21562         here.  
21563
21564         (Expression.ResolveBoolean): Move this from Statement.
21565
21566 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
21567
21568         * ecore.cs (FieldExpr): do not allow initialization of initonly
21569         fields on derived classes
21570
21571 2003-03-13  Martin Baulig  <martin@ximian.com>
21572
21573         * statement.cs (Block.Emit): Call ig.BeginScope() and
21574         ig.EndScope() when compiling with debugging info; call
21575         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21576
21577 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * expression.cs (Indexers): Do not construct immediately, allow
21580         for new members to be appended as we go.  Fixes 38143
21581
21582 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21583
21584         * expression.cs: save/restore context when resolving an unchecked
21585         expression.
21586
21587 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
21588
21589         * cfold.cs: Catch division by zero in modulus operator during
21590         constant folding.
21591
21592 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
21593
21594         * interface.cs (Interface.DefineMembers): Avoid defining members
21595         twice. 
21596
21597 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
21598
21599         * driver.cs: handle the +/- options for -noconfig
21600
21601         * statement.cs (Unckeched.Resolve): Also track the state of
21602         unchecked in the Resolve phase.
21603
21604 2003-02-27  Martin Baulig  <martin@ximian.com>
21605
21606         * ecore.cs (Expression.MemberLookup): Don't create a
21607         MethodGroupExpr for something which is not a method.  Fixes #38291.
21608
21609 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
21610
21611         * class.cs (MemberBase.CheckParameters): Also check that the type
21612         is unmanaged if it is a pointer.
21613
21614         * expression.cs (SizeOf.Resolve): Add location information.
21615
21616         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21617         a managed type is declared.
21618
21619         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21620         parameter modifiers as well.  Fixes bug 38606
21621
21622         * class.cs: Very sad.  Am backing out the speed up changes
21623         introduced by the ArrayList -> Array in the TypeContainer, as they
21624         were not actually that much faster, and introduced a bug (no error
21625         reports on duplicated methods).
21626
21627         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21628         source first, this will guarantee that we have a valid expression
21629         before calling in lower levels functions that will require a
21630         resolved object.  Then use this original_source in the
21631         target.ResolveLValue instead of the original source that was
21632         passed to us.
21633
21634         Another change.  Use target.Resolve instead of LValueResolve.
21635         Although we are resolving for LValues, we will let the Assign code
21636         take care of that (it will be called again from Resolve).  This
21637         basically allows code like this:
21638
21639         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21640         class Y { void A (X x) { x [0] += o; }
21641
21642         The problem was that the indexer was trying to resolve for
21643         set_Item (idx, object o) and never finding one.  The real set_Item
21644         was set_Item (idx, X).  By delaying the process we get the right
21645         semantics. 
21646
21647         Fixes bug 36505
21648
21649 2003-02-23  Martin Baulig  <martin@ximian.com>
21650
21651         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21652         while calling DoEmit ().
21653
21654         * codegen.cs (EmitContext.Mark): Don't mark locations in other
21655         source files; if you use the #line directive inside a method, the
21656         compiler stops emitting line numbers for the debugger until it
21657         reaches the end of the method or another #line directive which
21658         restores the original file.
21659
21660 2003-02-23  Martin Baulig  <martin@ximian.com>
21661
21662         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21663
21664 2003-02-23  Martin Baulig  <martin@ximian.com>
21665
21666         * statement.cs (Block.AddChildVariableNames): We need to call this
21667         recursively, not just for our immediate children.
21668
21669 2003-02-23  Martin Baulig  <martin@ximian.com>
21670
21671         * class.cs (Event.Define): Always make the field private, like csc does.
21672
21673         * typemanager.cs (TypeManager.RealMemberLookup): Make events
21674         actually work, fixes bug #37521.
21675
21676 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
21677
21678         * delegate.cs: When creating the various temporary "Parameters"
21679         classes, make sure that we call the ComputeAndDefineParameterTypes
21680         on those new parameters (just like we do with the formal ones), to
21681         allow them to be resolved in the context of the DeclSpace.
21682
21683         This fixes the bug that Dick observed in Bugzilla #38530.
21684
21685 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
21686
21687         * expression.cs (ResolveMemberAccess): When resolving a constant,
21688         do not attempt to pull a constant if the value was not able to
21689         generate a valid constant.
21690
21691         * const.cs (LookupConstantValue): Do not report more errors than required.
21692
21693 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21694
21695         * expression.cs: fixes bug #38328.
21696
21697 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21698
21699         * class.cs: Changed all the various members that can be part of a
21700         class from being an ArrayList to be an Array of the right type.
21701         During the DefineType type_list, interface_list, delegate_list and
21702         enum_list are turned into types, interfaces, delegates and enums
21703         arrays.  
21704
21705         And during the member population, indexer_list, event_list,
21706         constant_list, field_list, instance_constructor_list, method_list,
21707         operator_list and property_list are turned into their real arrays.
21708
21709         Although we could probably perform this operation earlier, for
21710         good error reporting we need to keep the lists and remove the
21711         lists for longer than required.
21712
21713         This optimization was triggered by Paolo profiling the compiler
21714         speed on the output of `gen-sample-program.pl' perl script. 
21715
21716         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21717         not crash in methods like MemberLookupFailed that use this field.  
21718
21719         This problem arises when the compiler fails to resolve a type
21720         during interface type definition for example.
21721
21722 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21723
21724         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21725         inherit from System.Object, so we have to stop at null, not only
21726         when reaching System.Object.
21727
21728 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
21729
21730         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21731         DeclaredOnly because the parent indexer might have had a different
21732         name, but did not loop until the top of the hierarchy was reached.
21733
21734         The problem this one fixes is 35492: when a class implemented an
21735         indexer from an interface, we were getting the interface method
21736         (which was abstract) and we were flagging an error (can not invoke
21737         abstract method).
21738
21739         This also keeps bug 33089 functioning, and test-148 functioning.
21740
21741         * typemanager.cs (IsSpecialMethod): The correct way of figuring
21742         out if a method is special is to see if it is declared in a
21743         property or event, or whether it is one of the predefined operator
21744         names.   This should fix correctly #36804.
21745
21746 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
21747
21748         The goal here is to remove the dependency on EmptyCast.Peel ().
21749         Killing it completely.
21750
21751         The problem is that currently in a number of places where
21752         constants are expected, we have to "probe" for an EmptyCast, and
21753         Peel, which is not the correct thing to do, as this will be
21754         repetitive and will likely lead to errors. 
21755
21756         The idea is to remove any EmptyCasts that are used in casts that
21757         can be reduced to constants, so we only have to cope with
21758         constants. 
21759
21760         This bug hunt was triggered by Bug 37363 and the desire to remove
21761         the duplicate pattern where we were "peeling" emptycasts to check
21762         whether they were constants.  Now constants will always be
21763         constants.
21764
21765         * ecore.cs: Use an enumconstant here instead of wrapping with
21766         EmptyCast.  
21767
21768         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21769         throwing me off.  By handling this we can get rid of a few hacks.
21770
21771         * statement.cs (Switch): Removed Peel() code.
21772
21773 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * class.cs: Location information for error 508
21776
21777         * expression.cs (New.DoResolve): Add a guard against double
21778         resolution of an expression.  
21779
21780         The New DoResolve might be called twice when initializing field
21781         expressions (see EmitFieldInitializers, the call to
21782         GetInitializerExpression will perform a resolve on the expression,
21783         and later the assign will trigger another resolution
21784
21785         This leads to bugs (#37014)
21786
21787         * delegate.cs: The signature for EndInvoke should contain any ref
21788         or out parameters as well.  We were not doing this in the past. 
21789
21790         * class.cs (Field.Define): Do not overwrite the type definition
21791         inside the `volatile' group.  Turns out that volatile enumerations
21792         were changing the type here to perform a validity test, which
21793         broke conversions. 
21794
21795 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21798         and structs, we do not want to load the instance variable
21799
21800         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21801         enum_type has to be handled like an object reference (implicit
21802         conversions exists from this to object), but the regular IsClass
21803         and IsValueType tests will never return true for this one.
21804
21805         Also we use TypeManager.IsValueType instead of type.IsValueType,
21806         just for consistency with the rest of the code (this is only
21807         needed if we ever use the construct exposed by test-180.cs inside
21808         corlib, which we dont today).
21809
21810 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
21811
21812         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21813         just InternalCall.
21814
21815 2003-02-09  Martin Baulig  <martin@ximian.com>
21816
21817         * namespace.cs (Namespace..ctor): Added SourceFile argument.
21818         (Namespace.DefineNamespaces): New static public method; this is
21819         called when we're compiling with debugging to add all namespaces
21820         to the symbol file.
21821
21822         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21823         pass it to the Namespace's .ctor.
21824
21825         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21826         and MethodBase arguments; pass the namespace ID to the symwriter;
21827         pass the MethodBase instead of the token to the symwriter.
21828         (SymbolWriter.DefineNamespace): New method to add a namespace to
21829         the symbol file.
21830
21831 2003-02-09  Martin Baulig  <martin@ximian.com>
21832
21833         * symbolwriter.cs: New file.  This is a wrapper around
21834         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
21835         methods here in near future.
21836
21837 2003-02-09  Martin Baulig  <martin@ximian.com>
21838
21839         * codegen.cs (EmitContext.Mark): Just pass the arguments to
21840         ILGenerator.MarkSequencePoint() which are actually used by the
21841         symbol writer.
21842
21843 2003-02-09  Martin Baulig  <martin@ximian.com>
21844
21845         * location.cs (SourceFile): New public sealed class.  This
21846         contains the name and an index which is used in the location's token.
21847         (Location): Reserve an appropriate number of bits in the token for
21848         the source file instead of walking over that list, this gives us a
21849         really huge performance improvement when compiling with debugging.
21850
21851         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21852         `SourceFile' argument instead of a string.
21853         (Driver.ProcessFile): Add all the files via Location.AddFile(),
21854         but don't parse/tokenize here, we need to generate the list of all
21855         source files before we do that.
21856         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
21857         the files.
21858
21859         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21860         instead of a string.
21861
21862         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21863         of a string.
21864
21865 2003-02-09  Martin Baulig  <martin@ximian.com>
21866
21867         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21868         filename on `#line default'.
21869
21870 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21871
21872         * statement.cs: don't clear the pinned var when the fixed statement
21873         returns from the method (fixes bug#37752).
21874
21875 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21876
21877         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21878         to IsValueType.
21879
21880 2003-02-07  Martin Baulig  <martin@ximian.com>
21881
21882         * driver.cs: Removed the `--debug-args' command line argument.
21883
21884         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21885         automatically by the AsssemblyBuilder.
21886         (CodeGen.InitializeSymbolWriter): We don't need to call any
21887         initialization function on the symbol writer anymore.  This method
21888         doesn't take any arguments.
21889
21890 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21891
21892         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21893         from referenced assemblies as well.
21894
21895 2003-02-02  Martin Baulig  <martin@ximian.com>
21896
21897         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21898
21899 2003-02-02  Martin Baulig  <martin@ximian.com>
21900
21901         * class.cs (Constructor.Emit): Open the symbol writer before
21902         emitting the constructor initializer.
21903         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21904         single-stepping through constructor initializers.
21905
21906 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21907
21908         * class.cs: Handle error 549: do not allow virtual methods in
21909         sealed classes. 
21910
21911 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21912
21913         * decl.cs: Check access levels when resolving types
21914
21915 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21916
21917         * statement.cs: Add parameters and locals set in catch blocks that might 
21918         return to set vector
21919
21920 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21921
21922         * class.cs (Operator): Set the SpecialName flags for operators.
21923
21924         * expression.cs (Invocation.DoResolve): Only block calls to
21925         accessors and operators on SpecialName methods.
21926
21927         (Cast.TryReduce): Handle conversions from char constants.
21928
21929
21930 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21931
21932         * statement.cs: small memory and time optimization in FlowBranching.
21933
21934 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21935
21936         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21937         problem that the last fix but in the other sid (Set).
21938
21939         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21940         access when there is no indexer in the hierarchy.
21941
21942 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21943
21944         * class.cs: Combine some if statements.
21945
21946 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21947
21948         * driver.cs: fixed bug #37187.
21949
21950 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21951
21952         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21953         any indexer, it's needed to build a list with all the indexers in the
21954         hierarchy (AllGetters), else we have problems. Fixes #35653.
21955
21956 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21957
21958         * class.cs (MethodData.Define): It is wrong for an interface
21959         implementation to be static in both cases: explicit and implicit.
21960         We were only handling this in one case.
21961
21962         Improve the if situation there to not have negations.
21963
21964         * class.cs (Field.Define): Turns out that we do not need to check
21965         the unsafe bit on field definition, only on usage.  Remove the test.
21966
21967 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21968
21969         * driver.cs: use assembly.Location instead of Codebase (the latest
21970         patch made mcs fail when using MS assemblies).
21971
21972 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21973
21974         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21975         get the path to *corlib.dll.
21976
21977 2003-01-21  Nick Drochak <ndrochak@gol.com>
21978
21979         * cs-tokenizer.cs:
21980         * pending.cs:
21981         * typemanager.cs: Remove compiler warnings
21982
21983 2003-01-20  Duncan Mak  <duncan@ximian.com>
21984
21985         * AssemblyInfo.cs: Bump the version number to 0.19.
21986
21987 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21988
21989         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21990
21991 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21992
21993         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21994
21995 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * cs-parser.jay: Small fix: we were not comparing the constructor
21998         name correctly.   Thanks to Zoltan for the initial pointer.
21999
22000 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
22001
22002         * cs-tokenizer.cs: Set file name when specified with #line
22003
22004 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
22005
22006         * cs-parser.jay: Only perform the constructor checks here if we
22007         are named like the class;  This will help provider a better
22008         error.  The constructor path is taken when a type definition is
22009         not found, but most likely the user forgot to add the type, so
22010         report that rather than the constructor error.
22011
22012 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
22013
22014         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
22015         allocations.
22016
22017 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22018
22019         * cs-parser.jay: Add cleanup call.
22020
22021 2003-01-13  Duncan Mak  <duncan@ximian.com>
22022
22023         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
22024         consistent with other methods.
22025
22026 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22027
22028         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
22029
22030 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
22031
22032         * attribute.cs: only set GuidAttr to true when we have a
22033         GuidAttribute.
22034
22035 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22036
22037         * ecore.cs:
22038         * expression.cs:
22039         * typemanager.cs: fixes to allow mcs compile corlib with the new
22040         Type.IsSubclassOf fix.
22041
22042 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * expression.cs (LocalVariableReference.DoResolve): Classify a
22045         constant as a value, not as a variable.   Also, set the type for
22046         the variable.
22047
22048         * cs-parser.jay (fixed_statement): take a type instead of a
22049         pointer_type, so we can produce a better error message later.
22050
22051         * statement.cs (Fixed.Resolve): Flag types that are not pointers
22052         as an error.  
22053
22054         (For.DoEmit): Make inifinite loops have a
22055         non-conditional branch back.
22056
22057         (Fixed.DoEmit): First populate the pinned variables, then emit the
22058         statement, then clear the variables.  Before I was emitting the
22059         code once for each fixed piece.
22060
22061
22062 2003-01-08  Martin Baulig  <martin@ximian.com>
22063
22064         * statement.cs (FlowBranching.MergeChild): A break in a
22065         SWITCH_SECTION does not leave a loop.  Fixes #36155.
22066
22067 2003-01-08  Martin Baulig  <martin@ximian.com>
22068
22069         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
22070         lives in the same number space than `param_map'.  Fixes #36154.
22071
22072 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
22073
22074         * cs-parser.jay (constructor_declaration): Set the
22075         Constructor.ModFlags before probing for it.  This makes the
22076         compiler report 514, 515 and 132 (the code was there, but got
22077         broken). 
22078
22079         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
22080         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
22081         (GotoCase.Resolve): Set `Returns' to ALWAYS.
22082
22083 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
22084
22085         * enum.cs: create the enum static fields using the enum type.
22086
22087 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
22088
22089         * class.cs: don't try to create the ParamBuilder for the return
22090         type if it's not needed (and handle it breaking for the ms runtime
22091         anyway).
22092
22093 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
22094
22095         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
22096
22097 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
22098
22099         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
22100         the command.   This showed up while compiling the JANET source
22101         code, which used \r as its only newline separator.
22102
22103 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
22104
22105         * class.cs (Method.Define): If we are an operator (because it
22106         reuses our code), then set the SpecialName and HideBySig.  #36128
22107
22108 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
22109
22110         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
22111         exception, report error 120 `object reference required'.
22112
22113         * driver.cs: Add --pause option, used during to measure the size
22114         of the process as it goes with --timestamp.
22115
22116         * expression.cs (Invocation.DoResolve): Do not allow methods with
22117         SpecialName to be invoked.
22118
22119 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
22120
22121         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
22122         number before adding it.
22123
22124 2002-12-21  Ravi Pratap  <ravi@ximian.com>
22125
22126         * ecore.cs (StandardImplicitConversion): When in an unsafe
22127         context, we allow conversion between void * to any other pointer
22128         type. This fixes bug #35973.
22129
22130 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
22131
22132         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
22133         is not thrown when extensionless outputs are used 
22134
22135 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22136
22137         * rootcontext.cs: fixed compilation of corlib.
22138
22139 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
22140
22141         * attribute.cs (Attributes.Contains): Add new method.
22142
22143         * class.cs (MethodCore.LabelParameters): if the parameter is an
22144         `out' parameter, check that no attribute `[In]' has been passed.
22145
22146         * enum.cs: Handle the `value__' name in an enumeration.
22147
22148 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
22149
22150         * decl.cs: Added special case to allow overrides on "protected
22151         internal" methods
22152
22153 2002-12-18  Ravi Pratap  <ravi@ximian.com>
22154
22155         * attribute.cs (Attributes.AddAttributeSection): Rename to this
22156         since it makes much more sense.
22157
22158         (Attributes.ctor): Don't require a Location parameter.
22159
22160         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
22161
22162         * attribute.cs (ApplyAttributes): Remove extra Location parameters
22163         since we already have that information per attribute.
22164
22165         * everywhere : make appropriate changes.
22166
22167         * class.cs (LabelParameters): Write the code which actually
22168         applies attributes to the return type. We can't do this on the MS
22169         .NET runtime so we flag a warning in the case an exception is
22170         thrown.
22171
22172 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
22173
22174         * const.cs: Handle implicit null conversions here too.
22175
22176 2002-12-17  Ravi Pratap  <ravi@ximian.com>
22177
22178         * class.cs (MethodCore.LabelParameters): Remove the extra
22179         Type [] parameter since it is completely unnecessary. Instead
22180         pass in the method's attributes so that we can extract
22181         the "return" attribute.
22182
22183 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
22184
22185         * cs-parser.jay (parse): Use Report.Error to flag errors instead
22186         of ignoring it and letting the compile continue.
22187
22188         * typemanager.cs (ChangeType): use an extra argument to return an
22189         error condition instead of throwing an exception.
22190
22191 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
22192
22193         * expression.cs (Unary.TryReduce): mimic the code for the regular
22194         code path.  Perform an implicit cast in the cases where we can
22195         implicitly convert to one of the integral types, and then reduce
22196         based on that constant.   This fixes bug #35483.
22197
22198 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22199
22200         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
22201
22202 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22203
22204         * namespace.cs: fixed bug #35489.
22205
22206 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * class.cs: Remove some dead code.
22209
22210         * cs-parser.jay: Estimate the number of methods needed
22211         (RootContext.MethodCount);
22212
22213         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
22214         numbers instead of StringBuilders.
22215
22216         * support.cs (PtrHashtable): Add constructor with initial size;
22217         We can now reduce reallocations of the method table.
22218
22219 2002-12-10  Ravi Pratap  <ravi@ximian.com>
22220
22221         * attribute.cs (ApplyAttributes): Keep track of the emitted
22222         attributes on a per-target basis. This fixes bug #35413.
22223
22224 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
22225
22226         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
22227         default to the Windows 1252 encoding.
22228
22229         (UnixParseOption): Support version, thanks to Alp for the missing
22230         pointer. 
22231
22232         * AssemblyInfo.cs: Add nice assembly information.
22233
22234         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
22235         (bug 35169).
22236
22237         * cs-parser.jay: Allow a trailing comma before the close bracked
22238         in the attribute_section production.
22239
22240         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
22241         address of the instance was being taken, I will take this out,
22242         because we take the address of the object immediately here.
22243
22244 2002-12-09  Ravi Pratap  <ravi@ximian.com>
22245
22246         * typemanager.cs (AreMultipleAllowed): Take care of the most
22247         obvious case where attribute type is not in the current assembly -
22248         stupid me ;-)
22249
22250 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
22251
22252         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
22253         definitions, instead of doing that afterwards.  
22254
22255         Also we use a nice little hack, depending on the constructor, we
22256         know if we are a "composed" name or a simple name.  Hence, we
22257         avoid the IndexOf test, and we avoid 
22258
22259         * codegen.cs: Add code to assist in a bug reporter to track down
22260         the source of a compiler crash. 
22261
22262 2002-12-07  Ravi Pratap  <ravi@ximian.com>
22263
22264         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
22265         types have been emitted for a given element and flag an error
22266         if something which does not have AllowMultiple set is used more
22267         than once.
22268
22269         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
22270         attribute types and their corresponding AllowMultiple properties
22271
22272         (AreMultipleAllowed): Check the property for a given type.
22273
22274         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
22275         property in the case we have a TypeContainer.
22276
22277         (Attributes.AddAttribute): Detect duplicates and just skip on
22278         adding them. This trivial fix catches a pretty gross error in our
22279         attribute emission - global attributes were being emitted twice!
22280
22281         Bugzilla bug #33187 is now fixed.
22282
22283 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
22284
22285         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
22286         instead of pp_and).
22287
22288         * expression.cs (Binary.ResolveOperator): I can only use the
22289         Concat (string, string, string) and Concat (string, string,
22290         string, string) if the child is actually a concatenation of
22291         strings. 
22292
22293 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
22294
22295         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
22296         context where we need a 2-character lookahead.
22297
22298         * pending.cs (PendingImplementation): Rework so we can keep track
22299         of interface types all the time, and flag those which were
22300         implemented by parents as optional.
22301
22302 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
22303
22304         * expression.cs (Binary.ResolveOperator): Use
22305         String.Concat(string,string,string) or
22306         String.Concat(string,string,string,string) when possible. 
22307
22308         * typemanager: More helper methods.
22309
22310
22311 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22312
22313         * pending.cs: remove the bogus return from GetMissingInterfaces()
22314         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22315
22316 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22317
22318         * namespace.cs: avoid duplicated 'using xxx' being added to
22319         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22320         when we get more than one 'using' statement for the same namespace.
22321         Report a CS0105 warning for it.
22322
22323 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
22324
22325         * cs-tokenizer.cs (consume_identifier): use read directly, instead
22326         of calling getChar/putback, uses internal knowledge of it.    
22327
22328         (xtoken): Reorder tokenizer so most common patterns are checked
22329         first.  This reduces the compilation time in another 5% (from 8.11s
22330         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22331
22332         The parsing time is 22% of the compilation in mcs, and from that
22333         64% is spent on the tokenization process.  
22334
22335         I tried using a binary search for keywords, but this is slower
22336         than the hashtable.  Another option would be to do a couple of
22337         things:
22338
22339                 * Not use a StringBuilder, instead use an array of chars,
22340                   with a set value.  Notice that this way we could catch
22341                   the 645 error without having to do it *afterwards*.
22342
22343                 * We could write a hand-parser to avoid the hashtable
22344                   compares altogether.
22345
22346         The identifier consumption process takes 37% of the tokenization
22347         time.  Another 15% is spent on is_number.  56% of the time spent
22348         on is_number is spent on Int64.Parse:
22349
22350                 * We could probably choose based on the string length to
22351                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
22352                   computations. 
22353
22354         Another 3% is spend on wrapping `xtoken' in the `token' function.
22355
22356         Handle 0xa0 as whitespace (#34752)
22357
22358 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
22359
22360         * typemanager.cs (IsCLRType): New routine to tell whether a type
22361         is one of the builtin types.  
22362
22363         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
22364         typecode in more places instead of doing pointer comparissions.
22365         We could leverage some knowledge about the way the typecodes are
22366         laid out.
22367
22368         New code to cache namespaces in assemblies, it is currently not
22369         invoked, to be used soon.
22370
22371         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22372
22373         * expression.cs (Binary.ResolveOperator): specially handle
22374         strings, and do not perform user-defined operator overloading for
22375         built-in types.
22376
22377 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22380         internalcall as it is a pretty simple operation;  Avoid whenever
22381         possible to call Char.IsLetter.
22382
22383         (consume_identifier): Cut by half the number of
22384         hashtable calls by merging the is_keyword and GetKeyword behavior.
22385
22386         Do not short-circuit, because if we do, we
22387         report errors (ie, #if false && true would produce an invalid
22388         directive error);
22389
22390
22391 2002-11-24  Martin Baulig  <martin@ximian.com>
22392
22393         * expression.cs (Cast.TryReduce): If we're in checked syntax,
22394         check constant ranges and report a CS0221.  Fixes #33186.
22395
22396 2002-11-24  Martin Baulig  <martin@ximian.com>
22397
22398         * cs-parser.jay: Make this work for uninitialized variable
22399         declarations in the `for' initializer.  Fixes #32416.
22400
22401 2002-11-24  Martin Baulig  <martin@ximian.com>
22402
22403         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22404         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
22405
22406 2002-11-24  Martin Baulig  <martin@ximian.com>
22407
22408         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22409         argument; if true, we also check for user-defined conversions.
22410         This is only needed if both arguments are of a user-defined type.
22411         Fixes #30443, added test-175.cs.
22412         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22413
22414         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22415
22416 2002-11-24  Martin Baulig  <martin@ximian.com>
22417
22418         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22419         function to get the store opcode.
22420         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22421         only emit the Ldelema if the store opcode is Stobj.  You must run
22422         both test-34 and test-167 to test this.  Fixes #34529.
22423
22424 2002-11-23  Martin Baulig  <martin@ximian.com>
22425
22426         * ecore.cs (Expression.MemberLookup): Added additional
22427         `qualifier_type' argument which is used when we're being called
22428         from MemberAccess.DoResolve() and null if we're called from a
22429         SimpleName lookup.
22430         (Expression.MemberLookupFailed): New method to report errors; this
22431         does the CS1540 check and reports the correct error message.
22432
22433         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22434         argument for the CS1540 check and redone the way how we're dealing
22435         with private members.  See the comment in the source code for details.
22436         (FilterWithClosure): Reverted this back to revision 1.197; renamed
22437         `closure_start_type' to `closure_qualifier_type' and check whether
22438         it's not null.  It was not this filter being broken, it was just
22439         being called with the wrong arguments.
22440
22441         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22442         and pass it the correct `qualifier_type'; this also does the error
22443         handling for us.
22444
22445 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
22446
22447         * expression.cs (Invocation.EmitParams): If the we are dealing
22448         with a non-built-in value type, load its address as well.
22449
22450         (ArrayCreation): Use a a pretty constant instead
22451         of the hardcoded value 2.   Use 6 instead of 2 for the number of
22452         static initializers.  
22453
22454         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22455         because they are not really value types, just glorified integers. 
22456
22457         * driver.cs: Do not append .exe, the CSC compiler does not do it.
22458
22459         * ecore.cs: Remove redundant code for enumerations, make them use
22460         the same code path as everything else, fixes the casting issue
22461         with enumerations in Windows.Forms.
22462
22463         * attribute.cs: Do only cast to string if it is a string, the
22464         validation happens later.
22465
22466         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22467         people upgrade their corlibs.
22468
22469         * ecore.cs: Oops, enumerations were not following the entire code path
22470
22471 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
22472
22473         * typemanager.cs (FilterWithClosure): Commented out the test for
22474         1540 in typemanager.cs, as it has problems when accessing
22475         protected methods from a parent class (see test-174.cs). 
22476
22477         * attribute.cs (Attribute.ValidateGuid): new method.
22478         (Attribute.Resolve): Use above.
22479
22480 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
22481
22482         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22483
22484         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22485         handling for enumerations, as we only needed the TypeContainer
22486         functionality to begin with (this is required for the fix below to
22487         work for enums that reference constants in a container class for
22488         example). 
22489
22490         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22491
22492         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22493         a valid TypeBuilder to perform lookups on.o
22494
22495         * class.cs (InheritableMemberSignatureCompare): Use true in the
22496         call to GetGetMethod and GetSetMethod, because we are comparing
22497         the signature, and we need to get the methods *even* if they are
22498         private. 
22499
22500         (PropertyBase.CheckBase): ditto.
22501
22502         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22503         GotoCase.Resolve): Use Peel on EmpytCasts.
22504
22505         * ecore.cs (EmptyCast): drop child, add Peel method.
22506
22507 2002-11-17  Martin Baulig  <martin@ximian.com>
22508
22509         * ecore.cs (EmptyCast.Child): New public property.
22510
22511         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22512         label resolved to an EmptyCast.  Fixes #34162.
22513         (GotoCase.Resolve): Likewise.
22514         (Block.EmitMeta): Likewise.
22515
22516 2002-11-17  Martin Baulig  <martin@ximian.com>
22517
22518         * expression.cs (Invocation.BetterConversion): Prefer int over
22519         uint; short over ushort; long over ulong for integer literals.
22520         Use ImplicitConversionExists instead of StandardConversionExists
22521         since we also need to check for user-defined implicit conversions.
22522         Fixes #34165.  Added test-173.cs.
22523
22524 2002-11-16  Martin Baulig  <martin@ximian.com>
22525
22526         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22527         with the `true' and `false' literals.  Fixes #33151.
22528
22529 2002-11-16  Martin Baulig  <martin@ximian.com>
22530
22531         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22532         October 22nd; don't do the cs1540 check for static members.
22533
22534         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22535         now using our own filter here and doing the cs1540 check again.
22536
22537 2002-11-16  Martin Baulig  <martin@ximian.com>
22538
22539         * support.cs (InternalParameters): Don't crash if we don't have
22540         any fixed parameters.  Fixes #33532.
22541
22542 2002-11-16  Martin Baulig  <martin@ximian.com>
22543
22544         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22545         when looking up static methods to make this work on Windows.
22546         Fixes #33773.
22547
22548 2002-11-16  Martin Baulig  <martin@ximian.com>
22549
22550         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22551         a setter rather than using PropertyInfo.CanWrite.
22552
22553 2002-11-15  Nick Drochak  <ndrochak@gol.com>
22554
22555         * class.cs: Allow acces to block member by subclasses. Fixes build
22556         breaker.
22557
22558 2002-11-14  Martin Baulig  <martin@ximian.com>
22559
22560         * class.cs (Constructor.Emit): Added the extern/block check.
22561         Fixes bug #33678.
22562
22563 2002-11-14  Martin Baulig  <martin@ximian.com>
22564
22565         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22566         iteration while looking for indexers, this is needed because the
22567         indexer may have a different name in our base classes.  Fixed the
22568         error reporting (no indexers at all, not get accessor, no
22569         overloaded match).  Fixes bug #33089.
22570         (IndexerAccess.DoResolveLValue): Likewise.
22571
22572 2002-11-14  Martin Baulig  <martin@ximian.com>
22573
22574         * class.cs (PropertyBase.CheckBase): Make this work for multiple
22575         indexers.  Fixes the first part of bug #33089.
22576         (MethodSignature.InheritableMemberSignatureCompare): Added support
22577         for properties.
22578
22579 2002-11-13  Ravi Pratap  <ravi@ximian.com>
22580
22581         * attribute.cs (Attribute.Resolve): Catch the
22582         NullReferenceException and report it since it isn't supposed to
22583         happen. 
22584
22585 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
22586
22587         * expression.cs (Binary.EmitBranchable): Also handle the cases for
22588         LogicalOr and LogicalAnd that can benefit from recursively
22589         handling EmitBranchable.  The code now should be nice for Paolo.
22590
22591 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * typemanager.cs (LookupType): Added a negative-hit hashtable for
22594         the Type lookups, as we perform quite a number of lookups on
22595         non-Types.  This can be removed once we can deterministically tell
22596         whether we have a type or a namespace in advance.
22597
22598         But this might require special hacks from our corlib.
22599
22600         * TODO: updated.
22601
22602         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22603         and double which avoids a conversion from an integer to a double.
22604
22605         * expression.cs: tiny optimization, avoid calling IsConstant,
22606         because it effectively performs the lookup twice.
22607
22608 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
22609
22610         But a bogus return here to keep the semantics of the old code
22611         until the Mono runtime is fixed.
22612
22613         * pending.cs (GetMissingInterfaces): New method used to remove all
22614         the interfaces that are already implemented by our parent
22615         classes from the list of pending methods. 
22616
22617         * interface.cs: Add checks for calls after ResolveTypeExpr.
22618
22619 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
22620
22621         * class.cs (Class.Emit): Report warning 67: event not used if the
22622         warning level is beyond 3.
22623
22624         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22625         being a NullLiteral.
22626
22627         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22628         specifiers. 
22629
22630         * class.cs (TypeContainer.GetClassBases): Cover a missing code
22631         path that might fail if a type can not be resolved.
22632
22633         * expression.cs (Binary.Emit): Emit unsigned versions of the
22634         operators. 
22635
22636         * driver.cs: use error 5.
22637
22638 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22639
22640         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22641
22642 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
22643
22644         * cs-parser.jay (switch_section): A beautiful patch from Martin
22645         Baulig that fixed 33094.
22646
22647 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
22648
22649         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22650         Check whether the base is abstract and report an error if so.
22651
22652         * expression.cs (IndexerAccess.DoResolveLValue,
22653         IndexerAccess.DoResolve): ditto. 
22654
22655         (Invocation.DoResolve): ditto.
22656
22657         (Invocation.FullMethodDesc): Improve the report string.
22658
22659         * statement.cs (Block): Eliminate IsVariableDefined as it is
22660         basically just a wrapper for GetVariableInfo.
22661
22662         * ecore.cs (SimpleName): Use new 
22663
22664         * support.cs (ReflectionParamter.ParameterType): We unwrap the
22665         type, as we return the actual parameter ref/unref state on a
22666         different call.
22667
22668 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
22669
22670         * support.cs: Return proper flags REF/OUT fixing the previous
22671         commit.  
22672
22673         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
22674         not used to mean `ref' but `ref or out' in ParameterReference
22675
22676         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22677         full type signature instead of calling TypeManger.CSharpName
22678         ourselves. 
22679
22680         * support.cs (InternalParameters.ParameterDesc): Do not compare
22681         directly to the modflags, because REF/OUT will actually be bitsets
22682         if set. 
22683
22684         * delegate.cs (VerifyMethod): Check also the modifiers.
22685
22686         * cs-tokenizer.cs: Fix bug where floating point values with an
22687         exponent where a sign was missing was ignored.
22688
22689         * driver.cs: Allow multiple assemblies to be specified in a single
22690         /r: argument
22691
22692 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
22693
22694         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
22695         because identifiers after a parenthesis would end up in this kind
22696         of production, and we needed to desamiguate it for having casts
22697         like:
22698
22699                 (UserDefinedType *) xxx
22700
22701 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
22702
22703         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22704         we should set on the Bindingflags.NonPublic, but not turn on
22705         private_ok.  private_ok controls whether a Private member is
22706         returned (this is chekced on the filter routine), while the
22707         BindingFlags.NonPublic just controls whether private/protected
22708         will be allowed.   This fixes the problem part of the problem of
22709         private properties being allowed to be used in derived classes.
22710
22711         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22712         so we can call the children DoResolveLValue method (this will
22713         properly signal errors on lvalue assignments to base properties)
22714
22715         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22716         getter are null, and we have a property info, we know that this
22717         happened because the lookup failed, so we report an error 122 for
22718         protection level violation.
22719
22720         We also silently return if setter and getter are null in the
22721         resolve functions, this condition only happens if we have flagged
22722         the error before.  This is the other half of the problem. 
22723
22724         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22725         not have accessibility information, that is why we were returning
22726         true in the filter function in typemanager.cs.
22727
22728         To properly report 122 (property is inaccessible because of its
22729         protection level) correctly, we report this error in ResolveAccess
22730         by failing if both the setter and the getter are lacking (ie, the
22731         lookup failed). 
22732
22733         DoResolve and DoLResolve have been modified to check for both
22734         setter/getter being null and returning silently, the reason being
22735         that I did not want to put the knowledge about this error in upper
22736         layers, like:
22737
22738         int old = Report.Errors;
22739         x = new PropertyExpr (...);
22740         if (old != Report.Errors)
22741                 return null;
22742         else
22743                 return x;
22744
22745         So the property expr is returned, but it is invalid, so the error
22746         will be flagged during the resolve process. 
22747
22748         * class.cs: Remove InheritablePropertySignatureCompare from the
22749         class, as we no longer depend on the property signature to compute
22750         whether it is possible to implement a method or not.
22751
22752         The reason is that calling PropertyInfo.GetGetMethod will return
22753         null (in .NET, in Mono it works, and we should change this), in
22754         cases where the Get Method does not exist in that particular
22755         class.
22756
22757         So this code:
22758
22759         class X { public virtual int A { get { return 1; } } }
22760         class Y : X { }
22761         class Z : Y { public override int A { get { return 2; } } }
22762
22763         Would fail in Z because the parent (Y) would not have the property
22764         defined.  So we avoid this completely now (because the alternative
22765         fix was ugly and slow), and we now depend exclusively on the
22766         method names.
22767
22768         (PropertyBase.CheckBase): Use a method-base mechanism to find our
22769         reference method, instead of using the property.
22770
22771         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22772         routines are gone now.
22773
22774         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22775         names, they were incorrectly named.
22776
22777         * cs-tokenizer.cs: Return are more gentle token on failure. 
22778
22779         * pending.cs (PendingImplementation.InterfaceMethod): This routine
22780         had an out-of-sync index variable, which caused it to remove from
22781         the list of pending methods the wrong method sometimes.
22782
22783 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
22784
22785         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22786         CanWrite, because those refer to this particular instance of the
22787         property, and do not take into account the fact that we can
22788         override single members of a property.
22789
22790         Constructor requires an EmitContext.  The resolution process does
22791         not happen here, but we need to compute the accessors before,
22792         because the resolution does not always happen for properties.
22793
22794         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22795         subclass, before we did not update this flag, but we did update
22796         bindingflags. 
22797
22798         (GetAccessors): Drop this routine, as it did not work in the
22799         presence of partially overwritten set/get methods. 
22800
22801         Notice that this broke the cs1540 detection, but that will require
22802         more thinking. 
22803
22804 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22805
22806         * class.cs:
22807         * codegen.cs:
22808         * driver.cs: issue a warning instead of an error if we don't support
22809         debugging for the platform. Also ignore a couple of errors that may
22810         arise when trying to write the symbols. Undo my previous patch.
22811
22812 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22813
22814         * driver.cs: ignore /debug switch except for Unix platforms.
22815
22816 2002-10-23  Nick Drochak  <ndrochak@gol.com>
22817
22818         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22819
22820 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
22821
22822         * driver.cs: Do not make mcs-debug conditional, so we do not break
22823         builds that use it.
22824
22825         * statement.cs (UsageVector.MergeChildren): I would like Martin to
22826         review this patch.  But basically after all the children variables
22827         have been merged, the value of "Breaks" was not being set to
22828         new_breaks for Switch blocks.  I think that it should be set after
22829         it has executed.  Currently I set this to the value of new_breaks,
22830         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22831         conservative, but I do not understand this code very well.
22832
22833         I did not break anything in the build, so that is good ;-)
22834
22835         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22836
22837 2002-10-20  Mark Crichton  <crichton@gimp.org>
22838
22839         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
22840
22841 2002-10-20  Nick Drochak  <ndrochak@gol.com>
22842
22843         * cfold.cs: Fixed compile blocker.
22844
22845 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
22846
22847         * driver.cs: I was chekcing the key, not the file.
22848
22849 2002-10-19  Ravi Pratap  <ravi@ximian.com>
22850
22851         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22852         message that we were generating - we just need to silently return
22853         a null.
22854
22855 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
22856
22857         * class.cs (Event.Define): Change my previous commit, as this
22858         breaks the debugger.  This is a temporary hack, as it seems like
22859         the compiler is generating events incorrectly to begin with.
22860
22861         * expression.cs (Binary.ResolveOperator): Added support for 
22862         "U operator - (E x, E y)"
22863
22864         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22865         y)".
22866
22867         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22868         init-only variables, but this path did not take into account that
22869         there might be also instance readonly variables.  Correct this
22870         problem. 
22871
22872         This fixes bug 32253
22873
22874         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22875         delegates as well.
22876
22877         * driver.cs: Change the extension for modules to `netmodule'
22878
22879         * cs-parser.jay: Improved slightly the location tracking for
22880         the debugger symbols.
22881
22882         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22883         modifiers that were specified instead of the hardcoded value
22884         (FamAndAssem).  This was basically ignoring the static modifier,
22885         and others.  Fixes 32429.
22886
22887         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22888         fixed a bug in the process (32476)
22889
22890         * expression.cs (ArrayAccess.EmitAssign): Patch from
22891         hwang_rob@yahoo.ca that fixes bug 31834.3
22892
22893 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22894
22895         * driver.cs: Make the module extension .netmodule.
22896
22897 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22898
22899         * driver.cs: Report an error if the resource file is not found
22900         instead of crashing.
22901
22902         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22903         false, like Emit does.
22904
22905 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22906
22907         * typemanager.cs: Remove unused private member.  Also reported mcs
22908         bug to report this as a warning like csc.
22909
22910 2002-10-15  Martin Baulig  <martin@gnome.org>
22911
22912         * statement.cs (Statement.Emit): Made this a virtual method; emits
22913         the line number info and calls DoEmit().
22914         (Statement.DoEmit): New protected abstract method, formerly knows
22915         as Statement.Emit().
22916
22917         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22918
22919 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22920
22921         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22922         have fixed a remaining problem: not every AddXXXX was adding a
22923         fully qualified name.  
22924
22925         Now everyone registers a fully qualified name in the DeclSpace as
22926         being defined instead of the partial name.  
22927
22928         Downsides: we are slower than we need to be due to the excess
22929         copies and the names being registered this way.  
22930
22931         The reason for this is that we currently depend (on the corlib
22932         bootstrap for instance) that types are fully qualified, because
22933         we dump all the types in the namespace, and we should really have
22934         types inserted into the proper namespace, so we can only store the
22935         basenames in the defined_names array.
22936
22937 2002-10-10  Martin Baulig  <martin@gnome.org>
22938
22939         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22940         from bug #31834, see the bug report for a testcase which is
22941         miscompiled.
22942
22943 2002-10-10  Martin Baulig  <martin@gnome.org>
22944
22945         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22946         flow analysis code for this.
22947
22948         * statement.cs (Do, While, For): Tell the flow analysis code about
22949         infinite loops.
22950         (FlowBranching.UsageVector): Added support for infinite loops.
22951         (Block.Resolve): Moved the dead code elimination here and use flow
22952         analysis to do it.
22953
22954 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22955
22956         * class.cs (Field.Define): Catch cycles on struct type
22957         definitions. 
22958
22959         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22960         fields if the fields are static.  We only need to check instance
22961         fields. 
22962
22963         * expression.cs (As.DoResolve): Test for reference type.
22964
22965         * statement.cs (Using.ResolveExpression): Use
22966         ConvertImplicitRequired, not ConvertImplicit which reports an
22967         error on failture
22968         (Using.ResolveLocalVariableDecls): ditto.
22969
22970         * expression.cs (Binary.ResolveOperator): Report errors in a few
22971         places where we had to.
22972
22973         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22974
22975 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22976
22977         * expression.cs: Use StoreFromPtr instead of extracting the type
22978         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22979
22980         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22981         an enumeration value to a System.Enum, but System.Enum is not a
22982         value type, but an class type, so we need to box.
22983
22984         (Expression.ConvertExplicit): One codepath could return
22985         errors but not flag them.  Fix this.  Fixes #31853
22986
22987         * parameter.cs (Resolve): Do not allow void as a parameter type.
22988
22989 2002-10-06  Martin Baulig  <martin@gnome.org>
22990
22991         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22992         if it's a class type and not a struct.  Fixes #31815.
22993
22994 2002-10-06  Martin Baulig  <martin@gnome.org>
22995
22996         * statement.cs: Reworked the flow analysis code a bit to make it
22997         usable for dead code elimination.
22998
22999 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23000
23001         * cs-parser.jay: allow empty source files. Fixes bug #31781.
23002
23003 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
23004
23005         * expression.cs (ComposedCast.DoResolveType): A quick workaround
23006         to fix the test 165, will investigate deeper.
23007
23008 2002-10-04  Martin Baulig  <martin@gnome.org>
23009
23010         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
23011         finally blocks actually work.
23012         (Try.Resolve): We don't need to create a sibling for `finally' if
23013         there is no finally block.
23014
23015 2002-10-04  Martin Baulig  <martin@gnome.org>
23016
23017         * class.cs (Constructor.Define): The default accessibility for a
23018         non-default constructor is private, not public.
23019
23020 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * class.cs (Constructor): Make AllowedModifiers public, add
23023         EXTERN.
23024
23025         * cs-parser.jay: Perform the modifiers test here, as the
23026         constructor for the Constructor class usually receives a zero
23027         because of the way we create it (first we create, later we
23028         customize, and we were never checking the modifiers).
23029
23030         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
23031         is a version of LookupTypeReflection that includes the type-name
23032         cache.  This can be used as a fast path for functions that know
23033         the fully qualified name and are only calling into *.GetType() to
23034         obtain a composed type.
23035
23036         This is also used by TypeManager.LookupType during its type
23037         composition.
23038
23039         (LookupType): We now also track the real type name, as sometimes
23040         we can get a quey for the real type name from things like
23041         ComposedCast.  This fixes bug 31422.
23042
23043         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
23044         complete type fullname, it does not have to go through the type
23045         resolution system to obtain the composed version of the type (for
23046         obtaining arrays or pointers).
23047
23048         (Conditional.Emit): Use the EmitBoolExpression to
23049         generate nicer code, as requested by Paolo.
23050
23051         (ArrayCreation.CheckIndices): Use the patch from
23052         hwang_rob@yahoo.ca to validate the array initializers. 
23053
23054 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
23055
23056         * class.cs (ConstructorInitializer.Emit): simplify code by using
23057         Invocation.EmitCall, and at the same time, fix the bugs in calling
23058         parent constructors that took variable arguments. 
23059
23060         * ecore.cs (Expression.ConvertNumericExplicit,
23061         Expression.ImplicitNumericConversion): Remove the code that
23062         manually wrapped decimal (InternalTypeConstructor call is now gone
23063         as well).
23064
23065         * expression.cs (Cast.TryReduce): Also handle decimal types when
23066         trying to perform a constant fold on the type.
23067
23068         * typemanager.cs (IsUnmanagedtype): Partially implemented.
23069
23070         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
23071         that only turned off an error report, and did nothing else. 
23072
23073 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
23074
23075         * driver.cs: Handle and ignore /fullpaths
23076
23077 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
23078
23079         * expression.cs (Binary.ResolveOperator): Catch the case where
23080         DoNumericPromotions returns true, 
23081
23082         (Binary.DoNumericPromotions): Simplify the code, and the tests.
23083
23084 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
23085
23086         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
23087         report error 70.
23088
23089 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
23090
23091         * ecore.cs (ConvertNumericExplicit): It is not enough that the
23092         conversion exists, but it is also required that the conversion be
23093         performed.  This manifested in "(Type64Enum) 2".  
23094
23095         * class.cs (TypeManager.AddMethod): The fix is not to change
23096         AddEnum, because that one was using a fully qualified name (every
23097         DeclSpace derivative does), but to change the AddMethod routine
23098         that was using an un-namespaced name.  This now correctly reports
23099         the duplicated name.
23100
23101         Revert patch until I can properly fix it.  The issue
23102         is that we have a shared Type space across all namespaces
23103         currently, which is wrong.
23104
23105         Options include making the Namespace a DeclSpace, and merge
23106         current_namespace/current_container in the parser.
23107
23108 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
23109
23110         * cs-parser.jay: Improve error reporting when we get a different
23111         kind of expression in local_variable_type and
23112         local_variable_pointer_type. 
23113
23114         Propagate this to avoid missleading errors being reported.
23115
23116         * ecore.cs (ImplicitReferenceConversion): treat
23117         TypeManager.value_type as a target just like object_type.   As
23118         code like this:
23119
23120         ValueType v = 1;
23121
23122         Is valid, and needs to result in the int 1 being boxed before it
23123         is assigned to the value type v.
23124
23125         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
23126         to validate the enumeration name.
23127
23128         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
23129         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
23130         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
23131
23132         * ecore.cs (TryImplicitIntConversion): When doing an
23133         implicit-enumeration-conversion, check if the type is 64-bits and
23134         perform a conversion before passing to EnumConstant.
23135
23136 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * decl.cs (Error_AmbiguousTypeReference); New routine used to
23139         report ambiguous type references.  Unlike the MS version, we
23140         report what the ambiguity is.   Innovation at work ;-)
23141
23142         (DeclSpace.FindType): Require a location argument to
23143         display when we display an ambiguous error.
23144
23145         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
23146
23147         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
23148
23149         * expression.cs (EmitDynamicInitializers): Apply patch from
23150         hwang_rob@yahoo.ca that fixes the order in which we emit our
23151         initializers. 
23152
23153 2002-09-21  Martin Baulig  <martin@gnome.org>
23154
23155         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
23156         delegate takes no arguments.
23157
23158 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
23159
23160         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
23161         from integers.
23162
23163         * expression.cs: Extract the underlying type.
23164
23165         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
23166
23167         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
23168
23169 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
23170
23171         * class.cs (TypeContainer.DefineType): We can not use the nice
23172         PackingSize with the size set to 1 DefineType method, because it
23173         will not allow us to define the interfaces that the struct
23174         implements.
23175
23176         This completes the fixing of bug 27287
23177
23178         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
23179         means also structs.  This fixes part of the problem. 
23180         (Expresion.ImplicitReferenceConversionExists): ditto.
23181
23182         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
23183         error if there were no errors reported during the type lookup
23184         process, to avoid duplicates or redundant errors.  Without this
23185         you would get an ambiguous errors plus a type not found.  We have
23186         beaten the user enough with the first error.  
23187
23188         (DeclSparce.FindType): Emit a warning if we have an ambiguous
23189         reference. 
23190
23191         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
23192         during the resolution process, stop the lookup, this avoids
23193         repeated error reports (same error twice).
23194
23195         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
23196
23197         * typemanager.cs (LookupType): Redo the type lookup code to match
23198         the needs of System.Reflection.  
23199
23200         The issue is that System.Reflection requires references to nested
23201         types to begin with a "+" sign instead of a dot.  So toplevel
23202         types look like: "NameSpace.TopLevelClass", and nested ones look
23203         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
23204         levels. 
23205
23206 2002-09-19  Martin Baulig  <martin@gnome.org>
23207
23208         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
23209         says that a method always returns or always throws an exception,
23210         don't report the CS0161.
23211
23212         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
23213         set `Returns = new_returns'.
23214
23215 2002-09-19  Martin Baulig  <martin@gnome.org>
23216
23217         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
23218         to an enum constant, check for a CS0176.
23219
23220 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
23221
23222         * class.cs (TypeContainer.CheckPairedOperators): Now we check
23223         for operators that must be in pairs and report errors.
23224
23225         * ecore.cs (SimpleName.DoResolveType): During the initial type
23226         resolution process, when we define types recursively, we must
23227         check first for types in our current scope before we perform
23228         lookups in the enclosing scopes.
23229
23230         * expression.cs (MakeByteBlob): Handle Decimal blobs.
23231
23232         (Invocation.VerifyArgumentsCompat): Call
23233         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
23234         I thought we were supposed to always call this, but there are a
23235         few places in the code where we dont do it.
23236
23237 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
23238
23239         * driver.cs: Add support in -linkres and -resource to specify the
23240         name of the identifier.
23241
23242 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
23243
23244         * ecore.cs (StandardConversionExists): Sync with the conversion
23245         code: allow anything-* to void* conversions.
23246
23247         (FindMostSpecificSource): Use an Expression argument
23248         instead of a Type, because we might be handed over a Literal which
23249         gets a few more implicit conversions that plain types do not.  So
23250         this information was being lost.
23251
23252         Also, we drop the temporary type-holder expression when not
23253         required.
23254
23255 2002-09-17  Martin Baulig  <martin@gnome.org>
23256
23257         * class.cs (PropertyBase.CheckBase): Don't check the base class if
23258         this is an explicit interface implementation.
23259
23260 2002-09-17  Martin Baulig  <martin@gnome.org>
23261
23262         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
23263         different `IndexerName' attributes.
23264
23265         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
23266         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
23267         virtual CommonResolve().
23268
23269 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
23270
23271         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
23272         and convert that to the UnderlyingType.
23273
23274         * statement.cs (Foreach.Resolve): Indexers are just like variables
23275         or PropertyAccesses.
23276
23277         * cs-tokenizer.cs (consume_string): Track line numbers and columns
23278         inside quoted strings, we were not doing this before.
23279
23280 2002-09-16  Martin Baulig  <martin@gnome.org>
23281
23282         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
23283         resolve it.  This is needed for the definite assignment check of the
23284         instance expression, fixes bug #29846.
23285         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
23286
23287 2002-09-16  Nick Drochak  <ndrochak@gol.com>
23288
23289         * parameter.cs: Fix compile error.  Cannot reference static member
23290         from an instance object.  Is this an mcs bug?
23291
23292 2002-09-14  Martin Baulig  <martin@gnome.org>
23293
23294         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
23295         multiple times.  Fixes bug #30295, added test-166.cs.
23296
23297 2002-09-14  Martin Baulig  <martin@gnome.org>
23298
23299         * statement.cs (Block.Emit): Don't emit unreachable code.
23300         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
23301         `break' statements.
23302         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
23303
23304 2002-09-14  Martin Baulig  <martin@gnome.org>
23305
23306         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23307         is set.
23308
23309 2002-09-14  Martin Baulig  <martin@gnome.org>
23310
23311         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23312         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23313         be false on the ms runtime.
23314
23315 2002-09-13  Martin Baulig  <martin@gnome.org>
23316
23317         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23318         the CS0038 error message.
23319
23320 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
23321
23322         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23323         constant inside, return it.
23324
23325 2002-09-12  Martin Baulig  <martin@gnome.org>
23326
23327         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23328         implicit conversion can be done between enum types.
23329
23330         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23331         check whether an implicit conversion to the current enum's UnderlyingType
23332         exists and report an error if not.
23333
23334         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23335         without debugging support.
23336
23337         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23338         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
23339
23340 2002-09-12  Martin Baulig  <martin@gnome.org>
23341
23342         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23343
23344         * ecore.cs (IMemberExpr.DeclaringType): New property.
23345         (SimpleName.SimpleNameResolve): Check whether we're accessing a
23346         nonstatic member of an outer type (CS0038).
23347
23348 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
23349
23350         * driver.cs: Activate the using-error detector at warning level
23351         4 (at least for MS-compatible APIs).
23352
23353         * namespace.cs (VerifyUsing): Small buglett fix.
23354
23355         * pending.cs (PendingImplementation): pass the container pointer. 
23356
23357         * interface.cs (GetMethods): Allow for recursive definition.  Long
23358         term, I would like to move every type to support recursive
23359         definitions, not the current ordering mechanism that we have right
23360         now.
23361
23362         The situation is this: Attributes are handled before interfaces,
23363         so we can apply attributes to interfaces.  But some attributes
23364         implement interfaces, we will now handle the simple cases
23365         (recursive definitions will just get an error).  
23366
23367         * parameter.cs: Only invalidate types at the end if we fail to
23368         lookup all types.  
23369
23370 2002-09-09  Martin Baulig  <martin@gnome.org>
23371
23372         * ecore.cs (PropertyExpr.Emit): Also check for
23373         TypeManager.system_int_array_get_length so this'll also work when
23374         compiling corlib.  Fixes #30003.
23375
23376 2002-09-09  Martin Baulig  <martin@gnome.org>
23377
23378         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23379         and throw an exception if we can't get the type's size.  Fixed #30040,
23380         added test-165.cs.
23381
23382 2002-09-09  Martin Baulig  <martin@gnome.org>
23383
23384         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23385
23386         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23387         context.  Fixes bug #30027.
23388
23389         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23390         virtual functions.  Fixes bug #30043, added test-164.cs.
23391
23392 2002-09-08  Ravi Pratap  <ravi@ximian.com>
23393
23394         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23395
23396 2002-09-08  Nick Drochak  <ndrochak@gol.com>
23397
23398         * driver.cs: Use an object to get the windows codepage since it's not a
23399         static property.
23400
23401 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
23402
23403         * statement.cs (For.Emit): for infinite loops (test == null)
23404         return whether there is a break inside, not always "true".
23405
23406         * namespace.cs (UsingEntry): New struct to hold the name of the
23407         using definition, the location where it is defined, and whether it
23408         has been used in a successful type lookup.
23409
23410         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23411         strings.
23412
23413         * decl.cs: ditto.
23414
23415 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23416
23417         * attribute.cs : Fix incorrect code which relied on catching
23418         a NullReferenceException to detect a null being passed in
23419         where an object was expected.
23420
23421 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * statement.cs (Try): flag the catch variable as assigned
23424
23425         * expression.cs (Cast): Simplified by using ResolveType instead of
23426         manually resolving.
23427
23428         * statement.cs (Catch): Fix bug by using ResolveType.
23429
23430 2002-09-06  Ravi Pratap  <ravi@ximian.com>
23431
23432         * expression.cs (BetterConversion): Special case for when we have
23433         a NullLiteral as the argument and we have to choose between string
23434         and object types - we choose string the way csc does.
23435
23436         * attribute.cs (Attribute.Resolve): Catch the
23437         NullReferenceException and report error #182 since the Mono
23438         runtime no more has the bug and having this exception raised means
23439         we tried to select a constructor which takes an object and is
23440         passed a null.
23441
23442 2002-09-05  Ravi Pratap  <ravi@ximian.com>
23443
23444         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23445         message (1502, 1503) when we can't locate a method after overload
23446         resolution. This is much more informative and closes the bug
23447         Miguel reported.
23448
23449         * interface.cs (PopulateMethod): Return if there are no argument
23450         types. Fixes a NullReferenceException bug.
23451
23452         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23453         expressions too. Previously we were checking only in one place for
23454         positional arguments leaving out named arguments.
23455
23456         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23457         type to the enum type is not allowed. Remove code corresponding to
23458         that.
23459
23460         (ConvertNumericExplicit): Allow explicit conversions from
23461         the underlying type to enum type. This precisely follows the spec
23462         and closes a bug filed by Gonzalo.
23463
23464 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23465
23466         * compiler.csproj:
23467         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23468
23469 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
23470
23471         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23472         it was important that we stored the right value after the
23473         reduction in `converted'.
23474
23475 2002-09-04  Martin Baulig  <martin@gnome.org>
23476
23477         * location.cs (Location.SymbolDocument): Use full pathnames for the
23478         source files.
23479
23480 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
23481
23482         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23483         of the expression resolve mechanism, because that will catch the
23484         SimpleName error failures.
23485
23486         (Conditional): If we can not resolve the
23487         expression, return, do not crash.
23488
23489 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23490
23491         * cs-tokenizer.cs:
23492         (location): display token name instead of its number.
23493
23494 2002-08-28  Martin Baulig  <martin@gnome.org>
23495
23496         * expression.cs (Binary.ResolveOperator): Don't silently return
23497         but return an error if an operator cannot be applied between two
23498         enum types.
23499
23500 2002-08-28  Martin Baulig  <martin@gnome.org>
23501
23502         * class.cs (Constructor.Define): Set the permission attributes
23503         correctly instead of making all constructors public.
23504
23505 2002-08-28  Martin Baulig  <martin@gnome.org>
23506
23507         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23508         for private members before reporting a CS0103; if we find anything,
23509         it's a CS0122.
23510
23511 2002-08-28  Martin Baulig  <martin@gnome.org>
23512
23513         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23514         to check whether `closure_start_type == closure_invocation_type',
23515         we also need to check whether `m.DeclaringType == closure_invocation_type'
23516         before bypassing the permission checks.  We might be accessing
23517         protected/private members from the base class.
23518         (TypeManager.RealMemberLookup): Only set private_ok if private
23519         members were requested via BindingFlags.NonPublic.
23520
23521         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23522
23523         * expression.cs (MemberAccess.ResolveMemberAccess): Set
23524         MethodGroupExpr.IsExplicitImpl if appropriate.
23525         (Invocation.DoResolve): Don't report the CS0120 for explicit
23526         interface implementations.
23527
23528 2002-08-27  Martin Baulig  <martin@gnome.org>
23529
23530         * expression.cs (Invocation.DoResolve): If this is a static
23531         method and we don't have an InstanceExpression, we must report
23532         a CS0120.
23533
23534 2002-08-25  Martin Baulig  <martin@gnome.org>
23535
23536         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23537         `==' between a valuetype and an object.
23538
23539 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
23540
23541         * ecore.cs (TypeExpr): Provide a ToString method.
23542
23543 2002-08-24  Martin Baulig  <martin@gnome.org>
23544
23545         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23546         now called proggie.dbg and it's a binary file.
23547
23548 2002-08-23  Martin Baulig  <martin@gnome.org>
23549
23550         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23551
23552 2002-08-23  Martin Baulig  <martin@gnome.org>
23553
23554         * struct.cs (MyStructInfo.ctor): Make this work with empty
23555         structs; it's not allowed to use foreach() on null.
23556
23557 2002-08-23  Martin Baulig  <martin@gnome.org>
23558
23559         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23560         writer the full pathname of the generated assembly.
23561
23562 2002-08-23  Martin Baulig  <martin@gnome.org>
23563
23564         * statements.cs (FlowBranching.UsageVector.MergeChildren):
23565         A `finally' block never returns or breaks; improved handling of
23566         unreachable code.
23567
23568 2002-08-23  Martin Baulig  <martin@gnome.org>
23569
23570         * statement.cs (Throw.Resolve): Allow `throw null'.
23571
23572 2002-08-23  Martin Baulig  <martin@gnome.org>
23573
23574         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23575         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23576         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
23577         MemberLookup would return a wrong event if this is an explicit
23578         interface implementation and the class has an event with the same
23579         name.
23580
23581 2002-08-23  Martin Baulig  <martin@gnome.org>
23582
23583         * statement.cs (Block.AddChildVariableNames): New public method.
23584         (Block.AddChildVariableName): Likewise.
23585         (Block.IsVariableNameUsedInChildBlock): Likewise.
23586         (Block.AddVariable): Check whether a variable name has already
23587         been used in a child block.
23588
23589         * cs-parser.jay (declare_local_variables): Mark all variable names
23590         from the current block as being used in a child block in the
23591         implicit block.
23592
23593 2002-08-23  Martin Baulig  <martin@gnome.org>
23594
23595         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23596         find the symbol writer.
23597
23598         * driver.cs: csc also allows the arguments to /define being
23599         separated by commas, not only by semicolons.
23600
23601 2002-08-23  Martin Baulig  <martin@gnome.org>
23602
23603         * interface.cs (Interface.GetMembers): Added static check for events.
23604
23605 2002-08-15  Martin Baulig  <martin@gnome.org>
23606
23607         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23608         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23609
23610         * ecore.cs (Expression.MemberLookup): Added documentation and explained
23611         why the MethodData.EmitDestructor() change was necessary.
23612
23613 2002-08-20  Martin Baulig  <martin@gnome.org>
23614
23615         * class.cs (TypeContainer.FindMembers): Added static check for events.
23616
23617         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23618
23619         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23620         use Type.GetEvents(), not Type.FindMembers().
23621
23622 2002-08-20  Martin Baulig  <martin@gnome.org>
23623
23624         * decl.cs (MemberCache): Added a special method cache which will
23625         be used for method-only searched.  This ensures that a method
23626         search will return a MethodInfo with the correct ReflectedType for
23627         inherited methods.      
23628
23629 2002-08-20  Martin Baulig  <martin@gnome.org>
23630
23631         * decl.cs (DeclSpace.FindMembers): Made this public.
23632
23633 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23634
23635         * delegate.cs: fixed build on windows.
23636         [FIXME:  Filed as bug #29150: MCS must report these errors.]
23637
23638 2002-08-19  Ravi Pratap  <ravi@ximian.com>
23639
23640         * ecore.cs (StandardConversionExists): Return a false
23641         if we are trying to convert the void type to anything else
23642         since that is not allowed.
23643
23644         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23645         we flag error 70 in the event an event is trying to be accessed
23646         directly from outside the declaring type.
23647
23648 2002-08-20  Martin Baulig  <martin@gnome.org>
23649
23650         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23651         MemberCache from typemanager.cs to decl.cs.
23652
23653 2002-08-19  Martin Baulig  <martin@gnome.org>
23654
23655         * class.cs (TypeContainer): Implement IMemberContainer.
23656         (TypeContainer.DefineMembers): Create the MemberCache.
23657         (TypeContainer.FindMembers): Do better BindingFlags checking; only
23658         return public members if BindingFlags.Public was given, check
23659         whether members are static.
23660
23661 2002-08-16  Martin Baulig  <martin@gnome.org>
23662
23663         * decl.cs (DeclSpace.Define): Splitted this in Define and
23664         DefineMembers.  DefineMembers is called first and initializes the
23665         MemberCache.
23666
23667         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
23668         DefineMembers() on all our DeclSpaces.
23669
23670         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23671         but call DefineMembers() on all nested interfaces.  We call their
23672         Define() in our new Define() function.
23673
23674         * interface.cs (Interface): Implement IMemberContainer.
23675         (Interface.Define): Moved all code except the attribute stuf to
23676         DefineMembers().
23677         (Interface.DefineMembers): Initialize the member cache.
23678
23679         * typemanager.cs (IMemberFinder): Removed this interface, we don't
23680         need this anymore since we can use MemberCache.FindMembers directly.
23681
23682 2002-08-19  Martin Baulig  <martin@gnome.org>
23683
23684         * typemanager.cs (MemberCache): When creating the cache for an
23685         interface type, add all inherited members.
23686         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23687         to `out bool used_cache' and documented it.
23688         (TypeManager.MemberLookup): If we already used the cache in the first
23689         iteration, we don't need to do the interfaces check.
23690
23691 2002-08-19  Martin Baulig  <martin@gnome.org>
23692
23693         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
23694         here from IMemberFinder and don't implement this interface anymore.
23695         (DeclSpace.MemberCache): Moved here from IMemberFinder.
23696
23697         * typemanager.cs (IMemberFinder): This interface is now only used by
23698         classes which actually support the member cache.
23699         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23700         since we only put DeclSpaces into this Hashtable.
23701         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23702         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23703
23704 2002-08-16  Martin Baulig  <martin@gnome.org>
23705
23706         * typemanager.cs (ICachingMemberFinder): Removed.
23707         (IMemberFinder.MemberCache): New property.
23708         (TypeManager.FindMembers): Merged this with RealFindMembers().
23709         This function will never be called from TypeManager.MemberLookup()
23710         so we can't use the cache here, just the IMemberFinder.
23711         (TypeManager.MemberLookup_FindMembers): Check whether the
23712         IMemberFinder has a MemberCache and call the cache's FindMembers
23713         function.
23714         (MemberCache): Rewrote larger parts of this yet another time and
23715         cleaned it up a bit.
23716
23717 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
23718
23719         * driver.cs (LoadArgs): Support quoting.
23720
23721         (Usage): Show the CSC-like command line arguments.
23722
23723         Improved a few error messages.
23724
23725 2002-08-15  Martin Baulig  <martin@gnome.org>
23726
23727         * typemanager.cs (IMemberContainer.Type): New property.
23728         (IMemberContainer.IsInterface): New property.
23729
23730         The following changes are conditional to BROKEN_RUNTIME, which is
23731         defined at the top of the file.
23732
23733         * typemanager.cs (MemberCache.MemberCache): Don't add the base
23734         class'es members, but add all members from TypeHandle.ObjectType
23735         if we're an interface.
23736         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23737         is the current type.
23738         (MemberCache.CacheEntry.Container): Removed this field.
23739         (TypeHandle.GetMembers): Include inherited members.
23740
23741 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23742
23743         * typemanager.cs: fixed compilation and added a comment on a field that
23744         is never used.
23745
23746 2002-08-15  Martin Baulig  <martin@gnome.org>
23747
23748         * class.cs (ConstructorInitializer.Resolve): In the
23749         Expression.MemberLookup call, use the queried_type as
23750         invocation_type.
23751
23752         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23753         declared' attribute, it's always true.
23754         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23755         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23756         temporary wrapper for FindMembers which tells MemberLookup whether
23757         members from the base classes are included in the return value.
23758         This will go away soon.
23759         (TypeManager.MemberLookup): Use this temporary hack here; once the
23760         new MemberCache is completed, we don't need to do the DeclaredOnly
23761         looping here anymore since the MemberCache will take care of this.
23762         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23763         (MemberCache): When creating the MemberCache for a class, get
23764         members from the current class and all its base classes.
23765         (MemberCache.CacheEntry.Container): New field.  This is a
23766         temporary hack until the Mono runtime is fixed to distinguish
23767         between ReflectedType and DeclaringType.  It allows us to use MCS
23768         with both the MS runtime and the unfixed Mono runtime without
23769         problems and without accecting performance.
23770         (MemberCache.SearchMembers): The DeclaredOnly looping from
23771         TypeManager.MemberLookup is now done here.      
23772
23773 2002-08-14  Martin Baulig  <martin@gnome.org>
23774
23775         * statement.cs (MyStructInfo.MyStructInfo): Don't call
23776         Type.GetFields on dynamic types but get the fields from the
23777         corresponding TypeContainer.
23778         (MyStructInfo.GetStructInfo): Added check for enum types.
23779
23780         * typemanager.cs (MemberList.IsSynchronized): Implemented.
23781         (MemberList.SyncRoot): Implemented.
23782         (TypeManager.FilterWithClosure): No need to check permissions if
23783         closure_start_type == closure_invocation_type, don't crash if
23784         closure_invocation_type is null.
23785
23786 2002-08-13  Martin Baulig  <martin@gnome.org>
23787
23788         Rewrote TypeContainer.FindMembers to use a member cache.  This
23789         gives us a speed increase of about 35% for the self-hosting MCS
23790         build and of about 15-20% for the class libs (both on GNU/Linux).
23791
23792         * report.cs (Timer): New class to get enhanced profiling.  This
23793         whole class is "TIMER" conditional since it remarkably slows down
23794         compilation speed.
23795
23796         * class.cs (MemberList): New class.  This is an IList wrapper
23797         which we're now using instead of passing MemberInfo[]'s around to
23798         avoid copying this array unnecessarily.
23799         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23800         (ICachingMemberFinder, IMemberContainer): New interface.
23801         (TypeManager.FilterWithClosure): If `criteria' is null, the name
23802         has already been checked, otherwise use it for the name comparision.
23803         (TypeManager.FindMembers): Renamed to RealMemberFinder and
23804         provided wrapper which tries to use ICachingMemberFinder.FindMembers
23805         if possible.  Returns a MemberList, not a MemberInfo [].
23806         (TypeHandle): New class, implements IMemberContainer.  We create
23807         one instance of this class per type, it contains a MemberCache
23808         which is used to do the member lookups.
23809         (MemberCache): New class.  Each instance of this class contains
23810         all members of a type and a name-based hash table.
23811         (MemberCache.FindMembers): This is our new member lookup
23812         function.  First, it looks up all members of the requested name in
23813         the hash table.  Then, it walks this list and sorts out all
23814         applicable members and returns them.
23815
23816 2002-08-13  Martin Baulig  <martin@gnome.org>
23817
23818         In addition to a nice code cleanup, this gives us a performance
23819         increase of about 1.4% on GNU/Linux - not much, but it's already
23820         half a second for the self-hosting MCS compilation.
23821
23822         * typemanager.cs (IMemberFinder): New interface.  It is used by
23823         TypeManager.FindMembers to call FindMembers on a TypeContainer,
23824         Enum, Delegate or Interface.
23825         (TypeManager.finder_to_member_finder): New PtrHashtable.
23826         (TypeManager.finder_to_container): Removed.
23827         (TypeManager.finder_to_delegate): Removed.
23828         (TypeManager.finder_to_interface): Removed.
23829         (TypeManager.finder_to_enum): Removed.
23830
23831         * interface.cs (Interface): Implement IMemberFinder.
23832
23833         * delegate.cs (Delegate): Implement IMemberFinder.
23834
23835         * enum.cs (Enum): Implement IMemberFinder.
23836
23837         * class.cs (TypeContainer): Implement IMemberFinder.
23838
23839 2002-08-12  Martin Baulig  <martin@gnome.org>
23840
23841         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23842
23843 2002-08-12  Martin Baulig  <martin@gnome.org>
23844
23845         * ecore.cs (ITypeExpression): New interface for expressions which
23846         resolve to a type.
23847         (TypeExpression): Renamed to TypeLookupExpression.
23848         (Expression.DoResolve): If we're doing a types-only lookup, the
23849         expression must implement the ITypeExpression interface and we
23850         call DoResolveType() on it.
23851         (SimpleName): Implement the new ITypeExpression interface.
23852         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23853         hack, the situation that we're only looking up types can't happen
23854         anymore when this method is called.  Moved the type lookup code to
23855         DoResolveType() and call it.
23856         (SimpleName.DoResolveType): This ITypeExpression interface method
23857         is now doing the types-only lookup.
23858         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23859         (ResolveFlags): Added MaskExprClass.
23860
23861         * expression.cs (MemberAccess): Implement the ITypeExpression
23862         interface.
23863         (MemberAccess.DoResolve): Added support for a types-only lookup
23864         when we're called via ITypeExpression.DoResolveType().
23865         (ComposedCast): Implement the ITypeExpression interface.
23866
23867         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23868         Expression.Resolve() with ResolveFlags.Type instead.
23869
23870 2002-08-12  Martin Baulig  <martin@gnome.org>
23871
23872         * interface.cs (Interface.Define): Apply attributes.
23873
23874         * attribute.cs (Attribute.ApplyAttributes): Added support for
23875         interface attributes.
23876
23877 2002-08-11  Martin Baulig  <martin@gnome.org>
23878
23879         * statement.cs (Block.Emit): Only check the "this" variable if we
23880         do not always throw an exception.
23881
23882         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23883         whether the property has a set accessor.
23884
23885 2002-08-11  Martin Baulig  <martin@gnome.org>
23886
23887         Added control flow analysis support for structs.
23888
23889         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23890         with control flow analysis turned off.
23891         (IVariable): New interface.
23892         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23893         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23894         (FieldExpr.DoResolve): Resolve the instance expression with flow
23895         analysis turned off and do the definite assignment check after the
23896         resolving when we know what the expression will resolve to.
23897
23898         * expression.cs (LocalVariableReference, ParameterReference):
23899         Implement the new IVariable interface, only call the flow analysis
23900         code if ec.DoFlowAnalysis is true.
23901         (This): Added constructor which takes a Block argument.  Implement
23902         the new IVariable interface.
23903         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23904         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23905         This does the definite assignment checks for struct members.
23906
23907         * class.cs (Constructor.Emit): If this is a non-static `struct'
23908         constructor which doesn't have any initializer, call
23909         Block.AddThisVariable() to tell the flow analysis code that all
23910         struct elements must be initialized before control returns from
23911         the constructor.
23912
23913         * statement.cs (MyStructInfo): New public class.
23914         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23915         argument to this indexer.  If non-zero, check an individual struct
23916         member, not the whole struct.
23917         (FlowBranching.CheckOutParameters): Check struct members.
23918         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23919         overloaded versions of these methods which take an additional
23920         `int field_idx' argument to check struct members.
23921         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23922         overloaded versions of these methods which take an additional
23923         `string field_name' argument to check struct member.s
23924         (VariableInfo): Implement the IVariable interface.
23925         (VariableInfo.StructInfo): New public property.  Returns the
23926         MyStructInfo instance of the variable if it's a struct or null.
23927         (Block.AddThisVariable): New public method.  This is called from
23928         Constructor.Emit() for non-static `struct' constructor which do
23929         not have any initializer.  It creates a special variable for the
23930         "this" instance variable which will be checked by the flow
23931         analysis code to ensure that all of the struct's fields are
23932         initialized before control returns from the constructor.
23933         (UsageVector): Added support for struct members.  If a
23934         variable/parameter is a struct with N members, we reserve a slot
23935         in the usage vector for each member.  A struct is considered fully
23936         initialized if either the struct itself (slot 0) or all its
23937         members are initialized.
23938
23939 2002-08-08  Martin Baulig  <martin@gnome.org>
23940
23941         * driver.cs (Driver.MainDriver): Only report an error CS5001
23942         if there were no compilation errors.
23943
23944         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23945         `UnsafeContext' property to determine whether the parent is in
23946         unsafe context rather than checking the parent's ModFlags:
23947         classes nested in an unsafe class are unsafe as well.
23948
23949 2002-08-08  Martin Baulig  <martin@gnome.org>
23950
23951         * statement.cs (UsageVector.MergeChildren): Distinguish between
23952         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23953         we return.  Added test17() and test18() to test-154.cs.
23954
23955 2002-08-08  Martin Baulig  <martin@gnome.org>
23956
23957         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23958         Family access, make sure the invoking type isn't a subclass of the
23959         queried type (that'd be a CS1540).
23960
23961         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23962         this method which takes an additional `Type invocation_type'.
23963
23964         * expression.cs (BaseAccess.DoResolve): Use the base type as
23965         invocation and query type.
23966         (MemberAccess.DoResolve): If the lookup failed and we're about to
23967         report a CS0122, try a lookup with the ec.ContainerType - if this
23968         succeeds, we must report a CS1540.
23969
23970 2002-08-08  Martin Baulig  <martin@gnome.org>
23971
23972         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23973         (MethodGroupExpr): Implement the IMemberExpr interface.
23974
23975         * expression (MemberAccess.ResolveMemberAccess): No need to have
23976         any special code for MethodGroupExprs anymore, they're now
23977         IMemberExprs.   
23978
23979 2002-08-08  Martin Baulig  <martin@gnome.org>
23980
23981         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23982         Family, FamANDAssem and FamORAssem permissions.
23983         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23984
23985 2002-08-08  Martin Baulig  <martin@gnome.org>
23986
23987         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23988         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23989         or loop block.
23990
23991 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23992
23993         * driver.cs: implemented /resource option to embed managed resources.
23994
23995 2002-08-07  Martin Baulig  <martin@gnome.org>
23996
23997         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23998         (FieldBase.HasFieldInitializer): New public property.
23999         (FieldBase.GetInitializerExpression): New public method.  Resolves and
24000         returns the field initializer and makes sure it is only resolved once.
24001         (TypeContainer.EmitFieldInitializers): Call
24002         FieldBase.GetInitializerExpression to get the initializer, this ensures
24003         that it isn't resolved multiple times.
24004
24005         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
24006         the resolving process (SimpleName/MemberLookup) that we're currently
24007         emitting a field initializer (which must not access any instance members,
24008         this is an error CS0236).
24009
24010         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
24011         argument, if the `IsFieldInitializer' flag is set, we must report and
24012         error CS0236 and not an error CS0120.   
24013
24014 2002-08-07  Martin Baulig  <martin@gnome.org>
24015
24016         * ecore.cs (IMemberExpr): New public interface.
24017         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
24018         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
24019         if the expression is an IMemberExpr.
24020
24021         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
24022         to be null, implicitly default to `this' if we're non-static in
24023         this case.  Simplified the code a lot by using the new IMemberExpr
24024         interface.  Also fixed bug #28176 here.
24025
24026 2002-08-06  Martin Baulig  <martin@gnome.org>
24027
24028         * cs-parser.jay (SimpleLookup): Removed.  We need to create
24029         ParameterReferences during semantic analysis so that we can do a
24030         type-only search when resolving Cast, TypeOf and SizeOf.
24031         (block): Pass the `current_local_parameters' to the Block's
24032         constructor.
24033
24034         * class.cs (ConstructorInitializer): Added `Parameters parameters'
24035         argument to the constructor.
24036         (ConstructorInitializer.Resolve): Create a temporary implicit
24037         block with the parameters.
24038
24039         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
24040         references here if we aren't doing a type-only search.
24041
24042         * statement.cs (Block): Added constructor which takes a
24043         `Parameters parameters' argument.
24044         (Block.Parameters): New public property.
24045
24046         * support.cs (InternalParameters.Parameters): Renamed `parameters'
24047         to `Parameters' and made it public readonly.
24048
24049 2002-08-06  Martin Baulig  <martin@gnome.org>
24050
24051         * ecore.cs (Expression.Warning): Made this public as well.
24052
24053         * report.cs (Report.Debug): Print the contents of collections.
24054
24055 2002-08-06  Martin Baulig  <martin@gnome.org>
24056
24057         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
24058         used to tell Resolve() which kinds of expressions it may return.
24059         (Expression.Resolve): Added overloaded version of this method which
24060         takes a `ResolveFlags flags' argument.  This can be used to tell
24061         Resolve() which kinds of expressions it may return.  Reports a
24062         CS0118 on error.
24063         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
24064         ResolveFlags.SimpleName.
24065         (Expression.Error118): Added overloaded version of this method which
24066         takes a `ResolveFlags flags' argument.  It uses the flags to determine
24067         which kinds of expressions are allowed.
24068
24069         * expression.cs (Argument.ResolveMethodGroup): New public method.
24070         Resolves an argument, but allows a MethodGroup to be returned.
24071         This is used when invoking a delegate.
24072
24073         * TODO: Updated a bit.
24074
24075 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24076
24077         Fixed compilation with csc.
24078
24079         * ecore.cs: Expression.Error made public. Is this correct? Should
24080         Warning be made public too?
24081
24082         * expression.cs: use ea.Location instead of ea.loc.
24083         [FIXME:  Filed as bug #28607: MCS must report these errors.]
24084
24085 2002-08-06  Martin Baulig  <martin@gnome.org>
24086
24087         * ecore.cs (Expression.loc): Moved the location here instead of
24088         duplicating it in all derived classes.
24089         (Expression.Location): New public property.
24090         (Expression.Error, Expression.Warning): Made them non-static and
24091         removed the location argument.
24092         (Expression.Warning): Added overloaded version which takes an
24093         `int level' argument.
24094         (Expression.Error118): Make this non-static and removed the
24095         expression and location arguments.
24096         (TypeExpr): Added location argument to the constructor.
24097
24098         * expression.cs (StaticCallExpr): Added location argument to
24099         the constructor.
24100         (Indirection, PointerArithmetic): Likewise.
24101         (CheckedExpr, UnCheckedExpr): Likewise.
24102         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
24103         (StringPtr): Likewise.
24104
24105
24106 2002-08-05  Martin Baulig  <martin@gnome.org>
24107
24108         * expression.cs (BaseAccess.DoResolve): Actually report errors.
24109
24110         * assign.cs (Assign.DoResolve): Check whether the source
24111         expression is a value or variable.
24112
24113         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
24114         while resolving the corresponding blocks.
24115
24116         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
24117         an error, don't silently return null.
24118
24119         * statement.cs (Block.AddVariable): Do the error reporting here
24120         and distinguish between CS0128 and CS0136.
24121         (Block.DoResolve): Report all unused labels (warning CS0164).
24122         (LabeledStatement): Pass the location to the constructor.
24123         (LabeledStatement.HasBeenReferenced): New property.
24124         (LabeledStatement.Resolve): Set it to true here.
24125
24126         * statement.cs (Return.Emit): Return success even after reporting
24127         a type mismatch error (CS0126 or CS0127), this is what csc does and
24128         it avoids confusing the users with any consecutive errors.
24129
24130 2002-08-05  Martin Baulig  <martin@gnome.org>
24131
24132         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
24133
24134         * const.cs (Const.LookupConstantValue): Catch circular definitions.
24135
24136         * expression.cs (MemberAccess.DoResolve): Silently return if an
24137         error has already been reported.
24138
24139         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
24140         error has already been reported.
24141
24142 2002-08-05  Martin Baulig  <martin@gnome.org>
24143
24144         * statement.cs (UsageVector): Only initialize the `parameters'
24145         vector if we actually have any "out" parameters.
24146
24147 2002-08-05  Martin Baulig  <martin@gnome.org>
24148
24149         * expression.cs (Binary.ResolveOperator): When combining delegates,
24150         they must have the same type.
24151
24152 2002-08-05  Martin Baulig  <martin@gnome.org>
24153
24154         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
24155         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
24156         work with the ms runtime and we also don't need it: if we're a
24157         PropertyBuilder and not in the `indexer_arguments' hash, then we
24158         are a property and not an indexer.
24159
24160         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
24161         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
24162         since the latter one doesn't work with the ms runtime.
24163
24164 2002-08-03  Martin Baulig  <martin@gnome.org>
24165
24166         Fixed bugs #27998 and #22735.
24167
24168         * class.cs (Method.IsOperator): New public field.
24169         (Method.CheckBase): Report CS0111 if there's already a method
24170         with the same parameters in the current class.  Report CS0508 when
24171         attempting to change the return type of an inherited method.
24172         (MethodData.Emit): Report CS0179 if a method doesn't have a body
24173         and it's not marked abstract or extern.
24174         (PropertyBase): New abstract base class for Property and Indexer.
24175         (PropertyBase.CheckBase): Moved here from Property and made it work
24176         for indexers.
24177         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
24178         the same so we can reuse it there.
24179         (Property, Indexer): Derive from PropertyBase.
24180         (MethodSignature.inheritable_property_signature_filter): New delegate
24181         to find properties and indexers.
24182
24183         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
24184         argument and improved error reporting.
24185
24186         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
24187         EmptyReadOnlyParameters and made it a property.
24188
24189         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
24190         version of this method which takes a `PropertyInfo indexer'.
24191         (TypeManager.RegisterIndexer): New method.
24192
24193         * class.cs: Added myself as author of this file :-)
24194
24195 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24196
24197         * class.cs: fixed compilation on windoze.
24198
24199 2002-08-03  Martin Baulig  <martin@gnome.org>
24200
24201         * interface.cs (Interface.GetInterfaceBases): Check whether all
24202         base interfaces are at least as accessible than the current one.
24203
24204         * class.cs (TypeContainer.GetClassBases): Check whether base types
24205         are at least as accessible than the current type.
24206         (TypeContainer.AsAccessible): Implemented and made non-static.
24207         (MemberBase.CheckParameters): Report errors if the accessibility
24208         checks fail.
24209
24210         * delegate.cs (Delegate.Delegate): The default visibility is
24211         internal for top-level types and private for nested types.
24212         (Delegate.Define): Report errors if the accessibility checks fail.
24213
24214         * enum.cs (Enum.Enum): The default visibility is internal for
24215         top-level types and private for nested types.
24216         (Enum.DefineType): Compute the correct visibility.
24217
24218         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
24219         function which takes a `bool is_toplevel' instead of a TypeContainer.
24220
24221         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
24222         builtin type.
24223
24224 2002-08-02  Martin Baulig  <martin@gnome.org>
24225
24226         * expression.cs (LocalVariableReferenc): Added constructor which
24227         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
24228         (LocalVariableReference.IsReadOnly): New property.
24229         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
24230         variable is readonly, use our own readonly flag to do this; you can
24231         use the new constructor to get a writable reference to a read-only
24232         variable.
24233
24234         * cs-parser.jay (foreach_statement, using_statement): Get a writable
24235         reference to the local variable.
24236
24237 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
24238
24239         * rootcontext.cs (ResolveCore): Also include System.Exception
24240
24241         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
24242         we reach an EmptyStatement.
24243
24244         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
24245         is also fine.
24246
24247         * expression.cs (Binary.ResolveOperator): Check error result in
24248         two places.
24249
24250         use brtrue/brfalse directly and avoid compares to null.
24251
24252 2002-08-02  Martin Baulig  <martin@gnome.org>
24253
24254         * class.cs (TypeContainer.Define): Define all nested interfaces here.
24255         Fixes bug #28407, added test-155.cs.
24256
24257 2002-08-01  Martin Baulig  <martin@gnome.org>
24258
24259         * class.cs (Event.EmitDefaultMethod): Make this work with static
24260         events.  Fixes #28311, added verify-3.cs.
24261
24262 2002-08-01  Martin Baulig  <martin@gnome.org>
24263
24264         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
24265         `is_disposable' fields.
24266         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
24267         `hm.is_disposable' if we're using the collection pattern.
24268         (Foreach.EmitCollectionForeach): Use the correct type for the
24269         enumerator's local variable, only emit the try/finally block if
24270         necessary (fixes #27713).
24271
24272 2002-08-01  Martin Baulig  <martin@gnome.org>
24273
24274         * ecore.cs (Expression.report118): Renamed to Error118 and made
24275         it public static.
24276
24277         * statement.cs (Throw.Resolve): Check whether the expression is of
24278         the correct type (CS0118) and whether the type derives from
24279         System.Exception (CS0155).
24280         (Catch.Resolve): New method.  Do the type lookup here and check
24281         whether it derives from System.Exception (CS0155).
24282         (Catch.CatchType, Catch.IsGeneral): New public properties.
24283
24284         * typemanager.cs (TypeManager.exception_type): Added.
24285
24286 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
24287
24288         * driver.cs: Updated About function.
24289
24290 2002-07-31  Martin Baulig  <martin@gnome.org>
24291
24292         Implemented Control Flow Analysis.
24293
24294         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
24295         (EmitContext.CurrentBranching): Added.
24296         (EmitContext.StartFlowBranching): Added.
24297         (EmitContext.EndFlowBranching): Added.
24298         (EmitContext.KillFlowBranching): Added.
24299         (EmitContext.IsVariableAssigned): Added.
24300         (EmitContext.SetVariableAssigned): Added.
24301         (EmitContext.IsParameterAssigned): Added.
24302         (EmitContext.SetParameterAssigned): Added.
24303         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
24304         Added control flow analysis stuff here.
24305
24306         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24307         resolve the expression as lvalue.
24308         (LocalVariableReference.DoResolve): Check whether the variable has
24309         already been assigned.
24310         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24311         the parameter as assigned here.
24312         (ParameterReference.DoResolve): Check whether the parameter has already
24313         been assigned.
24314         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24315         expression as lvalue.
24316
24317         * statement.cs (FlowBranching): New class for the flow analysis code.
24318         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24319         (LabeledStatement.IsDefined): New public property.
24320         (LabeledStatement.AddUsageVector): New public method to tell flow
24321         analyis that the label may be reached via a forward jump.
24322         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24323         flow analysis.
24324         (VariableInfo.Number): New public field.  This is used by flow analysis
24325         to number all locals of a block.
24326         (Block.CountVariables): New public property.  This is the number of
24327         local variables in this block (including the locals from all parent
24328         blocks).
24329         (Block.EmitMeta): Number all the variables.
24330
24331         * statement.cs: Added flow analysis support to all classes.
24332
24333 2002-07-31  Martin Baulig  <martin@gnome.org>
24334
24335         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24336         To get debugging messages, compile mcs with /define:MCS_DEBUG and
24337         then use this argument.
24338
24339         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24340
24341         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24342         use this to specify /define options.
24343
24344 2002-07-29  Martin Baulig  <martin@gnome.org>
24345
24346         * statement.cs (Fixed): Moved all code that does variable lookups
24347         and resolvings from Emit to Resolve.
24348
24349         * statement.cs (For): Moved all code that does variable lookups
24350         and resolvings from Emit to Resolve.
24351
24352         * statement.cs (Using): Moved all code that does variable lookups
24353         and resolvings from Emit to Resolve.
24354
24355 2002-07-29  Martin Baulig  <martin@gnome.org>
24356
24357         * attribute.cs (Attribute.Resolve): Explicitly catch a
24358         System.NullReferenceException when creating the
24359         CustromAttributeBuilder and report a different warning message.
24360
24361 2002-07-29  Martin Baulig  <martin@gnome.org>
24362
24363         * support.cs (ParameterData.ParameterName): Added method to
24364         get the name of a parameter.
24365
24366         * typemanager.cs (TypeManager.IsValueType): New public method.
24367
24368 2002-07-29  Martin Baulig  <martin@gnome.org>
24369
24370         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
24371         is a flag which specifies that it's either ref or out.
24372         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24373         the out parameter to `out Parameter.Modifier mod', also set the
24374         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24375
24376         * support.cs (InternalParameters.ParameterModifier): Distinguish
24377         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24378         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24379
24380         * expression.cs (Argument.GetParameterModifier): Distinguish
24381         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24382         Parameter.Modifier.ISBYREF flag if it's either ref or out.
24383
24384 2002-07-29  Martin Baulig  <martin@gnome.org>
24385
24386         * expression.cs (ParameterReference.ParameterReference): Added
24387         `Location loc' argument to the constructor.
24388
24389         * cs-parser.jay: Pass location to ParameterReference.
24390
24391 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
24392
24393         * statement.cs (Try): Initialize the location.
24394
24395         * cs-parser.jay: pass location to Try.
24396
24397         * expression.cs (Unary.Reduce): Change the prototype to return
24398         whether a constant fold could be performed or not.  The result is
24399         returned in an out parameters.  In the case of Indirection and
24400         AddressOf, we want to perform the full tests.
24401
24402 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
24403
24404         * statement.cs (Statement.Emit): Flag dead code.
24405
24406 2002-07-27  Andrew Birkett  <andy@nobugs.org>
24407
24408         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24409
24410 2002-07-27  Martin Baulig  <martin@gnome.org>
24411
24412         * class.cs (MethodData.Define): Put back call to
24413         TypeManager.AddMethod(), accidentally commented this out.
24414
24415         * report.cs (Debug): New public method to print debugging information,
24416         this is `[Conditional ("DEBUG")]'.
24417
24418 2002-07-26  Martin Baulig  <martin@gnome.org>
24419
24420         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24421         (switch_statement): Push the current_block to the switch_stack and
24422         pop it again when we're done with the switch.
24423         (switch_section): The new block is a child of the current_block.
24424         Fixes bug #24007, added test-152.cs.
24425
24426 2002-07-27  Martin Baulig  <martin@gnome.org>
24427
24428         * expression.cs (Invocation.EmitArguments): When calling a varargs
24429         function with only its fixed arguments, we need to pass an empty
24430         array.
24431
24432 2002-07-27  Martin Baulig  <martin@gnome.org>
24433
24434         Mono 0.13 has been released.
24435
24436 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
24437
24438         * driver.cs: Rename --resource to --linkres, because that is what
24439         we do currently, we dont support --resource yet.
24440
24441         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24442
24443 2002-07-25  Martin Baulig  <martin@gnome.org>
24444
24445         * class.cs (MethodData): New public class.  This is a `method builder'
24446         class for a method or one accessor of a Property/Indexer/Event.
24447         (MethodData.GetMethodFlags): Moved here from MemberBase.
24448         (MethodData.ApplyAttributes): Likewise.
24449         (MethodData.ApplyObsoleteAttribute): Likewise.
24450         (MethodData.ApplyConditionalAttribute): Likewise.
24451         (MethodData.ApplyDllImportAttribute): Likewise.
24452         (MethodData.CheckAbstractAndExternal): Likewise.
24453         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24454         (MethodData.Emit): Formerly known as Method.Emit().
24455         (MemberBase): Moved everything which was specific to a single
24456         accessor/method to MethodData.
24457         (Method): Create a new MethodData and call Define() and Emit() on it.
24458         (Property, Indexer, Event): Create a new MethodData objects for each
24459         accessor and call Define() and Emit() on them.
24460
24461 2002-07-25  Martin Baulig  <martin@gnome.org>
24462
24463         Made MethodCore derive from MemberBase to reuse the code from there.
24464         MemberBase now also checks for attributes.
24465
24466         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24467         (MemberBase.GetMethodFlags): Moved here from class Method and marked
24468         as virtual.
24469         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24470         `CallingConventions cc' and `Attributes opt_attrs' arguments.
24471         (MemberBase.ApplyAttributes): New virtual method; applies the
24472         attributes to a method or accessor.
24473         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24474         (MemberBase.ApplyConditionalAttribute): Likewise.
24475         (MemberBase.ApplyDllImportAttribute): Likewise.
24476         (MemberBase.CheckAbstractAndExternal): Likewise.
24477         (MethodCore.ParameterTypes): This is now a property instead of a
24478         method, it's initialized from DoDefineParameters().
24479         (MethodCore.ParameterInfo): Removed the set accessor.
24480         (MethodCore.DoDefineParameters): New protected virtual method to
24481         initialize ParameterTypes and ParameterInfo.
24482         (Method.GetReturnType): We can now simply return the MemberType.
24483         (Method.GetMethodFlags): Override the MemberBase version and add
24484         the conditional flags.
24485         (Method.CheckBase): Moved some code from Define() here, call
24486         DoDefineParameters() here.
24487         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24488         here to avoid some larger code duplication.
24489         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24490         ensure that abstract and external accessors don't declare a body.
24491
24492         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24493         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24494         lookup in the attribute's parent classes, so we need to abort as soon
24495         as we found the first match.
24496         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24497         the attribute has no arguments.
24498
24499         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24500         of a Method.
24501
24502 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24503
24504         * cs-parser.jay: reverted previous patch.
24505
24506 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24507
24508         * cs-parser.jay: fixed bug #22119.
24509
24510 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24511
24512         * attribute.cs: fixed compilation. The error was:
24513         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
24514         be assigned to before control leaves the current method."
24515         [FIXME:  Filed as bug #28186: MCS must report this error.]
24516
24517 2002-07-25  Martin Baulig  <martin@gnome.org>
24518
24519         * attribute.cs (Attribute.Conditional_GetConditionName): New static
24520         method to pull the condition name ouf of a Conditional attribute.
24521         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24522         the obsolete message and error flag out of an Obsolete attribute.
24523
24524         * class.cs (Method.GetMethodFlags): New public method to get the
24525         TypeManager.MethodFlags for this method.
24526         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24527         private methods.
24528         (Method.Define): Get and apply the Obsolete and Conditional attributes;
24529         if we're overriding a virtual function, set the new private variable
24530         `parent_method'; call the new TypeManager.AddMethod().
24531
24532         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
24533         the MethodBuilder and the Method in a PtrHashtable.
24534         (TypeManager.builder_to_method): Added for this purpose.
24535         (TypeManager.MethodFlags): Added IsObsoleteError.
24536         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
24537         Obsolete and Conditional arguments in MethodBuilders.  If we discover
24538         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24539         the message from the attribute.
24540
24541 2002-07-24  Martin Baulig  <martin@gnome.org>
24542
24543         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24544         preprocessor directives, ensure that the argument to #define/#undef is
24545         exactly one identifier and that it's actually an identifier.
24546
24547         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24548         did not work ....
24549
24550 2002-07-24  Martin Baulig  <martin@gnome.org>
24551
24552         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24553         initialize it to TypeManager.object_type in the constructor.
24554         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24555         of the `hm.get_current' method if we're using the collection pattern.
24556         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24557         for the explicit conversion to make it work when we're using the collection
24558         pattern and the `Current' property has a different return type than `object'.
24559         Fixes #27713.
24560
24561 2002-07-24  Martin Baulig  <martin@gnome.org>
24562
24563         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24564         does not match, but don't report any errors.  This method is called in
24565         order for all methods in a MethodGroupExpr until a matching method is
24566         found, so we don't want to bail out if the first method doesn't match.
24567         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24568         matches, report the 123.  Fixes #28070.
24569
24570 2002-07-24  Martin Baulig  <martin@gnome.org>
24571
24572         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24573         TypeManager.TypeToCoreType() to the top of the method so the
24574         following equality checks will work.  Fixes #28107.
24575
24576 2002-07-24  Martin Baulig  <martin@gnome.org>
24577
24578         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24579         operand is of type uint, and the other operand is of type sbyte,
24580         short or int, the operands are converted to type long." -
24581         Actually do what this comment already told us.  Fixes bug #28106,
24582         added test-150.cs.
24583
24584 2002-07-24  Martin Baulig  <martin@gnome.org>
24585
24586         * class.cs (MethodBase): New abstract class.  This is now a base
24587         class for Property, Indexer and Event to avoid some code duplication
24588         in their Define() and DefineMethods() methods.
24589         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24590         generic methods for Define() and DefineMethods().
24591         (FieldBase): Derive from MemberBase, not MemberCore.
24592         (Property): Derive from MemberBase, not MemberCore.
24593         (Property.DefineMethod): Moved all the code from this method to the
24594         new MethodBase.DefineAccessor(), just call it with appropriate
24595         argumetnts.
24596         (Property.Define): Call the new Property.DoDefine(), this does some
24597         sanity checks and we don't need to duplicate the code everywhere.
24598         (Event): Derive from MemberBase, not MemberCore.
24599         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24600         accessors, this will also make them work with interface events.
24601         (Indexer): Derive from MemberBase, not MemberCore.
24602         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24603         (Indexer.Define): Use the new MethodBase functions.
24604
24605         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24606         argument to the constructor.
24607         (Interface.FindMembers): Added support for interface events.
24608         (Interface.PopluateEvent): Implemented.
24609
24610         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
24611
24612 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
24613
24614         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24615         but this is required to check for a method name being the same as
24616         the containing class.  
24617
24618         Handle this now.
24619
24620 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24621
24622         * interface.cs: initialize variable.
24623
24624 2002-07-23  Martin Baulig  <martin@gnome.org>
24625
24626         Implemented the IndexerName attribute in interfaces.
24627
24628         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24629         name if this is an explicit interface implementation.
24630         (Indexer.InterfaceIndexerName): New public variable.  If we're
24631         implementing an interface indexer, this is the IndexerName in that
24632         interface.  Otherwise, it's the IndexerName.
24633         (Indexer.DefineMethod): If we're implementing interface indexer,
24634         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
24635         and Pending.ImplementIndexer methods.
24636         (Indexer.Define): Also define the PropertyBuilder if we're
24637         implementing an interface indexer and this is neither an explicit
24638         interface implementation nor do the IndexerName match the one in
24639         the interface.
24640
24641         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24642         If a method is defined here, then we always need to create a proxy
24643         for it.  This is used when implementing interface indexers.
24644         (Pending.IsInterfaceIndexer): New public method.
24645         (Pending.ImplementIndexer): New public method.
24646         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24647         This is used when implementing interface indexers to define a proxy
24648         if necessary.
24649         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24650         define a proxy if necessary.
24651
24652         * interface.cs (Interface.IndexerName): New public variable.
24653         (Interface.PopulateIndexer): Set the IndexerName.
24654         (Interface.DefineIndexers): New private method.  Populate all the
24655         indexers and make sure their IndexerNames match.
24656
24657         * typemanager.cs (IndexerPropertyName): Added support for interface
24658         indexers.
24659
24660 2002-07-22  Martin Baulig  <martin@gnome.org>
24661
24662         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24663         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24664         ret if HasReturnLabel.
24665         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24666         variables.
24667
24668         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24669         and set the ec.LoopBeginTryCatchLevel.
24670         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24671         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24672         the current ec.TryCatchLevel, the branch goes out of an exception
24673         block.  In this case, we need to use Leave and not Br.
24674
24675 2002-07-22  Martin Baulig  <martin@gnome.org>
24676
24677         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24678         block unless the block does not always return or it is contained in
24679         another try { ... } catch { ... } block.  Fixes bug #26506.
24680         Added verify-1.cs to the test suite.
24681
24682 2002-07-22  Martin Baulig  <martin@gnome.org>
24683
24684         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24685         then we do not always return.  Fixes bug #24985.
24686
24687 2002-07-22  Martin Baulig  <martin@gnome.org>
24688
24689         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24690         lookup on a per-class level; ie. walk up the class hierarchy until we
24691         found at least one applicable method, then choose the best among them.
24692         Fixes bug #24463 and test-29.cs.
24693
24694 2002-07-22  Martin Baulig  <martin@gnome.org>
24695
24696         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24697         return types of the methods.  The return type is not part of the
24698         signature and we must not check it to make the `new' modifier work.
24699         Fixes bug #27999, also added test-147.cs.
24700         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24701
24702         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24703         on the method's return type.
24704
24705 2002-07-21  Martin Baulig  <martin@gnome.org>
24706
24707         * assign.cs: Make this work if the rightmost source is a constant and
24708         we need to do an implicit type conversion.  Also adding a few more tests
24709         to test-38.cs which should have caught this.
24710
24711         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24712         target in the makefile for this.  The makefile.gnu is primarily intended
24713         for end-users who don't want to debug the compiler.
24714
24715 2002-07-21  Martin Baulig  <martin@gnome.org>
24716
24717         * assign.cs: Improved the Assign class so it can now handle embedded
24718         assignments (X = Y = Z = something).  As a side-effect this'll now also
24719         consume less local variables.  test-38.cs now passes with MCS, added
24720         a few new test cases to that test.
24721
24722 2002-07-20  Martin Baulig  <martin@gnome.org>
24723
24724         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24725         instructions.  Fixes bug #27977, also added test-146.cs.
24726
24727 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24728
24729         * cs-tokenizer.cs: fixed getHex ().
24730
24731 2002-07-19  Martin Baulig  <martin@gnome.org>
24732
24733         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24734         not Type.GetType() to lookup the array type.  This is needed when
24735         we're constructing an array of a user-defined type.
24736         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24737         single-dimensional arrays, but also for single-dimensial arrays of
24738         type decimal.
24739
24740 2002-07-19  Martin Baulig  <martin@gnome.org>
24741
24742         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24743         this function is called, it's not allowed to share LocalBuilders
24744         among ILGenerators.
24745
24746 2002-07-19  Martin Baulig  <martin@gnome.org>
24747
24748         * expression.cs (Argument.Resolve): Report an error 118 when trying
24749         to pass a type as argument.
24750
24751 2002-07-18  Martin Baulig  <martin@gnome.org>
24752
24753         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24754         Conv_R_Un for the signed `long' type.
24755
24756 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
24757
24758         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24759         `expr' for the temporary result, as that will fail if we do
24760         multiple resolves on the same expression.
24761
24762 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
24763
24764         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24765         ec.TypeContainer for looking up aliases. 
24766
24767         * class.cs (TypeContainer): Remove LookupAlias from here.
24768
24769         * decl.cs (DeclSpace); Move here.
24770
24771 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
24772
24773         * class.cs (FindMembers): Only call filter if the constructor
24774         bulider is not null.
24775
24776         Also handle delegates in `NestedTypes' now.  Now we will perform
24777         type lookups using the standard resolution process.  This also
24778         fixes a bug.
24779
24780         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24781         This uses Expressions (the limited kind that can be parsed by the
24782         tree) instead of strings.
24783
24784         * expression.cs (ComposedCast.ToString): Implement, used to flag
24785         errors since now we have to render expressions.
24786
24787         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
24788         FormArrayType. 
24789
24790         * ecore.cs (SimpleName.ToString): ditto.
24791
24792         * cs-parser.jay: Instead of using strings to assemble types, use
24793         Expressions to assemble the type (using SimpleName, ComposedCast,
24794         MemberAccess).  This should fix the type lookups in declarations,
24795         because we were using a different code path for this.
24796
24797         * statement.cs (Block.Resolve): Continue processing statements
24798         even when there is an error.
24799
24800 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
24801
24802         * class.cs (Event.Define): Also remove the `remove' method from
24803         the list of pending items.
24804
24805         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24806         generate more compact code. 
24807
24808 2002-07-17  Martin Baulig  <martin@gnome.org>
24809
24810         * const.cs (Const.LookupConstantValue): Add support for constant
24811         `unchecked' and `checked' expressions.
24812         Also adding test case test-140.cs for this.
24813
24814 2002-07-17  Martin Baulig  <martin@gnome.org>
24815
24816         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24817         check whether mi.ReturnType implements the IEnumerator interface; the
24818         `==' and the IsAssignableFrom() will fail in this situation.
24819
24820 2002-07-16  Ravi Pratap  <ravi@ximian.com>
24821
24822         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
24823         here too.
24824
24825 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24826
24827         * expression.cs: fixed bug #27811.
24828
24829 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
24830
24831         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24832         Molaro: when we are a ref, the value already contains a pointer
24833         value, do not take the address of it.
24834
24835 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24836         * removed mb-parser.jay and mb-tokenizer.cs
24837
24838 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24839
24840         * expression.cs: check against the building corlib void type.
24841
24842 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24843
24844         * ecore.cs: fix for valuetype static readonly fields: when 
24845         initializing them, we need their address, not the address of a copy.
24846
24847 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24848
24849         * typemanager.cs: register also enum_type in corlib.
24850
24851 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24852
24853         * class.cs: allow calling this (but not base) initializers in structs.
24854
24855 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24856
24857         * ecore.cs: make sure we compare against the building base types
24858         in GetTypeSize ().
24859
24860 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24861
24862         * typemanager.cs: fix TypeToCoreType() to handle void and object
24863         (corlib gets no more typerefs after this change).
24864
24865 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * expression.cs (ArrayCreation.EmitArrayArguments): use
24868         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24869
24870         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24871         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24872         array indexes, the runtime actually forbids them.
24873
24874         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24875         for array arguments here.
24876
24877         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24878         instead of the default for ValueTypes.
24879
24880         (New.DoEmit): Use IsValueType instead of
24881         IsSubclassOf (value_type)
24882         (New.DoResolve): ditto.
24883         (Invocation.EmitCall): ditto.
24884
24885         * assign.cs (Assign): ditto.
24886
24887         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24888         Statements *are* currently doing part of their resolution during
24889         Emit.  
24890
24891         Expressions do always resolve during resolve, but statements are
24892         only required to propagate resolution to their children.
24893
24894 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24895
24896         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24897
24898         (LoadAssembly): Do not add the dll if it is already specified
24899
24900         (MainDriver): Add the System directory to the link path at the end,
24901         after all the other -L arguments. 
24902
24903         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24904         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24905         ldelem.u1) and using the opposite for sbytes.
24906
24907         This fixes Digger, and we can finally run it.
24908
24909         * driver.cs (UnixParseOption): Move the option parsing here.  
24910         (CSCParseOption): Implement CSC-like parsing of options.
24911
24912         We now support both modes of operation, the old Unix way, and the
24913         new CSC-like way.  This should help those who wanted to make cross
24914         platform makefiles.
24915
24916         The only thing broken is that /r:, /reference: and /lib: are not
24917         implemented, because I want to make those have the same semantics
24918         as the CSC compiler has, and kill once and for all the confussion
24919         around this.   Will be doing this tomorrow.
24920
24921         * statement.cs (Unsafe.Resolve): The state is checked during
24922         resolve, not emit, so we have to set the flags for IsUnsfe here.
24923
24924 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24925
24926         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24927         not catch the Error_ObjectRefRequired in SimpleName (as it is
24928         possible to have a class/instance variable name that later gets
24929         deambiguated), we have to check this here.      
24930
24931 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24932
24933         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24934         make static and put into Expression.
24935
24936         (Event.Define): Register the private field of the event with the 
24937         TypeManager so that GetFieldFromEvent can get at it.
24938
24939         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24940         keep track of the private field associated with an event which
24941         has no accessors.
24942
24943         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24944         private field.
24945
24946         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24947
24948 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24949
24950         * expression.cs (Binary.EmitBranchable): this routine emits the
24951         Binary expression in a branchable context.  This basically means:
24952         we need to branch somewhere, not just get the value on the stack.
24953
24954         This works together with Statement.EmitBoolExpression.
24955
24956         * statement.cs (Statement.EmitBoolExpression): Use
24957         EmitBranchable. 
24958
24959 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24960
24961         * statement.cs (For): Reduce the number of jumps in loops.
24962
24963         (For): Implement loop inversion for the For statement.
24964
24965         (Break): We can be breaking out of a Try/Catch controlled section
24966         (foreach might have an implicit try/catch clause), so we need to
24967         use Leave instead of Br.
24968
24969         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24970         now).  If the instace expression supports IMemoryLocation, we use
24971         the AddressOf method from the IMemoryLocation to extract the
24972         address instead of emitting the instance.
24973
24974         This showed up with `This', as we were emitting the instance
24975         always (Emit) instead of the Address of This.  Particularly
24976         interesting when This is a value type, as we dont want the Emit
24977         effect (which was to load the object).
24978
24979 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24980
24981         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24982
24983         * statement.cs (Checked): Set the CheckedState during the resolve
24984         process too, as the ConvCast operations track the checked state on
24985         the resolve process, and not emit.
24986
24987         * cs-parser.jay (namespace_member_declaration): Flag that we have
24988         found a declaration when we do.  This is used to flag error 1529
24989
24990         * driver.cs: Report ok when we display the help only.
24991
24992 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24993
24994         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24995
24996 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * cs-tokenizer.cs (define): We also have to track locally the
24999         defines.  AllDefines is just used for the Conditional Attribute,
25000         but we also need the local defines for the current source code. 
25001
25002 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * statement.cs (While, For, Do): These loops can exit through a
25005         Break statement, use this information to tell whether the
25006         statement is the last piece of code.
25007
25008         (Break): Flag that we break.
25009
25010         * codegen.cs (EmitContexts): New `Breaks' state variable.
25011
25012 2002-07-03  Martin Baulig  <martin@gnome.org>
25013
25014         * class.cs (TypeContainer.MethodModifiersValid): Allow override
25015         modifiers in method declarations in structs.  Otherwise, you won't
25016         be able to override things like Object.Equals().
25017
25018 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
25019
25020         * class.cs (Method, Property, Indexer): Do not allow the public
25021         modifier to be used in explicit interface implementations.
25022
25023         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
25024         override modifiers in method declarations in structs
25025
25026 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
25027
25028         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
25029         integer or real overflow, report an error
25030
25031 2002-07-02  Martin Baulig  <martin@gnome.org>
25032
25033         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
25034         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
25035         to tell the runtime about our newly created System.Object and
25036         System.ValueType types.
25037
25038 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
25039
25040         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
25041         struct instead of Ldarg/Starg.
25042
25043 2002-07-02  Martin Baulig  <martin@gnome.org>
25044
25045         * expression.cs (Indirection.Indirection): Call
25046         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
25047
25048 2002-07-02  Martin Baulig  <martin@gnome.org>
25049
25050         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
25051         ValueType, call TypeManager.TypeToCoreType() on it.
25052         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
25053         the OpCodes.Newarr argument.
25054
25055 2002-07-02  Martin Baulig  <martin@gnome.org>
25056
25057         * expression.cs (Invocation.EmitCall): When compiling corlib,
25058         replace all calls to the system's System.Array type to calls to
25059         the newly created one.
25060
25061         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
25062         System.Array methods.
25063         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
25064         from the system's System.Array type which must be replaced.
25065
25066 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
25067
25068         * typemanager.cs: load unverifiable_code_ctor so we can build
25069         corlib using the correct type. Avoid using GetTypeCode() with
25070         TypeBuilders.
25071         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
25072         TypeManager.object_type to allow building corlib.
25073
25074 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25075
25076         * ecore.cs: handle System.Enum separately in LoadFromPtr().
25077
25078 2002-07-01  Martin Baulig  <martin@gnome.org>
25079
25080         * class.cs: Make the last change actually work, we need to check
25081         whether `ifaces != null' to avoid a crash.
25082
25083 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25084
25085         * class.cs: when we build structs without fields that implement
25086         interfaces, we need to add the interfaces separately, since there is
25087         no API to both set the size and add the interfaces at type creation
25088         time.
25089
25090 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25091
25092         * expression.cs: the dimension arguments to the array constructors
25093         need to be converted if they are a long.
25094
25095 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
25096
25097         * class.cs: don't emit ldarg.0 if there is no parent constructor
25098         (fixes showstopper for corlib).
25099
25100 2002-06-29  Martin Baulig  <martin@gnome.org>
25101
25102         MCS now compiles corlib on GNU/Linux :-)
25103
25104         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
25105         ie. check for MethodImplOptions.InternalCall.
25106
25107         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
25108         and TypeManager.attribute_type are null, so we must explicitly check
25109         whether parent is not null to find out whether it's an attribute type.
25110         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
25111         and SetBuilder, not only if the property is neither abstract nor external.
25112         This is necessary to set the MethodImplOptions on the accessor methods.
25113         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
25114         SetBuilder, see Property.Emit().
25115
25116         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
25117         populate "System.Object", "System.ValueType" and "System.Attribute" since
25118         they've already been populated from BootCorlib_PopulateCoreTypes().
25119
25120 2002-06-29  Martin Baulig  <martin@gnome.org>
25121
25122         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
25123         is the NullLiteral, we also need to make sure that target_type is not
25124         an enum type.   
25125
25126 2002-06-29  Martin Baulig  <martin@gnome.org>
25127
25128         * rootcontext.cs (RootContext.ResolveCore): We must initialize
25129         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
25130         before calling BootstrapCorlib_ResolveDelegate ().
25131
25132 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25133
25134         * statement.cs: fixed build-breaker. All tests passed ok.
25135
25136 2002-06-27  Martin Baulig  <martin@gnome.org>
25137
25138         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
25139         for System.Decimal when compiling corlib.
25140
25141 2002-06-27  Martin Baulig  <martin@gnome.org>
25142
25143         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
25144         switch blocks which contain nothing but a default clause.
25145
25146 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
25147
25148        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
25149
25150 2002-06-27  Martin Baulig  <martin@gnome.org>
25151
25152         * ecore.cs (PropertyExpr.PropertyExpr): Call
25153         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
25154
25155         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
25156         is already a TypeBuilder.
25157
25158 2002-06-27  Martin Baulig  <martin@gnome.org>
25159
25160         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
25161         `target_type == TypeManager.array_type', not IsAssignableFrom() in
25162         the "from an array-type to System.Array" case.  This makes it work
25163         when compiling corlib.
25164
25165 2002-06-27  Martin Baulig  <martin@gnome.org>
25166
25167         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
25168         non-static PropertyExpr, set its InstanceExpression.  This makes
25169         the `ICollection.Count' property work in System/Array.cs.
25170
25171 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
25172
25173         * driver.cs: Made error handling more consistent.  Errors now
25174         tracked by Report class, so many methods which used to return int
25175         now return void.  Main() now prints success/failure and 
25176         errors/warnings message.
25177
25178         Renamed '--probe' compiler argument to '--expect-error'.  Removed
25179         the magic number return values (123 and 124).  Now, if the
25180         expected error occurs, the compiler exits with success (exit value
25181         0).  If the compilation completes without seeing that particular
25182         error, the compiler exits with failure (exit value 1).  The
25183         makefile in mcs/errors has been changed to handle the new behaviour.
25184
25185         * report.cs: Made 'expected error' number a property and renamed
25186         it from 'Probe' to 'ExpectedError'.
25187
25188         * genericparser.cs: Removed error handling support, since it is
25189         now all done by Report class.
25190
25191         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
25192         class, so parse() no longer returns an int.
25193
25194         * namespace.cs: Use Report.Error instead of GenericParser.error
25195
25196 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
25197
25198         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
25199         TypeContainer.AddOperator): At the front of the list put the
25200         explicit implementations, so they get resolved/defined first. 
25201
25202 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
25203
25204         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
25205         interface type is implemented by this TypeContainer.  Used during
25206         explicit interface implementation.
25207
25208         (Property.Define, Indexer.Define, Method.Define): Validate that
25209         the given interface in the explicit implementation is one of the
25210         base classes for the containing type.
25211
25212         Also if we are explicitly implementing an interface, but there is
25213         no match in the pending implementation table, report an error.
25214
25215         (Property.Define): Only define the property if we are
25216         not explicitly implementing a property from an interface.  Use the
25217         correct name also for those properties (the same CSC uses,
25218         although that is really not needed).
25219
25220         (Property.Emit): Do not emit attributes for explicitly implemented
25221         properties, as there is no TypeBuilder.
25222
25223         (Indexer.Emit): ditto.
25224
25225         Hiding then means that we do not really *implement* a pending
25226         implementation, which makes code fail.
25227
25228 2002-06-22  Martin Baulig  <martin@gnome.org>
25229
25230         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
25231         the return value of Object.GetType().  [FIXME: we need to do this whenever
25232         we get a type back from the reflection library].
25233
25234 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25235
25236         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
25237
25238 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
25239
25240         * attribute.cs: Return null if we can not look up the type.
25241
25242         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
25243         the interface types found.
25244
25245         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
25246         interface types found.
25247
25248         * typemanager.cs (GetInterfaces): Make this routine returns alll
25249         the interfaces and work around the lame differences between
25250         System.Type and System.Reflection.Emit.TypeBuilder in the results
25251         result for GetInterfaces.
25252
25253         (ExpandInterfaces): Given an array of interface types, expand and
25254         eliminate repeated ocurrences of an interface.  This expands in
25255         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
25256         be IA, IB, IC.
25257
25258 2002-06-21  Martin Baulig  <martin@gnome.org>
25259
25260         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
25261         on System.Enum.
25262
25263 2002-06-21  Martin Baulig  <martin@gnome.org>
25264
25265         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
25266         and called with one of the core types, return the corresponding typebuilder for
25267         that type.
25268
25269         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
25270         element type.
25271
25272 2002-06-21  Martin Baulig  <martin@gnome.org>
25273
25274         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
25275         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
25276         (Expression.ConvertReferenceExplicit): Likewise.
25277
25278         * expression.cs (ElementAccess.DoResolve): Likewise.
25279         (ElementAccess.DoResolveLValue): Likewise.
25280
25281 2002-06-10  Martin Baulig  <martin@gnome.org>
25282
25283         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
25284         add the "value" parameter to the parameter list.
25285
25286         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
25287         to our caller.
25288
25289 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
25290
25291         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
25292         the argument to an int, uint, long or ulong, per the spec.  Also
25293         catch negative constants in array creation.
25294
25295 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
25296
25297         * class.cs: do not allow the same interface to appear twice in
25298         the definition list.
25299
25300 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25301
25302         * ecore.cs: don't use ldlen with System.Array.
25303
25304 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25305
25306         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25307
25308 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25309
25310         * modifiers.cs: produce correct field attributes for protected
25311         internal. Easy fix so miguel can work on ther harder stuff:-)
25312
25313 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
25314
25315         * pending.cs: New file.  Move the code from class.cs here.
25316         Support clearning the pending flag for all methods (when not doing
25317         explicit interface implementation).
25318
25319 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25320
25321         * rootcontext.cs: added a couple more types needed to bootstrap.
25322
25323 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25326         constructor in the type, instead of any constructor in the type
25327         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
25328         a bug in the Mono runtime when applying the params attribute). 
25329
25330 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
25331         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25332
25333 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
25334
25335         * expression.cs (Unary.ResolveOperator): Use TypeManager
25336         to resolve the type.
25337
25338 2002-06-13  Ravi Pratap  <ravi@ximian.com>
25339
25340         * cs-parser.jay (enum_member_declaration): Pass in the attributes
25341         attached.
25342
25343         * enum.cs (AddEnumMember): Add support to store the attributes associated 
25344         with each member too.
25345
25346         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25347         field builders too - this takes care of the enum member case.
25348
25349 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
25350
25351         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25352         address-of operator on both value types and pointers.
25353
25354 2002-06-10  Martin Baulig  <martin@gnome.org>
25355
25356         * interface.cs (Interface.PopulateIndexer): Add the indexer's
25357         PropertyBuilder to the `property_builders' list.
25358
25359         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25360         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25361         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
25362         find any indexers which are inherited from an interface.
25363
25364 2002-06-09  Martin Baulig  <martin@gnome.org>
25365
25366         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25367         the same type as the constant if necessary.  There's also a test-130.cs
25368         for this.
25369
25370         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25371
25372         * typemanager.cs (TypeManager.ChangeType): Previously known as
25373         Enum.ChangeEnumType().
25374
25375 2002-06-09  Martin Baulig  <martin@gnome.org>
25376
25377         * expression.cs (Cast.TryReduce): Added support for consts.
25378
25379 2002-06-08  Ravi Pratap  <ravi@ximian.com>
25380
25381         * class.cs (Accessor): Hold attributes information so we can pass
25382         it along.
25383
25384         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25385         Modify to pass in attributes attached to the methods.
25386
25387         (add_accessor_declaration, remove_accessor_declaration): Ditto.
25388
25389         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25390         to handle the Accessor kind :-)
25391
25392         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25393
25394 2002-06-08  Martin Baulig  <martin@gnome.org>
25395
25396         * expression.cs (Unary.TryReduceNegative): Added support for
25397         ULongConstants.
25398
25399 2002-06-08  Martin Baulig  <martin@gnome.org>
25400
25401         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25402         name can't be found in the `defined_names' - the caller will do a
25403         MemberLookup in this case and thus find methods in System.Enum
25404         such as Enum.IsDefined().
25405
25406 2002-06-08  Martin Baulig  <martin@gnome.org>
25407
25408         * enum.cs (Enum.ChangeEnumType): This is a custom version of
25409         Convert.ChangeType() which works with TypeBuilder created types.
25410         (Enum.LookupEnumValue, Enum.Define): Use it here.
25411
25412         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25413         `TypeBuilder.BaseType != null' check.
25414         (TypeContainer.FindMembers): Only lookup parent members if we
25415         actually have a parent.
25416         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25417         (ConstructorInitializer.Resolve): Likewise.
25418
25419         * interface.cs (Interface.FindMembers): Added
25420         `TypeBuilder.BaseType != null' check.
25421
25422         * rootcontext.cs (RootContext.ResolveCore): Added
25423         "System.Runtime.CompilerServices.IndexerNameAttribute" to
25424         classes_second_stage.
25425
25426         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25427         debug_type and trace_type when compiling with --nostdlib.       
25428
25429 2002-06-07  Martin Baulig  <martin@gnome.org>
25430
25431         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25432         (AddField): Set it to true when adding a non-static field.
25433         (DefineType): Use `have_nonstatic_fields' to find out whether we
25434         have non-static fields, not `Fields != null'.
25435
25436 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25439         dereferencing a null on the static-field code path)
25440
25441 2002-05-30  Martin Baulig  <martin@gnome.org>
25442
25443         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25444         to take command line arguments.  Use reflection to call the new
25445         custom `Initialize' function on the symbol writer and pass it the
25446         command line arguments.
25447
25448         * driver.cs (--debug-args): New command line argument to pass command
25449         line arguments to the symbol writer.
25450
25451 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
25452
25453         * assign.cs (DoResolve): Forgot to do the implicit conversion to
25454         the target type for indexers and properties.  Thanks to Joe for
25455         catching this.
25456
25457 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
25458
25459         * typemanager.cs (MethodFlags): returns the method flags
25460         (Obsolete/ShouldIgnore) that control warning emission and whether
25461         the invocation should be made, or ignored. 
25462
25463         * expression.cs (Invocation.Emit): Remove previous hack, we should
25464         not do this on matching a base type, we should do this based on an attribute
25465
25466         Only emit calls to System.Diagnostics.Debug and
25467         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25468         on the command line.
25469
25470         * rootcontext.cs: Global settings for tracing and debugging.
25471
25472         * cs-tokenizer.cs (define): New utility function to track
25473         defines.   Set the global settings for TRACE and DEBUG if found.
25474
25475 2002-05-25  Ravi Pratap  <ravi@ximian.com>
25476
25477         * interface.cs (Populate*): Pass in the TypeContainer as well as
25478         the DeclSpace as parameters so that we can create EmitContexts and
25479         then use that to apply attributes etc.
25480
25481         (PopulateMethod, PopulateEvent, PopulateProperty)
25482         (PopulateIndexer): Apply attributes everywhere.
25483
25484         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25485         etc.
25486
25487         (ApplyAttributes): Update accordingly.
25488
25489         We now apply interface attributes for all members too.
25490
25491 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
25492
25493         * class.cs (Indexer.Define); Correctly check if we are explicit
25494         implementation (instead of checking the Name for a ".", we
25495         directly look up if the InterfaceType was specified).
25496
25497         Delay the creation of the PropertyBuilder.
25498
25499         Only create the PropertyBuilder if we are not an explicit
25500         interface implementation.   This means that explicit interface
25501         implementation members do not participate in regular function
25502         lookups, and hence fixes another major ambiguity problem in
25503         overload resolution (that was the visible effect).
25504
25505         (DefineMethod): Return whether we are doing an interface
25506         implementation. 
25507
25508         * typemanager.cs: Temporary hack until we get attributes in
25509         interfaces (Ravi is working on that) and we get IndexerName
25510         support in interfaces.
25511
25512         * interface.cs: Register the indexers as properties.
25513
25514         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25515         warning, I have verified that this is a bug in the .NET runtime
25516         (JavaScript suffers of the same problem).
25517
25518         * typemanager.cs (MemberLookup): When looking up members for
25519         interfaces, the parent of an interface is the implicit
25520         System.Object (so we succeed in searches of Object methods in an
25521         interface method invocation.  Example:  IEnumerable x;  x.ToString
25522         ()) 
25523
25524 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
25525
25526         * class.cs (Event): Events should also register if they do
25527         implement the methods that an interface requires.
25528
25529         * typemanager.cs (MemberLookup); use the new GetInterfaces
25530         method. 
25531
25532         (GetInterfaces): The code used to lookup interfaces for a type is
25533         used in more than one place, factor it here. 
25534
25535         * driver.cs: Track the errors at the bottom of the file, we kept
25536         on going.
25537
25538         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25539         instance if the method we are calling is static!
25540
25541 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
25542
25543         * attribute.cs (ApplyAttributes): Make this function filter out
25544         the IndexerName attribute (as that attribute in reality is never
25545         applied) and return the string constant for the IndexerName
25546         attribute. 
25547
25548         * class.cs (TypeContainer.Emit): Validate that all the indexers
25549         have the same IndexerName attribute, and if so, set the
25550         DefaultName attribute on the class. 
25551
25552         * typemanager.cs: The return value might contain other stuff (not
25553         only methods).  For instance, consider a method with an "Item"
25554         property and an Item method.
25555
25556         * class.cs: If there is a problem with the parameter types,
25557         return. 
25558
25559 2002-05-24  Ravi Pratap  <ravi@ximian.com>
25560
25561         * ecore.cs (ImplicitConversionExists): Wrapper function which also
25562         looks at user defined conversion after making a call to 
25563         StandardConversionExists - we need this for overload resolution.
25564
25565         * expression.cs : Update accordingly the various method calls.
25566
25567         This fixes 2 bugs filed against implicit user defined conversions 
25568
25569 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
25570
25571         * statement.cs: Track the result of the assignment.
25572
25573 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
25574
25575         * expression.cs (MemberAccess): Improved error reporting for
25576         inaccessible members.
25577
25578 2002-05-22  Martin Baulig  <martin@gnome.org>
25579
25580         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
25581         itself with debugging support.
25582
25583 2002-05-22  Martin Baulig  <martin@gnome.org>
25584
25585         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25586         Removed, this isn't needed anymore.
25587
25588 2002-05-20  Martin Baulig  <martin@gnome.org>
25589
25590         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25591         be underlying type for an enum.
25592
25593 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
25594
25595         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25596         that splits out the loading of just the core types.
25597
25598         * rootcontext.cs (ResolveCore): Split the struct resolution in
25599         two, so we can load the enumeration underlying types before any
25600         enums are used.
25601
25602         * expression.cs (Is): Bandaid until we fix properly Switch (see
25603         bug #24985 for details).
25604
25605         * typemanager.cs (ImplementsInterface): The hashtable will contain
25606         a null if there are no interfaces implemented.
25607
25608 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
25609
25610         * cs-parser.jay (indexer_declarator): It is fine to have array
25611         parameters
25612
25613 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25614
25615         * typemanager.cs: (RegisterBuilder): New function used to register
25616         TypeBuilders that implement interfaces.  Since
25617         TypeBuilder.GetInterfaces (as usual) does not work with lame
25618         Reflection.Emit. 
25619         (AddUserType): register interfaces.
25620
25621         (ImplementsInterface): Use the builder_to_ifaces hash if we are
25622         dealing with TypeBuilder.  Also, arrays are showing up as
25623         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25624         methods can not be invoked on them!
25625
25626         * ecore.cs (ExplicitReferenceConversionExists): Made public.
25627         (ImplicitReferenceConversionExists): Split out from
25628         StandardConversionExists. 
25629
25630         * expression.cs (As): We were only implementing one of the three
25631         cases for the as operator.  We now implement them all.
25632         (Is): Implement the various other cases for Is as well.
25633
25634         * typemanager.cs (CACHE): New define used to control if we want or
25635         not the FindMembers cache.  Seems to have a negative impact on
25636         performance currently
25637
25638         (MemberLookup): Nested types have full acess to
25639         enclosing type members
25640
25641         Remove code that coped with instance/static returns for events, we
25642         now catch this in RealFindMembers.
25643
25644         (RealFindMembers): only perform static lookup if the instance
25645         lookup did not return a type or an event.  
25646
25647 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25648
25649         * assign.cs (CompoundAssign): We pass more semantic information
25650         now to Compound Assignments than we did before: now we have all
25651         the information at hand, and now we resolve the target *before* we
25652         do the expression expansion, which allows the "CacheValue" method
25653         to have the effect we intended (before, a [x] += 1 would generate
25654         two differen ArrayAccess expressions from the ElementAccess,
25655         during the resolution process).
25656
25657         (CompoundAssign.DoResolve): Resolve target and original_source here.
25658
25659 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
25660
25661         * expression.cs (ArrayAccess): dropped debugging information. 
25662
25663         * typemanager.cs: Small bug fix: I was always returning i_members,
25664         instead of one of i_members or s_members (depending on which had
25665         the content).
25666
25667         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
25668         method is invoked before any code generation takes place, and it
25669         is a mechanism to inform that the expression will be invoked more
25670         than once, and that the method should use temporary values to
25671         avoid having side effects
25672
25673         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25674
25675         * ecore.cs (Expression.CacheTemporaries): Provide empty default
25676         implementation.
25677
25678         * expression.cs (Indirection, ArrayAccess): Add support for
25679         CacheTemporaries in these two bad boys. 
25680
25681         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25682         ldobj or ldind_ref.  
25683         (StoreFromPtr): Handle stobj as well.
25684
25685         * expression.cs (UnaryMutator): Share more code.
25686
25687         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25688         down: I was not tracking the Filter function as well, which
25689         was affecting the results of the cache.
25690
25691 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
25692
25693         * attribute.cs: Remove the hack to handle the CharSet property on
25694         StructLayouts. 
25695
25696 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
25697
25698         * attribute.cs (DoResolve): More uglyness, we now only try to
25699         resolve the attribute partially, to extract the CharSet
25700         information (only if we are a StructLayout attribute).  Otherwise 
25701
25702         (GetExtraTypeInfo): Add some code to conditionally kill in the
25703         future this.   I am more and more convinced that the .NET
25704         framework has special code to handle the attribute setting on
25705         certain elements.
25706
25707         * expression.cs (IsParamsMethodApplicable): Revert my previous
25708         foreach change here, it was wrong.
25709
25710 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
25711
25712         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25713         (pp_expr): do not abort on unknown input, just return.
25714         (eval): abort if there are pending chars.
25715
25716         * attribute.cs (Attribute.Resolve): Positional parameters are
25717         optional.  Deal with that case.
25718
25719         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25720         the Ansi/Unicode/Auto information for the type.
25721
25722         (TypeContainer.DefineType): instantiate the EmitContext here, as
25723         we will be using it during the type definition (to resolve
25724         attributes) and during the emit phase.
25725
25726         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25727         to pull type information out of the attributes
25728
25729         (Attribute.Resolve): track the constructor builder, and allow for
25730         multiple invocations (structs and classes will use this).
25731
25732         * ecore.cs (MemberLookupFinal): new version with all the
25733         parameters customizable.
25734
25735         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25736         constructors.  Return if the result value is null (as the error
25737         would have been flagged already by MemberLookupFinal)
25738
25739         Do not allow instances of abstract classes or interfaces to be
25740         created.
25741
25742         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25743         We have to compare the assembly property here when dealing with
25744         FamANDAssem and Assembly access modifiers, because we might be
25745         creating an assembly from *modules* (that means that we are not
25746         getting TypeBuilders for types defined in other modules that are
25747         part of this assembly).
25748
25749         (Method.Emit): If the method is marked abstract and has a body,
25750         emit an error. 
25751
25752         (TypeContainer.DefineMembers): If both the defined member and the
25753         parent name match are methods, then do not emit any warnings: let
25754         the Method.Define routine take care of flagging warnings.  But if
25755         there is a mismatch (method overrides something else, or method is
25756         overriwritten by something, then emit warning).
25757
25758         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25759         set to null, this means `do not check for the return type on the
25760         signature'. 
25761
25762         (Method.Define): set the return type for the method signature to
25763         null, so that we get methods with the same name and parameters and
25764         different return types.  This is used to flag warning 114 (you are
25765         hiding a method, and you probably want to use the new/override
25766         keywords instead).
25767
25768         * typemanager.cs (MemberLookup): Implemented proper access
25769         control, closing a long standing set of bug reports.  The problem
25770         was that the Framework only has two bits: Public and NonPublic,
25771         and NonPublic includes private and protected methods, but we need
25772         to enforce the FamANDAssem, FamOrAssem and Family. 
25773
25774 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
25775
25776         * statement.cs (GotoCase): Return true: Ammounts to giving up
25777         knowledge on whether we return or not, and letting the other case
25778         be responsible for it.
25779
25780 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
25781
25782         * driver.cs: Do not load directories for each file processed, only
25783         do it if there is a pattern.
25784
25785         * ecore.cs: Report readonly assigns here as well, as we might have
25786         been resolved only by MemberAccess.
25787
25788         (SimpleName.SimpleNameResolve): Also be useful for LValue
25789         resolution.   We need this to propagate assign to local readonly variables
25790
25791         * typemanager.cs: Use a ptrhashtable for the criteria, because we
25792         do not want to reuse potential criteria memory.
25793
25794         * class.cs (MyEventBuilder): Set reflected_type;
25795
25796         * ecore.cs (Constantify): Added support for constifying bools.
25797
25798         (RootContext.LookupType): Added a cache for values looked up in
25799         the declaration space.
25800
25801         * typemanager.cs (FindMembers): Now is a front-end to
25802         RealFindMembers, and provides a two-level hashtable-based cache to
25803         the request.  
25804
25805         15% performance improvement: from 22.5 to 19.2 seconds.
25806
25807         * expression.cs (IsParamsMethodApplicable): use foreach.
25808         (Invocation.DoResolve): ditto.
25809         (New.DoResolve): ditto.
25810         (ArrayCreation.DoResolve): ditto.
25811
25812         * ecore.cs (FindMostEncompassingType): use foreach.
25813
25814         * delegate.cs (NewDelegate.DoResolve): Use foreach
25815
25816         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25817         (RemoveMethods): use foreach.
25818
25819         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25820         nested foreach statements instead of for, and also break out of
25821         the inner loop once a match is found.
25822
25823         (Invocation.OverloadResolve): Use foreach, simplify the code. 
25824
25825 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
25826
25827         * cfold.cs (BinaryFold): During an enumeration evaluation context,
25828         we actually unwrap the expression to allow for extra information
25829         to be extracted. 
25830
25831         * expression.cs: Use Shr_Un on unsigned operations. 
25832
25833 2002-05-08  Ravi Pratap  <ravi@ximian.com>
25834
25835         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
25836         applicable operators was not being considered correctly. This closes
25837         the bug Miguel reported.
25838
25839 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25840
25841         * attribute.cs: check that the type derives from System.Attribute
25842         and report the correct error in that case (moved the duplicate code to
25843         its own method, too).
25844
25845 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25846
25847         * attribute.cs: lookup attribute type name as the spec says: first the
25848         bare attribute name and then name + "Attribute" (nant compiles with
25849         mcs after this fix).
25850
25851 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
25852
25853         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
25854         Because of the way we parse things, we should try to see if a
25855         UIntConstant can fit in an integer.
25856
25857 2002-05-07  Ravi Pratap  <ravi@ximian.com>
25858
25859         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25860         when we are in an explicit context.
25861
25862         (ConvertReferenceExplicit): When converting from Iface type S to Class
25863         T make sure the rules are implemented as an OR.
25864
25865         * parameter.cs (ParameterType): Make it a property for now although the
25866         purpose really isn't anything immediate.
25867
25868         * expression.cs (Is*Applicable): Do better checking on the parameter type
25869         of a ref/out parameter. The ones from the system assemblies are already 
25870         marked with the correct type so we don't need to do any correction.
25871
25872         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25873         the object type is standard too so include that.
25874
25875 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25876
25877         * ecore.cs (StandardConversionExists): Augment with missing code:
25878         deal with IntConstant, LongConstants and Enumerations.
25879
25880         * assign.cs: Report the error, instead of failing silently
25881
25882         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25883         typecontainer that they are declared, because the
25884         typecontainer/namespace will have the list of using clauses that
25885         need to be applied.
25886
25887         Assembly Attributes were escaping the normal registration
25888         mechanism. 
25889
25890         (EmitCode): Apply attributes within an EmitContext that represents
25891         the container they were declared on.
25892
25893         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25894
25895 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25896
25897         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25898         Revamp completely - make much cleaner as we now operate only
25899         on a set of Types.
25900
25901         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25902         to implement the logic detailed in the spec more correctly.
25903
25904         (UserDefinedConversion): Update accordingly.
25905
25906 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25907
25908         * statement.cs: Return flow analysis information up.
25909
25910         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25911         and the default.
25912
25913         (token): Do not consume an extra character before calling
25914         decimal_digits.
25915
25916 2002-05-06  Piers Haken <piersh@friskit.com>
25917
25918         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25919
25920 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25921
25922         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25923         EmitContext during the instance constructor initializer
25924         resolution, to stop access to instance variables.
25925
25926         This is mandated by the spec, last paragraph of the `constructor
25927         initializers' section. 
25928
25929 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25930
25931         * cs-parser.jay, class.cs (Accessor): new class used to represent
25932         an accessor (get or set).  In the past we used `null' to represent
25933         a missing accessor.  But this is ambiguous because there was no
25934         way to tell in abstract indexers/properties if one of them was
25935         specified.
25936
25937         Now there is a way of addressing that.
25938
25939         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25940         instead of FindMembers.
25941
25942         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25943         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25944
25945         * attribute.cs: Treat indexers and properties as the same in terms
25946         of applying attributes
25947
25948         * ecore.cs (FindMostEncompassedType): Use statically initialized
25949         EmptyExpressions()s like we do elsewhere to avoid creating useless
25950         objects (and we take this out of the tight loop).
25951
25952         (GetConversionOperators): Move the code to extract the actual
25953         operators to a separate routine to clean things up.
25954
25955 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25956
25957         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25958         events are always registered FieldBuilders.
25959
25960         * class.cs (FieldBase): New class shared by Fields 
25961
25962         * delegate.cs: If we are a toplevel delegate, use our full name.
25963         If we are a nested delegate, then only use our tail name.
25964
25965 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25966
25967         * expression.cs (IsApplicable): Ensure that we add the "&" to
25968         ref/out types before comparing it with the type of the argument.
25969
25970         (IsParamsMethodApplicable): Ditto.
25971
25972         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25973         silly me ;-)
25974
25975         * delegate.cs : Handle the case when we have more than one applicable
25976         method. Flag an error only when we finish checking all.
25977
25978 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25979
25980         * expression.cs: Add support for boolean static initializers.
25981
25982 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25983
25984         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25985
25986         * parameter.cs (ComputeParameterTypes,
25987         ComputeAndDefineParameterTypes): Better error handling: now we
25988         clear the `types' cache if we fail during any of the type lookups.
25989         We also return the status code correctly to our caller
25990
25991         * delegate.cs: If we fail to define a delegate, abort the extra
25992         steps. 
25993
25994         * expression.cs (Binary.ResolveOperator): for
25995         operator==(object,object) and operator !=(object, object) we also
25996         have to verify that there is an implicit conversion from one to
25997         the other.
25998
25999         (ArrayAccess.DoResolve): Array Access can operate on
26000         non-variables. 
26001
26002 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
26003
26004         * assign.cs (CompoundAssign): A new class used as a "flag" that
26005         the assignment actually is happening as part of a compound
26006         assignment operator.
26007
26008         During compound assignment, a few new rules exist to enable things
26009         like:
26010
26011         byte b |= 1 + 2
26012
26013         From the spec:
26014
26015         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
26016         to the type of x) if y is implicitly convertible to the type of x,
26017         and the operator is a builtin operator and the return type of the
26018         operator is explicitly convertible to the type of x. 
26019
26020         * rootcontext.cs: Reset warning level to 2.  4 catches various
26021         "interesting" features in mcs, we must clean this up at some
26022         point, but currently am trying to kill other bugs ;-)
26023
26024         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
26025         in container classes as well.  
26026
26027         * expression.cs (Binary.ResolveOperator): Handle string case
26028         before anything else (as operator overloading does emit an error
26029         before doing anything else).
26030
26031         This code could go away when we move to a table driven model, but
26032         i could not come up with a good plan last night.
26033
26034 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
26035
26036         * typemanager.cs (CSharpName): reimplementation using regex.
26037         * class.cs: added null check for fields in Emit
26038         * rootcontext.cs: set warninglevel to 4
26039
26040 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
26041
26042         * typemanager.cs (CSharpName): reimplemented with Lupus
26043         suggestion.
26044
26045 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
26046
26047         * statement.cs (If): correclty implement Resolve, because we were
26048         not catching sem errors in there.  The same process is needed
26049         everywhere else. 
26050         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
26051
26052
26053         (Statement.Warning_DeadCodeFound): Factorize code.
26054         (While): Report dead code here too.
26055
26056         (Statement): Added Resolve virtual method to allow
26057         for resolution split from the emit code.
26058
26059 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
26060
26061         * statement.cs (EmitBoolExpression): No longer try to resolve the
26062         expression here.    
26063         (MakeBoolean): New utility function that resolve, implicitly
26064         converts to boolean and tags the expression. 
26065
26066
26067         (If, Do): Implement dead code elimination.
26068         (While): Implement loop inversion
26069
26070         (Do, While, For, If): Resolve the expression prior to calling our
26071         code generation.
26072
26073 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
26074
26075         * class.cs:
26076           - added method Report28 (warning: program has more than one entry point)
26077           - added method IsEntryPoint, implements paragraph 10.1 of the spec
26078           - modified method Method.Define, the part at the end of the method
26079
26080         * rootcontext.cs: added static public Location EntryPointLocation;
26081           
26082         * ../errors/cs0028.cs : Add test case for the above warning.              
26083
26084         * typemanager.cs:
26085           - modified method CSharpName to allow arrays of primitive type to
26086             be printed nicely (e.g. instead of System.Int32[][] it now prints
26087             int[][])
26088           - added method CSharpSignature: returns the signature of a method
26089             in string format to be used in reporting errors, warnings, etc.
26090
26091         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
26092         with String.Empty.
26093
26094 2002-04-26  Ravi Pratap  <ravi@ximian.com>
26095
26096         * delegate.cs (Define): Fix extremely silly bug where I was
26097         setting the type of the 'object' parameter of the BeginInvoke
26098         method to System.IAsyncResult instead of System.Object ;-)
26099
26100 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
26101
26102         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
26103         here. 
26104
26105         (Constructor.Emit): return if we fail to initialize the
26106         constructor.  Another door closed!  
26107
26108         * expression.cs (New.DoResolve): Improve error message (from -6 to
26109         1501).  Use DeclaredOnly lookup to find the exact constructor.
26110
26111         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
26112         loop.  This is useful.
26113
26114         * cs-parser.jay: Adjust the default parameters so that destructors
26115         have the proper signature.
26116
26117 2002-04-26  Martin Baulig  <martin@gnome.org>
26118
26119         * driver.cs (LoadAssembly): If `assembly' contains any characters
26120         which are only valid in path names and not in assembly names
26121         (currently slash, backslash and point), use Assembly.LoadFrom ()
26122         instead of Assembly.Load () on the `assembly' (before iteration
26123         over the link_paths).
26124
26125 2002-04-26  Martin Baulig  <martin@gnome.org>
26126
26127         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
26128
26129 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
26130
26131         * class.cs (Property): use the new typemanager.MemberLookup
26132
26133         (TypeContainer.MemberLookup): Implement using the
26134         TypeManager.MemberLookup now. 
26135
26136         * typemanager.cs: Make MemberLookup a function of the TypeManager,
26137         and return MemberInfos, so that these can be used without an
26138         EmitContext (what we had before).
26139
26140 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
26141
26142         * expression.cs: Fix the case where the argument to params if the
26143         type of the params.  I omitted handling this before.   Fixed
26144
26145 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
26146
26147         * driver.cs: Call BootCorlib_PopulateCoreType
26148
26149         * class.cs (Property.CheckBase): Check for properties only, not
26150         for all members. 
26151
26152         * interface.cs: Temporary hack: try/catch around the
26153         CustomAttributeBuilder, because I am getting an exception that I
26154         do not understand.
26155
26156         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
26157         types whose definitions are required to be there (attributes are
26158         defined before standard types).
26159
26160         Compute definitions as we boot the various types, as they are used
26161         immediately (value_type class will need object_type, but if we do
26162         not initialize object_type, we will pass a null, which will let
26163         the runtime pick the System.Object from the existing corlib, which
26164         is not what we want).
26165
26166 2002-04-22  Patrik Torstensson <totte@labs2.com>
26167
26168         * cs-tokenizer.cs: fixed a number of trim() issues.
26169
26170 2002-04-22  Ravi Pratap  <ravi@ximian.com>
26171
26172         * expression.cs (Argument.Type): Ensure that we return the correct
26173         type when we have out or ref parameters [in which case we 
26174         append a "&"].
26175
26176 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
26177
26178         * class.cs (Property, Indexer): Allow extern modifier in there. 
26179
26180         * typemanager.cs (InitBaseTypes): Initializes object_type and
26181         value_type, since those will be used early on during the bootstrap
26182         process to compile corlib.
26183
26184         (InitCoreTypes): Move code from here to InitBaseTypes.
26185
26186 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
26187
26188         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
26189         single-dimension arrays as using the ldlen opcode.  
26190
26191         Daniel Lewis discovered this optimization.  
26192
26193         * typemanager.cs: Add signature for System.Array::get_Length
26194
26195 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26196
26197         * statement.cs: report the error when the foreach does not apply to an
26198         array nor a collection.
26199
26200 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
26201
26202         * expression.cs: Add implicit conversions to the operator ~.
26203
26204         * constant.cs (DecimalConstant.Emit): Emit decimal value.
26205
26206         * typemanager.cs: Locate the decimal constructor.
26207
26208 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26209
26210         * attribute.cs: use the new property of TypeOf.
26211         * expression.cs: added 'get' property around typearg.
26212
26213         These changes fix a build breaker reported by NickD. Is this the
26214         correct way to fix?  If not, please, revert my changes and make it
26215         work :-).
26216
26217 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
26218
26219         * attribute.cs: Add support for typeof in attribute invocations.
26220         I am not sure that this is right though.
26221
26222 2002-04-14  Duncan Mak  <duncan@ximian.com>
26223
26224         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
26225         Binary.Operator.Division case.
26226
26227 2002-04-13  Ravi Pratap  <ravi@ximian.com>
26228
26229         * class.cs (DefineType): Ensure that we do a proper check on
26230         attribute types and also register it with the TypeManager.
26231
26232         (TypeContainer.Targets): The default for attribute types is
26233         AttributeTargets.All.
26234
26235         * attribute.cs (ApplyAttributes): Registering the attribute type
26236         is done elsewhere, not when we discover we have a Usage attribute.
26237
26238 2002-04-12  Ravi Pratap  <ravi@ximian.com>
26239
26240         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
26241         and get rid of is_delegate parameter.
26242
26243         * everywhere : update.
26244
26245 2002-04-12  Ravi Pratap  <ravi@ximian.com>
26246
26247         * cs-parser.jay (compilation_unit): Revamp completely to use
26248         some new ideas that I got from Rhys' grammar to solve the problems
26249         with assembly level attributes.
26250
26251         (outer_declaration): New grammar production.
26252
26253         (attribute_sections): Add.
26254
26255         (opt_attributes): Base on attribute_sections
26256
26257         (namespace_declaration): Allow opt_attributes to tackle the case
26258         when we have assembly level attributes - we are clever in this
26259         regard now ;-)
26260
26261         * attribute.cs (ApplyAttributes): Do not worry about assembly 
26262         attributes in the non-global context.
26263
26264         * rootcontext.cs (AddGlobalAttributes): Go back to using this
26265         instead of SetGlobalAttributes.
26266
26267         * class.cs, rootcontext.cs : Ensure we define and generate 
26268         attribute types before anything else.
26269
26270         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
26271         and flag the new error -20 for the case when the attribute type
26272         does not have valid targets specified. csc does not catch this.
26273
26274         * ../errors/errors.txt : update for error # -20
26275
26276 2002-04-11  Ravi Pratap  <ravi@ximian.com>
26277
26278         * support.cs (InternalParameters.ParameterModifier): Do some null
26279         checking and return sane values.
26280
26281         * class.cs (Method.Define): If we are a PInvoke method, ensure
26282         that we are static and extern. Report error # 601
26283
26284         * ../errors/cs0601.cs : Add test case for the above error.
26285
26286 2002-04-07  Ravi Pratap  <ravi@ximian.com>
26287
26288         * rootcontext.cs (attribute_types): We need to keep type of
26289         all attribute types separately and emit code for them first.
26290
26291         (RegisterAttribute) : Implement.
26292
26293         * class.cs (DefineType): Check if the current Type is a custom
26294         attribute type and register it accordingly.
26295
26296         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
26297         adding the first attribute twice and rename to
26298
26299         (SetGlobalAttributes): this.
26300
26301         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
26302         lookups.
26303
26304         * attribute.cs (ApplyAttributes): Take an additional argument telling us
26305         if we are processing global arguments. Hmm, I am unsure of this.
26306
26307 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26308
26309         * expression.cs: added static array of strings to avoid calling
26310         Enum.ToString () for Operator in Binary. Significant recover of
26311         performance.
26312
26313 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
26314
26315         * class.cs (FindMembers): Allow the Builders of the various
26316         members to be null.  If they are skip them.  This only happens
26317         during the PInvoke declaration.
26318
26319 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
26320
26321         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26322         failure, so we do not keep going afterwards.
26323
26324         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26325         wanted to pass `false' as the `is_delegate' argument.  If this is
26326         the case, why not use delegate_type == null to mean `is_delegate =
26327         false' and anything else as is_delegate = true.
26328
26329 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
26330
26331         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26332         code for the section, not the beginning of the tests.
26333
26334 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
26335
26336         * cfold.cs: Handle operator + (Enum x, Underlying x) 
26337
26338         * expression.cs (Binary): same.  Warn about errors where we have
26339         Enum/Enum in operator + as well.
26340
26341 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
26342
26343         * statement.cs:
26344                 - added support for switch(bool)
26345                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26346                 - add TableSwitchEmit() to handle table-based switch statements
26347
26348 2002-04-05  Ravi Pratap  <ravi@ximian.com>
26349
26350         * expression.cs (Invocation.OverloadResolve): Factor out code which
26351         does parameter compatibility checking with arguments so that we can 
26352         re-use the code even from Delegate.VerifyApplicability
26353
26354         (VerifyArgumentsCompat): Move above code here.
26355
26356         * delegate.cs (VerifyApplicability): Get rid of duplicate code
26357         and instead make a call to the above method.
26358
26359 2002-03-31  Ravi Pratap  <ravi@ximian.com>
26360
26361         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26362         We use it to keep track of classes which are attribute types.
26363
26364 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
26365
26366         * delegate.cs (Delegate.Define): Correctly define the types in the
26367         presence of fixed and array parameters.
26368
26369         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26370         doing FindMembers.
26371
26372         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26373         include NonPublic after the first iteration.
26374
26375         * class.cs (Indexer.CheckBase): Only check if both parents are
26376         non-null. 
26377
26378         * cs-parser.jay (accessor_body): If empty, set to null.
26379
26380         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26381         same code path here to resolve constants names that we did have in
26382         MemberAccess.DoResolve.  There is too much code duplicated here.
26383
26384 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
26385
26386         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26387
26388         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26389         to MakeUnionSet.
26390
26391         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26392         tokens, numbers and strings.
26393
26394         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26395         parenthesis.
26396
26397         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26398         asyncronous parameters and the regular parameters.  
26399
26400         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26401         specify the target directory.
26402
26403         * expression.cs: (This.DoResolve): Simplify
26404         (As.Emit): Optimize, do not generate IsInst if the expression is
26405         always of the given type.
26406
26407         (Is.DoResolve): Bug fix, we were reporting both always/never for
26408         the is expression.
26409
26410         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26411         creating too many unnecessary arrays.
26412
26413 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
26414
26415         * class.cs (EmitFieldInitializer): Use Assign expression to assign
26416         fields instead of rolling our own initializer.   Takes care of all
26417         implicit conversions, and drops unnecessary static checks/argument.
26418
26419 2002-03-31  Dick Porter  <dick@ximian.com>
26420
26421         * driver.cs: use the GetDirectories() return values properly, and
26422         use "/" as path separator.
26423
26424 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
26425
26426         * expression.cs (Unary): Optimize - - expr into expr.
26427         (Binary): Optimize a + (-b) into a -b.
26428
26429         * codegen.cs (CodeGen): Made all methods static.
26430
26431 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
26432
26433         * rootcontext.cs: 
26434
26435         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26436         TypeBuilder property.
26437
26438         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26439         instead. 
26440
26441         * tree.cs: Removed the various RecordXXXX, and replaced with a
26442         single RecordDecl.  Removed all the accessor methods, and just
26443         left a single access point Type 
26444
26445         * enum.cs: Rename DefineEnum to DefineType.
26446
26447         * decl.cs: New abstract method `DefineType' used to unify the
26448         Defines for Enumerations, Interfaces, TypeContainers and
26449         Delegates.
26450
26451         (FindType): Moved LookupInterfaceOrClass here.  Moved the
26452         LookupBaseClasses method that used to live in class.cs and
26453         interface.cs here, and renamed to FindType.
26454
26455         * delegate.cs: Implement DefineType.  Take advantage of the
26456         refactored pattern for locating the parent builder without taking
26457         the parent_builder argument (which we know does not work if we are
26458         nested, and triggering a toplevel definition).
26459
26460 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26461
26462         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26463         accessibility of a member has changed during override and report
26464         an error if so.
26465
26466         * class.cs (Method.Define, Property.Define): Only complain on
26467         overrides if the method is private, any other accessibility is
26468         fine (and since we just checked the permission is the same, we are
26469         good to go).
26470
26471         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26472         and elif are processed always.  The other pre-processing
26473         directives are only processed if we are "taking" the path
26474
26475 2002-03-29  Martin Baulig  <martin@gnome.org>
26476
26477         * class.cs (Method.Emit): Only emit symbolic debugging info if the
26478         current location is not Null.
26479
26480         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26481         a separate method so we can profile it.
26482
26483         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26484         `span.Seconds' are just seconds, but no minutes or hours.
26485         (MainDriver): Profile the CodeGen.SaveSymbols calls.
26486
26487 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26488
26489         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26490         Remove the gratuitous set of Final:
26491
26492                                 // If an interface implementation, then we can set Final.
26493                                 if (((flags & MethodAttributes.Abstract) == 0) &&
26494                                     implementing.DeclaringType.IsInterface)
26495                                         flags |= MethodAttributes.Final;
26496
26497         I do not know what I was smoking when I used that.
26498
26499
26500         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26501         step into fixing the name resolution issues for delegates and
26502         unifying the toplevel name resolution.
26503
26504 2002-03-28  Martin Baulig  <martin@gnome.org>
26505
26506         * class.cs (Method.Emit): If we have a symbol writer, call its
26507         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26508         tell it about the current method.
26509
26510         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26511         writer that we're going to emit the first byte of IL code for a new
26512         statement (a new source line).
26513         (EmitContext.EmitTopBlock): If we have a symbol writer, call
26514         EmitContext.Mark() before emitting any code.
26515
26516         * location.cs (SymbolDocument): Return null when we're Null.
26517
26518         * statement.cs (Statement): Moved the `Location loc' variable here.
26519         (Statement.EmitBoolExpression): If we have a symbol writer, call
26520         ec.Mark() before emitting any code to tell it that we're at the
26521         beginning of a new statement.
26522         (StatementExpression): Added `Location' argument to the constructor.
26523         (Block): Added public readonly variable `StartLocation' and public
26524         variable `EndLocation'.  The latter is to be set using SetEndLocation().
26525         (Block): Added constructor which takes a start and end location.
26526         (Block.SetEndLocation): New method. This sets the end location.
26527         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26528         local variables we create.
26529         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26530         each statement and do also mark the begin and end of the block.
26531
26532         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26533         tell it the current lexer.Location, use Location.Null for the end of the
26534         block.
26535         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26536         current block, set its end location using SetEndLocation().
26537         (statement_expression): StatementExpression constructor now takes the
26538         lexer.Location as additional argument.
26539         (for_statement, declare_local_variables): Likewise.
26540         (declare_local_variables): When creating a new implicit block, use the
26541         new Block constructor and pass it the lexer.Location.
26542
26543 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26544
26545         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26546         members also on the parent interfaces recursively.
26547
26548 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
26549
26550         * report.cs: Use new formats, since Gonzalo finished the missing
26551         bits. 
26552
26553         * expression.cs (Binary.ResolveOperator): added missing operator|
26554         operator& and operator^ for bool/bool.
26555
26556         * cs-parser.jay: CheckDef now takes a Location argument that is
26557         used to report errors more precisly (instead of reporting the end
26558         of a definition, we try to track something which is a lot closer
26559         to the source of the problem).
26560
26561         * cs-tokenizer.cs: Track global token use, so we can properly flag
26562         the use of #define/#undef after the first token has been seen.
26563
26564         Also, rename the reportXXXX to Error_DescriptiveName
26565
26566         * decl.cs (DeclSpace.IsTopLevel): Move property here from
26567         TypeContainer, so that Enum and Interface can use this too.
26568
26569         * class.cs (TypeContainer.LookupInterfaceOrClass,
26570         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26571         `builder' argument.  Typically this was used to pass the parent
26572         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26573         the definition).  
26574
26575         The problem is that a nested class could trigger the definition of
26576         a toplevel class, and the builder would be obviously wrong in that
26577         case. 
26578
26579         So we drop this argument, and we compute dynamically the
26580         TypeBuilder/ModuleBuilder (the correct information was available
26581         to us anyways from DeclSpace.Parent)
26582
26583         * interface.cs (Interface.DefineInterface): Drop builder
26584         parameter cleanup like class.cs
26585
26586         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
26587         like class.cs
26588
26589         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26590         values. 
26591
26592         (Try.Emit): Propagate the returns value from the statement.
26593
26594         (Return.Emit): Even if we are leavning 
26595
26596         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26597
26598         * modifiers.cs: Fix the computation of MethodAttributes flags.
26599
26600 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26601
26602         * driver.cs: allow compilation of files that start with '/'.
26603         Add a default case when checking the argument of --target.
26604
26605 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
26606
26607         * interface.cs: Implement the same search algorithm for types in
26608         the interface code.
26609
26610         * delegate.cs: Do not allow multiple definition.
26611
26612         * Recovered ChangeLog that got accidentally amputated
26613
26614         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26615
26616         * rootcontext.cs: Load manually enum to allow core classes to
26617         contain enumerations.
26618
26619         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26620         Update to new static methods in TypeManager.
26621
26622         * typemanager.cs (GetMethod, GetConstructor): Use our
26623         implementation of FindMembers to find the members, since during
26624         corlib compilation, the types are TypeBuilders and GetMethod and
26625         GetConstructor do not work.
26626
26627         Make all methods in TypeManager static.
26628
26629         (InitCodeHelpers): Split the functionality from
26630         the InitCodeTypes function.
26631
26632         * driver.cs: Call InitCodeHelpers after we have populated the
26633         types. 
26634
26635         * cs-parser.jay (delegate_declaration): we did not used to compute
26636         the delegate name correctly for void delegates.
26637
26638 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
26639
26640         * rootcontext.cs (RootContext): Init the interface_resolve_order
26641         and type_container_resolve_order always.
26642
26643         (ResolveCore, BootstrapCorlib_ResolveClass,
26644         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26645         compiler when compiling with --nostdlib
26646
26647         * class.cs (TypeContainer.DefineType): Check that our parent is
26648         not null.  This test is most important when we are bootstraping
26649         the core types.
26650
26651         * codegen.cs: Split out the symbol writing code.
26652
26653 2002-03-25  Martin Baulig  <martin@gnome.org>
26654
26655         * driver.cs (-g): Made -g an alias for --debug.
26656
26657 2002-03-24  Martin Baulig  <martin@gnome.org>
26658
26659         * codegen.cs (SymbolWriter): New public variable. Returns the
26660         current symbol writer.
26661         (CodeGen): Added `bool want_debugging_support' argument to the
26662          constructor. If true, tell the ModuleBuild that we want debugging
26663         support and ask it for the ISymbolWriter.
26664         (Save): If we have a symbol writer, call it's Close() method after
26665         saving the assembly.
26666
26667         * driver.c (--debug): New command line argument to create a
26668         debugger information file.
26669
26670         * location.cs (SymbolDocument): New public property. Returns an
26671         ISymbolDocumentWriter object for the current source file or null
26672         if we don't have a symbol writer.
26673
26674 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
26675
26676         * driver.cs (LoadAssembly): Correctly return when all the paths
26677         have been tried and not before.
26678
26679         * statement.cs (Switch.Emit): return the actual coverage for this
26680         statement (returns/not-returns)
26681
26682         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26683         switch of the statement if we are the last switch section.  That
26684         kills two problems: try/catch problems (we used to emit an empty
26685         nop at the end) and switch statements where all branches would
26686         return. 
26687
26688 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
26689
26690         * driver.cs: Add default assemblies (the equivalent to the
26691         Microsoft CSC.RSP file)
26692
26693         * cs-tokenizer.cs: When updating `cols and setting it to zero,
26694         also update tokens_seen and set it to false.
26695
26696         * driver.cs: Implement --recurse for Mike.
26697
26698         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26699         correctly splitting out the paths.
26700
26701 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26702
26703         * interface.cs (Interface.PopulateProperty): Instead of using
26704         `parent' as the declaration space for the set parameters, use
26705         `this' 
26706
26707         * support.cs (InternalParameters): InternalParameters constructor
26708         takes a DeclSpace instead of a TypeContainer.
26709
26710         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26711         types are being initialized, load the address of it before calling
26712         the function.  
26713
26714         (New): Provide a mechanism to disable the generation of local
26715         value type temporaries when the caller will be providing us with
26716         an address to store it.
26717
26718         (ArrayCreation.EmitDynamicInitializers): Use it.
26719
26720 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
26721
26722         * expression.cs (Invocation.EmitArguments): Only probe for array
26723         property if there is more than one argument.  Sorry about that.
26724
26725         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26726         empty param arrays.
26727
26728         * class.cs (Method.LabelParameters): Fix incorrect code path that
26729         prevented the `ParamArrayAttribute' from being applied to the
26730         params attribute.
26731
26732 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
26733
26734         * support.cs (ReflectionParameters): Correctly compute whether the
26735         last argument is a params array.  Fixes the problem with
26736         string.Split ('a')
26737
26738         * typemanager.cs: Make the assemblies array always be non-null
26739         (empty, but non-null)
26740
26741         * tree.cs (RecordDecl): New function that abstracts the recording
26742         of names.  This reports error 101, and provides a pointer to the
26743         previous declaration.  Fixes a crash in the compiler.
26744
26745         * cs-parser.jay (constructor_declaration): Update to new grammar,
26746         and provide a constructor_body that can be empty.
26747
26748 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
26749
26750         * driver.cs: Add support for --resources.
26751
26752         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26753         Make all types for the various array helper methods be integer.
26754
26755         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26756         CheckState to ConvCast.
26757
26758         (ConvCast): Now it takes a `checked' state argument, to avoid
26759         depending on the emit context for the conversion, and just using
26760         the resolve time setting.
26761
26762         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26763         instead of Invocation.EmitArguments.  We do not emit the original
26764         arguments, instead we emit those which have been converted to
26765         unsigned int expressions.
26766
26767         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26768
26769         * codegen.cs: ditto.
26770
26771         * expression.cs (LocalVariableReference): Drop the use of the
26772         Store function that depended on the variable index.
26773
26774         * statement.cs (VariableInfo): Drop the `Idx' property from this
26775         class, as this is not taking into account the indexes for
26776         temporaries tat we generate during the execution, getting the
26777         indexes wrong.
26778
26779         * class.cs: First emit class initializers, then call the parent
26780         constructor. 
26781
26782         * expression.cs (Binary): Fix opcode emision.
26783         (UnaryMutator.EmitCode): Support checked code generation
26784
26785         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26786         matches for events for both the Static and Instance scans,
26787         pointing to the same element.   Fix that.
26788
26789 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
26790
26791         * rootcontext.cs (ResolveTree): Always set the
26792         interface_resolve_order, because nested interfaces will be calling
26793         into us.
26794
26795         * class.cs (GetInterfaceOrClass): Track the same resolution
26796         process used by TypeManager.LookupType.  This fixes the nested
26797         type lookups in class declarations (separate path from
26798         LookupType). 
26799
26800         (TypeContainer.DefineType): Also define nested interfaces.
26801         (TypeContainer.RegisterOrder): New public function used to
26802         register the order in which child interfaces need to be closed.
26803
26804         Nested interfaces need to be closed after their parents have been
26805         created. 
26806
26807         * interface.cs (InterfaceAttr): Put all the logic for computing
26808         the interface attribute here. 
26809
26810         (DefineInterface): Register our interface order with the
26811         RootContext or with the TypeContainer depending on the case.
26812
26813 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26814
26815         * cs-parser.jay: rework foreach statement to work with the new
26816         changes to the policy on SimpleNames.
26817
26818         * report.cs: support Stacktrace on warnings as well.
26819
26820         * makefile: drop --unsafe and /unsafe from the compile.
26821
26822 2002-03-13  Ravi Pratap  <ravi@ximian.com>
26823
26824         * ecore.cs (StandardConversionExists): Modify to take an Expression
26825         as the first parameter. Ensure we do null -> reference type conversion
26826         checking.
26827
26828         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26829         temporary Expression objects.
26830
26831 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26832
26833         * interface.cs: workaround bug in method overloading resolution
26834         (there is already a bugzilla bug for it).
26835
26836 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26837
26838         We could also solve this problem by having a separate path for
26839         performing type lookups, instead of DoResolve, we could have a
26840         ResolveType entry point, and only participating pieces of the
26841         production (simplename, deref, array) would implement this. 
26842
26843         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26844         signal SimpleName to only resolve type names and not attempt to
26845         resolve anything else.
26846
26847         * expression.cs (Cast): Set the flag.
26848
26849         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26850
26851         * class.cs: Only report 108 if there is no `new' modifier.
26852
26853         * cs-parser.jay: rework foreach statement to work with the new
26854         changes to the policy on SimpleNames.
26855
26856         * report.cs: support Stacktrace on warnings as well.
26857
26858         * makefile: drop --unsafe and /unsafe from the compile.
26859
26860 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26861
26862         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26863         lookups here, instead of doing that at parse time.  This means
26864         that our grammar will not introduce `LocalVariableReferences' as
26865         expressions at this point.  That solves the problem of code like
26866         this:
26867
26868         class X {
26869            static void Main ()
26870            { int X = 1;
26871             { X x = null }}}
26872
26873         This is only half the fix.  The full fix requires parameters to
26874         also be handled in this way.
26875
26876         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26877         makes the use more obvious of the DeclSpace.  The
26878         ec.TypeContainer.TypeBuilder is now only used to pull the
26879         TypeBuilder for it.
26880
26881         My theory is that I can get rid of the TypeBuilder completely from
26882         the EmitContext, and have typecasts where it is used (from
26883         DeclSpace to where it matters).  
26884
26885         The only pending problem is that the code that implements Aliases
26886         is on TypeContainer, and probably should go in DeclSpace.
26887
26888         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26889         lookups here, instead of doing that at parse time.  This means
26890         that our grammar will not introduce `LocalVariableReferences' as
26891         expressions at this point.  That solves the problem of code like
26892         this:
26893
26894         class X {
26895            static void Main ()
26896            { int X = 1;
26897             { X x = null }}}
26898
26899         This is only half the fix.  The full fix requires parameters to
26900         also be handled in this way.
26901
26902         * class.cs (Property.DefineMethod): When implementing an interface
26903         method, set newslot, when implementing an abstract method, do not
26904         set the flag (before we tried never setting it, or always setting
26905         it, which is the difference).
26906         (Indexer.DefineMethod): same.
26907         (Method.DefineMethod): same.
26908
26909         * ecore.cs: Only set the status used flag if we get back a Field.
26910
26911         * attribute.cs: Temporary hack, so Paolo can keep working.
26912
26913 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26914
26915         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26916         the unmanaged type in the case we have a MarshalAs attribute.
26917
26918         (Resolve): Handle the case when we are parsing the special MarshalAs
26919         attribute [we need to store the unmanaged type to use later]
26920
26921         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26922         MarshalAs Attribute.
26923
26924         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26925         on parameters and accordingly set the marshalling info.
26926
26927 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26928
26929         * class.cs: Optimizing slightly by removing redundant code after
26930         we switched to the `NoTypes' return value.
26931         (Property.DefineMethod): use NoTypes here too.
26932
26933         This fixes the bug I introduced in my last batch of changes.
26934
26935 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26936
26937         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26938
26939         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26940         Enums since those are types too. 
26941
26942         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26943
26944         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26945         thanks to a call during the lookup process.
26946
26947 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26948
26949         * statement.cs (Foreach): Lots of work to accomodate a particular
26950         kind of foreach statement that I had not kept in mind.  It is
26951         possible to have foreachs on classes that provide a GetEnumerator
26952         method that return objects that implement the "pattern" for using
26953         a foreach, there is no need to support GetEnumerator
26954         specifically. 
26955
26956         This is needed to compile nant.
26957
26958         * decl.cs: Only report 114 if the member is not `Finalize' and if
26959         the warning level is at least 2.
26960
26961         * class.cs: Moved the compare function from Method to
26962         MethodSignature. 
26963
26964         (MethodSignature.InheritableMemberSignatureCompare): Add new
26965         filter function that is used to extract inheritable methods from a
26966         class. 
26967
26968         (Method.Define): Use the new `inheritable_method_signature_filter'
26969         delegate
26970
26971         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26972         command. 
26973
26974 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26975
26976         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26977
26978         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26979
26980         * expression.cs: Pass location information to
26981         ConvertImplicitStandard. 
26982
26983         * class.cs: Added debugging code to track return values from
26984         interfaces. 
26985
26986 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26987
26988         * expression.cs (Is.DoResolve): If either side of the `is' is an
26989         interface, do not flag the warning.
26990
26991         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26992         for interfaces
26993
26994         * report.cs: Allow for --fatal to be used with --probe.
26995
26996         * typemanager.cs (NoTypes): Move the definition for the empty Type
26997         array here. 
26998
26999         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
27000         properties. 
27001         (TypeContainer.DefineProxy): New function used to proxy to parent
27002         implementations when implementing interfaces.
27003         (TypeContainer.ParentImplements): used to lookup if our parent
27004         implements a public function that is required by an interface.
27005         (TypeContainer.VerifyPendingMethods): Hook this up.
27006
27007         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
27008         `modules' and `assemblies' arraylists into arrays.  We only grow
27009         these are the very early start up of the program, so this improves
27010         the speedof LookupType (nicely measured).
27011
27012         * expression.cs (MakeByteBlob): Replaced unsafe code with
27013         BitConverter, as suggested by Paolo.
27014
27015         * cfold.cs (ConstantFold.Binary): Special case: perform constant
27016         folding of string concatenation, but if either side is a string,
27017         and the other is not, then return null, and let the runtime use
27018         the concatenation on the string plus the object (using
27019         `Object.ToString'). 
27020
27021 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
27022
27023         Constant Folding has been implemented now.
27024
27025         * expression.cs (Unary.Reduce): Do not throw an exception, catch
27026         the error instead on types that are not supported in one's
27027         complement. 
27028
27029         * constant.cs (Constant and all children): New set of functions to
27030         perform implict and explicit conversions.
27031
27032         * ecore.cs (EnumConstant): Implement the new functions to perform
27033         conversion by proxying to the child expression.
27034
27035         * codegen.cs: (ConstantCheckState): Constant evaluation has its
27036         own separate setting that can not be turned off from the command
27037         line using --unchecked or --checked and is only controlled using
27038         the checked/unchecked statements and expressions.  This setting is
27039         used by the constant folder to flag errors.
27040
27041         * expression.cs (CheckedExpr, UncheckedExpr): Set the
27042         ConstantCheckState as well.   
27043
27044         During Resolve, they also have to flag the state, because the
27045         constant folder runs completely in the Resolve phase.
27046
27047         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
27048         well.
27049
27050 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
27051
27052         * cfold.cs: New file, this file contains the constant folder.
27053
27054         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
27055         argument to track whether we are using the resulting address to
27056         load or store a value and provide better error messages. 
27057
27058         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
27059         new AddressOf arguments.
27060
27061         * statement.cs (Foreach.EmitCollectionForeach): Update
27062
27063         * expression.cs (Argument.Emit): Call AddressOf with proper
27064         arguments to track usage.
27065
27066         (New.DoEmit): Call AddressOf with new arguments.
27067
27068         (Unary.Emit): Adjust AddressOf call.
27069
27070 2002-03-01  Ravi Pratap  <ravi@ximian.com>
27071
27072         * cs-parser.jay (member_access): Change the case for pre-defined types
27073         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
27074         this suggestion.
27075
27076         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
27077         a method body.
27078
27079         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
27080         essentially like methods and apply attributes like MethodImplOptions to them too.
27081
27082         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
27083         not being null.
27084
27085         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
27086         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
27087         is the DeclSpace.
27088
27089         * Update code everywhere accordingly.
27090
27091         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
27092
27093         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
27094
27095 2002-02-28  Ravi Pratap  <ravi@ximian.com>
27096
27097         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
27098         try performing lookups against those instead of jumping straight into using
27099         the 'using' clauses.
27100
27101         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
27102
27103         (LookupType): Perform lookups in implicit parents too.
27104
27105         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
27106         sequence as RootContext.LookupType. 
27107
27108         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
27109         the various cases of namespace lookups into this method.
27110
27111 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
27112
27113         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
27114         in positional arguments)
27115
27116         * class.cs (Operator): Update the AllowedModifiers to contain
27117         extern. 
27118
27119         * cs-parser.jay: Update operator declaration to allow for the
27120         operator body to be empty.
27121
27122         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
27123         values. 
27124
27125 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
27126
27127         * class.cs (Method.Emit): Label parameters.
27128
27129         * driver.cs: Return 1 or 0 as the program exit code.
27130
27131 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
27132
27133         * expression.cs: Special case the `null' object when trying to
27134         auto-compute the type, as anything can be explicitly converted to
27135         that. 
27136
27137         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
27138         spotting this Paolo.
27139
27140         (Expression.ImplicitNumericConversion): Perform comparissions of
27141         the type using the underlying type in the case of an enumeration
27142         rather than using the enumeration type for the compare.
27143
27144         Cope with the underlying == type case, which is not possible to
27145         catch before. 
27146
27147         (Expression.ConvertNumericExplicit): Perform comparissions of
27148         the type using the underlying type in the case of an enumeration
27149         rather than using the enumeration type for the compare.
27150
27151         * driver.cs: If the user does not supply an extension, assume .exe
27152
27153         * cs-parser.jay (if_statement): Rewrote so that we can track the
27154         location for the if statement.
27155
27156         * expression.cs (Binary.ConstantFold): Only concat strings when
27157         the operation is "+", not everything ;-)
27158
27159         * statement.cs (Statement.EmitBoolExpression): Take a location
27160         argument. 
27161         (If, While, Do): Track location.
27162
27163         * expression.cs (Binary.ResolveOperator): In the object + string
27164         case, I was missing a call to ConvertImplicit
27165
27166 2002-02-25  Ravi Pratap  <ravi@ximian.com>
27167
27168         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
27169         Location arguments. Ensure we use RootContext.LookupType to do our work
27170         and not try to do a direct Type.GetType and ModuleBuilder.GetType
27171
27172         * interface.cs (PopulateMethod): Handle the type of the parameter being
27173         null gracefully.
27174
27175         * expression.cs (Invocation.BetterFunction): Handle the case when we 
27176         have a params method with no fixed arguments and a call is made with no
27177         arguments.
27178
27179 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
27180
27181         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
27182         the verbatim-string-literal
27183
27184         * support.cs (InternalParameters.ParameterModifier): handle null
27185         fixed parameters.
27186         (InternalParameters.ParameterType): ditto.
27187
27188         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
27189         duplicating the name of the variable parameter.
27190         (GetParameterByName): Fix bug where we were not looking up array
27191         paramters if they were the only present (thanks Paolo!).
27192         (GetParameterInfo): We only have an empty set of types if both
27193         fixed and array are set to null.
27194         (GetParameterInfo-idx): Handle FixedParameter == null
27195
27196         * cs-parser.jay: Handle the case where there is no catch
27197         statements (missing null test).
27198
27199 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
27200
27201         * driver.cs (MainDriver): Be conservative on our command line
27202         handling.
27203
27204         Catch DirectoryNotFoundException when calling GetFiles.
27205
27206         (SplitPathAndPattern): Used to split the input specification into
27207         a path and a pattern that we can feed to Directory.GetFiles.
27208
27209 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
27210
27211         * statement.cs (Fixed): Implement the last case of the Fixed
27212         statement (string handling).
27213
27214         * expression.cs (StringPtr): New class used to return a char * to
27215         a string;  Used by the Fixed statement.
27216
27217         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
27218
27219         * expression.cs (Binary.ResolveOperator): Remove redundant
27220         MemberLookup pn parent type.
27221         Optimize union call, we do not need a union if the types are the same.
27222         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
27223         type.
27224
27225         Specialize the use of MemberLookup everywhere, instead of using
27226         the default settings. 
27227
27228         (StackAlloc): Implement stackalloc keyword.
27229
27230         * cs-parser.jay: Add rule to parse stackalloc.
27231
27232         * driver.cs: Handle /h, /help, /?
27233
27234         * expression.cs (MakeByteBlob): Removed the hacks we had in place
27235         before we supported unsafe code.
27236
27237         * makefile: add --unsafe to the self compilation of mcs.
27238
27239 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
27240
27241         * expression.cs (PointerArithmetic): New class that is used to
27242         perform pointer arithmetic.
27243         (Binary.Resolve): Handle pointer arithmetic
27244         Handle pointer comparission.
27245         (ArrayPtr): Utility expression class that is used to take the
27246         address of an array.
27247
27248         (ElementAccess): Implement array access for pointers
27249
27250         * statement.cs (Fixed): Implement fixed statement for arrays, we
27251         are missing one more case before we are done.
27252
27253         * expression.cs (Indirection): Implement EmitAssign and set the
27254         ExprClass to Variable.  This allows pointer dereferences to be
27255         treated as variables, and to have values assigned to them.
27256
27257         * ecore.cs (Expression.StoreFromPtr): New utility function to
27258         store values dereferencing.
27259
27260 2002-02-20  Ravi Pratap  <ravi@ximian.com>
27261
27262         * expression.cs (Binary.ResolveOperator): Ensure that we are
27263         not trying to operate on a void type - this fixes the reported
27264         bug.
27265
27266         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
27267         the parent implementation is sealed.
27268
27269         * ../errors/cs0239.cs : Add.
27270
27271         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
27272
27273         * typemanager.cs (unverifiable_code_type): Corresponds to 
27274         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
27275         which have unsafe code in them.
27276
27277         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
27278         unsafe context.
27279
27280 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
27281
27282         * cs-tokenizer.cs: Add support for @"litreal strings"
27283
27284         Make tokenizer accept pre-processor directives
27285         on any column (remove the old C-like limitation). 
27286
27287         * rootcontext.cs (EmitCode): Emit any global attributes.
27288         (AddGlobalAttributes): Used to keep track of assembly attributes. 
27289
27290         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
27291
27292         * cs-parser.jay: Add support for global attributes.  
27293
27294 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
27295
27296         * expression.cs (Indirection): New helper class.  Unary will
27297         create Indirection classes to be able to implement the
27298         IMemoryLocation interface on it.
27299
27300 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
27301
27302         * cs-parser.jay (fixed_statement): reference the right statement.
27303
27304         * statement.cs (Fixed.Emit): Finish implementing the fixed
27305         statement for the &x case.
27306
27307 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
27308
27309         * class.cs (Property.Define, Method.Define): Remove newslot when
27310         `implementing'.  
27311
27312         * modifiers.cs: My use of NewSlot when `Abstract' was set was
27313         wrong.  NewSlot should only be used if the `new' keyword is present.
27314
27315         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27316         locating our system dir.  Sorry about this.
27317
27318 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27319
27320         * driver.cs (GetSystemDir): Compute correctly the location of our
27321         system assemblies.  I was using the compiler directory instead of
27322         the library directory.
27323
27324 2002-02-13  Ravi Pratap  <ravi@ximian.com>
27325
27326         * expression.cs (BetterFunction): Put back in what Miguel commented out
27327         since it is the correct fix. The problem is elsewhere ;-)
27328
27329         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27330         parameters of the parms method are themselves compatible or not !
27331
27332         (StandardConversionExists): Fix very dangerous bug where we were forgetting
27333         to check that a class implements an interface before saying that an implicit
27334         conversion was allowed. Use ImplementsInterface to do the checking.
27335
27336 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
27337
27338         * class.cs (Method.Define): Track whether we are an explicit
27339         implementation or not.  And only call DefineMethodOverride if we
27340         are an explicit implementation.
27341
27342         (Property.DefineMethod): Ditto.
27343
27344 2002-02-11  Ravi Pratap  <ravi@ximian.com>
27345
27346         * expression.cs (BetterFunction): Catch hideous bug which was
27347          preventing us from detecting ambiguous calls due to implicit casts i.e
27348         cs0121.
27349
27350 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
27351
27352         * support.cs (Pair): Remove un-needed method.  I figured why I was
27353         getting the error in cs-parser.jay, the variable in a foreach loop
27354         is readonly, and the compiler does not really treat this as a variable.
27355
27356         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
27357         instead of EQUALS in grammar.  
27358
27359         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27360
27361         * expression.cs (Unary.DoResolve): Check whether the argument is
27362         managed or not.
27363
27364 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
27365
27366         * support.cs: Api for Pair to set a value.  Despite the fact that
27367         the variables are public the MS C# compiler refuses to compile
27368         code that accesses the field if the variable is part of a foreach
27369         statement. 
27370
27371         * statement.cs (Fixed): Begin implementation of the fixed
27372         statement.
27373
27374         (Block.AddVariable): Return the VariableInfo on success and null
27375         on failure instead of true/false. 
27376
27377         * cs-parser.jay (foreach): Catch errors on variables already
27378         defined (we were ignoring this value before) and properly unwind
27379         the block hierarchy
27380
27381         (fixed_statement): grammar for the fixed statement.
27382
27383 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
27384
27385         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27386         pointer types to be incretemented.
27387
27388         (SizeOf): Implement.
27389
27390         * cs-parser.jay (pointer_member_access): Implement
27391         expr->IDENTIFIER production.
27392
27393         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27394         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27395         on safe contexts.
27396
27397         (Unary): Implement indirection.
27398
27399         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27400         use in non-unsafe context).
27401
27402         (SimpleName.DoResolve): Check for pointers in field access on safe
27403         contexts. 
27404
27405         (Expression.LoadFromPtr): Factor the load-indirect code in this
27406         function.  This was duplicated in UnboxCast and ParameterReference
27407
27408 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
27409
27410         * expression.cs (ComposedCast): report an error if a pointer cast
27411         is used in a safe region.
27412
27413         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27414         pointer type casts in unsafe context.
27415
27416         * codegen.cs (EmitContext): Set up IsUnsafe.
27417
27418         * cs-parser.jay (non_expression_type): Add productions for pointer
27419         casts. 
27420
27421         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27422         code.  We should not use force into static mode if the method is
27423         not virtual.  Fixes bug in MIS
27424
27425         * statement.cs (Do.Emit, While.Emit, For.Emit,
27426         Statement.EmitBoolExpression): Add support to Do and While to
27427         propagate infinite loop as `I do return' semantics.
27428
27429         Improve the For case to also test for boolean constants.
27430
27431         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27432         to the list of attributes we can add.
27433
27434         Remove `EmitContext' argument.
27435
27436         * class.cs (Method.Define): Apply parameter attributes.
27437         (Constructor.Define): Apply parameter attributes.
27438         (MethodCore.LabelParameters): Move here the core of labeling
27439         parameters. 
27440
27441         * support.cs (ReflectionParameters.ParameterModifier,
27442         InternalParameters.ParameterModifier): Use IsByRef on the type and
27443         only return the OUT bit for these parameters instead of in/out/ref
27444         flags.
27445
27446         This is because I miss-understood things.  The ParameterInfo.IsIn
27447         and IsOut represent whether the parameter has the [In] and [Out]
27448         attributes set.  
27449
27450 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
27451
27452         * ecore.cs (FieldExpr.Emit): Release temporaries.
27453
27454         * assign.cs (LocalTemporary.Release): new function.
27455
27456         * codegen.cs (EmitContext.GetTemporaryStorage,
27457         EmitContext.FreeTemporaryStorage): Rework the way we deal with
27458         temporary storage.  Now we can "put back" localbuilders when we
27459         are done with them
27460
27461 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
27462
27463         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27464         need to make a copy of the variable to generate verifiable code.
27465
27466 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
27467
27468         * driver.cs: Compute dynamically the system directory.
27469
27470         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27471         Slower, but more generally useful.  Used by the abstract
27472         registering implementation. 
27473
27474         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27475         the rules for the special rule on Type/instances.  First check if
27476         we have the same name, and if so, try that special static path
27477         rather than the instance path.
27478
27479 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
27480
27481         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27482         for, while and if.
27483
27484         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27485         Enum, ValueType, Delegate or Array for non-corlib compiles.
27486
27487         * cs-tokenizer.cs: Catch long identifiers (645)
27488
27489         * typemanager.cs (IndexerPropetyName): Ravi never tested this
27490         piece of code.
27491
27492         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27493         fix, we were returning too early, so we were not registering
27494         pending methods from abstract classes.
27495
27496         Do not register pending methods if the class is abstract.
27497
27498         * expression.cs (Conditional.DoResolve): Report circular implicit
27499         conversions when we neecd to compute it for conditional
27500         expressions. 
27501
27502         (Is.DoResolve): If the expression is always of the provided type,
27503         flag warning 183.  If the expression can not ever be of the
27504         provided type flag warning 184.
27505
27506         * class.cs: Catch 169 as well.
27507
27508         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27509         read. 
27510
27511 2002-01-18  Nick Drochak  <ndrochak@gol.com>
27512
27513         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
27514
27515 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
27516
27517         * interface.cs: (PopulateMethod): Check for pointers being defined
27518         only if the unsafe context is active.
27519         (PopulateProperty): ditto.
27520         (PopulateIndexer): ditto.
27521
27522         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27523         specified.  If pointers are present, make sure that they are
27524         present in an unsafe context.
27525         (Constructor, Constructor.Define): ditto.
27526         (Field, Field.Define): ditto.
27527         (Property, Property.Define): ditto.
27528         (Event, Event.Define): ditto.
27529
27530         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27531         hashtable if there are classes or structs defined.
27532
27533         * expression.cs (LocalVariableReference.DoResolve): Simplify this
27534         code, as the constant resolution moved.
27535
27536         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27537         the metadata, so we can flag error 133. 
27538
27539         * decl.cs (MemberCore.UnsafeOK): New function to test that a
27540         pointer is being declared in an unsafe context.
27541
27542 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
27543
27544         * modifiers.cs (Modifiers.Check): Require a Location argument.
27545         Report error 227 for Unsafe use.
27546
27547         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27548
27549         * statement.cs (For.Emit): If the test is null, then report that
27550         we do `return', as we wont reach anything afterwards.
27551
27552         (Switch.SwitchGoverningType): Track the expression that matched
27553         the conversion.
27554
27555         * driver.cs: Allow negative numbers as an error code to flag.
27556
27557         * cs-parser.jay: Handle 1551.
27558
27559         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27560
27561 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27562
27563         * cs-parser.jay: Report 1518 (type declaration can only contain
27564         class, struct, interface, enum or delegate)
27565
27566         (switch_label): Report 1523 (keywords `case' or `default' must
27567         preced code)
27568
27569         (opt_switch_sections): Report 1522 (empty switch)
27570
27571         * driver.cs: Report 1515 (response file specified multiple times)
27572         Report 1516 (Source file specified multiple times).
27573
27574         * expression.cs (Argument.Resolve): Signal 1510
27575
27576         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27577         access not allowed in static code)
27578
27579 2002-01-11  Ravi Pratap  <ravi@ximian.com>
27580
27581         * typemanager.cs (IsPointerType): Utility method which we are going
27582         to need a lot.
27583
27584         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27585         the object type, so we take care of that.
27586
27587         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27588
27589         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27590         added to non-params parameters :-)
27591
27592         * typemanager.cs (CSharpName): Include 'void' type too. 
27593
27594         (void_ptr_type): Include in the set of core types.
27595
27596         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
27597         duplicating code.
27598
27599         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
27600         an unsafe context.
27601
27602         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
27603         completely forgotten about it.
27604
27605 2002-01-10  Ravi Pratap  <ravi@ximian.com>
27606
27607         * cs-parser.jay (pointer_type): Add. This begins our implementation
27608         of parsing rules for unsafe code.
27609
27610         (unsafe_statement): Implement.
27611
27612         (embedded_statement): Modify to include the above.
27613
27614         * statement.cs (Unsafe): Implement new class for unsafe blocks.
27615
27616         * codegen.cs (EmitContext.InUnsafe): Add. This determines
27617         if the current context is an unsafe one.
27618
27619         * cs-parser.jay (local_variable_pointer_type): Since local variable types
27620         are handled differently, we need separate rules for them.
27621
27622         (local_variable_declaration): Update to use local_variable_pointer_type
27623         to allow variable declarations of unmanaged pointer types.
27624
27625         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27626         in unsafe contexts.
27627
27628         * ../errors/cs0214.cs : Add.
27629
27630 2002-01-16  Nick Drochak  <ndrochak@gol.com>
27631
27632         * makefile: remove 'response' file when cleaning.
27633
27634 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27635
27636         * cs-parser.jay: Report 1524.
27637
27638 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
27639
27640         * typemanager.cs (RegisterMethod): drop checking if we have
27641         registered this from here
27642
27643 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
27644
27645         * class.cs (Method.EmitDestructor): Implement calling our base
27646         destructor. 
27647
27648         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27649         value of InFinally.
27650
27651         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27652         this routine and will wrap the call in a try/catch block.  Deal
27653         with the case.
27654
27655 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
27656
27657         * ecore.cs (Expression.MemberLookup): instead of taking a
27658         parameter `same_type' that was used to tell whether we could
27659         access private members we compute our containing type from the
27660         EmitContext.
27661
27662         (FieldExpr): Added partial support for volatile fields.  This does
27663         not work for volatile fields exposed from assemblies, as I can not
27664         figure out how to extract the modreq from it.
27665
27666         Updated all the source files to use this.
27667
27668         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27669         because it is referenced by MemberLookup very often. 
27670
27671 2002-01-09  Ravi Pratap  <ravi@ximian.com>
27672
27673         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27674         TypeBuilder.GetCustomAttributes to retrieve what we need.
27675
27676         Get rid of redundant default_member_attr_type as this is the same as
27677         default_member_type which already exists.
27678
27679         * interface.cs, attribute.cs : Update accordingly.
27680
27681 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
27682
27683         * typemanager.cs: Enable IndexerPropertyName again.  It does not
27684         work for TYpeBuilders though.  Ravi, can you please fix this?
27685
27686         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27687
27688         * expression.cs (Argument.Emit): Handle the case of ref objects
27689         being passed to ref functions;  
27690
27691         (ParameterReference.EmitLoad): Loads the content of the pointer
27692         without dereferencing.
27693
27694 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27695
27696         * cs-tokenizer.cs: Implemented the pre-processing expressions.
27697
27698 2002-01-08  Ravi Pratap  <ravi@ximian.com>
27699
27700         * class.cs (Indexer.DefineMethod): Incorporate the interface
27701         type in the name of the method if we are doing explicit interface
27702         implementation.
27703
27704         * expression.cs (ConversionExists): Remove as it is completely obsolete.
27705
27706         (BetterConversion): Fix extremely trivial bug where we were referring to
27707         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27708         again !
27709
27710         * ../errors/bug16.cs : Add although we have fixed it.
27711
27712 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27713
27714         * expression.cs (BaseIndexer): Begin implementation.
27715
27716         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27717
27718         * cs-parser.jay (indexer_declarator): Use qualified_identifier
27719         production directly to remove a shift/reduce, and implement
27720         explicit interface implementation.
27721
27722         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27723         after a floating point suffix.
27724
27725         * expression.cs (DoNumericPromotions): Improved the conversion for
27726         uint/uint.  If we have a constant, we avoid doing a typecast to a
27727         larger type.
27728
27729         * class.cs (Indexer): Implement explicit interface implementation
27730         for indexers.
27731
27732 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27733
27734         * class.cs: make the default instance constructor public and hidebysig.
27735
27736 2001-01-03  Ravi Pratap  <ravi@ximian.com>
27737
27738         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27739         so we can call it from elsewhere.
27740
27741         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27742         we emit it internally if the class has a defined indexer; otherwise the user
27743         emits it by decorating the class definition with the DefaultMemberAttribute.
27744
27745         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27746         attribute is not used on a type which defines an indexer.
27747
27748         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27749         character when we skip whitespace.
27750
27751         * ../errors/cs0646.cs : Add.
27752
27753 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
27754
27755         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27756         again. 
27757
27758         * makefile: Add practical target `mcs3.exe' which builds the third
27759         generation compiler. 
27760
27761         * expression.cs (New): Fix structures constructor calling.
27762
27763         * class.cs (Property, Method, Indexer): Emit Final flag on the
27764         method if we are an interface implementation and we are not
27765         abstract. 
27766
27767         * ecore.cs (PropertyExpr): New public field `IsBase', tells
27768         whether this property is referencing a `base' method.
27769
27770         * expression.cs (Invocation.EmitCall): take an extra argument:
27771         is_base, this is used to determine whether the `call' or
27772         `callvirt' opcode should be used.
27773
27774
27775         * delegate.cs: update EmitCall.
27776
27777         * class.cs (Method.Define): Set NewSlot for the cases where we are
27778         not implementing an interface method.
27779
27780         (Property.Define): ditto.
27781
27782 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
27783
27784         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27785         'r'.  Allows mcs to parse itself fully.
27786
27787 2002-01-02  Ravi Pratap  <ravi@ximian.com>
27788
27789         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27790         of the number of initializers that require the InitializeArray method.
27791
27792         (CheckIndices): Store the Expression in all cases - not the plain value. Also
27793         update the above field where necessary.
27794
27795         (MakeByteBlob): Update accordingly.
27796
27797         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
27798         greater than 2.
27799
27800         (EmitDynamicInitializers): Update in accordance with the new optimization.
27801
27802         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27803         same OpCode applies.
27804
27805         * cs-parser.jay : Fix some glaring errors I introduced.
27806
27807 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
27808
27809         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27810         so that we can check for name clashes there too.
27811
27812         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27813         for interface indexers.
27814
27815         * interfaces.cs (Define): Emit the default member attribute.
27816
27817         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27818         variable was being referred to while setting the value ;-)
27819
27820 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
27821
27822         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27823         byte-by-byte information when we know the data is zero.
27824
27825         Make the block always a multiple of 4, because
27826         DefineInitializedData has a bug.
27827
27828         * assign.cs: Fix, we should assign from the temporary, not from
27829         the source. 
27830
27831         * expression.cs (MakeByteBlob): Fix my incorrect code.
27832
27833 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
27834
27835         * typemanager.cs (EnumToUnderlying): This function is used to get
27836         the underlying type from an enumeration, because it does not
27837         always work. 
27838
27839         * constant.cs: Use the I4_S form for values between -128 and 127.
27840
27841         * statement.cs (Block.LookupLabel): Looks up a label.
27842         (Block): Drop support for labeled blocks.
27843
27844         (LabeledStatement): New kind of statement that represents a label
27845         only.
27846
27847         (Goto): Finally implement this bad boy.
27848
27849         * cs-parser.jay: Update to reflect new mechanism to implement
27850         labels.
27851
27852 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
27853
27854         * codegen.cs (EmitContext.This): a codegen property that keeps the
27855         a single instance of this instead of creating many different this
27856         instances. 
27857
27858         * delegate.cs (Delegate.DoResolve): Update to use the property;
27859
27860         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27861
27862         * expression.cs (BaseAccess.DoResolve): Ditto.
27863
27864 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27865
27866         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27867         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27868
27869         (InitCoreTypes): Update accordingly.
27870
27871         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27872         so we can quickly store the state.
27873
27874         (ApplyAttributes): Set the correct implementation flags
27875         for InternalCall methods.
27876
27877 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27878
27879         * expression.cs (EmitCall): if a method is not virtual, then do
27880         not use callvirt on it.
27881
27882         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27883         user defined stuff) requires the use of stobj, which takes an
27884         address on the stack instead of an array and an index.  So emit
27885         the Ldelema operation for it.
27886
27887         (EmitStoreOpcode): Use stobj for valuetypes.
27888
27889         (UnaryMutator.EmitCode): Use the right 1 value depending on
27890         whether we are dealing with int64/uint64, float or doubles.
27891
27892         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27893         constructors that I implemented last night.
27894
27895         (Constructor.IsDefault): Fix to work properly for static
27896         constructors.
27897
27898         * cs-parser.jay (CheckDef): report method signature errors.
27899         Update error number 103 to be 132.
27900
27901         * decl.cs: New AdditionResult enumeration value: MethodExists.
27902         Although we do this check for methods later on in the semantic
27903         analysis, catching repeated default constructors is so easy that
27904         we catch these here. 
27905
27906         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27907         promotions code.
27908
27909         (ParameterReference.EmitAssign, Emit): handle
27910         bools as bytes.
27911
27912         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27913         (ArrayAccess.EmitStoreOpcode): ditto.
27914
27915         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27916
27917         * expression.cs (MakeByteBlob): Complete all the missing types
27918         (uint, short, ushort, byte, sbyte)
27919
27920         * class.cs: Only init instance field initializers on instance
27921         constructors. 
27922
27923         Rename `constructors' to instance_constructors. 
27924
27925         (TypeContainer.AddConstructor): Only add constructors to the list
27926         if it is not static.
27927
27928         Make sure that we handle default_static_constructor independently
27929         everywhere where we handle instance_constructors
27930
27931 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27932
27933         * class.cs: Do not lookup or create a base initializer for a
27934         static constructor.
27935
27936         (ConstructorInitializer.Resolve): use the proper type to lookup
27937         for constructors.
27938
27939         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27940
27941         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27942         in DeclSpace. 
27943
27944         * decl.cs: CloseType is now an virtual method, the default
27945         implementation just closes this type.
27946
27947 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27948
27949         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27950         to PreserveSig by default. Also emit HideBySig on such methods.
27951
27952         Basically, set the defaults to standard values.
27953
27954         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27955         argument, if candidate is better, it can't be worse than the best !
27956
27957         (Invocation): Re-write bits to differentiate between methods being
27958         applicable in their expanded form and their normal form - for params
27959         methods of course.
27960
27961         Get rid of use_standard everywhere as only standard conversions are allowed
27962         in overload resolution. 
27963
27964         More spec conformance.
27965
27966 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27967
27968         * driver.cs: Add --timestamp, to see where the compiler spends
27969         most of its time.
27970
27971         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27972         `this' in static code.
27973
27974         (SimpleName.DoResolve): Implement in terms of a helper function
27975         that allows static-references to be passed upstream to
27976         MemberAccess.
27977
27978         (Expression.ResolveWithSimpleName): Resolve specially simple
27979         names when called by MemberAccess to implement the special
27980         semantics. 
27981
27982         (Expression.ImplicitReferenceConversion): Handle conversions from
27983         Null to reference types before others, as Null's type is
27984         System.Object. 
27985
27986         * expression.cs (Invocation.EmitCall): Handle the special case of
27987         calling methods declared on a reference type from a ValueType
27988         (Base classes System.Object and System.Enum)
27989
27990         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27991         the left hand side is a TypeExpr, not on every enumeration. 
27992
27993         (Binary.Resolve): If types are reference types, then do a cast to
27994         object on operators != and == of both arguments.
27995
27996         * typemanager.cs (FindMembers): Extract instance and static
27997         members if requested.
27998
27999         * interface.cs (PopulateProperty): Use void_type instead of null
28000         as the return type for the setter method.
28001
28002         (PopulateIndexer): ditto.
28003
28004 2001-12-27  Ravi Pratap  <ravi@ximian.com>
28005
28006         * support.cs (ReflectionParameters): Fix minor bug where we
28007         were examining the wrong parameter for the ParamArray attribute.
28008
28009         Cope with requests for the type of the parameter at position
28010         greater than the params parameter's. We now return the element
28011         type of the params array as that makes more sense.
28012
28013         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
28014         accordingly as we no longer have to extract the element type
28015         ourselves.
28016
28017         (Invocation.OverloadResolve): Update.
28018
28019 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
28020
28021         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
28022         against IEnumerator, test whether the return value is a descendant
28023         of the IEnumerator interface.
28024
28025         * class.cs (Indexer.Define): Use an auxiliary method to implement
28026         the other bits of the method definition.  Begin support for
28027         explicit interface implementation.
28028
28029         (Property.DefineMethod): Use TypeManager.void_type instead of null
28030         for an empty return value.
28031
28032 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
28033
28034         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
28035         dealing with a FieldExpr which is composed of a FieldBuilder, in
28036         the code path we did extract the constant, but we should have
28037         obtained the underlying value to be able to cast it (otherwise we
28038         end up in an infinite loop, this is what Ravi was running into).
28039
28040         (ArrayCreation.UpdateIndices): Arrays might be empty.
28041
28042         (MemberAccess.ResolveMemberAccess): Add support for section
28043         14.5.4.1 that deals with the special case of E.I when E is a type
28044         and something else, that I can be a reference to a static member.
28045
28046         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
28047         handle a particular array type to create byte blobs, it is just
28048         something we dont generate byteblobs for.
28049
28050         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
28051         arguments. 
28052
28053         * location.cs (Push): remove the key from the hashtable that we
28054         are about to add.   This happens for empty files.
28055
28056         * driver.cs: Dispose files after we have parsed them.
28057
28058         (tokenize): new function that only runs the tokenizer on its
28059         input, for speed testing.
28060
28061 2001-12-26  Ravi Pratap  <ravi@ximian.com>
28062
28063         * class.cs (Event.Define): Define the private field only if there
28064         are no accessors defined.
28065
28066         * expression.cs (ResolveMemberAccess): If there is no associated
28067         field with the event, that means we have an event defined with its
28068         own accessors and we should flag error cs0070 since transforming
28069         ourselves into a field is not valid in that case.
28070
28071         * ecore.cs (SimpleName.DoResolve): Same as above.
28072
28073         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
28074         and charset to sane values.
28075
28076 2001-12-25  Ravi Pratap  <ravi@ximian.com>
28077
28078         * assign.cs (DoResolve): Perform check on events only if they 
28079         are being accessed outside the declaring type.
28080
28081         * cs-parser.jay (event_declarations): Update rules to correctly
28082         set the type of the implicit parameter etc.
28083
28084         (add_accessor, remove_accessor): Set current local parameters.
28085
28086         * expression.cs (Binary): For delegate addition and subtraction,
28087         cast the return value from the method into the appropriate delegate
28088         type.
28089
28090 2001-12-24  Ravi Pratap  <ravi@ximian.com>
28091
28092         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
28093         of these as the workaround is unnecessary.
28094
28095         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
28096         delegate data - none of that is needed at all.
28097
28098         Re-write bits to extract the instance expression and the delegate method
28099         correctly.
28100
28101         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
28102         on delegates too.
28103
28104         * attribute.cs (ApplyAttributes): New method to take care of common tasks
28105         of attaching attributes instead of duplicating code everywhere.
28106
28107         * everywhere : Update code to do attribute emission using the above method.
28108
28109 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
28110
28111         * expression.cs (IsParamsMethodApplicable): if there are not
28112         parameters, return immediately.
28113
28114         * ecore.cs: The 0 literal can be implicity converted to an enum
28115         type. 
28116
28117         (SimpleName.DoResolve): First lookup the type, then lookup the
28118         members. 
28119
28120         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
28121         want to get its address.  If the InstanceExpression is not
28122         addressable, store the result in a temporary variable, then get
28123         the address of it.
28124
28125         * codegen.cs: Only display 219 errors on warning level or above. 
28126
28127         * expression.cs (ArrayAccess): Make it implement the
28128         IMemoryLocation interface.
28129
28130         (Binary.DoResolve): handle the operator == (object a, object b)
28131         and operator != (object a, object b) without incurring into a
28132         BoxedCast (because 5 != o should never be performed).
28133
28134         Handle binary enumerator operators.
28135
28136         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
28137         value type, otherwise use Ldelem_ref.
28138
28139         Use precomputed names;
28140
28141         (AddressOf): Implement address of
28142
28143         * cs-parser.jay (labeled_statement): Fix recursive block
28144         addition by reworking the production.
28145
28146         * expression.cs (New.DoEmit): New has a special case:
28147                 
28148                  If we are dealing with a ValueType, we have a few
28149                  situations to deal with:
28150                 
28151                     * The target of New is a ValueType variable, that is
28152                       easy, we just pass this as the variable reference
28153                 
28154                     * The target of New is being passed as an argument,
28155                       to a boxing operation or a function that takes a
28156                       ValueType.
28157                 
28158                       In this case, we need to create a temporary variable
28159                       that is the argument of New.
28160
28161
28162 2001-12-23  Ravi Pratap  <ravi@ximian.com>
28163
28164         * rootcontext.cs (LookupType): Check that current_type is not null before
28165         going about looking at nested types.
28166
28167         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
28168         not implement the IAssignMethod interface any more.
28169
28170         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
28171         where we tranform them into FieldExprs if they are being resolved from within
28172         the declaring type.
28173
28174         * ecore.cs (SimpleName.DoResolve): Do the same here.
28175
28176         * assign.cs (DoResolve, Emit): Clean up code considerably. 
28177
28178         * ../errors/bug10.cs : Add.
28179
28180         * ../errors/cs0070.cs : Add.
28181
28182         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
28183
28184         * assign.cs : Get rid of EventIsLocal everywhere.
28185
28186 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
28187
28188         * ecore.cs (ConvertIntLiteral): finished the implementation.
28189
28190         * statement.cs (SwitchLabel): Convert the value we are using as a
28191         key before looking up the table.
28192
28193 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
28194
28195         * codegen.cs (EmitTopBlock): Require a Location argument now.
28196
28197         * cs-parser.jay (constructor_declarator): We need to setup
28198         current_local_parameters before we parse the
28199         opt_constructor_initializer, to allow the variables to be bound
28200         to the constructor arguments.
28201
28202         * rootcontext.cs (LookupType): First lookup nested classes in our
28203         class and our parents before we go looking outside our class.
28204
28205         * expression.cs (ConstantFold): Extract/debox the values at the
28206         beginnning. 
28207
28208         * rootcontext.cs (EmitCode): Resolve the constants first before we
28209         resolve the types.  This is not really needed, but it helps debugging.
28210
28211         * statement.cs: report location.
28212
28213         * cs-parser.jay: pass location to throw statement.
28214
28215         * driver.cs: Small bug fix.
28216
28217         * report.cs: Updated format to be 4-zero filled digits.
28218
28219 2001-12-22  Ravi Pratap  <ravi@ximian.com>
28220
28221         * expression.cs (CheckIndices): Fix minor bug where the wrong
28222         variable was being referred to ;-)
28223
28224         (DoEmit): Do not call EmitStaticInitializers when the 
28225         underlying type is System.Object.
28226
28227 2001-12-21  Ravi Pratap  <ravi@ximian.com>
28228
28229         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
28230         and do the usual workaround for SRE.
28231
28232         * class.cs (MyEventBuilder.EventType): New member to get at the type
28233         of the event, quickly.
28234
28235         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
28236
28237         * assign.cs (Assign.DoResolve): Handle the case when the target
28238         is an EventExpr and perform the necessary checks.
28239
28240         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
28241         interface.
28242
28243         (SimpleName.MemberStaticCheck): Include check for EventExpr.
28244
28245         (EventExpr): Set the type in the constructor itself since we 
28246         are meant to be born fully resolved.
28247
28248         (EventExpr.Define): Revert code I wrote earlier.
28249                 
28250         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
28251         instance expression is null. The instance expression is a This in that case
28252         or a null, depending on whether it is a static method or not.
28253
28254         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
28255         refers to more than one method.
28256
28257         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
28258         and accordingly flag errors.
28259
28260 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28261
28262         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
28263
28264 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
28265
28266         * location.cs (ToString): Provide useful rutine.
28267
28268 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28269
28270         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
28271         objects, return the actual integral boxed.
28272
28273         * statement.cs (SwitchLabel): define an ILLabel for each
28274         SwitchLabel. 
28275
28276         (Switch.CheckSwitch): If the value is a Literal, extract
28277         the underlying literal.
28278
28279         Also in the unused hashtable we had, add the SwitchLabel so we can
28280         quickly look this value up.
28281
28282         * constant.cs: Implement a bunch of new constants.  Rewrite
28283         Literal based on this.  Made changes everywhere to adapt to this.
28284
28285         * expression.cs (Expression.MakeByteBlob): Optimize routine by
28286         dereferencing array only once, and also copes with enumrations.
28287
28288         bytes are two bytes wide, not one.
28289
28290         (Cast): Perform constant conversions.
28291
28292         * ecore.cs (TryImplicitIntConversion): Return literals instead of
28293         wrappers to the literals here.
28294
28295         * expression.cs (DoNumericPromotions): long literals can converted
28296         to ulong implicity (this is taken care of elsewhere, but I was
28297         missing this spot).
28298
28299         * ecore.cs (Expression.Literalize): Make the return type Literal,
28300         to improve type checking.
28301
28302         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
28303
28304 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
28305
28306         * literal.cs: Revert code from ravi that checked the bounds.  The
28307         bounds are sane by the definition of the type itself. 
28308
28309         * typemanager.cs: Fix implementation of ImplementsInterface.  We
28310         need to actually look up in our parent hierarchy for interfaces
28311         implemented. 
28312
28313         * const.cs: Use the underlying type for enumerations
28314
28315         * delegate.cs: Compute the basename for the delegate creation,
28316         that should fix the delegate test case, and restore the correct
28317         Type Lookup semantics in rootcontext
28318
28319         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
28320         referencing a nested type with the Reflection API is using the "+"
28321         sign. 
28322
28323         * cs-parser.jay: Do not require EOF token at the end.
28324
28325 2001-12-20  Ravi Pratap  <ravi@ximian.com>
28326
28327         * rootcontext.cs (LookupType): Concatenate type names with
28328         a '.' instead of a '+' The test suite passes again.
28329
28330         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28331         field of the enumeration.
28332
28333         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28334         the case when the member is an EventExpr.
28335
28336         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28337         static has an associated instance expression.
28338
28339         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28340
28341         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28342
28343         * class.cs (Event.Define): Register event and perform appropriate checks
28344         for error #111.
28345
28346         We define the Add and Remove methods even if the use provides none because
28347         in that case, we provide default implementations ourselves.
28348
28349         Define a private field of the type of the event. This is done by the CSC compiler
28350         and we should be doing it too ;-)
28351
28352         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28353         More methods we use in code we generate.
28354
28355         (multicast_delegate_type, delegate_type): Two separate types since the distinction
28356         is important.
28357
28358         (InitCoreTypes): Update accordingly for the above.
28359
28360         * class.cs (Event.Emit): Generate code for default accessors that we provide
28361
28362         (EmitDefaultMethod): Do the job in the above.
28363
28364         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
28365         appropriate place.
28366
28367 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
28368
28369         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28370         builders even if we were missing one.
28371
28372         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28373         pass the Basename as our class name instead of the Name.  The
28374         basename will be correctly composed for us.
28375
28376         * parameter.cs (Paramters): Now takes a Location argument.
28377
28378         * decl.cs (DeclSpace.LookupType): Removed convenience function and
28379         make all the code call directly LookupType in RootContext and take
28380         this chance to pass the Location information everywhere.
28381
28382         * Everywhere: pass Location information.
28383
28384 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
28385
28386         * class.cs (Constructor.Define): Updated way of detecting the
28387         length of the parameters.
28388
28389         (TypeContainer.DefineType): Use basename as the type name for
28390         nested types.
28391
28392         (TypeContainer.Define): Do not recursively define types here, as
28393         definition is taken care in order by the RootContext.
28394
28395         * tree.cs: Keep track of namespaces in a per-file basis.
28396
28397         * parameter.cs (Parameter.ComputeSignature): Update to use
28398         DeclSpace. 
28399
28400         (Parameters.GetSignature): ditto.
28401
28402         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28403         instead of a TypeContainer.
28404
28405         (Interface.SemanticAnalysis): Use `this' instead of our parent to
28406         resolve names.  Because we need to be resolve in our context, not
28407         our parents.
28408
28409         * driver.cs: Implement response files.
28410
28411         * class.cs (TypeContainer.DefineType): If we are defined, do not
28412         redefine ourselves.
28413
28414         (Event.Emit): Emit the code for add/remove handlers.
28415         (Event.Define): Save the MethodBuilders for add/remove.
28416
28417         * typemanager.cs: Use pair here too.
28418
28419         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28420         DictionaryEntry requires the first argument to be non-null.  
28421
28422         (enum_declaration): Compute full name for registering the
28423         enumeration.
28424
28425         (delegate_declaration): Instead of using
28426         formal_parameter_list, use opt_formal_parameter_list as the list
28427         can be empty.
28428
28429         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28430         (EventParsing): New property that controls whether `add' and
28431         `remove' are returned as tokens or identifiers (for events);
28432
28433 2001-12-19  Ravi Pratap  <ravi@ximian.com>
28434
28435         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28436         use MyEventBuilder only and let it wrap the real builder for us.
28437
28438         (MyEventBuilder): Revamp constructor etc.
28439
28440         Implement all operations that we perform on EventBuilder in precisely the same
28441         way here too.
28442
28443         (FindMembers): Update to use the EventBuilder member.
28444
28445         (Event.Emit): Update accordingly.
28446
28447 2001-12-18  Ravi Pratap  <ravi@ximian.com>
28448
28449         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28450         by calling the appropriate methods.
28451
28452         (GetCustomAttributes): Make stubs as they cannot possibly do anything
28453         useful.
28454
28455         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28456
28457 2001-12-17  Ravi Pratap  <ravi@ximian.com>
28458
28459         * delegate.cs (Delegate.Populate): Check that the return type
28460         and various parameters types are indeed accessible.
28461
28462         * class.cs (Constructor.Define): Same here.
28463
28464         (Field.Define): Ditto.
28465
28466         (Event.Define): Ditto.
28467
28468         (Operator.Define): Check that the underlying Method defined itself
28469         correctly - so it's MethodBuilder should not be null.
28470
28471         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28472         expression happens to be null.
28473
28474         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28475         members but as of now we don't seem to be able to do anything really useful with it.
28476
28477         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28478         not the EventBuilder.
28479
28480 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
28481
28482         * cs-tokenizer.cs: Add support for defines.
28483         Add support for #if, #elif, #else, #endif
28484
28485         (eval_var): evaluates a variable.
28486         (eval): stubbed for evaluating functions.
28487
28488         * cs-parser.jay: Pass the defines information
28489
28490         * driver.cs: Add --define command line option.
28491
28492         * decl.cs: Move MemberCore here.
28493
28494         Make it the base class for DeclSpace.  This allows us to catch and
28495         report 108 and 109 for everything now.
28496
28497         * class.cs (TypeContainer.Define): Extract all the members
28498         before populating and emit the warning 108 (new keyword required
28499         to override) instead of having each member implement this.
28500
28501         (MemberCore.Define): New abstract method, we will be using this in
28502         the warning reporting engine in Populate.
28503
28504         (Operator.Define): Adjust to new MemberCore protocol. 
28505
28506         * const.cs (Const): This does not derive from Expression, it is a
28507         temporary object we use to create fields, it is a MemberCore. 
28508
28509         * class.cs (Method.Define): Allow the entry point to be in a
28510         specific class.
28511
28512         * driver.cs: Rewrite the argument handler to clean it up a bit.
28513
28514         * rootcontext.cs: Made it just an auxiliary namespace feature by
28515         making everything static.
28516
28517         * driver.cs: Adapt code to use RootContext type name instead of
28518         instance variable.
28519
28520         * delegate.cs: Remove RootContext argument.
28521
28522         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28523         argument. 
28524
28525         * class.cs (Event.Define): The lookup can fail.
28526
28527         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
28528
28529         * expression.cs: Resolve the this instance before invoking the code.
28530
28531 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
28532
28533         * cs-parser.jay: Add a production in element_access that allows
28534         the thing to become a "type" reference.  This way we can parse
28535         things like "(string [])" as a type.
28536
28537         Note that this still does not handle the more complex rules of
28538         casts. 
28539
28540
28541         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
28542
28543         * ecore.cs: (CopyNewMethods): new utility function used to
28544         assemble the list of methods from running FindMembers.
28545
28546         (MemberLookup): Rework FindMembers so that 
28547
28548 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
28549
28550         * class.cs (TypeContainer): Remove Delegates who fail to be
28551         defined.
28552
28553         * delegate.cs (Populate): Verify that we dont get null return
28554         values.   TODO: Check for AsAccessible.
28555
28556         * cs-parser.jay: Use basename to emit error 574 (destructor should
28557         have the same name as container class), not the full name.
28558
28559         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28560         possible representation.  
28561
28562         Also implements integer type suffixes U and L.
28563
28564 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
28565
28566         * expression.cs (ArrayCreation.DoResolve): We need to do the
28567         argument resolution *always*.
28568
28569         * decl.cs: Make this hold the namespace.  Hold the root context as
28570         well.
28571         (LookupType): Move here.
28572
28573         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28574
28575         * location.cs (Row, Name): Fixed the code, it was always returning
28576         references to the first file.
28577
28578         * interface.cs: Register properties defined through interfaces.
28579
28580         * driver.cs: Add support for globbing on the command line
28581
28582         * class.cs (Field): Make it derive from MemberCore as well.
28583         (Event): ditto.
28584
28585 2001-12-15  Ravi Pratap  <ravi@ximian.com>
28586
28587         * class.cs (Event::Define): Check that the type of the event is a delegate
28588         type else flag error #66.
28589
28590         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28591         same.
28592
28593         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28594         values of EntryPoint, CharSet etc etc.
28595
28596         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28597
28598         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28599         be null and we should ignore this. I am not sure if this is really clean. Apparently,
28600         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28601         which needs this to do its work.
28602
28603         * ../errors/cs0066.cs : Add.
28604
28605 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
28606
28607         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28608         helper functions.
28609
28610         * class.cs: (MethodSignature.MethodSignature): Removed hack that
28611         clears out the parameters field.
28612         (MemberSignatureCompare): Cleanup
28613
28614         (MemberCore): New base class used to share code between MethodCore
28615         and Property.
28616
28617         (RegisterRequiredImplementations) BindingFlags.Public requires
28618         either BindingFlags.Instace or Static.  Use instance here.
28619
28620         (Property): Refactored code to cope better with the full spec.
28621
28622         * parameter.cs (GetParameterInfo): Return an empty array instead
28623         of null on error.
28624
28625         * class.cs (Property): Abstract or extern properties have no bodies.
28626
28627         * parameter.cs (GetParameterInfo): return a zero-sized array.
28628
28629         * class.cs (TypeContainer.MethodModifiersValid): Move all the
28630         method modifier validation to the typecontainer so we can reuse
28631         this on properties.
28632
28633         (MethodCore.ParameterTypes): return an empty sized array of types.
28634
28635         (Property.Define): Test property modifier validity.
28636
28637         Add tests for sealed/override too.
28638
28639         (Method.Emit): abstract or extern methods have no bodies.
28640
28641 2001-12-14  Ravi Pratap  <ravi@ximian.com>
28642
28643         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28644         thing.
28645
28646         (Method::Define, ::Emit): Modify accordingly.
28647
28648         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28649
28650         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28651
28652         * makefile: Pass in /unsafe.
28653
28654 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
28655
28656         * class.cs (MakeKey): Kill routine.
28657
28658         * class.cs (TypeContainer.Define): Correctly define explicit
28659         method implementations (they require the full interface name plus
28660         the method name).
28661
28662         * typemanager.cs: Deply the PtrHashtable here and stop using the
28663         lame keys.  Things work so much better.
28664
28665         This of course broke everyone who depended on `RegisterMethod' to
28666         do the `test for existance' test.  This has to be done elsewhere.
28667
28668         * support.cs (PtrHashtable): A hashtable that avoid comparing with
28669         the object stupid Equals method (because, that like fails all over
28670         the place).  We still do not use it.
28671
28672         * class.cs (TypeContainer.SetRequiredInterface,
28673         TypeContainer.RequireMethods): Killed these two routines and moved
28674         all the functionality to RegisterRequiredImplementations.
28675
28676         (TypeContainer.RegisterRequiredImplementations): This routine now
28677         registers all the implementations required in an array for the
28678         interfaces and abstract methods.  We use an array of structures
28679         which can be computed ahead of time to reduce memory usage and we
28680         also assume that lookups are cheap as most classes will not
28681         implement too many interfaces.
28682
28683         We also avoid creating too many MethodSignatures.
28684
28685         (TypeContainer.IsInterfaceMethod): Update and optionally does not
28686         clear the "pending" bit if we find that there are problems with
28687         the declaration.
28688
28689         (TypeContainer.VerifyPendingMethods): Update to report errors of
28690         methods that look like implementations but are not.
28691
28692         (TypeContainer.Define): Add support for explicit interface method
28693         implementation. 
28694
28695 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
28696
28697         * typemanager.cs: Keep track of the parameters here instead of
28698         being a feature of the TypeContainer.
28699
28700         * class.cs: Drop the registration of parameters here, as
28701         InterfaceMethods are also interface declarations.
28702
28703         * delegate.cs: Register methods with the TypeManager not only with
28704         the TypeContainer.  This code was buggy.
28705
28706         * interface.cs: Full registation here.
28707
28708 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
28709
28710         * expression.cs: Remove reducer for binary expressions, it can not
28711         be done this way.
28712
28713         * const.cs: Put here the code that used to go into constant.cs
28714
28715         * constant.cs: Put here the code for constants, this is a new base
28716         class for Literals.
28717
28718         * literal.cs: Make Literal derive from Constant.
28719
28720 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
28721
28722         * statement.cs (Return.Emit): Report error 157 if the user
28723         attempts to return from a finally block.
28724
28725         (Return.Emit): Instead of emitting a return, jump to the end of
28726         the function.
28727
28728         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28729         LocalBuilder to store the result of the function.  ReturnLabel is
28730         the target where we jump.
28731
28732
28733 2001-12-09  Radek Doulik  <rodo@ximian.com>
28734
28735         * cs-parser.jay: remember alias in current namespace
28736
28737         * ecore.cs (SimpleName::DoResolve): use aliases for types or
28738         namespaces
28739
28740         * class.cs (LookupAlias): lookup alias in my_namespace
28741
28742         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28743         aliases hashtable
28744         (LookupAlias): lookup alias in this and if needed in parent
28745         namespaces
28746
28747 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
28748
28749         * support.cs: 
28750
28751         * rootcontext.cs: (ModuleBuilder) Made static, first step into
28752         making things static.  I need this to avoid passing the
28753         TypeContainer when calling ParameterType.
28754
28755         * support.cs (InternalParameters.ParameterType): Remove ugly hack
28756         that did string manipulation to compute the type and then call
28757         GetType.  Use Parameter.ParameterType instead.
28758
28759         * cs-tokenizer.cs: Consume the suffix for floating values.
28760
28761         * expression.cs (ParameterReference): figure out whether this is a
28762         reference parameter or not.  Kill an extra variable by computing
28763         the arg_idx during emission.
28764
28765         * parameter.cs (Parameters.GetParameterInfo): New overloaded
28766         function that returns whether a parameter is an out/ref value or not.
28767
28768         (Parameter.ParameterType): The type of the parameter (base,
28769         without ref/out applied).
28770
28771         (Parameter.Resolve): Perform resolution here.
28772         (Parameter.ExternalType): The full type (with ref/out applied).
28773
28774         * statement.cs (Using.Emit, Using.EmitExpression): Implement
28775         support for expressions on the using statement.
28776
28777 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
28778
28779         * statement.cs (Using.EmitLocalVariableDecls): Split the
28780         localvariable handling of the using statement.
28781
28782         (Block.EmitMeta): Keep track of variable count across blocks.  We
28783         were reusing slots on separate branches of blocks.
28784
28785         (Try.Emit): Emit the general code block, we were not emitting it. 
28786
28787         Check the type of the declaration to be an IDisposable or
28788         something that can be implicity converted to it. 
28789
28790         Emit conversions if required.
28791
28792         * ecore.cs (EmptyExpression): New utility class.
28793         (Expression.ImplicitConversionExists): New utility function.
28794
28795 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
28796
28797         * statement.cs (Using): Implement.
28798
28799         * expression.cs (LocalVariableReference): Support read only variables.
28800
28801         * statement.cs: Remove the explicit emit for the Leave opcode.
28802         (VariableInfo): Add a readonly field.
28803
28804 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
28805
28806         * ecore.cs (ConvCast): new class used to encapsulate the various
28807         explicit integer conversions that works in both checked and
28808         unchecked contexts.
28809
28810         (Expression.ConvertNumericExplicit): Use new ConvCast class to
28811         properly generate the overflow opcodes.
28812
28813 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28814
28815         * statement.cs: The correct type for the EmptyExpression is the
28816         element_type, not the variable type.  Ravi pointed this out.
28817
28818 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28819
28820         * class.cs (Method::Define): Handle PInvoke methods specially
28821         by using DefinePInvokeMethod instead of the usual one.
28822
28823         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28824         above to do the task of extracting information and defining the method.
28825
28826 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28827
28828         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28829         of the condition for string type.
28830
28831         (Emit): Move that here. 
28832
28833         (ArrayCreation::CheckIndices): Keep string literals in their expression
28834         form.
28835
28836         (EmitDynamicInitializers): Handle strings appropriately.
28837
28838 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28839
28840         * codegen.cs (EmitContext): Replace multiple variables with a
28841         single pointer to the current Switch statement.
28842
28843         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28844         EmitContext.
28845
28846 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28847
28848         * statement.cs 
28849
28850         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28851         default'.
28852
28853         (Foreach.Emit): Foreach on arrays was not setting
28854         up the loop variables (for break/continue).
28855
28856         (GotoCase): Semi-implented.
28857
28858 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28859
28860         * attribute.cs (CheckAttribute): Handle system attributes by using
28861         Attribute.GetAttributes to examine information we need.
28862
28863         (GetValidPlaces): Same here.
28864
28865         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28866
28867         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28868
28869         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28870
28871         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28872
28873         (Method::Emit): Handle the case when we are a PInvoke method.
28874
28875 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28876
28877         * expression.cs: Use ResolveWithSimpleName on compound names.
28878
28879 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28880
28881         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28882         before trying to reduce it.
28883
28884         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28885
28886         * constant.cs (LookupConstantValue): Implement.
28887
28888         (EmitConstant): Use the above in emitting the constant.
28889
28890         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28891         that are user-defined by doing a LookupConstantValue on them.
28892
28893         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28894         too, like above.
28895
28896 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28897
28898         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28899
28900         (BaseAccess.DoResolve): Implement.
28901
28902         (MemberAccess.DoResolve): Split this routine into a
28903         ResolveMemberAccess routine that can be used independently
28904
28905 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28906
28907         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28908         As that share bits of the implementation.  Is returns a boolean,
28909         while As returns the Type that is being probed.
28910
28911 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28912
28913         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28914         instead of a Literal - much easier.
28915
28916         (EnumInTransit): Remove - utterly useless :-)
28917
28918         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28919
28920         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28921
28922         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28923         chain when we have no associated expression.
28924
28925 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28926
28927         * constant.cs (Define): Use Location while reporting the errror.
28928
28929         Also emit a warning when 'new' is used and there is no inherited
28930         member to hide.
28931
28932         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28933         populated.
28934
28935         (LookupEnumValue): Implement to lookup an enum member's value and define it
28936         if necessary.
28937
28938         (Populate): Re-write accordingly to use the above routine.
28939
28940 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28941
28942         * expression.cs (This): Fix prototype for DoResolveLValue to
28943         override the base class DoResolveLValue.
28944
28945         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28946         declarations) 
28947
28948         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28949         (we need to load the address of the field here).  This fixes
28950         test-22. 
28951
28952         (FieldExpr.DoResolveLValue): Call the DoResolve
28953         function to initialize the Instance expression.
28954
28955         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28956         correctly the GetEnumerator operation on a value type.
28957
28958         * cs-parser.jay: Add more simple parsing error catches.
28959
28960         * statement.cs (Switch): Add support for string switches.
28961         Handle null specially.
28962
28963         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28964
28965 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28966
28967         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28968
28969         (declare_local_constant): New helper function.
28970
28971         * statement.cs (AddConstant): Keep a separate record of constants
28972
28973         (IsConstant): Implement to determine if a variable is a constant.
28974
28975         (GetConstantExpression): Implement.
28976
28977         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28978
28979         * statement.cs (IsVariableDefined): Re-write.
28980
28981 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28982
28983         * class.cs (TypeContainer::FindMembers): Look for constants
28984         in the case when we are looking for MemberTypes.Field
28985
28986         * expression.cs (MemberAccess::DoResolve): Check that in the
28987         case we are a FieldExpr and a Literal, we are not being accessed
28988         by an instance reference.
28989
28990         * cs-parser.jay (local_constant_declaration): Implement.
28991
28992         (declaration_statement): Implement for constant declarations.
28993
28994 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28995
28996         * statement.cs (Switch): Catch double defaults.
28997
28998         (Switch): More work on the switch() statement
28999         implementation.  It works for integral values now, need to finish
29000         string support.
29001
29002
29003 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
29004
29005         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
29006         integer literals into other integer literals.  To be used by
29007         switch. 
29008
29009 2001-11-24  Ravi Pratap  <ravi@ximian.com>
29010
29011         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
29012         some memory.
29013
29014         (EmitDynamicInitializers): Cope with the above since we extract data
29015         directly from ArrayData now.
29016
29017         (ExpectInitializers): Keep track of whether initializers are mandatory
29018         or not.
29019
29020         (Bounds): Make it a hashtable to prevent the same dimension being 
29021         recorded for every element in that dimension.
29022
29023         (EmitDynamicInitializers): Fix bug which prevented the Set array method
29024         from being found.
29025
29026         Also fix bug which was causing the indices to be emitted in the reverse
29027         order.
29028
29029 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
29030
29031         * expression.cs (ArrayCreation): Implement the bits that Ravi left
29032         unfinished.  They do not work, because the underlying code is
29033         sloppy.
29034
29035 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
29036
29037         * cs-parser.jay: Remove bogus fixme.
29038
29039         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
29040         on Switch statement.
29041
29042 2001-11-23  Ravi Pratap  <ravi@ximian.com>
29043
29044         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
29045         the same. 
29046
29047         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
29048         parameter. Apparently, any expression is allowed. 
29049
29050         (ValidateInitializers): Update accordingly.
29051
29052         (CheckIndices): Fix some tricky bugs thanks to recursion.
29053
29054         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
29055         I was being completely brain-dead.
29056
29057         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
29058         and re-write acordingly.
29059
29060         (DelegateInvocation): Re-write accordingly.
29061
29062         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
29063
29064         (MakeByteBlob): Handle types more correctly.
29065
29066         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
29067         initialization from expressions but it is incomplete because I am a complete
29068         Dodo :-|
29069
29070 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
29071
29072         * statement.cs (If.Emit): Fix a bug that generated incorrect code
29073         on If.  Basically, we have to return `true' (ie, we do return to
29074         our caller) only if both branches of the if return.
29075
29076         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
29077         short-circuit operators, handle them as short circuit operators. 
29078
29079         (Cast.DoResolve): Resolve type.
29080         (Cast.Cast): Take an expression as the target type.
29081
29082         * cs-parser.jay (cast_expression): Remove old hack that only
29083         allowed a limited set of types to be handled.  Now we take a
29084         unary_expression and we resolve to a type during semantic
29085         analysis.
29086
29087         Use the grammar productions from Rhys to handle casts (this is
29088         not complete like Rhys syntax yet, we fail to handle that corner
29089         case that C# has regarding (-x), but we will get there.
29090
29091 2001-11-22  Ravi Pratap  <ravi@ximian.com>
29092
29093         * class.cs (EmitFieldInitializer): Take care of the case when we have a
29094         field which is an array type.
29095
29096         * cs-parser.jay (declare_local_variables): Support array initialization too.
29097
29098         * typemanager.cs (MakeKey): Implement.
29099
29100         (everywhere): Use the above appropriately.
29101
29102         * cs-parser.jay (for_statement): Update for array initialization while
29103         declaring variables.
29104
29105         * ecore.cs : The error message was correct, it's the variable's names that
29106         were misleading ;-) Make the code more readable.
29107
29108         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
29109         the correct type etc.
29110
29111         (ConvertExplicit): Handle Enum types by examining the underlying type.
29112
29113 2001-11-21  Ravi Pratap  <ravi@ximian.com>
29114
29115         * parameter.cs (GetCallingConvention): Always return
29116         CallingConventions.Standard for now.
29117
29118 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
29119
29120         * expression.cs (Binary.ResolveOperator): Update the values of `l'
29121         and `r' after calling DoNumericPromotions.
29122
29123         * ecore.cs: Fix error message (the types were in the wrong order).
29124
29125         * statement.cs (Foreach.ProbeCollectionType): Need to pass
29126         BindingFlags.Instance as well 
29127
29128         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
29129         implicit int literal conversion in an empty cast so that we
29130         propagate the right type upstream.
29131
29132         (UnboxCast): new class used to unbox value types.
29133         (Expression.ConvertExplicit): Add explicit type conversions done
29134         by unboxing.
29135
29136         (Expression.ImplicitNumericConversion): Oops, forgot to test for
29137         the target type before applying the implicit LongLiterals to ULong
29138         literal cast.
29139
29140 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
29141
29142         * cs-parser.jay (for_statement): Reworked the way For works: now
29143         we declare manually any variables that are introduced in
29144         for_initializer to solve the problem of having out-of-band code
29145         emition (that is what got for broken).
29146
29147         (declaration_statement): Perform the actual variable declaration
29148         that used to be done in local_variable_declaration here.
29149
29150         (local_variable_declaration): Do not declare anything, just pass
29151         the information on a DictionaryEntry
29152
29153 2001-11-20  Ravi Pratap  <ravi@ximian.com>
29154
29155         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
29156         re-write of the logic to now make it recursive.
29157
29158         (UpdateIndices): Re-write accordingly.
29159
29160         Store element data in a separate ArrayData list in the above methods.
29161
29162         (MakeByteBlob): Implement to dump the array data into a byte array.
29163
29164 2001-11-19  Ravi Pratap  <ravi@ximian.com>
29165
29166         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
29167         into CheckIndices.
29168
29169         * constant.cs (Define): Implement.
29170
29171         (EmitConstant): Re-write fully.
29172
29173         Pass in location info.
29174
29175         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
29176         respectively.
29177
29178         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
29179         DictionaryEntry since we need location info too.
29180
29181         (constant_declaration): Update accordingly.
29182
29183         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
29184         code into another method : UpdateIndices.
29185
29186 2001-11-18  Ravi Pratap  <ravi@ximian.com>
29187
29188         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
29189         some type checking etc.
29190
29191 2001-11-17  Ravi Pratap  <ravi@ximian.com>
29192
29193         * expression.cs (ArrayCreation::ValidateInitializers): Implement
29194         bits to provide dimension info if the user skips doing that.
29195
29196         Update second constructor to store the rank correctly.
29197
29198 2001-11-16  Ravi Pratap  <ravi@ximian.com>
29199
29200         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
29201         and try to implement.
29202
29203         * ../errors/cs0150.cs : Add.
29204
29205         * ../errors/cs0178.cs : Add.
29206
29207 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
29208
29209         * statement.cs: Implement foreach on multi-dimensional arrays. 
29210
29211         * parameter.cs (Parameters.GetParameterByName): Also lookup the
29212         name of the params argument.
29213
29214         * expression.cs: Use EmitStoreOpcode to get the right opcode while
29215         initializing the array.
29216
29217         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
29218         we can use this elsewhere.
29219
29220         * statement.cs: Finish implementation of foreach for single
29221         dimension arrays.
29222
29223         * cs-parser.jay: Use an out-of-band stack to pass information
29224         around, I wonder why I need this.
29225
29226         foreach_block: Make the new foreach_block the current_block.
29227
29228         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
29229         function used to return a static Parameters structure.  Used for
29230         empty parameters, as those are created very frequently.
29231
29232         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
29233
29234 2001-11-15  Ravi Pratap  <ravi@ximian.com>
29235
29236         * interface.cs : Default modifier is private, not public. The
29237         make verify test passes again.
29238
29239 2001-11-15  Ravi Pratap  <ravi@ximian.com>
29240
29241         * support.cs (ReflectionParameters): Fix logic to determine
29242         whether the last parameter is a params one. Test 9 passes again.
29243
29244         * delegate.cs (Populate): Register the builders we define with
29245         RegisterParameterForBuilder. Test 19 passes again.
29246
29247         * cs-parser.jay (property_declaration): Reference $6 instead
29248         of $$ to get at the location.
29249
29250         (indexer_declaration): Similar stuff.
29251
29252         (attribute): Ditto.
29253
29254         * class.cs (Property): Register parameters for the Get and Set methods
29255         if they exist. Test 23 passes again.
29256
29257         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
29258         call to EmitArguments as we are sure there aren't any params arguments. 
29259         Test 32 passes again.
29260
29261         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
29262         IndexOutOfRangeException. 
29263
29264         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
29265         Test 33 now passes again.
29266
29267 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
29268
29269         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
29270         broke a bunch of things.  Will have to come up with a better way
29271         of tracking locations.
29272
29273         * statement.cs: Implemented foreach for single dimension arrays.
29274
29275 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29276
29277         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
29278         an error.  This removes the lookup from the critical path.
29279
29280         * cs-parser.jay: Removed use of temporary_loc, which is completely
29281         broken. 
29282
29283 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
29284
29285         * support.cs (ReflectionParameters.ParameterModifier): Report
29286         whether the argument is a PARAMS argument or not.
29287
29288         * class.cs: Set the attribute `ParamArrayAttribute' on the
29289         parameter argument.
29290
29291         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
29292         and cons_param_array_attribute (ConstructorInfo for
29293         ParamArrayAttribute)., 
29294
29295         * codegen.cs: Emit the return using the `Return' statement, that
29296         way we can report the error correctly for missing return values. 
29297
29298         * class.cs (Method.Emit): Clean up.
29299
29300         * expression.cs (Argument.Resolve): Take another argument: the
29301         location where this argument is used.  Notice that this is not
29302         part of the "Argument" class as to reduce the size of the
29303         structure (we know the approximate location anyways).
29304
29305         Test if the argument is a variable-reference, if not, then
29306         complain with a 206.
29307
29308         (Argument.Emit): Emit addresses of variables.
29309
29310         (Argument.FullDesc): Simplify.
29311
29312         (Invocation.DoResolve): Update for Argument.Resolve.
29313
29314         (ElementAccess.DoResolve): ditto.
29315
29316         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29317         method should be virtual, as this method is always virtual.
29318
29319         (NewDelegate.DoResolve): Update for Argument.Resolve.
29320
29321         * class.cs (ConstructorInitializer.DoResolve): ditto.
29322
29323         * attribute.cs (Attribute.Resolve): ditto.
29324
29325 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
29326
29327         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29328
29329         * expression.cs (ParameterReference): Drop IStackStorage and implement
29330         IAssignMethod instead. 
29331
29332         (LocalVariableReference): ditto.
29333
29334         * ecore.cs (FieldExpr): Drop IStackStorage and implement
29335         IAssignMethod instead. 
29336
29337 2001-11-13  Miguel de Icaza <miguel@ximian.com>
29338
29339         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29340         enumerations that are used in heavily used structures derive from
29341         byte in a laughable and pathetic attempt to reduce memory usage.
29342         This is the kind of pre-optimzations that you should not do at
29343         home without adult supervision.
29344
29345         * expression.cs (UnaryMutator): New class, used to handle ++ and
29346         -- separatedly from the other unary operators.  Cleans up the
29347         code, and kills the ExpressionStatement dependency in Unary.
29348
29349         (Unary): Removed `method' and `Arguments' from this class, making
29350         it smaller, and moving it all to SimpleCall, so I can reuse this
29351         code in other locations and avoid creating a lot of transient data
29352         strucutres when not required.
29353
29354         * cs-parser.jay: Adjust for new changes.
29355
29356 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
29357
29358         * enum.cs (Enum.Populate): If there is a failure during
29359         definition, return
29360
29361         * cs-parser.jay (opt_enum_base): we used to catch type errors
29362         here, but this is really incorrect.  The type error should be
29363         catched during semantic analysis.
29364
29365 2001-12-11  Ravi Pratap  <ravi@ximian.com>
29366
29367         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29368         current_local_parameters as expected since I, in my stupidity, had forgotten
29369         to do this :-)
29370
29371         * attribute.cs (GetValidPlaces): Fix stupid bug.
29372
29373         * class.cs (Method::Emit): Perform check on applicability of attributes.
29374
29375         (Constructor::Emit): Ditto.
29376
29377         (Field::Emit): Ditto.
29378
29379         (Field.Location): Store location information.
29380
29381         (Property, Event, Indexer, Operator): Ditto.
29382
29383         * cs-parser.jay (field_declaration): Pass in location for each field.
29384
29385         * ../errors/cs0592.cs : Add.
29386
29387 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29388
29389         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29390
29391         (InitCoreTypes): Update accordingly.
29392
29393         (RegisterAttrType, LookupAttr): Implement.
29394
29395         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29396         info about the same.
29397
29398         (Resolve): Update to populate the above as necessary.
29399
29400         (Error592): Helper.
29401
29402         (GetValidPlaces): Helper to the above.
29403
29404         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29405
29406         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29407
29408 2001-11-12  Ravi Pratap  <ravi@ximian.com>
29409
29410         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29411
29412         * ../errors/cs0617.cs : Add.
29413
29414 2001-11-11  Ravi Pratap  <ravi@ximian.com>
29415
29416         * enum.cs (Emit): Rename to Populate to be more consistent with what
29417         we expect it to do and when exactly it is called.
29418
29419         * class.cs, rootcontext.cs : Update accordingly.
29420
29421         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29422         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29423
29424         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29425
29426         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29427         of a fieldinfo using the above, when dealing with a FieldBuilder.
29428
29429 2001-11-10  Ravi Pratap  <ravi@ximian.com>
29430
29431         * ../errors/cs0031.cs : Add.
29432
29433         * ../errors/cs1008.cs : Add.
29434
29435         * ../errrors/cs0543.cs : Add.
29436
29437         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29438         enum type.
29439
29440         (FindMembers): Implement.
29441
29442         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29443         enums and delegates too.
29444
29445         (enum_types): Rename to builder_to_enum.
29446
29447         (delegate_types): Rename to builder_to_delegate.
29448
29449         * delegate.cs (FindMembers): Implement.
29450
29451 2001-11-09  Ravi Pratap  <ravi@ximian.com>
29452
29453         * typemanager.cs (IsEnumType): Implement.
29454
29455         * enum.cs (Emit): Re-write parts to account for the underlying type
29456         better and perform checking etc.
29457
29458         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29459         of the underlying type.
29460
29461         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29462         value
29463
29464         * enum.cs (error31): Helper to report error #31.
29465
29466         * cs-parser.jay (enum_declaration): Store location of each member too.
29467
29468         * enum.cs (member_to_location): New hashtable. 
29469
29470         (AddEnumMember): Update location hashtable.
29471
29472         (Emit): Use the location of each member while reporting errors.
29473
29474 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29475
29476         * cs-parser.jay: A for_initializer if is a
29477         local_variable_declaration really ammount to have an implicit
29478         block with the variable declaration and no initializer for for.
29479
29480         * statement.cs (For.Emit): Cope with null initializers.
29481
29482         This fixes the infinite loop on for initializers.
29483
29484 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
29485
29486         * enum.cs: More cleanup.
29487
29488         * ecore.cs: Remove dead code.
29489
29490         * class.cs (Property.Emit): More simplification.
29491         (Event.Emit): ditto.
29492
29493         Reworked to have less levels of indentation.
29494
29495 2001-11-08  Ravi Pratap  <ravi@ximian.com>
29496
29497         * class.cs (Property): Emit attributes.
29498
29499         (Field): Ditto.
29500
29501         (Event): Ditto.
29502
29503         (Indexer): Ditto.
29504
29505         (Operator): Ditto.
29506
29507         * enum.cs (Emit): Ditto.
29508
29509         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29510         Enums too.
29511
29512         * class.cs (Field, Event, etc.): Move attribute generation into the
29513         Emit method everywhere.
29514
29515         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29516         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29517         as we had no way of defining nested enums !
29518
29519         * rootcontext.cs : Adjust code accordingly.
29520
29521         * typemanager.cs (AddEnumType): To keep track of enum types separately.
29522
29523 2001-11-07  Ravi Pratap  <ravi@ximian.com>
29524
29525         * expression.cs (EvalConstantExpression): Move into ecore.cs
29526
29527         * enum.cs (Enum): Rename some members and make them public and readonly
29528         according to our convention.
29529
29530         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29531         nothing else.
29532
29533         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29534
29535         (Enum::Emit): Write a simple version for now which doesn't try to compute
29536         expressions. I shall modify this to be more robust in just a while.
29537
29538         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29539
29540         (TypeContainer::CloseType): Create the Enum types too.
29541
29542         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29543
29544         * expression.cs (EvalConstantExpression): Get rid of completely.
29545
29546         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29547         user-defined values and other cases.
29548
29549         (IsValidEnumLiteral): Helper function.
29550
29551         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
29552         out there in the case we had a literal FieldExpr.
29553
29554         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29555
29556         (Literalize): Revamp a bit to take two arguments.
29557
29558         (EnumLiteral): New class which derives from Literal to wrap enum literals.
29559
29560 2001-11-06  Ravi Pratap  <ravi@ximian.com>
29561
29562         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29563
29564         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29565
29566         (Resolve): Use the above to ensure we have proper initializers.
29567
29568 2001-11-05  Ravi Pratap  <ravi@ximian.com>
29569
29570         * expression.cs (Expression::EvalConstantExpression): New method to 
29571         evaluate constant expressions.
29572
29573         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29574
29575 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29576
29577         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29578         in an array.
29579
29580         (Binary.ResolveOperator): Handle operator != (object a, object b)
29581         and operator == (object a, object b);
29582
29583         (Binary.DoNumericPromotions): Indicate whether the numeric
29584         promotion was possible.
29585
29586         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29587         Implement.  
29588
29589         Made the ArrayAccess implement interface IAssignMethod instead of
29590         IStackStore as the order in which arguments are passed reflects
29591         this.
29592
29593         * assign.cs: Instead of using expr.ExprClass to select the way of
29594         assinging, probe for the IStackStore/IAssignMethod interfaces.
29595
29596         * typemanager.cs: Load InitializeArray definition.
29597
29598         * rootcontext.cs (RootContext.MakeStaticData): Used to define
29599         static data that can be used to initialize arrays. 
29600
29601 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
29602
29603         * expression.cs: Handle operator== and operator!= for booleans.
29604
29605         (Conditioal.Reduce): Implement reducer for the ?: operator.
29606
29607         (Conditional.Resolve): Implement dead code elimination.
29608
29609         (Binary.Resolve): Catch string literals and return a new
29610         concatenated string.
29611
29612         (Unary.Reduce): Implement reduction of unary expressions.
29613
29614         * ecore.cs: Split out the expression core handling here.
29615
29616         (Expression.Reduce): New method used to perform constant folding
29617         and CSE.  This is needed to support constant-expressions. 
29618
29619         * statement.cs (Statement.EmitBoolExpression): Pass true and false
29620         targets, and optimize for !x.
29621
29622 2001-11-04  Ravi Pratap  <ravi@ximian.com>
29623
29624         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29625         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29626         set custom atttributes.
29627
29628         * literal.cs (Literal::GetValue): New abstract method to return the actual
29629         value of the literal, cast as an object.
29630
29631         (*Literal): Implement GetValue method.
29632
29633         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29634         expressions to the arraylist but objects of type Argument.
29635
29636         * class.cs (TypeContainer::Emit): Emit our attributes too.
29637
29638         (Method::Emit, Constructor::Emit): Ditto.
29639
29640         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29641         to be ignoring earlier.
29642
29643 2001-11-03  Ravi Pratap  <ravi@ximian.com>
29644
29645         * attribute.cs (AttributeSection::Define): Implement to do the business
29646         of constructing a CustomAttributeBuilder.
29647
29648         (Attribute): New trivial class. Increases readability of code.  
29649
29650         * cs-parser.jay : Update accordingly.
29651
29652         (positional_argument_list, named_argument_list, named_argument): New rules
29653
29654         (attribute_arguments): Use the above so that we are more correct.
29655
29656 2001-11-02  Ravi Pratap  <ravi@ximian.com>
29657
29658         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29659         to perform all checks for a method with a params parameter.
29660
29661         (Invocation::OverloadResolve): Update to use the above method and therefore
29662         cope correctly with params method invocations.
29663
29664         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
29665         params too.
29666
29667         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29668         constructors in our parent too because we can't afford to miss out on 
29669         protected ones ;-)
29670
29671         * attribute.cs (AttributeSection): New name for the class Attribute
29672
29673         Other trivial changes to improve readability.
29674
29675         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29676         use the new class names.
29677
29678 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29679
29680         * class.cs (Method::Define): Complete definition for params types too
29681
29682         (Indexer::Define): Ditto.
29683
29684         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29685         Cope everywhere with a request for info about the array parameter.
29686
29687 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29688
29689         * tree.cs (RecordNamespace): Fix up to check for the correct key.
29690
29691         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
29692         local_variable_type to extract the string corresponding to the type.
29693
29694         (local_variable_type): Fixup the action to use the new helper method.
29695
29696         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
29697         go.
29698
29699         * expression.cs : Clean out code which uses the above.
29700
29701 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29702
29703         * typemanager.cs (RegisterMethod): Check if we already have an existing key
29704         and bale out if necessary by returning a false.
29705
29706         (RegisterProperty): Ditto.
29707
29708         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29709         and print out appropriate error messages.
29710
29711         * interface.cs (everywhere): Ditto.
29712
29713         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29714         location to constructor.
29715
29716         * class.cs (Property, Event, Indexer): Update accordingly.
29717
29718         * ../errors/cs111.cs : Added.
29719
29720         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29721         of a method, as laid down by the spec.
29722
29723         (Invocation::OverloadResolve): Use the above method.
29724
29725 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29726
29727         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29728         now take a TypeContainer and a Parameters object.
29729
29730         (ParameterData): Modify return type of ParameterModifier method to be 
29731         Parameter.Modifier and not a string.
29732
29733         (ReflectionParameters, InternalParameters): Update accordingly.
29734
29735         * expression.cs (Argument::GetParameterModifier): Same here.
29736
29737         * support.cs (InternalParameters::ParameterType): Find a better way of determining
29738         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29739         symbol in it at all so maybe this is only for now.
29740
29741 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29742
29743         * support.cs (InternalParameters): Constructor now takes an extra argument 
29744         which is the actual Parameters class.
29745
29746         (ParameterDesc): Update to provide info on ref/out modifiers.
29747
29748         * class.cs (everywhere): Update call to InternalParameters to pass in
29749         the second argument too.
29750
29751         * support.cs (ParameterData): Add ParameterModifier, which is a method 
29752         to return the modifier info [ref/out etc]
29753
29754         (InternalParameters, ReflectionParameters): Implement the above.
29755
29756         * expression.cs (Argument::ParameterModifier): Similar function to return
29757         info about the argument's modifiers.
29758
29759         (Invocation::OverloadResolve): Update to take into account matching modifiers 
29760         too.
29761
29762         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29763         a new SetFormalParameters object which we pass to InternalParameters.
29764
29765 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29766
29767         * expression.cs (NewArray): Merge into the ArrayCreation class.
29768
29769 2001-10-29  Ravi Pratap  <ravi@ximian.com>
29770
29771         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
29772         NewUserdefinedArray into one as there wasn't much of a use in having
29773         two separate ones.
29774
29775         * expression.cs (Argument): Change field's name to ArgType from Type.
29776
29777         (Type): New readonly property which returns the proper type, taking into 
29778         account ref/out modifiers.
29779
29780         (everywhere): Adjust code accordingly for the above.
29781
29782         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29783         whether we are emitting for a ref or out parameter.
29784
29785         * expression.cs (Argument::Emit): Use the above field to set the state.
29786
29787         (LocalVariableReference::Emit): Update to honour the flag and emit the
29788         right stuff.
29789
29790         * parameter.cs (Attributes): Set the correct flags for ref parameters.
29791
29792         * expression.cs (Argument::FullDesc): New function to provide a full desc.
29793
29794         * support.cs (ParameterData): Add method ParameterDesc to the interface.
29795
29796         (ReflectionParameters, InternalParameters): Implement the above method.
29797
29798         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29799         reporting errors.
29800
29801         (Invocation::FullMethodDesc): Ditto. 
29802
29803 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
29804
29805         * cs-parser.jay: Add extra production for the second form of array
29806         creation. 
29807
29808         * expression.cs (ArrayCreation): Update to reflect the above
29809         change. 
29810
29811         * Small changes to prepare for Array initialization.
29812
29813 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
29814
29815         * typemanager.cs (ImplementsInterface): interface might be null;
29816         Deal with this problem;
29817
29818         Also, we do store negative hits on the cache (null values), so use
29819         this instead of calling t.GetInterfaces on the type everytime.
29820
29821 2001-10-28  Ravi Pratap  <ravi@ximian.com>
29822
29823         * typemanager.cs (IsBuiltinType): New method to help determine the same.
29824
29825         * expression.cs (New::DoResolve): Get rid of array creation code and instead
29826         split functionality out into different classes.
29827
29828         (New::FormArrayType): Move into NewBuiltinArray.
29829
29830         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29831         quite useless.
29832
29833         (NewBuiltinArray): New class to handle creation of built-in arrays.
29834
29835         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29836         account creation of one-dimensional arrays.
29837
29838         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29839
29840         (NewUserdefinedArray::DoResolve): Implement.
29841
29842         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29843
29844         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29845         we maintain inside the TypeManager. This is necessary to perform lookups on the
29846         module builder.
29847
29848         (LookupType): Update to perform GetType on the module builders too.     
29849
29850         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29851
29852         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29853
29854 2001-10-23  Ravi Pratap  <ravi@ximian.com>
29855
29856         * expression.cs (New::DoResolve): Implement guts of array creation.
29857
29858         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29859
29860 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29861
29862         * expression.cs: Fix bug I introduced lsat night that broke
29863         Delegates. 
29864
29865         (Expression.Resolve): Report a 246 error (can not resolve name)
29866         if we find a SimpleName in the stream.
29867
29868         (Expression.ResolveLValue): Ditto.
29869
29870         (Expression.ResolveWithSimpleName): This function is a variant of
29871         ResolveName, this one allows SimpleNames to be returned without a
29872         warning.  The only consumer of SimpleNames is MemberAccess
29873
29874 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29875
29876         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29877         might arrive here.  I have my doubts that this is correct.
29878
29879         * statement.cs (Lock): Implement lock statement.
29880
29881         * cs-parser.jay: Small fixes to support `lock' and `using'
29882
29883         * cs-tokenizer.cs: Remove extra space
29884
29885         * driver.cs: New flag --checked, allows to turn on integer math
29886         checking. 
29887
29888         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29889         Threading.Monitor.Exit 
29890
29891 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29892
29893         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29894         Expression Class to be IndexerAccess.
29895
29896         Notice that Indexer::DoResolve sets the eclass to Value.
29897
29898 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29899
29900         * class.cs (TypeContainer::Emit): Emit code for indexers.
29901
29902         * assign.cs (IAssignMethod): New interface implemented by Indexers
29903         and Properties for handling assignment.
29904
29905         (Assign::Emit): Simplify and reuse code. 
29906
29907         * expression.cs (IndexerAccess, PropertyExpr): Implement
29908         IAssignMethod, clean up old code. 
29909
29910 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29911
29912         * typemanager.cs (ImplementsInterface): New method to determine if a type
29913         implements a given interface. Provides a nice cache too.
29914
29915         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29916         method.
29917
29918         (ConvertReferenceExplicit): Ditto.
29919
29920         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29921         various methods, with correct names etc.
29922
29923         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29924         Operator.UnaryNegation.
29925
29926         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29927         we have a unary plus or minus operator.
29928
29929         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29930         UnaryMinus.
29931
29932         * everywhere : update accordingly.
29933
29934         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29935         respectively.
29936
29937         * class.cs (Method::Define): For the case where we are implementing a method
29938         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29939         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29940
29941 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29942
29943         * interface.cs (FindMembers): Implement to work around S.R.E
29944         lameness.
29945
29946         * typemanager.cs (IsInterfaceType): Implement.
29947
29948         (FindMembers): Update to handle interface types too.
29949
29950         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29951         use IsAssignableFrom as that is not correct - it doesn't work.
29952
29953         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29954         and accordingly override EmitStatement.
29955
29956         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29957         using the correct logic :-)
29958
29959 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29960
29961         * ../errors/cs-11.cs : Add to demonstrate error -11 
29962
29963 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29964
29965         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29966         then pass this as a hint to ResolveLValue.
29967
29968         * expression.cs (FieldExpr): Add Location information
29969
29970         (FieldExpr::LValueResolve): Report assignment to readonly
29971         variable. 
29972
29973         (Expression::ExprClassFromMemberInfo): Pass location information.
29974
29975         (Expression::ResolveLValue): Add new method that resolves an
29976         LValue. 
29977
29978         (Expression::DoResolveLValue): Default invocation calls
29979         DoResolve. 
29980
29981         (Indexers): New class used to keep track of indexers in a given
29982         Type. 
29983
29984         (IStackStore): Renamed from LValue, as it did not really describe
29985         what this did.  Also ResolveLValue is gone from this interface and
29986         now is part of Expression.
29987
29988         (ElementAccess): Depending on the element access type
29989
29990         * typemanager.cs: Add `indexer_name_type' as a Core type
29991         (System.Runtime.CompilerServices.IndexerNameAttribute)
29992
29993         * statement.cs (Goto): Take a location.
29994
29995 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29996
29997         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29998         if two delegates are compatible.
29999
30000         (NewDelegate::DoResolve): Update to take care of the case when
30001         we instantiate a delegate from another delegate.
30002
30003         * typemanager.cs (FindMembers): Don't even try to look up members
30004         of Delegate types for now.
30005
30006 2001-10-18  Ravi Pratap  <ravi@ximian.com>
30007
30008         * delegate.cs (NewDelegate): New class to take care of delegate
30009         instantiation.
30010
30011         * expression.cs (New): Split the delegate related code out into 
30012         the NewDelegate class.
30013
30014         * delegate.cs (DelegateInvocation): New class to handle delegate 
30015         invocation.
30016
30017         * expression.cs (Invocation): Split out delegate related code into
30018         the DelegateInvocation class.
30019
30020 2001-10-17  Ravi Pratap  <ravi@ximian.com>
30021
30022         * expression.cs (New::DoResolve): Implement delegate creation fully
30023         and according to the spec.
30024
30025         (New::DoEmit): Update to handle delegates differently.
30026
30027         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
30028         because of which we were printing out arguments in reverse order !
30029
30030         * delegate.cs (VerifyMethod): Implement to check if the given method
30031         matches the delegate.
30032
30033         (FullDelegateDesc): Implement.
30034
30035         (VerifyApplicability): Implement.
30036
30037         * expression.cs (Invocation::DoResolve): Update to accordingly handle
30038         delegate invocations too.
30039
30040         (Invocation::Emit): Ditto.
30041
30042         * ../errors/cs1593.cs : Added.
30043
30044         * ../errors/cs1594.cs : Added.
30045
30046         * delegate.cs (InstanceExpression, TargetMethod): New properties.
30047
30048 2001-10-16  Ravi Pratap  <ravi@ximian.com>
30049
30050         * typemanager.cs (intptr_type): Core type for System.IntPtr
30051
30052         (InitCoreTypes): Update for the same.
30053
30054         (iasyncresult_type, asynccallback_type): Ditto.
30055
30056         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
30057         correct.
30058
30059         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
30060         too.
30061
30062         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
30063         the builders for the 4 members of a delegate type :-)
30064
30065         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
30066         type.
30067
30068         * expression.cs (New::DoResolve): Implement guts for delegate creation.
30069
30070         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
30071
30072 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
30073
30074         * statement.cs (Break::Emit): Implement.   
30075         (Continue::Emit): Implement.
30076
30077         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
30078         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
30079         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
30080         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
30081         end loop
30082
30083         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
30084         properties that track the label for the current loop (begin of the
30085         loop and end of the loop).
30086
30087 2001-10-15  Ravi Pratap  <ravi@ximian.com>
30088
30089         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
30090         use of emitting anything at all.
30091
30092         * class.cs, rootcontext.cs : Get rid of calls to the same.
30093
30094         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
30095
30096         (Populate): Define the constructor correctly and set the implementation
30097         attributes.
30098
30099         * typemanager.cs (delegate_types): New hashtable to hold delegates that
30100         have been defined.
30101
30102         (AddDelegateType): Implement.
30103
30104         (IsDelegateType): Implement helper method.
30105
30106         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
30107
30108         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
30109         and accordingly handle it.
30110
30111         * delegate.cs (Populate): Take TypeContainer argument.
30112         Implement bits to define the Invoke method. However, I still haven't figured out
30113         how to take care of the native int bit :-(
30114
30115         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
30116         Qualify the name of the delegate, not its return type !
30117
30118         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
30119         conversion.
30120
30121         (StandardConversionExists): Checking for array types turns out to be recursive.
30122
30123         (ConvertReferenceExplicit): Implement array conversion.
30124
30125         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
30126
30127 2001-10-12  Ravi Pratap  <ravi@ximian.com>
30128
30129         * cs-parser.jay (delegate_declaration): Store the fully qualified
30130         name as it is a type declaration.
30131
30132         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
30133         readonly.
30134
30135         (DefineDelegate): Renamed from Define. Does the same thing essentially,
30136         as TypeContainer::DefineType.
30137
30138         (Populate): Method in which all the definition of the various methods (Invoke)
30139         etc is done.
30140
30141         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
30142         see.
30143
30144         (CloseDelegate): Finally creates the delegate.
30145
30146         * class.cs (TypeContainer::DefineType): Update to define delegates.
30147         (Populate, Emit and CloseType): Do the same thing here too.
30148
30149         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
30150         delegates in all these operations.
30151
30152 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
30153
30154         * expression.cs: LocalTemporary: a new expression used to
30155         reference a temporary that has been created.
30156
30157         * assign.cs: Handle PropertyAccess back here, so that we can
30158         provide the proper semantic access to properties.
30159
30160         * expression.cs (Expression::ConvertReferenceExplicit): Implement
30161         a few more explicit conversions. 
30162
30163         * modifiers.cs: `NEW' modifier maps to HideBySig.
30164
30165         * expression.cs (PropertyExpr): Make this into an
30166         ExpressionStatement, and support the EmitStatement code path. 
30167
30168         Perform get/set error checking, clean up the interface.
30169
30170         * assign.cs: recognize PropertyExprs as targets, and if so, turn
30171         them into toplevel access objects.
30172
30173 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
30174
30175         * expression.cs: PropertyExpr::PropertyExpr: use work around the
30176         SRE.
30177
30178         * typemanager.cs: Keep track here of our PropertyBuilders again to
30179         work around lameness in SRE.
30180
30181 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
30182
30183         * expression.cs (LValue::LValueResolve): New method in the
30184         interface, used to perform a second resolution pass for LValues. 
30185
30186         (This::DoResolve): Catch the use of this in static methods.
30187
30188         (This::LValueResolve): Implement.
30189
30190         (This::Store): Remove warning, assigning to `this' in structures
30191         is 
30192
30193         (Invocation::Emit): Deal with invocation of
30194         methods on value types.  We need to pass the address to structure
30195         methods rather than the object itself.  (The equivalent code to
30196         emit "this" for structures leaves the entire structure on the
30197         stack instead of a pointer to it). 
30198
30199         (ParameterReference::DoResolve): Compute the real index for the
30200         argument based on whether the method takes or not a `this' pointer
30201         (ie, the method is static).
30202
30203         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
30204         value types returned from functions when we need to invoke a
30205         method on the sturcture.
30206
30207
30208 2001-10-11  Ravi Pratap  <ravi@ximian.com>
30209
30210         * class.cs (TypeContainer::DefineType): Method to actually do the business of
30211         defining the type in the Modulebuilder or Typebuilder. This is to take
30212         care of nested types which need to be defined on the TypeBuilder using
30213         DefineNestedMethod.
30214
30215         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
30216         methods in RootContext, only ported to be part of TypeContainer.
30217
30218         (TypeContainer::GetInterfaceOrClass): Ditto.
30219
30220         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
30221
30222         * interface.cs (Interface::DefineInterface): New method. Does exactly
30223         what RootContext.CreateInterface did earlier, only it takes care of nested types 
30224         too.
30225
30226         (Interface::GetInterfaces): Move from RootContext here and port.
30227
30228         (Interface::GetInterfaceByName): Same here.
30229
30230         * rootcontext.cs (ResolveTree): Re-write.
30231
30232         (PopulateTypes): Re-write.
30233
30234         * class.cs (TypeContainer::Populate): Populate nested types too.
30235         (TypeContainer::Emit): Emit nested members too.
30236
30237         * typemanager.cs (AddUserType): Do not make use of the FullName property,
30238         instead just use the name argument passed in as it is already fully
30239         qualified.
30240
30241         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
30242         to TypeContainer mapping to see if a type is user-defined.
30243
30244         * class.cs (TypeContainer::CloseType): Implement. 
30245
30246         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
30247         the default constructor.
30248
30249         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
30250         twice.
30251
30252         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
30253
30254         * interface.cs (CloseType): Create the type here.
30255
30256         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
30257         the hierarchy.
30258
30259         Remove all the methods which are now in TypeContainer.
30260
30261 2001-10-10  Ravi Pratap  <ravi@ximian.com>
30262
30263         * delegate.cs (Define): Re-write bits to define the delegate
30264         correctly.
30265
30266 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
30267
30268         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
30269
30270         * expression.cs (ImplicitReferenceConversion): handle null as well
30271         as a source to convert to any reference type.
30272
30273         * statement.cs (Return): Perform any implicit conversions to
30274         expected return type.  
30275
30276         Validate use of return statement.  
30277
30278         * codegen.cs (EmitContext): Pass the expected return type here.
30279
30280         * class.cs (Method, Constructor, Property): Pass expected return
30281         type to EmitContext.
30282
30283 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
30284
30285         * expression.cs: Make DoResolve take an EmitContext instead of a
30286         TypeContainer.
30287
30288         Replaced `l' and `location' for `loc', for consistency.
30289
30290         (Error, Warning): Remove unneeded Tc argument.
30291
30292         * assign.cs, literal.cs, constant.cs: Update to new calling
30293         convention. 
30294
30295         * codegen.cs: EmitContext now contains a flag indicating whether
30296         code is being generated in a static method or not.
30297
30298         * cs-parser.jay: DecomposeQI, new function that replaces the old
30299         QualifiedIdentifier.  Now we always decompose the assembled
30300         strings from qualified_identifier productions into a group of
30301         memberaccesses.
30302
30303 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
30304
30305         * rootcontext.cs: Deal with field-less struct types correctly now
30306         by passing the size option to Define Type.
30307
30308         * class.cs: Removed hack that created one static field. 
30309
30310 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30311
30312         * statement.cs: Moved most of the code generation here. 
30313
30314 2001-10-09  Ravi Pratap  <ravi@ximian.com>
30315
30316         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30317         seem very right.
30318
30319         (ElementAccess): Remove useless bits for now - keep checks as the spec
30320         says.
30321
30322 2001-10-08  Ravi Pratap  <ravi@ximian.com>
30323
30324         * expression.cs (ElementAccess::DoResolve): Remove my crap code
30325         and start performing checks according to the spec.
30326
30327 2001-10-07  Ravi Pratap  <ravi@ximian.com>
30328
30329         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30330         rank_specifiers instead.
30331
30332         (rank_specifiers): Change the order in which the rank specifiers are stored
30333
30334         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30335
30336         * expression.cs (ElementAccess): Implement the LValue interface too.
30337
30338 2001-10-06  Ravi Pratap  <ravi@ximian.com>
30339
30340         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30341         except that user defined conversions are not included.
30342
30343         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
30344         perform the conversion of the return type, if necessary.
30345
30346         (New::DoResolve): Check whether we are creating an array or an object
30347         and accordingly do the needful.
30348
30349         (New::Emit): Same here.
30350
30351         (New::DoResolve): Implement guts of array creation.
30352
30353         (New::FormLookupType): Helper function.
30354
30355 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
30356
30357         * codegen.cs: Removed most of the code generation here, and move the
30358         corresponding code generation bits to the statement classes. 
30359
30360         Added support for try/catch/finalize and throw.
30361
30362         * cs-parser.jay: Added support for try/catch/finalize.
30363
30364         * class.cs: Catch static methods having the flags override,
30365         virtual or abstract.
30366
30367         * expression.cs (UserCast): This user cast was not really doing
30368         what it was supposed to do.  Which is to be born in fully resolved
30369         state.  Parts of the resolution were being performed at Emit time! 
30370
30371         Fixed this code.
30372
30373 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30374
30375         * expression.cs: Implicity convert the result from UserCast.
30376
30377 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30378
30379         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30380         prevented it from working correctly. 
30381
30382         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30383         merely ConvertImplicit.
30384
30385 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
30386
30387         * typemanager.cs: Make the LookupTypeContainer function static,
30388         and not per-instance.  
30389
30390         * class.cs: Make static FindMembers (the one that takes a Type
30391         argument). 
30392
30393         * codegen.cs: Add EmitForeach here.
30394
30395         * cs-parser.jay: Make foreach a toplevel object instead of the
30396         inline expansion, as we need to perform semantic analysis on it. 
30397
30398 2001-10-05  Ravi Pratap  <ravi@ximian.com>
30399
30400         * expression.cs (Expression::ImplicitUserConversion): Rename to
30401         UserDefinedConversion.
30402
30403         (Expression::UserDefinedConversion): Take an extra argument specifying 
30404         whether we look for explicit user conversions too.
30405
30406         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30407
30408         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30409
30410         (ExplicitUserConversion): Make it a call to UserDefinedConversion
30411         with the appropriate arguments.
30412
30413         * cs-parser.jay (cast_expression): Record location too.
30414
30415         * expression.cs (Cast): Record location info.
30416
30417         (Expression::ConvertExplicit): Take location argument.
30418
30419         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30420         to determine if we are doing explicit conversions.
30421
30422         (UserCast::Emit): Update accordingly.
30423
30424         (Expression::ConvertExplicit): Report an error if everything fails.
30425
30426         * ../errors/cs0030.cs : Add.
30427
30428 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
30429
30430         * modifiers.cs: If the ABSTRACT keyword is present, also set the
30431         virtual and newslot bits. 
30432
30433         * class.cs (TypeContainer::RegisterRequiredImplementations):
30434         Record methods we need.
30435
30436         (TypeContainer::MakeKey): Helper function to make keys for
30437         MethodBases, since the Methodbase key is useless.
30438
30439         (TypeContainer::Populate): Call RegisterRequiredImplementations
30440         before defining the methods.   
30441
30442         Create a mapping for method_builders_to_methods ahead of time
30443         instead of inside a tight loop.
30444
30445         (::RequireMethods):  Accept an object as the data to set into the
30446         hashtable so we can report interface vs abstract method mismatch.
30447
30448 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30449
30450         * report.cs: Make all of it static.
30451
30452         * rootcontext.cs: Drop object_type and value_type computations, as
30453         we have those in the TypeManager anyways.
30454
30455         Drop report instance variable too, now it is a global.
30456
30457         * driver.cs: Use try/catch on command line handling.
30458
30459         Add --probe option to debug the error reporting system with a test
30460         suite. 
30461
30462         * report.cs: Add support for exiting program when a probe
30463         condition is reached.
30464
30465 2001-10-03  Ravi Pratap  <ravi@ximian.com>
30466
30467         * expression.cs (Binary::DoNumericPromotions): Fix the case when
30468         we do a forcible conversion regardless of type, to check if 
30469         ForceConversion returns a null.
30470
30471         (Binary::error19): Use location to report error.
30472
30473         (Unary::error23): Use location here too.
30474
30475         * ../errors/cs0019.cs : Check in.
30476
30477         * ../errors/cs0023.cs : Check in.
30478
30479         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30480         case of a non-null MethodInfo object with a length of 0 !
30481
30482         (Binary::ResolveOperator): Flag error if overload resolution fails to find
30483         an applicable member - according to the spec :-)
30484         Also fix logic to find members in base types.
30485
30486         (Unary::ResolveOperator): Same here.
30487
30488         (Unary::report23): Change name to error23 and make first argument a TypeContainer
30489         as I was getting thoroughly confused between this and error19 :-)
30490
30491         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30492         (::FindMostEncompassedType): Implement.
30493         (::FindMostEncompassingType): Implement.
30494         (::StandardConversionExists): Implement.
30495
30496         (UserImplicitCast): Re-vamp. We now need info about most specific
30497         source and target types so that we can do the necessary conversions.
30498
30499         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30500         mathematical union with no duplicates.
30501
30502 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30503
30504         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30505         in order from base classes to child classes, so that we can in
30506         child classes look up in our parent for method names and
30507         attributes (required for handling abstract, virtual, new, override
30508         constructs: we need to instrospect our base class, and if we dont
30509         populate the classes in order, the introspection might be
30510         incorrect.  For example, a method could query its parent before
30511         the parent has any methods and would determine that the parent has
30512         no abstract methods (while it could have had them)).
30513
30514         (RootContext::CreateType): Record the order in which we define the
30515         classes.
30516
30517 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
30518
30519         * class.cs (TypeContainer::Populate): Also method definitions can
30520         fail now, keep track of this.
30521
30522         (TypeContainer::FindMembers): Implement support for
30523         DeclaredOnly/noDeclaredOnly flag.
30524
30525         (Constructor::Emit) Return the ConstructorBuilder.
30526
30527         (Method::Emit) Return the MethodBuilder. 
30528         Check for abstract or virtual methods to be public.
30529
30530         * rootcontext.cs (RootContext::CreateType): Register all the
30531         abstract methods required for the class to be complete and the
30532         interface methods that must be implemented. 
30533
30534         * cs-parser.jay: Report error 501 (method requires body if it is
30535         not marked abstract or extern).
30536
30537         * expression.cs (TypeOf::Emit): Implement.
30538
30539         * typemanager.cs: runtime_handle_type, new global type.
30540
30541         * class.cs (Property::Emit): Generate code for properties.
30542
30543 2001-10-02  Ravi Pratap  <ravi@ximian.com>
30544
30545         * expression.cs (Unary::ResolveOperator): Find operators on base type
30546         too - we now conform exactly to the spec.
30547
30548         (Binary::ResolveOperator): Same here.
30549
30550         * class.cs (Operator::Define): Fix minor quirk in the tests.
30551
30552         * ../errors/cs0215.cs : Added.
30553
30554         * ../errors/cs0556.cs : Added.
30555
30556         * ../errors/cs0555.cs : Added.
30557
30558 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30559
30560         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30561         single integer which is really efficient
30562
30563 2001-10-01  Ravi Pratap  <ravi@ximian.com>
30564
30565         *  expression.cs (Expression::ImplicitUserConversion): Use location
30566         even in the case when we are examining True operators.
30567  
30568         * class.cs (Operator::Define): Perform extensive checks to conform
30569         with the rules for operator overloading in the spec.
30570
30571         * expression.cs (Expression::ImplicitReferenceConversion): Implement
30572         some of the other conversions mentioned in the spec.
30573
30574         * typemanager.cs (array_type): New static member for the System.Array built-in
30575         type.
30576
30577         (cloneable_interface): For System.ICloneable interface.
30578
30579         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30580         we start resolving the tree and populating types.
30581
30582         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30583  
30584 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30585
30586         * expression.cs (Expression::ExprClassFromMemberInfo,
30587         Expression::Literalize): Create literal expressions from
30588         FieldInfos which are literals.
30589
30590         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30591         type casts, because they were wrong.  The test suite in tests
30592         caught these ones.
30593
30594         (ImplicitNumericConversion): ushort to ulong requires a widening
30595         cast. 
30596
30597         Int32 constant to long requires widening cast as well.
30598
30599         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30600         for integers because the type on the stack is not i4.
30601
30602 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
30603
30604         * expression.cs (report118): require location argument. 
30605
30606         * parameter.cs: Do not dereference potential null value.
30607
30608         * class.cs: Catch methods that lack the `new' keyword when
30609         overriding a name.  Report warnings when `new' is used without
30610         anything being there to override.
30611
30612         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30613
30614         * class.cs: Only add constructor to hashtable if it is non-null
30615         (as now constructors can fail on define).
30616
30617         (TypeManager, Class, Struct): Take location arguments.
30618
30619         Catch field instance initialization in structs as errors.
30620
30621         accepting_filter: a new filter for FindMembers that is static so
30622         that we dont create an instance per invocation.
30623
30624         (Constructor::Define): Catch errors where a struct constructor is
30625         parameterless 
30626
30627         * cs-parser.jay: Pass location information for various new
30628         constructs. 
30629
30630         * delegate.cs (Delegate): take a location argument.
30631
30632         * driver.cs: Do not call EmitCode if there were problesm in the
30633         Definition of the types, as many Builders wont be there. 
30634
30635         * decl.cs (Decl::Decl): Require a location argument.
30636
30637         * cs-tokenizer.cs: Handle properly hex constants that can not fit
30638         into integers, and find the most appropiate integer for it.
30639
30640         * literal.cs: Implement ULongLiteral.
30641
30642         * rootcontext.cs: Provide better information about the location of
30643         failure when CreateType fails.
30644
30645 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
30646
30647         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30648         as well.
30649
30650         * expression.cs (Binary::CheckShiftArguments): Add missing type
30651         computation.
30652         (Binary::ResolveOperator): Add type to the logical and and logical
30653         or, Bitwise And/Or and Exclusive Or code paths, it was missing
30654         before.
30655
30656         (Binary::DoNumericPromotions): In the case where either argument
30657         is ulong (and most signed types combined with ulong cause an
30658         error) perform implicit integer constant conversions as well.
30659
30660 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30661
30662         * expression.cs (UserImplicitCast): Method should always be
30663         non-null. 
30664         (Invocation::BetterConversion): Simplified test for IntLiteral.
30665
30666         (Expression::ImplicitNumericConversion): Split this routine out.
30667         Put the code that performs implicit constant integer conversions
30668         here. 
30669
30670         (Expression::Resolve): Become a wrapper around DoResolve so we can
30671         check eclass and type being set after resolve.
30672
30673         (Invocation::Badness): Remove this dead function
30674
30675         (Binary::ResolveOperator): Do not compute the expensive argumnets
30676         unless we have a union for it.
30677
30678         (Probe::Emit): Is needs to do an isinst and then
30679         compare against null.
30680
30681         (::CanConvert): Added Location argument.  If the Location argument
30682         is null (Location.Null), then we do not report errors.  This is
30683         used by the `probe' mechanism of the Explicit conversion.  We do
30684         not want to generate an error for something that the user
30685         explicitly requested to be casted.  But the pipeline for an
30686         explicit cast first tests for potential implicit casts.
30687
30688         So for now, if the Location is null, it means `Probe only' to
30689         avoid adding another argument.   Might have to revise this
30690         strategy later.
30691
30692         (ClassCast): New class used to type cast objects into arbitrary
30693         classes (used in Explicit Reference Conversions).
30694
30695         Implement `as' as well.
30696
30697         Reverted all the patches from Ravi below: they were broken:
30698
30699                 * The use of `level' as a mechanism to stop recursive
30700                   invocations is wrong.  That was there just to catch the
30701                   bug with a strack trace but not as a way of addressing
30702                   the problem.
30703
30704                   To fix the problem we have to *understand* what is going
30705                   on and the interactions and come up with a plan, not
30706                   just get things going.
30707
30708                 * The use of the type conversion cache that I proposed
30709                   last night had an open topic: How does this work across
30710                   protection domains.  A user defined conversion might not
30711                   be public in the location where we are applying the
30712                   conversion, a different conversion might be selected
30713                   (ie, private A->B (better) but public B->A (worse),
30714                   inside A, A->B applies, but outside it, B->A will
30715                   apply).
30716
30717                 * On top of that (ie, even if the above is solved),
30718                   conversions in a cache need to be abstract.  Ie, `To
30719                   convert from an Int to a Short use an OpcodeCast', not
30720                   `To convert from an Int to a Short use the OpcodeCast on
30721                   the variable 5' (which is what this patch was doing).
30722
30723 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30724
30725         * expression.cs (Invocation::ConversionExists): Re-write to use
30726         the conversion cache
30727
30728         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30729         cache all conversions done, not just user-defined ones.
30730
30731         (Invocation::BetterConversion): The real culprit. Use ConversionExists
30732         to determine if a conversion exists instead of acutually trying to 
30733         perform the conversion. It's faster too.
30734
30735         (Expression::ConvertExplicit): Modify to use ConversionExists to check
30736         and only then attempt the implicit conversion.
30737
30738 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30739
30740         * expression.cs (ConvertImplicit): Use a cache for conversions
30741         already found. Check level of recursion and bail out if necessary.
30742
30743 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30744
30745         * typemanager.cs (string_concat_string_string, string_concat_object_object):
30746         Export standard methods that we expect for string operations.
30747
30748         * statement.cs (Block::UsageWarning): Track usage of variables and
30749         report the errors for not used variables.
30750
30751         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30752         operator. 
30753
30754 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30755
30756         * codegen.cs: remove unnneded code 
30757
30758         * expression.cs: Removed BuiltinTypeAccess class
30759
30760         Fix the order in which implicit conversions are
30761         done.  
30762
30763         The previous fixed dropped support for boxed conversions (adding a
30764         test to the test suite now)
30765
30766         (UserImplicitCast::CanConvert): Remove test for source being null,
30767         that code is broken.  We should not feed a null to begin with, if
30768         we do, then we should track the bug where the problem originates
30769         and not try to cover it up here.
30770
30771         Return a resolved expression of type UserImplicitCast on success
30772         rather than true/false.  Ravi: this is what I was talking about,
30773         the pattern is to use a static method as a "constructor" for
30774         objects. 
30775
30776         Also, do not create arguments until the very last minute,
30777         otherwise we always create the arguments even for lookups that
30778         will never be performed. 
30779
30780         (UserImplicitCast::Resolve): Eliminate, objects of type
30781         UserImplicitCast are born in a fully resolved state. 
30782
30783         * typemanager.cs (InitCoreTypes): Init also value_type
30784         (System.ValueType). 
30785
30786         * expression.cs (Cast::Resolve): First resolve the child expression.
30787
30788         (LValue): Add new method AddressOf to be used by
30789         the `&' operator.  
30790
30791         Change the argument of Store to take an EmitContext instead of an
30792         ILGenerator, because things like FieldExpr need to be able to call
30793         their children expression to generate the instance code. 
30794
30795         (Expression::Error, Expression::Warning): Sugar functions for
30796         reporting errors.
30797
30798         (Expression::MemberLookup): Accept a TypeContainer instead of a
30799         Report as the first argument.
30800
30801         (Expression::ResolvePrimary): Killed.  I still want to improve
30802         this as currently the code is just not right.
30803
30804         (Expression::ResolveMemberAccess): Simplify, but it is still
30805         wrong. 
30806
30807         (Unary::Resolve): Catch errors in AddressOf operators.
30808
30809         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30810         index to a byte for the short-version, or the compiler will choose
30811         the wrong Emit call, which generates the wrong data.
30812
30813         (ParameterReference::Emit, ::Store): same.
30814
30815         (FieldExpr::AddressOf): Implement.
30816
30817         * typemanager.cs: TypeManager: made public variable instead of
30818         property.
30819
30820         * driver.cs: document --fatal.
30821
30822         * report.cs (ErrorMessage, WarningMessage): new names for the old
30823         Error and Warning classes.
30824
30825         * cs-parser.jay (member_access): Turn built-in access to types
30826         into a normal simplename
30827
30828 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30829
30830         * expression.cs (Invocation::BetterConversion): Fix to cope
30831         with q being null, since this was introducing a bug.
30832
30833         * expression.cs (ConvertImplicit): Do built-in conversions first.
30834
30835 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30836
30837         * expression.cs (UserImplicitCast::Resolve): Fix bug.
30838
30839 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30840
30841         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30842         I had introduced long ago (what's new ?).
30843
30844         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
30845         the work of all the checking. 
30846         (ConvertImplicit): Call CanConvert and only then create object if necessary.
30847         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30848
30849         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30850         that is the right way. 
30851
30852         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
30853         overloading resolution. Use everywhere instead of cutting and pasting code.
30854
30855         (Binary::ResolveOperator): Use MakeUnionSet.
30856
30857         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
30858         we have to convert to bool types. Not complete yet.
30859
30860 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30861
30862         * typemanager.cs (TypeManager::CSharpName): support ushort.
30863
30864         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30865         to provide an expression that performsn an implicit constant int
30866         conversion (section 6.1.6).
30867         (Expression::ConvertImplicitRequired): Reworked to include
30868         implicit constant expression conversions.
30869
30870         (Expression::ConvertNumericExplicit): Finished.
30871
30872         (Invocation::Emit): If InstanceExpression is null, then it means
30873         that we perform a call on this.
30874
30875 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30876
30877         * expression.cs (Unary::Emit): Remove some dead code.
30878         (Probe): Implement Resolve and Emit for `is'.
30879         (Expression::ConvertImplicitRequired): Attempt to do constant
30880         expression conversions here.  Maybe should be moved to
30881         ConvertImplicit, but I am not sure.
30882         (Expression::ImplicitLongConstantConversionPossible,
30883         Expression::ImplicitIntConstantConversionPossible): New functions
30884         that tell whether is it possible to apply an implicit constant
30885         expression conversion.
30886
30887         (ConvertNumericExplicit): Started work on explicit numeric
30888         conversions.
30889
30890         * cs-parser.jay: Update operator constants.
30891
30892         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30893         (Parameters::GetSignature): Hook up VerifyArgs here.
30894         (Parameters::VerifyArgs): Verifies that no two arguments have the
30895         same name. 
30896
30897         * class.cs (Operator): Update the operator names to reflect the
30898         ones that the spec expects (as we are just stringizing the
30899         operator names).
30900
30901         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30902         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30903         previous usage did only work for our methods.
30904         (Expression::ConvertImplicit): Handle decimal implicit numeric
30905         conversions as well.
30906         (Expression::InternalTypeConstructor): Used to invoke constructors
30907         on internal types for default promotions.
30908
30909         (Unary::Emit): Implement special handling for the pre/post
30910         increment/decrement for overloaded operators, as they need to have
30911         the same semantics as the other operators.
30912
30913         (Binary::ResolveOperator): ditto.
30914         (Invocation::ConversionExists): ditto.
30915         (UserImplicitCast::Resolve): ditto.
30916
30917 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30918
30919         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30920         operator, return after emitting body. Regression tests pass again !
30921
30922         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30923         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30924         (Invocation::OverloadResolve): Ditto.
30925         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30926
30927         * everywhere : update calls to the above methods accordingly.
30928
30929 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30930
30931         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30932
30933         * expression.cs (ExpressionStatement): New base class used for
30934         expressions that can appear in statements, so that we can provide
30935         an alternate path to generate expression that do not leave a value
30936         on the stack.
30937
30938         (Expression::Emit, and all the derivatives): We no longer return
30939         whether a value is left on the stack or not.  Every expression
30940         after being emitted leaves a single value on the stack.
30941
30942         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30943         facilties of ExpressionStatement if possible.
30944
30945         * cs-parser.jay: Update statement_expression.
30946
30947 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30948
30949         * driver.cs: Change the wording of message
30950
30951 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30952
30953         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30954         the type of the expression to the return type of the method if
30955         we have an overloaded operator match ! The regression tests pass again !
30956         (Unary::ResolveOperator): Ditto.
30957
30958         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30959         to find "op_Implicit", not "implicit" ;-)
30960         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30961         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30962
30963         * everywhere : Correct calls to the above accordingly.
30964
30965         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30966         (ConvertImplicit): Do user-defined conversion if it exists.
30967
30968 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30969
30970         * assign.cs: track location.
30971         (Resolve): Use implicit conversions on assignment.
30972
30973         * literal.cs: Oops.  Not good, Emit of short access values should
30974         pass (Bytes) or the wrong argument will be selected.
30975
30976         * expression.cs (Unary::Emit): Emit code for -expr.
30977
30978         (Unary::ResolveOperator): Handle `Substract' for non-constants
30979         (substract from zero from the non-constants).
30980         Deal with Doubles as well. 
30981
30982         (Expression::ConvertImplicitRequired): New routine that reports an
30983         error if no implicit conversion exists. 
30984
30985         (Invocation::OverloadResolve): Store the converted implicit
30986         expressions if we make them
30987
30988 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30989
30990         * class.cs (ConstructorInitializer): Take a Location argument.
30991         (ConstructorBaseInitializer): Same here.
30992         (ConstructorThisInitializer): Same here.
30993
30994         * cs-parser.jay : Update all calls accordingly.
30995
30996         * expression.cs (Unary, Binary, New): Take location argument.
30997         Update accordingly everywhere.
30998
30999         * cs-parser.jay : Update all calls to the above to take a location
31000         argument.
31001
31002         * class.cs : Ditto.
31003
31004 2001-09-24  Ravi Pratap  <ravi@ximian.com>
31005
31006         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
31007         (Invocation::BetterConversion): Same here
31008         (Invocation::ConversionExists): Ditto.
31009
31010         (Invocation::ConversionExists): Implement.
31011
31012 2001-09-22  Ravi Pratap  <ravi@ximian.com>
31013
31014         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
31015         Also take an additional TypeContainer argument.
31016
31017         * All over : Pass in TypeContainer as argument to OverloadResolve.
31018
31019         * typemanager.cs (CSharpName): Update to check for the string type and return
31020         that too.
31021
31022         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
31023         a given method.
31024
31025 2001-09-21  Ravi Pratap  <ravi@ximian.com>
31026
31027         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
31028         (Invocation::BetterFunction): Implement.
31029         (Invocation::BetterConversion): Implement.
31030         (Invocation::ConversionExists): Skeleton, no implementation yet.
31031
31032         Okay, things work fine !
31033
31034 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
31035
31036         * typemanager.cs: declare and load enum_type, delegate_type and
31037         void_type. 
31038
31039         * expression.cs (Expression::Emit): Now emit returns a value that
31040         tells whether a value is left on the stack or not.  This strategy
31041         might be reveted tomorrow with a mechanism that would address
31042         multiple assignments.
31043         (Expression::report118): Utility routine to report mismatches on
31044         the ExprClass.
31045
31046         (Unary::Report23): Report impossible type/operator combination
31047         utility function.
31048
31049         (Unary::IsIncrementableNumber): Whether the type can be
31050         incremented or decremented with add.
31051         (Unary::ResolveOperator): Also allow enumerations to be bitwise
31052         complemented. 
31053         (Unary::ResolveOperator): Implement ++, !, ~,
31054
31055         (Invocation::Emit): Deal with new Emit convetion.
31056
31057         * All Expression derivatives: Updated their Emit method to return
31058         whether they leave values on the stack or not.
31059
31060         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
31061         stack for expressions that are statements. 
31062
31063 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
31064
31065         * expression.cs (LValue): New interface.  Must be implemented by
31066         LValue objects.
31067         (LocalVariableReference, ParameterReference, FieldExpr): Implement
31068         LValue interface.
31069
31070         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
31071         interface for generating code, simplifies the code.
31072
31073 2001-09-20  Ravi Pratap  <ravi@ximian.com>
31074
31075         * expression.cs (everywhere): Comment out return statements in ::Resolve
31076         methods to avoid the warnings.
31077
31078 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
31079
31080         * driver.cs (parse): Report error 2001 if we can not open the
31081         source file.
31082
31083         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
31084         not resolve it.
31085
31086         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
31087         object. 
31088
31089         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
31090         otherwise nested blocks end up with the same index.
31091
31092         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
31093
31094         * expression.cs:  Instead of having FIXMEs in the Resolve
31095         functions, throw exceptions so it is obvious that we are facing a
31096         bug. 
31097
31098         * cs-parser.jay (invocation_expression): Pass Location information.
31099
31100         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
31101         Use a basename for those routines because .NET does not like paths
31102         on them. 
31103
31104         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
31105         already defined.
31106
31107 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
31108
31109         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
31110         are loading the correct data types (throws an exception if not).
31111         (TypeManager::InitCoreTypes): Use CoreLookupType
31112
31113         * expression.cs (Unary::ResolveOperator): return the child
31114         expression for expressions which are just +expr.
31115         (Unary::ResolveOperator): Return negative literals for -LITERAL
31116         expressions (otherwise they are Unary {Literal}).
31117         (Invocation::Badness): Take into account `Implicit constant
31118         expression conversions'.
31119
31120         * literal.cs (LongLiteral): Implement long literal class.
31121         (IntLiteral): export the `Value' of the intliteral. 
31122
31123 2001-09-19  Ravi Pratap  <ravi@ximian.com>
31124
31125         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
31126
31127         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
31128         instead of 'Operator'
31129
31130         * expression.cs (Binary::ResolveOperator): Update accordingly.
31131         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
31132         and 'Minus'
31133
31134         * cs-parser.jay (unary_expression): Update to use the new names.
31135
31136         * gen-treedump.cs (GetUnary): Same here.
31137
31138         * expression.cs (Unary::Resolve): Implement.
31139         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
31140         operators are found instead of making noise ;-)
31141         (Unary::ResolveOperator): New method to do precisely the same thing which
31142         Binary::ResolveOperator does for Binary expressions.
31143         (Unary.method, .Arguments): Add.
31144         (Unary::OperName): Implement.   
31145         (Unary::ForceConversion): Copy and Paste !
31146
31147         * class.cs (Operator::Define): Fix a small bug for the case when we have 
31148         a unary operator.
31149
31150         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
31151         for the inbuilt operators. Only overloading works for now ;-)
31152
31153 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
31154
31155         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
31156         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
31157
31158         * expression.cs (This::Emit): Implement. 
31159         (This::Resolve): Implement.
31160         (TypeOf:Resolve): Implement.
31161         (Expression::ResolveSimpleName): Add an implicit this to instance
31162         field references. 
31163         (MemberAccess::Resolve): Deal with Parameters and Fields. 
31164         Bind instance variable to Field expressions.
31165         (FieldExpr::Instance): New field used to track the expression that
31166         represents the object instance.
31167         (FieldExpr::Resolve): Track potential errors from MemberLookup not
31168         binding 
31169         (FieldExpr::Emit): Implement.
31170
31171         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
31172         the last instruction contains a return opcode to avoid generating
31173         the last `ret' instruction (this generates correct code, and it is
31174         nice to pass the peverify output).
31175
31176         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
31177         initializer for static and instance variables.
31178         (Constructor::Emit): Allow initializer to be null in the case of
31179         static constructors.  Only emit initializer for instance
31180         constructors. 
31181
31182         (TypeContainer::FindMembers): Return a null array if there are no
31183         matches.
31184
31185         Also fix the code for the MemberTypes.Method branch, as it was not
31186         scanning that for operators (or tried to access null variables before).
31187
31188         * assign.cs (Assign::Emit): Handle instance and static fields. 
31189
31190         * TODO: Updated.
31191
31192         * driver.cs: Stop compilation if there are parse errors.
31193
31194         * cs-parser.jay (constructor_declaration): Provide default base
31195         initializer for non-static constructors.
31196         (constructor_declarator): Do not provide a default base
31197         initializers if none was specified.
31198         Catch the fact that constructors should not have parameters.
31199
31200         * class.cs: Do not emit parent class initializers for static
31201         constructors, that should be flagged as an error.
31202
31203 2001-09-18  Ravi Pratap  <ravi@ximian.com>
31204
31205         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
31206         Move back code into TypeContainer::Populate.
31207
31208 2001-09-18  Ravi Pratap  <ravi@ximian.com>
31209
31210         * class.cs (TypeContainer::AddConstructor): Fix the check to
31211         compare against Name, not Basename. 
31212         (Operator::OpType): Change Plus and Minus to Add and Subtract.
31213
31214         * cs-parser.jay : Update accordingly.
31215
31216         * class.cs (TypeContainer::FindMembers): For the case where we are searching
31217         for methods, don't forget to look into the operators too.
31218         (RegisterMethodBuilder): Helper method to take care of this for
31219         methods, constructors and operators.
31220         (Operator::Define): Completely revamp.
31221         (Operator.OperatorMethod, MethodName): New fields.
31222         (TypeContainer::Populate): Move the registering of builders into
31223         RegisterMethodBuilder.
31224         (Operator::Emit): Re-write.
31225
31226         * expression.cs (Binary::Emit): Comment out code path to emit method
31227         invocation stuff for the case when we have a user defined operator. I am
31228         just not able to get it right !
31229
31230 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
31231
31232         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
31233         argument. 
31234
31235         (Expression::MemberLookup): Provide a version that allows to
31236         specify the MemberTypes and BindingFlags. 
31237
31238         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
31239         so it was not fetching variable information from outer blocks.
31240
31241         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
31242         Beforefieldinit as it was buggy.
31243
31244         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
31245         that Ravi put here.  
31246
31247         * class.cs (Constructor::Emit): Only emit if block is not null.
31248         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
31249         deal with this by semantically definining it as if the user had
31250         done it.
31251
31252         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
31253         constructors as we now "emit" them at a higher level.
31254
31255         (TypeContainer::DefineDefaultConstructor): Used to define the
31256         default constructors if none was provided.
31257
31258         (ConstructorInitializer): Add methods Resolve and Emit. 
31259
31260         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
31261
31262 2001-09-17  Ravi Pratap  <ravi@ximian.com>
31263
31264         * class.cs (TypeContainer::EmitDefaultConstructor): Register
31265         the default constructor builder with our hashtable for methodbuilders
31266         to methodcores.
31267
31268         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
31269         and argument_count is 0 in which case we have a match.
31270         (Binary::ResolveOperator): More null checking and miscellaneous coding
31271         style cleanup.
31272
31273 2001-09-17  Ravi Pratap  <ravi@ximian.com>
31274
31275         * rootcontext.cs (IsNameSpace): Compare against null.
31276
31277         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
31278
31279         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
31280         and Unary::Operator.
31281
31282         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
31283         accordingly.
31284
31285         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
31286         we have overloaded operators.
31287         (Binary::ResolveOperator): Implement the part which does the operator overload
31288         resolution.
31289
31290         * class.cs (Operator::Emit): Implement.
31291         (TypeContainer::Emit): Emit the operators we have too.
31292
31293         * expression.cs (Binary::Emit): Update to emit the appropriate code for
31294         the case when we have a user-defined operator.
31295
31296 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
31297
31298         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
31299
31300 2001-09-16  Ravi Pratap  <ravi@ximian.com>
31301
31302         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
31303         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
31304         (Constructor::Emit): Implement.
31305         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31306         if we have no work to do. 
31307         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
31308         Emit method.
31309
31310         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31311         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31312
31313         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31314         of parent.parent.
31315
31316 2001-09-15  Ravi Pratap  <ravi@ximian.com>
31317
31318         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31319         in the source.
31320         (Tree::RecordNamespace): Method to do what the name says ;-)
31321         (Tree::Namespaces): Property to get at the namespaces hashtable.
31322
31323         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
31324         keep track.
31325
31326         * rootcontext.cs (IsNamespace): Fixed it :-)
31327
31328 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31329
31330         * class.cs (TypeContainer::FindMembers): Add support for
31331         constructors. 
31332         (MethodCore): New class that encapsulates both the shared aspects
31333         of a Constructor and a Method.  
31334         (Method, Constructor): Factored pieces into MethodCore.
31335
31336         * driver.cs: Added --fatal which makes errors throw exceptions.
31337         Load System assembly as well as part of the standard library.
31338
31339         * report.cs: Allow throwing exceptions on errors for debugging.
31340
31341         * modifiers.cs: Do not use `parent', instead use the real type
31342         container to evaluate permission settings.
31343
31344         * class.cs: Put Ravi's patch back in.  He is right, and we will
31345         have to cope with the
31346
31347 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31348
31349         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31350         FamORAssem, not FamANDAssem.
31351
31352 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
31353
31354         * driver.cs: Added --parse option that only parses its input files
31355         and terminates.
31356
31357         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
31358         incorrect.  IsTopLevel is not used to tell whether an object is
31359         root_types or not (that can be achieved by testing this ==
31360         root_types).  But to see if this is a top-level *class* (not
31361         necessarly our "toplevel" container). 
31362
31363 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31364
31365         * enum.cs (Enum::Define): Modify to call the Lookup method on the
31366         parent instead of a direct call to GetType.
31367
31368 2001-09-14  Ravi Pratap  <ravi@ximian.com>
31369
31370         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31371         Modifiers.TypeAttr. This should just be a call to that method.
31372
31373         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31374         object so that we can determine if we are top-level or not.
31375
31376         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
31377         TypeContainer too.
31378
31379         * enum.cs (Enum::Define): Ditto.
31380
31381         * modifiers.cs (FieldAttr): Re-write.
31382
31383         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31384         (TypeContainer::HaveStaticConstructor): New property to provide access
31385         to precisely that info.
31386
31387         * modifiers.cs (MethodAttr): Re-write.
31388         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31389
31390         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31391         of top-level types as claimed.
31392
31393 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31394
31395         * expression.cs (MemberLookup): Fruitless attempt to lookup
31396         constructors.  Maybe I need to emit default constructors?  That
31397         might be it (currently .NET emits this for me automatically).
31398         (Invocation::OverloadResolve): Cope with Arguments == null.
31399         (Invocation::EmitArguments): new function, shared by the new
31400         constructor and us.
31401         (Invocation::Emit): Handle static and instance methods.  Emit
31402         proper call instruction for virtual or non-virtual invocations.
31403         (New::Emit): Implement.
31404         (New::Resolve): Implement.
31405         (MemberAccess:Resolve): Implement.
31406         (MethodGroupExpr::InstanceExpression): used conforming to the spec
31407         to track instances.
31408         (FieldExpr::Resolve): Set type.
31409
31410         * support.cs: Handle empty arguments.
31411                 
31412         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31413         SimpleLookup): Auxiliary routines to help parse a qualifier
31414         identifier.  
31415
31416         Update qualifier_identifier rule.
31417
31418         * codegen.cs: Removed debugging messages.
31419
31420         * class.cs: Make this a global thing, this acts just as a "key" to
31421         objects that we might have around.
31422
31423         (Populate): Only initialize method_builders_to_methods once.
31424
31425         * expression.cs (PropertyExpr): Initialize type from the
31426         PropertyType. 
31427
31428         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31429         Resolve pattern.  Attempt to implicitly convert value to boolean.
31430         Emit code.
31431
31432         * expression.cs: Set the type for the int32/int32 argument case.
31433         (Binary::ResolveOperator): Set the return type to boolean for
31434         comparission operators
31435
31436         * typemanager.cs: Remove debugging print code.
31437
31438         (Invocation::Resolve): resolve type.
31439
31440         * class.cs: Allocate a MemberInfo of the correct size, as the code
31441         elsewhere depends on the test to reflect the correct contents.
31442
31443         (Method::) Keep track of parameters, due to System.Reflection holes
31444
31445         (TypeContainer::Populate): Keep track of MethodBuilders to Method
31446         mapping here.
31447
31448         (TypeContainer::FindMembers): Use ArrayList and then copy an array
31449         of the exact size and return that.
31450
31451         (Class::LookupMethodByBuilder): New function that maps
31452         MethodBuilders to its methods.  Required to locate the information
31453         on methods because System.Reflection bit us again.
31454
31455         * support.cs: New file, contains an interface ParameterData and
31456         two implementations: ReflectionParameters and InternalParameters
31457         used to access Parameter information.  We will need to grow this
31458         as required.
31459
31460         * expression.cs (Invocation::GetParameterData): implement a cache
31461         and a wrapper around the ParameterData creation for methods. 
31462         (Invocation::OverloadResolve): Use new code.
31463
31464 2001-09-13  Ravi Pratap  <ravi@ximian.com>
31465
31466         * class.cs (TypeContainer::EmitField): Remove and move into 
31467         (Field::Define): here and modify accordingly.
31468         (Field.FieldBuilder): New member.
31469         (TypeContainer::Populate): Update accordingly.
31470         (TypeContainer::FindMembers): Implement.
31471
31472 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31473
31474         * statement.cs: (VariableInfo::VariableType): New field to be
31475         initialized with the full type once it is resolved. 
31476
31477 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
31478
31479         * parameter.cs (GetParameterInfo): Use a type cache to compute
31480         things only once, and to reuse this information
31481
31482         * expression.cs (LocalVariableReference::Emit): Implement.
31483         (OpcodeCast::Emit): fix.
31484
31485         (ParameterReference::Resolve): Implement.
31486         (ParameterReference::Emit): Implement.
31487
31488         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31489         that are expressions need to stay as Expressions.
31490
31491         * typemanager.cs (CSharpName): Returns the C# name of a type if
31492         possible. 
31493
31494         * expression.cs (Expression::ConvertImplicit): New function that
31495         implements implicit type conversions.
31496
31497         (Expression::ImplicitReferenceConversion): Implements implicit
31498         reference conversions.
31499
31500         (EmptyCast): New type for transparent casts.
31501
31502         (OpcodeCast): New type for casts of types that are performed with
31503         a sequence of bytecodes.
31504
31505         (BoxedCast): New type used for casting value types into reference
31506         types.  Emits a box opcode.
31507
31508         (Binary::DoNumericPromotions): Implements numeric promotions of
31509         and computation of the Binary::Type.
31510
31511         (Binary::EmitBranchable): Optimization.
31512
31513         (Binary::Emit): Implement code emission for expressions.
31514
31515         * typemanager.cs (TypeManager): Added two new core types: sbyte
31516         and byte.
31517
31518 2001-09-12  Ravi Pratap  <ravi@ximian.com>
31519
31520         * class.cs (TypeContainer::FindMembers): Method which does exactly
31521         what Type.FindMembers does, only we don't have to use reflection. No
31522         implementation yet.
31523
31524         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31525         typecontainer objects as we need to get at them.
31526         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31527
31528         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31529         typecontainer object.
31530
31531         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31532         of just a Report object.
31533
31534 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31535
31536         * class.cs (Event::Define): Go back to using the prefixes "add_" and
31537         "remove_"
31538         (TypeContainer::Populate): Now define the delegates of the type too.
31539         (TypeContainer.Delegates): Property to access the list of delegates defined
31540         in the type.
31541
31542         * delegates.cs (Delegate::Define): Implement partially.
31543
31544         * modifiers.cs (TypeAttr): Handle more flags.
31545
31546 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31547
31548         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31549         and not <=
31550         (Operator::Define): Re-write logic to get types by using the LookupType method
31551         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31552         (Indexer::Define): Ditto.
31553         (Event::Define): Ditto.
31554         (Property::Define): Ditto.
31555
31556 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31557
31558         * class.cs (TypeContainer::Populate): Now define operators too. 
31559         (TypeContainer.Operators): New property to access the list of operators
31560         in a type.
31561         (Operator.OperatorMethodBuilder): New member to hold the method builder
31562         for the operator we are defining.
31563         (Operator::Define): Implement.
31564
31565 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31566
31567         * class.cs (Event::Define): Make the prefixes of the accessor methods
31568         addOn_ and removeOn_ 
31569
31570         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31571         of the location being passed in too. Ideally, this should go later since all
31572         error reporting should be done through the Report object.
31573
31574         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31575         (Populate): Iterate thru the indexers we have and define them too.
31576         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31577         for the get and set accessors.
31578         (Indexer::Define): Implement.
31579
31580 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
31581
31582         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
31583         my previous implementation, did not work.
31584
31585         * typemanager.cs: Add a couple of missing types (the longs).
31586
31587         * literal.cs: Use TypeManager.bool_type instead of getting it.
31588
31589         * expression.cs (EventExpr): New kind of expressions.
31590         (Expressio::ExprClassFromMemberInfo): finish
31591
31592 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
31593
31594         * assign.cs: Emit stores to static fields differently.
31595
31596 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31597
31598         * Merge in changes and adjust code to tackle conflicts. Backed out my
31599         code in Assign::Resolve ;-) 
31600
31601 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31602
31603         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31604         instead Report.Error and also pass in the location.
31605         (CSharpParser::Lexer): New readonly property to return the reference
31606         to the Tokenizer object.
31607         (declare_local_variables): Use Report.Error with location instead of plain 
31608         old error.
31609         (CheckDef): Ditto.
31610
31611         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31612         (Operator.CheckBinaryOperator): Ditto.
31613
31614         * cs-parser.jay (operator_declarator): Update accordingly.
31615
31616         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31617         (CheckBinaryOperator): Same here.
31618
31619         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31620         on the name without any prefixes of namespace names etc. This is because we
31621         already might have something already fully qualified like 
31622         'System.Console.WriteLine'
31623
31624         * assign.cs (Resolve): Begin implementation. Stuck ;-)
31625
31626 2001-09-07  Ravi Pratap  <ravi@ximian.com>
31627
31628         * cs-tokenizer.cs (location): Return a string which also contains
31629         the file name.
31630
31631         * expression.cs (ElementAccess): New class for expressions of the
31632         type 'element access.'
31633         (BaseAccess): New class for expressions of the type 'base access.'
31634         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31635         respectively.
31636
31637         * cs-parser.jay (element_access): Implement action.
31638         (base_access): Implement actions.
31639         (checked_expression, unchecked_expression): Implement.
31640
31641         * cs-parser.jay (local_variable_type): Correct and implement.
31642         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31643
31644         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31645
31646         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31647         name and the specifiers.
31648
31649         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31650
31651         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
31652         making them all public ;-)
31653
31654         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31655         class anyways.
31656
31657 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
31658
31659         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31660         PropertyExprs.
31661         (FieldExpr, PropertyExprs): New resolved expressions.
31662         (SimpleName::MemberStaticCheck): Perform static checks for access
31663         to non-static fields on static methods. Maybe this should be
31664         generalized for MemberAccesses. 
31665         (SimpleName::ResolveSimpleName): More work on simple name
31666         resolution. 
31667
31668         * cs-parser.jay (primary_expression/qualified_identifier): track
31669         the parameter index.
31670
31671         * codegen.cs (CodeGen::Save): Catch save exception, report error.
31672         (EmitContext::EmitBoolExpression): Chain to expression generation
31673         instead of temporary hack.
31674         (::EmitStatementExpression): Put generic expression code generation.
31675
31676         * assign.cs (Assign::Emit): Implement variable assignments to
31677         local variables, parameters and fields.
31678
31679 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
31680
31681         * statement.cs (Block::GetVariableInfo): New method, returns the
31682         VariableInfo for a variable name in a block.
31683         (Block::GetVariableType): Implement in terms of GetVariableInfo
31684
31685         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31686         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31687
31688 2001-09-06  Ravi Pratap  <ravi@ximian.com>
31689
31690         * cs-parser.jay (operator_declaration): Continue on my quest : update
31691         to take attributes argument.
31692         (event_declaration): Ditto.
31693         (enum_declaration): Ditto.
31694         (indexer_declaration): Ditto.
31695
31696         * class.cs (Operator::Operator): Update constructor accordingly.
31697         (Event::Event): Ditto.
31698
31699         * delegate.cs (Delegate::Delegate): Same here.
31700
31701         * enum.cs (Enum::Enum): Same here.
31702
31703 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31704
31705         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31706
31707         * ../tests/cs0658.cs : New file to demonstrate error 0658.
31708
31709         * attribute.cs (Attributes): New class to encapsulate all attributes which were
31710         being passed around as an arraylist.
31711         (Attributes::AddAttribute): Method to add attribute sections.
31712
31713         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31714         (struct_declaration): Update accordingly.
31715         (constant_declaration): Update.
31716         (field_declaration): Update.
31717         (method_header): Update.
31718         (fixed_parameter): Update.
31719         (parameter_array): Ditto.
31720         (property_declaration): Ditto.
31721         (destructor_declaration): Ditto.
31722
31723         * class.cs (Struct::Struct): Update constructors accordingly.
31724         (Class::Class): Ditto.
31725         (Field::Field): Ditto.
31726         (Method::Method): Ditto.
31727         (Property::Property): Ditto.
31728         (TypeContainer::OptAttribute): update property's return type.
31729
31730         * interface.cs (Interface.opt_attributes): New member.
31731         (Interface::Interface): Update to take the extra Attributes argument.
31732
31733         * parameter.cs (Parameter::Parameter): Ditto.
31734
31735         * constant.cs (Constant::Constant): Ditto.
31736
31737         * interface.cs (InterfaceMemberBase): New OptAttributes field.
31738         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
31739         the attributes as a parameter.
31740         (InterfaceProperty): Update constructor call.
31741         (InterfaceEvent): Ditto.
31742         (InterfaceMethod): Ditto.
31743         (InterfaceIndexer): Ditto.
31744
31745         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
31746         pass the attributes too.
31747         (interface_event_declaration): Ditto.
31748         (interface_property_declaration): Ditto.
31749         (interface_method_declaration): Ditto.
31750         (interface_declaration): Ditto.
31751
31752 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
31753
31754         * class.cs (Method::Define): Track the "static Main" definition to
31755         create an entry point. 
31756
31757         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31758         EntryPoint if we find it. 
31759
31760         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31761         (EmitContext::ig): Make this variable public.
31762
31763         * driver.cs: Make the default output file be the first file name
31764         with the .exe extension.  
31765
31766         Detect empty compilations
31767
31768         Handle various kinds of output targets.  Handle --target and
31769         rename -t to --dumper.
31770
31771         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31772         methods inherited from Expression return now an Expression.  This
31773         will is used during the tree rewriting as we resolve them during
31774         semantic analysis.
31775
31776         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31777         the spec.  Missing entirely is the information about
31778         accessability of elements of it.
31779
31780         (Expression::ExprClassFromMemberInfo): New constructor for
31781         Expressions that creates a fully initialized Expression based on
31782         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31783         a Type.
31784
31785         (Invocation::Resolve): Begin implementing resolution of invocations.
31786
31787         * literal.cs (StringLiteral):  Implement Emit.
31788
31789 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31790
31791         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31792         member.
31793
31794 2001-09-04  Ravi Pratap  <ravi@ximian.com>
31795
31796         * cs-parser.jay (attribute_arguments): Implement actions.
31797         (attribute): Fix bug in production. Implement action.
31798         (attribute_list): Implement.
31799         (attribute_target): Implement.
31800         (attribute_target_specifier, opt_target_specifier): Implement
31801         (CheckAttributeTarget): New method to check if the attribute target
31802         is valid.
31803         (attribute_section): Implement.
31804         (opt_attributes): Implement.
31805
31806         * attribute.cs : New file to handle attributes.
31807         (Attribute): Class to hold attribute info.
31808
31809         * cs-parser.jay (opt_attribute_target_specifier): Remove production
31810         (attribute_section): Modify production to use 2 different rules to 
31811         achieve the same thing. 1 s/r conflict down !
31812         Clean out commented, useless, non-reducing dimension_separator rules.
31813
31814         * class.cs (TypeContainer.attributes): New member to hold list
31815         of attributes for a type.
31816         (Struct::Struct): Modify to take one more argument, the attribute list.
31817         (Class::Class): Ditto.
31818         (Field::Field): Ditto.
31819         (Method::Method): Ditto.
31820         (Property::Property): Ditto.
31821
31822         * cs-parser.jay (struct_declaration): Update constructor call to
31823         pass in the attributes too.
31824         (class_declaration): Ditto.
31825         (constant_declaration): Ditto.
31826         (field_declaration): Ditto.
31827         (method_header): Ditto.
31828         (fixed_parameter): Ditto.
31829         (parameter_array): Ditto.
31830         (property_declaration): Ditto.
31831
31832         * constant.cs (Constant::Constant): Update constructor similarly.
31833         Use System.Collections.
31834
31835         * parameter.cs (Parameter::Parameter): Update as above.
31836
31837 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31838
31839         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31840         (TypeContainer.delegates): New member to hold list of delegates.
31841
31842         * cs-parser.jay (delegate_declaration): Implement the action correctly 
31843         this time as I seem to be on crack ;-)
31844
31845 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
31846
31847         * rootcontext.cs (RootContext::IsNamespace): new function, used to
31848         tell whether an identifier represents a namespace.
31849
31850         * expression.cs (NamespaceExpr): A namespace expression, used only
31851         temporarly during expression resolution.
31852         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31853         utility functions to resolve names on expressions.
31854
31855 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
31856
31857         * codegen.cs: Add hook for StatementExpressions. 
31858
31859         * class.cs: Fix inverted test for static flag in methods.
31860
31861 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31862
31863         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31864         to make it coincide with MS' number.
31865         (Operator::CheckBinaryOperator): Ditto.
31866
31867         * ../errors/errors.txt : Remove error numbers added earlier.
31868
31869         * ../errors/cs1019.cs : Test case for error # 1019
31870
31871         * ../errros/cs1020.cs : Test case for error # 1020
31872
31873         * cs-parser.jay : Clean out commented cruft.
31874         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31875         used anywhere - non-reducing rule.
31876         (namespace_declarations): Non-reducing rule - comment out.
31877
31878         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31879         with TypeContainer::AddEnum.
31880
31881         * delegate.cs : New file for delegate handling classes.
31882         (Delegate): Class for declaring delegates.
31883
31884         * makefile : Update.
31885
31886         * cs-parser.jay (delegate_declaration): Implement.
31887
31888 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31889
31890         * class.cs (Event::Define): Implement.
31891         (Event.EventBuilder): New member.
31892
31893         * class.cs (TypeContainer::Populate): Update to define all enums and events
31894         we have.
31895         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31896         readonly fields for all these cases ?
31897
31898 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31899
31900         * class.cs (Property): Revamp to use the convention of making fields readonly.
31901         Accordingly modify code elsewhere.
31902
31903         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31904         the Define method of the Property class.
31905
31906         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31907         trivial bug.
31908         (TypeContainer::Populate): Update to define all the properties we have. Also
31909         define all enumerations.
31910
31911         * enum.cs (Define): Implement.
31912
31913 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31914
31915         * cs-parser.jay (overloadable_operator): The semantic value is an
31916         enum of the Operator class.
31917         (operator_declarator): Implement actions.
31918         (operator_declaration): Implement.
31919
31920         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31921         validity of definitions.
31922         (Operator::CheckBinaryOperator): Static method to check for binary operators
31923         (TypeContainer::AddOperator): New method to add an operator to a type.
31924
31925         * cs-parser.jay (indexer_declaration): Added line to actually call the
31926         AddIndexer method so it gets added ;-)
31927
31928         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31929         already taken care of by the MS compiler ?  
31930
31931 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31932
31933         * class.cs (Operator): New class for operator declarations.
31934         (Operator::OpType): Enum for the various operators.
31935
31936 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31937
31938         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31939         ostensibly handle this in semantic analysis.
31940
31941         * cs-parser.jay (general_catch_clause): Comment out
31942         (specific_catch_clauses, specific_catch_clause): Ditto.
31943         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31944         (catch_args, opt_catch_args): New productions.
31945         (catch_clause): Rewrite to use the new productions above
31946         (catch_clauses): Modify accordingly.
31947         (opt_catch_clauses): New production to use in try_statement
31948         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31949         and re-write the code in the actions to extract the specific and
31950         general catch clauses by being a little smart ;-)
31951
31952         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31953         Hooray, try and catch statements parse fine !
31954
31955 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31956
31957         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31958         string from the hashtable of variables.
31959
31960         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31961         I end up making that mistake ;-)
31962         (catch_clauses): Fixed gross error which made Key and Value of the 
31963         DictionaryEntry the same : $1 !!
31964
31965 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31966
31967         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31968
31969         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31970         when the add and remove accessors are specified. 
31971
31972 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31973
31974         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31975         information about indexer_declarator.
31976         (indexer_declarator): Implement actions.
31977         (parsing_indexer): New local boolean used to keep track of whether
31978         we are parsing indexers or properties. This is necessary because 
31979         implicit_parameters come into picture even for the get accessor in the 
31980         case of an indexer.
31981         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31982
31983         * class.cs (Indexer): New class for indexer declarations.
31984         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31985         (TypeContainer::indexers): New member to hold list of indexers for the
31986         type.
31987
31988 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31989
31990         * cs-parser.jay (add_accessor_declaration): Implement action.
31991         (remove_accessor_declaration): Implement action.
31992         (event_accessors_declaration): Implement
31993         (variable_declarators): swap statements for first rule - trivial.
31994
31995         * class.cs (Event): New class to hold information about event
31996         declarations.
31997         (TypeContainer::AddEvent): New method to add an event to a type
31998         (TypeContainer::events): New member to hold list of events.
31999
32000         * cs-parser.jay (event_declaration): Implement actions.
32001
32002 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
32003
32004         * cs-parser.jay (dim_separators): Implement. Make it a string
32005         concatenating all the commas together, just as they appear.
32006         (opt_dim_separators): Modify accordingly
32007         (rank_specifiers): Update accordingly. Basically do the same
32008         thing - instead, collect the brackets here.
32009         (opt_rank_sepcifiers): Modify accordingly.
32010         (array_type): Modify to actually return the complete type string
32011         instead of ignoring the rank_specifiers.
32012         (expression_list): Implement to collect the expressions
32013         (variable_initializer): Implement. We make it a list of expressions
32014         essentially so that we can handle the array_initializer case neatly too.
32015         (variable_initializer_list): Implement.
32016         (array_initializer): Make it a list of variable_initializers
32017         (opt_array_initializer): Modify accordingly.
32018
32019         * expression.cs (New::NType): Add enumeration to help us
32020         keep track of whether we have an object/delegate creation
32021         or an array creation.
32022         (New:NewType, New::Rank, New::Indices, New::Initializers): New
32023         members to hold data about array creation.
32024         (New:New): Modify to update NewType
32025         (New:New): New Overloaded contructor for the array creation
32026         case.
32027
32028         * cs-parser.jay (array_creation_expression): Implement to call
32029         the overloaded New constructor.
32030
32031 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
32032
32033         * class.cs (TypeContainer::Constructors): Return member
32034         constructors instead of returning null.
32035
32036 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
32037
32038         * typemanager.cs (InitCoreTypes): Initialize the various core
32039         types after we have populated the type manager with the user
32040         defined types (this distinction will be important later while
32041         compiling corlib.dll)
32042
32043         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
32044         on Expression Classification.  Now all expressions have a method
32045         `Resolve' and a method `Emit'.
32046
32047         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
32048         generation from working.     Also add some temporary debugging
32049         code. 
32050
32051 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
32052
32053         * codegen.cs: Lots of code generation pieces.  This is only the
32054         beginning, will continue tomorrow with more touches of polish.  We
32055         handle the fundamentals of if, while, do, for, return.  Others are
32056         trickier and I need to start working on invocations soon.
32057
32058         * gen-treedump.cs: Bug fix, use s.Increment here instead of
32059         s.InitStatement. 
32060
32061         * codegen.cs (EmitContext): New struct, used during code
32062         emission to keep a context.   Most of the code generation will be
32063         here. 
32064
32065         * cs-parser.jay: Add embedded blocks to the list of statements of
32066         this block.  So code generation proceeds in a top down fashion.
32067
32068 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
32069
32070         * statement.cs: Add support for multiple child blocks.
32071
32072 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
32073
32074         * codegen.cs (EmitCode): New function, will emit the code for a
32075         Block of code given a TypeContainer and its ILGenerator. 
32076
32077         * statement.cs (Block): Standard public readonly optimization.
32078         (Block::Block constructors): Link children. 
32079         (Block::Child): Child Linker.
32080         (Block::EmitVariables): Emits IL variable declarations.
32081
32082         * class.cs: Drop support for MethodGroups here, delay until
32083         Semantic Analysis.
32084         (Method::): Applied the same simplification that I did before, and
32085         move from Properties to public readonly fields.
32086         (Method::ParameterTypes): Returns the parameter types for the
32087         function, and implements a cache that will be useful later when I
32088         do error checking and the semantic analysis on the methods is
32089         performed.
32090         (Constructor::GetCallingConvention): Renamed from CallingConvetion
32091         and made a method, optional argument tells whether this is a class
32092         or a structure to apply the `has-this' bit.
32093         (Method::GetCallingConvention): Implement, returns the calling
32094         convention. 
32095         (Method::Define): Defines the type, a second pass is performed
32096         later to populate the methods.
32097
32098         (Constructor::ParameterTypes): implement a cache similar to the
32099         one on Method::ParameterTypes, useful later when we do semantic
32100         analysis. 
32101
32102         (TypeContainer::EmitMethod):  New method.  Emits methods.
32103
32104         * expression.cs: Removed MethodGroup class from here.
32105
32106         * parameter.cs (Parameters::GetCallingConvention): new method.
32107
32108 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
32109
32110         * class.cs (TypeContainer::Populate): Drop RootContext from the
32111         argument. 
32112
32113         (Constructor::CallingConvention): Returns the calling convention.
32114         (Constructor::ParameterTypes): Returns the constructor parameter
32115         types. 
32116
32117         (TypeContainer::AddConstructor): Keep track of default constructor
32118         and the default static constructor.
32119
32120         (Constructor::) Another class that starts using `public readonly'
32121         instead of properties. 
32122
32123         (Constructor::IsDefault): Whether this is a default constructor. 
32124
32125         (Field::) use readonly public fields instead of properties also.
32126
32127         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
32128         track of static constructors;  If none is used, turn on
32129         BeforeFieldInit in the TypeAttributes. 
32130
32131         * cs-parser.jay (opt_argument_list): now the return can be null
32132         for the cases where there are no arguments. 
32133
32134         (constructor_declarator): If there is no implicit `base' or
32135         `this', then invoke the default parent constructor. 
32136
32137         * modifiers.cs (MethodAttr): New static function maps a set of
32138         modifiers flags into a MethodAttributes enum
32139         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
32140         MethodAttr, TypeAttr to represent the various mappings where the
32141         modifiers are used.
32142         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
32143
32144 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
32145
32146         * parameter.cs (GetParameterInfo): Fix bug where there would be no
32147         method arguments.
32148
32149         * interface.cs (PopulateIndexer): Implemented the code generator
32150         for interface indexers.
32151
32152 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
32153
32154         * interface.cs (InterfaceMemberBase): Now we track the new status
32155         here.  
32156
32157         (PopulateProperty): Implement property population.  Woohoo!  Got
32158         Methods and Properties going today. 
32159
32160         Removed all the properties for interfaces, and replaced them with
32161         `public readonly' fields. 
32162
32163 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
32164
32165         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
32166         initialize their hashtables/arraylists only when they are needed
32167         instead of doing this always.
32168
32169         * parameter.cs: Handle refs and out parameters.
32170
32171         * cs-parser.jay: Use an ArrayList to construct the arguments
32172         instead of the ParameterCollection, and then cast that to a
32173         Parameter[] array.
32174
32175         * parameter.cs: Drop the use of ParameterCollection and use
32176         instead arrays of Parameters.
32177
32178         (GetParameterInfo): Use the Type, not the Name when resolving
32179         types. 
32180
32181 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
32182
32183         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
32184         and instead use public readonly fields.
32185
32186         * class.cs: Put back walking code for type containers.
32187
32188 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
32189
32190         * class.cs (MakeConstant): Code to define constants.
32191
32192         * rootcontext.cs (LookupType): New function.  Used to locate types 
32193
32194
32195 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
32196
32197         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
32198         this System.Reflection code is.  Kudos to Microsoft
32199
32200         * typemanager.cs: Implement a type cache and avoid loading all
32201         types at boot time.  Wrap in LookupType the internals.  This made
32202         the compiler so much faster.  Wow.  I rule!
32203
32204         * driver.cs: Make sure we always load mscorlib first (for
32205         debugging purposes, nothing really important).
32206
32207         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
32208         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
32209
32210         * rootcontext.cs: Lookup types on their namespace;  Lookup types
32211         on namespaces that have been imported using the `using' keyword.
32212
32213         * class.cs (TypeContainer::TypeAttr): Virtualize.
32214         (Class::TypeAttr): Return attributes suitable for this bad boy.
32215         (Struct::TypeAttr): ditto.
32216         Handle nested classes.
32217         (TypeContainer::) Remove all the type visiting code, it is now
32218         replaced with the rootcontext.cs code
32219
32220         * rootcontext.cs (GetClassBases): Added support for structs. 
32221
32222 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
32223
32224         * interface.cs, statement.cs, class.cs, parameter.cs,
32225         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
32226         Drop use of TypeRefs, and use strings instead.
32227
32228 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
32229
32230         * rootcontext.cs: 
32231
32232         * class.cs (Struct::Struct): set the SEALED flags after
32233         checking the modifiers.
32234         (TypeContainer::TypeAttr): new property, returns the
32235         TypeAttributes for a class.  
32236
32237         * cs-parser.jay (type_list): Oops, list production was creating a
32238         new list of base types.
32239
32240         * rootcontext.cs (StdLib): New property.
32241         (GetInterfaceTypeByName): returns an interface by type name, and
32242         encapsulates error handling here.
32243         (GetInterfaces): simplified.
32244         (ResolveTree): Encapsulated all the tree resolution here.
32245         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
32246         types. 
32247
32248         * driver.cs: Add support for --nostdlib, to avoid loading the
32249         default assemblies.
32250         (Main): Do not put tree resolution here. 
32251
32252         * rootcontext.cs: Beginning of the class resolution.
32253
32254 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
32255
32256         * rootcontext.cs: Provide better error reporting. 
32257
32258         * cs-parser.jay (interface_base): set our $$ to be interfaces.
32259
32260         * rootcontext.cs (CreateInterface): Handle the case where there
32261         are no parent interfaces.
32262
32263         (CloseTypes): Routine to flush types at the end.
32264         (CreateInterface): Track types.
32265         (GetInterfaces): Returns an array of Types from the list of
32266         defined interfaces.
32267
32268         * typemanager.c (AddUserType): Mechanism to track user types (puts
32269         the type on the global type hash, and allows us to close it at the
32270         end). 
32271
32272 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
32273
32274         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
32275         RecordInterface instead.
32276
32277         * cs-parser.jay: Updated to reflect changes above.
32278
32279         * decl.cs (Definition): Keep track of the TypeBuilder type that
32280         represents this type here.  Not sure we will use it in the long
32281         run, but wont hurt for now.
32282
32283         * driver.cs: Smaller changes to accomodate the new code.
32284
32285         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
32286         when done. 
32287
32288         * rootcontext.cs (CreateInterface):  New method, used to create
32289         the System.TypeBuilder type for interfaces.
32290         (ResolveInterfaces): new entry point to resolve the interface
32291         hierarchy. 
32292         (CodeGen): Property, used to keep track of the code generator.
32293
32294 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
32295
32296         * cs-parser.jay: Add a second production for delegate_declaration
32297         with `VOID'.
32298
32299         (enum_body): Put an opt_comma here instead of putting it on
32300         enum_body or enum_member_declarations so we can handle trailing
32301         commas on enumeration members.  Gets rid of a shift/reduce.
32302
32303         (type_list): Need a COMMA in the middle.
32304
32305         (indexer_declaration): Tell tokenizer to recognize get/set
32306
32307         * Remove old targets.
32308
32309         * Re-add the parser target.
32310
32311 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32312
32313         * cs-parser.jay: Add precendence rules for a number of operators
32314         ot reduce the number of shift/reduce conflicts in the grammar.
32315
32316 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
32317
32318         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32319         and put it here.
32320
32321         Get rid of old crufty code.
32322
32323         * rootcontext.cs: Use this to keep track of the parsed
32324         representation and the defined types available to the program. 
32325
32326         * gen-treedump.cs: adjust for new convention.
32327
32328         * type.cs: Split out the type manager, and the assembly builder
32329         from here. 
32330
32331         * typemanager.cs: the type manager will live here now.
32332
32333         * cil-codegen.cs: And the code generator here. 
32334
32335 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
32336
32337         * makefile: Fixed up for easy making.
32338
32339 2001-07-13  Simon Cozens <simon@simon-cozens.org>
32340
32341         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32342         the 
32343
32344         (unary_expression): Expand pre_increment_expression and
32345         post_decrement_expression to reduce a shift/reduce.
32346
32347 2001-07-11  Simon Cozens
32348
32349         * cs-tokenizer.cs: Hex numbers should begin with a 0.
32350
32351         Improve allow_keyword_as_indent name.
32352
32353 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
32354
32355         * Adjustments for Beta2. 
32356
32357 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
32358
32359         * decl.cs: Added `Define' abstract method.
32360         (InTransit): new property, used to catch recursive definitions. 
32361
32362         * interface.cs: Implement `Define'. 
32363
32364         * modifiers.cs: Map Modifiers.constants to
32365         System.Reflection.TypeAttribute flags.
32366
32367         * class.cs: Keep track of types and user-defined types.
32368         (BuilderInit): New method for creating an assembly
32369         (ResolveType): New function to launch the resolution process, only
32370         used by interfaces for now.
32371
32372         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32373         that are inserted into the name space. 
32374
32375 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
32376
32377         * ARGH.  I have screwed up my tree so many times due to the use of
32378         rsync rather than using CVS.  Going to fix this at once. 
32379
32380         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
32381         load types.
32382
32383 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
32384
32385         * Experiment successful: Use System.Type rather that our own
32386         version of Type.  
32387
32388 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
32389
32390         * cs-parser.jay: Removed nsAliases from here.
32391
32392         Use new namespaces, handle `using XXX;' 
32393
32394         * namespace.cs: Reimplemented namespace handling, use a recursive
32395         definition of the class.  Now we can keep track of using clauses
32396         and catch invalid using clauses.
32397
32398 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
32399
32400         * gen-treedump.cs: Adapted for all the renaming.
32401
32402         * expression.cs (Expression): this class now has a Type property
32403         which returns an expression Type.
32404
32405         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32406         `Type', as this has a different meaning now in the base
32407
32408 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
32409
32410         * interface.cs, class.cs: Removed from all the sources the
32411         references to signature computation, as we can not do method
32412         signature computation during the parsing time, as we are not
32413         trying to solve at that point distinguishing:
32414
32415         class X {
32416                 void a (Blah x) {}
32417                 void a (NS.Blah x) {}
32418         }
32419
32420         Which depending on the context might be valid or not, as we do not
32421         know if Blah is the same thing as NS.Blah at that point.
32422
32423         * Redid everything so the code uses TypeRefs now instead of
32424         Types.  TypeRefs are just temporary type placeholders, that need
32425         to be resolved.  They initially have a pointer to a string and the
32426         current scope in which they are used.  This is used later by the
32427         compiler to resolve the reference to an actual Type. 
32428
32429         * DeclSpace is no longer a CIR.Type, and neither are
32430         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
32431         are all DeclSpaces, but no Types. 
32432
32433         * type.cs (TypeRefManager): This implements the TypeRef manager,
32434         which keeps track of all the types that need to be resolved after
32435         the parsing has finished. 
32436
32437 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
32438
32439         * ARGH.  We are going to have to store `foreach' as a class rather
32440         than resolving it, as we need to verify error 1579 after name
32441         resolution.   *OR* we could keep a flag that says `This request to
32442         IEnumerator comes from a foreach statement' which we can then use
32443         to generate the error.
32444
32445 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
32446
32447         * class.cs (TypeContainer.AddMethod): we now add methods to the
32448         MethodGroup instead of the method hashtable.  
32449
32450         * expression.cs: Add MethodGroup abstraction, which gets us one
32451         step closer to the specification in the way we handle method
32452         declarations.  
32453
32454         * cs-parser.jay (primary_expression): qualified_identifier now
32455         tried to match up an identifier to a local variable reference or
32456         to a parameter reference.
32457
32458         current_local_parameters is now a parser global variable that
32459         points to the current parameters for the block, used during name
32460         lookup.
32461
32462         (property_declaration): Now creates an implicit `value' argument to
32463         the set accessor.
32464
32465 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
32466
32467         * parameter.cs: Do not use `param' arguments as part of the
32468         signature, per the spec.
32469
32470 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
32471
32472         * decl.cs: Base class for classes, structs and interfaces.  This
32473         is the "Declaration Space" 
32474
32475         * cs-parser.jay: Use CheckDef for checking declaration errors
32476         instead of having one on each function.
32477
32478         * class.cs: Factor out some code for handling error handling in
32479         accordance to the "Declarations" section in the "Basic Concepts"
32480         chapter in the ECMA C# spec.
32481
32482         * interface.cs: Make all interface member classes derive from
32483         InterfaceMemberBase.
32484
32485 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
32486
32487         * Many things: all interfaces are parsed and generated in
32488         gen-treedump.  Support for member variables, constructors,
32489         destructors, properties, constants is there.
32490
32491         Beginning of the IL backend, but very little done, just there for
32492         testing purposes. 
32493
32494 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
32495
32496         * cs-parser.jay: Fix labeled statement.
32497
32498         * cs-tokenizer.cs (escape): Escape " and ' always.
32499         ref_line, ref_name: keep track of the line/filename as instructed
32500         by #line by the compiler.
32501         Parse #line.
32502
32503 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
32504
32505         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32506         to match the values in System.CodeDOM.
32507
32508         Divid renamed to Divide.
32509
32510         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32511         statements. 
32512         (Statements.set): remove.
32513
32514         * System.CodeDOM/CodeCatchClause.cs: always have a valid
32515         statements. 
32516
32517         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32518         falseStatements always have valid values. 
32519
32520         * cs-parser.jay: Use System.CodeDOM now.
32521