e24336b0a73a841ba891298a090787014018d2b2
[mono.git] / mcs / mcs / ChangeLog
1 2009-04-23  Miguel de Icaza  <miguel@novell.com>
2
3         * eval.cs: Make getcompletions silent and enable debugging output
4         if the -v option is passed.
5
6         * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
7         Consider looking up the namespace that matches the prefix being
8         used. 
9
10         This is part of the support for allowing completions like:
11         `System.Co<TAB>' to complete to System.Console.
12
13         * complete.cs (CompletionSimpleName.AppendResults): Make this
14         routine reusable.
15
16 2009-04-21  Raja R Harinath  <harinath@hurrynot.org>
17
18         * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
19         COMPLETE_COMPLETION as internal.
20
21 2009-04-17  Miguel de Icaza  <miguel@novell.com>
22
23         * complete.cs: Include namespace resolution in simple names as
24         well as global types and types in the using scope in the
25         resolution. 
26
27         * namespace.cs: Supporting infrastrcture to provide completions
28         based on the current using scope. 
29
30         * eval.cs: Introduce an entry point that allows for initialization
31         to return a list of the files passed on the command line.
32
33 2009-04-14  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #494243
36         * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
37
38 2009-04-13  Marek Safar  <marek.safar@gmail.com>
39
40         A fix for bug #493887
41         * statement.cs: Don't skip string multi-section with default or
42         null label when populating string hashtable.
43
44 2009-04-06  Marek Safar  <marek.safar@gmail.com>
45
46         A fix for bug #492329
47         * expression.cs (New): Load variable when assigning type parameter
48         to ref variable.
49
50 2009-04-06  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #488960
53         * decl.cs: Compare MVAR types using non-null values.
54
55 2009-03-27  Marek Safar  <marek.safar@gmail.com>
56
57         * typemanager.cs, expression.cs: Removed unused nullable checks.
58
59 2009-03-27  Marek Safar  <marek.safar@gmail.com>
60
61         * *.cs: Removed some gmcs conditionals.
62
63 2009-03-26  Marek Safar  <marek.safar@gmail.com>
64
65         * generic.cs, support.cs: Moved generics stuff out of support.cs
66
67 2009-03-24  Marek Safar  <marek.safar@gmail.com>
68
69         * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
70         DeclaringType.
71
72 2009-03-23  Marek Safar  <marek.safar@gmail.com>
73
74         * attribute.cs: Consider all members for error reporting when
75         checking named arguments.
76
77 2009-03-23  Marek Safar  <marek.safar@gmail.com>
78
79         A fix for bug #487625
80         * namespace.cs: Use a warning for all predefined type conflicts.
81
82 2009-03-23  Marek Safar  <marek.safar@gmail.com>
83
84         A fix for bug #485706
85         * statement.cs: Explicitly type catch type argument to pass verifier
86         check.
87
88 2009-03-22  Miguel de Icaza  <miguel@novell.com>
89
90         Initial support to provide code completion facilities to consumers
91         of the evaluator API.
92         
93         * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
94         support the completion engine.   When we reach the end of the
95         input stream instead of returning EOF, when this flag is true the
96         tokenizer instead produces:
97
98                 One GENERATE_COMPLETION token: this token then must be
99                 handled in the grammar at every point where the user
100                 would likely request a completion.
101
102                 As many COMPLETE_COMPLETION tokens as necessary.   These
103                 tokens are generated to assist the parser in unwinding and
104                 producing a valid parse tree.    
105
106         The parser rules do not have to be perfect, the parser needs to be
107         augmented with judicious use of GENERATE_COMPLETION tokens to
108         improve the areas where we can provide completion and the parser
109         needs to add support for COMPLETE_COMPLETION tokens in productions
110         to make them work.
111
112         It is common to not have enough support for COMPLETE_COMPLETION
113         under certain rules and that even if we generated the
114         GENERATE_COMPLETION token that the resulting tree will be invalid
115         due to the missing rules that support COMPLETE_COMPLETION.
116
117         The final EOF token is produced by having the parser notify the
118         tokenizer when it reaches the root production that the next token
119         should be EOF.
120
121         * support.cs (CompletionResult): New Exception.   This exception
122         is thrown to return the completion results when one of the special
123         completion expressions is reached.
124
125         This exception is thrown by the completing ExpressionStatements
126         classes that live in complete.cs
127
128         * complete.cs (CompletingExpression): a new base class for
129         completing expressions.   This derives from the
130         ExpressionStatement class and not from Expression as it allows
131         completion to happen not only where expressions are expected in
132         the grammar, but also where statements are expected.
133
134         (CompletionSimpleName): A new class used to provide completions
135         for SimpleNames.     This currently only resolves to local
136         variables from the evaluator context (GetVars call).
137
138         (CompletionMemberAccess): Implements support for completing member
139         access patterns. 
140
141         * cs-parser.jay: Add support for completion in a few places. 
142
143         * eval.cs (GetCompletions): New public API for the evaluator that
144         returns a list of possible completions given the input.   The
145         return value is an array of completions 
146
147         * anonymous.cs (Compatible): If the exception thrown from the
148         resolved expression is a CompletionResult exception let that one
149         through instead of printing a diagnostic error in the try/catch. 
150 <       
151 2009-03-22  Miguel de Icaza  <miguel@novell.com>
152
153         * 
154
155         * driver.cs (Main): Use Environment.Exit to quit quickly and
156         prevent the compiler from doing the usual wait for helper thread
157         to terminate.  
158
159         This is to prevent a slowdown that was reported by Gonzalo on
160         ASP.NET 
161
162 2009-03-19  Marek Safar  <marek.safar@gmail.com>
163
164         * ecore.cs: Load build-in types directly instead of accessing
165         an internal field.
166
167 2009-03-18  Marek Safar  <marek.safar@gmail.com>
168
169         * ecore.cs: Always use unbox.any when available.
170
171 2009-03-18  Marek Safar  <marek.safar@gmail.com>
172
173         * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
174
175 2009-03-17  Marek Safar  <marek.safar@gmail.com>
176
177         * generic.cs: Removed obsolete version of type inference.
178
179 2009-03-16  Marek Safar  <marek.safar@gmail.com>
180
181         * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
182         expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
183         delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
184         attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
185
186 2009-03-11  Marek Safar  <marek.safar@gmail.com>
187
188         A fix for bug #482996
189         * anonymous.cs: Make sure we are not infering return type when
190         checking type compatibility.
191
192 2009-03-11  Marek Safar  <marek.safar@gmail.com>
193
194         * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
195         rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
196         generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
197         attributes in their own structure. Needed when accessing their
198         properties before they are resolved.
199
200 2009-03-09  Marek Safar  <marek.safar@gmail.com>
201
202         * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
203         hashtable (~10x faster).
204         
205         * driver.cs: Removed wrong Reset.
206
207 2009-03-08  Marek Safar  <marek.safar@gmail.com>
208
209         * class.cs: Use correct common base type for unmanaged delayed
210         check.
211
212         * rootcontext.cs: Wrap unhandled exception.
213
214 2009-03-06  Raja R Harinath  <harinath@hurrynot.org>
215
216         Make SeekableStreamReader self-tuning and arbitrarily seekable
217         * support.cs (SeekableStreamReader.ResetStream): New.  Allocates
218         the buffer.
219         (SeekableStreamReader.Position.set): Use it.  Simplify logic
220         which, as a side-effect, makes it arbitrarily-seekable.  Tune the
221         buffer size when the stream needs to be re-read from the beginning.
222
223 2009-03-05  Marek Safar  <marek.safar@gmail.com>
224
225         A fix for bug #480100
226         * parameter.cs: A parameter is not hoisted when used directly as ET.
227
228 2009-03-04  Marek Safar  <marek.safar@gmail.com>
229
230         * statement.cs: Fixed an issue when using variable is of interface
231         type.
232
233 2009-03-03  Marek Safar  <marek.safar@gmail.com>
234
235         A fix for bug #480319
236         * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
237
238 2009-03-03  Marek Safar  <marek.safar@gmail.com>
239
240         A fix for bug #480867
241         * typemanager.cs, expression.cs, ecore.cs: Changed method group
242         expression to have no valid type.
243
244 2009-03-03  Marek Safar  <marek.safar@gmail.com>
245
246         A fix for bug #481258
247         * class.cs: Set extension method flag in partial container.
248
249 2009-03-03  Marek Safar  <marek.safar@gmail.com>
250
251         * statement.cs, typemanager.cs: Use expression for StringEmitter.
252         
253         * attribute.cs: Add sanity check.
254
255 2009-02-27  Marek Safar  <marek.safar@gmail.com>
256
257         * class.cs: Add external constructor error.
258
259 2009-02-26  Marek Safar  <marek.safar@gmail.com>
260
261         A fix for bug #475354
262         * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
263         correctly user defined nullable equality operators.
264
265 2009-02-25  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #479532
268         * expression.cs: Implement NewInitialize::AddressOf.
269
270 2009-02-25  Marek Safar  <marek.safar@gmail.com>
271
272         A fix for bug #413633
273         * expression.cs: Iterate all base class-constraint types.
274
275 2009-02-24  Marek Safar  <marek.safar@gmail.com>
276
277         A fix for bug #479209
278         * literal.cs: Mutate null underlying type.
279
280 2009-02-24  Marek Safar  <marek.safar@gmail.com>
281
282         A fix for bug #476295
283         * convert.cs: Avoid wrapping implicitly convertible reference type.
284
285 2009-02-23  Marek Safar  <marek.safar@gmail.com>
286
287         * iterators.cs: Create MemberName correctly.
288
289 2009-02-23  Marek Safar  <marek.safar@gmail.com>
290
291         A fix for bug #478655
292         * literal.cs: Check also underlying null type conversion.
293
294 2009-02-21  Marek Safar  <marek.safar@gmail.com>
295
296         * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
297
298 2009-02-20  Marek Safar  <marek.safar@gmail.com>
299
300         A fix for bug #477447
301         * statement.cs: Add reference to correct parent storey when this
302         is accessible from deep children storey (more than 1 level).
303
304 2009-02-19  Marek Safar  <marek.safar@gmail.com>
305
306         A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
307         * class.cs: Define base type members before setting up member cache.
308
309 2009-02-18  Marek Safar  <marek.safar@gmail.com>
310
311         A fix for bug #477378
312         * nullable.cs, expression.cs, statement.cs: More precise null type
313         sanity checks.
314
315 2009-02-18  Marek Safar  <marek.safar@gmail.com>
316
317         A fix for bug #472805
318         * typemanager.cs, namespace.cs: Import only visible extension method
319         types.
320
321 2009-02-18  Marek Safar  <marek.safar@gmail.com>
322
323         A fix for bug #476895
324         * attribute.cs: Use correct resolve context for attribute type.
325
326 2009-02-18  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #476266
329         * anonymous.cs: Mutate multi-dimensional arrays.
330
331 2009-02-18  Marek Safar  <marek.safar@gmail.com>
332
333         A fix for bug #476400
334         * statement.cs, expression.cs: Removed wrong Dispose optimization.
335
336 2009-02-18  Marek Safar  <marek.safar@gmail.com>
337
338         A fix for bug #476811
339         * generics.cs: Fixed null-literal check.
340
341 2009-02-17  Marek Safar  <marek.safar@gmail.com>
342
343         * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
344         expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
345         messing with static variables.
346
347 2009-02-16  Marek Safar  <marek.safar@gmail.com>
348
349         A fix for bug #475965
350         * generics.cs: Check generic parameter type after extracting from
351         Expression<T>.
352
353 2009-02-16  Marek Safar  <marek.safar@gmail.com>
354
355         A fix for bug #475823
356         * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
357         typed-null support.
358
359 2009-02-14  Marek Safar  <marek.safar@gmail.com>
360
361         * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
362         Simplified event field definition using backing field and not
363         field builder directly.
364
365         * expression.cs (EmitLdArg): Optimize fast paths.
366
367 2009-02-13  Marek Safar  <marek.safar@gmail.com>
368
369         A fix for bug #475327
370         * expression.cs (ArrayCreation): Don't mutate values optimized away.
371
372 2009-02-13  Marek Safar  <marek.safar@gmail.com>
373
374         A fix for bug #475342
375         * cs-parser.jay: Using 'super' instead of 'base' to call base
376         constructor crashes compiler.
377
378 2009-02-13  Marek Safar  <marek.safar@gmail.com>
379
380         A fix for bug #475354
381         * expression.cs (Constantify): Add nullable types.
382         
383         * const.cs (EmitDecimalConstant): Avoid explicit cast.
384
385 2009-02-12  Marek Safar  <marek.safar@gmail.com>
386
387         A fix for bug #475246
388         * expression.cs: More broken flowanalysis hacking needed.
389
390 2009-02-12  Marek Safar  <marek.safar@gmail.com>
391
392         * attribute.cs: Compare only ref/out array modifiers. 
393
394 2009-02-11  Marek Safar  <marek.safar@gmail.com>
395
396         * statement.cs: Use member cache when looking for foreach members.
397
398 2009-02-11  Marek Safar  <marek.safar@gmail.com>
399
400         * expression.cs: Don't expose internal initializer types.
401         
402         * statement.cs: Check also explicit conversions for goto case.
403
404 2009-02-11  Marek Safar  <marek.safar@gmail.com>
405
406         * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
407
408 2009-02-10  Marek Safar  <marek.safar@gmail.com>
409
410         * *.cs: Replace null-type with NullLiteral where appropriate.
411
412 2009-02-09  Marek Safar  <marek.safar@gmail.com>
413
414         * expression.cs: Initializer of reference argument use temporary
415         variable to be verifiable.
416         
417         * parameter.cs: Share EmitLdArg.
418
419 2009-02-09  Marek Safar  <marek.safar@gmail.com>
420
421         A fix for bug #473559
422         * class.cs: Fixed: Not reporting error about nested class with the
423         same name.
424
425 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
426
427         Contributed under the MIT/X11 license.
428
429         * generic.cs: Added VerifyVariantTypeParameters which performs new
430         variance verification logic. The old logic, based on the spec, was
431         wrong because the spec is full of LIES!
432
433         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
434
435         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
436
437         * class.cs:
438         * ecore.cs: Added calls to the new variance verification logic.
439
440         * parameter.cs:
441         * delegate.cs: Removed calls to the old variance verification logic.
442
443 2009-02-06  Marek Safar  <marek.safar@gmail.com>
444
445         * delegate.cs: Use cached Invoke method directly.
446
447 2009-02-06  Marek Safar  <marek.safar@gmail.com>
448
449         * expression.cs: Emit expression tree for hoisted variable access.
450
451 2009-02-04  Marek Safar  <marek.safar@gmail.com>
452
453         * namespace.cs: Add better extension class check.
454
455 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
456
457         * generic.cs: Fixed typeo (TypeParameter.Variacne).
458
459 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
460
461         This patch adds initial generic variance support to the compiler.
462         It is contributed under the MIT/X11 license.
463
464         * typemanager.cs: Modified ImplementsInterface to check variance.
465         Added VerifyVariantTypeParameters which checks the specified type to see
466         if it uses a variant type parameter as a type argument (which is not
467         allowed). Added IsVariantOf which determins if the first type is a
468         variant of the second. NOTE: This only supports reference types at
469         the moment to conform with the current level of VM support. When the
470         VM supports value types, this will follow step.
471
472         * generic.cs: Added the Variance enum. Added a Variance property to
473         TypeParameter and added variance support to definition phase. Added a
474         Variance property to TypeParameterName. Also check to make sure that
475         no variant types appear in generic method parameters.
476
477         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
478         keywords if the langversion supports it.
479
480         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
481         that variant types are only used in legal positions. Also added
482         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
483         parameters.
484
485         * decl.cs: Construct TypeParameter with the variance information.
486
487         * convert.cs: Checks variance in ImplicitReferenceConversionExists
488         and ImplicitConversionStandard.
489
490         * rootcontext.cs: Added new "Future" language version.
491
492         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
493         type parameters are not used as type arguments in interface inheritance.
494         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
495         parameters are not used as method return types. In MemberBase.
496         ResolveMemberType, ensure that variant type parameters are not used
497         as type arguments. Also call VerifyNoVariantTypeParameters on every
498         set of parameters which are resolved.
499
500         * delegate.cs: Modified Delegate.Define to ensure that variant
501         parameters are not used as type arguments and that a contravariant
502         parameter is not used as the return type. Also call
503         VerifyNoVariantTypeParameters on the delegate parameters.
504
505         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
506         to specify generic variance.
507
508         * driver.cs: Added support for LanguageVersion.Future in the form of
509         "-langversion:future".
510
511         * generic-mcs.cs: Stubbed out new members in generic.cs.
512
513 2009-02-03  Marek Safar  <marek.safar@gmail.com>
514
515         * class.cs, generic.cs: Emit type parameter constraints for nested
516         types.
517
518 2009-02-02  Marek Safar  <marek.safar@gmail.com>
519
520         A fix for bug #471213
521         * class.cs: Avoid emitting backing field for abstract event fields.
522
523 2009-02-01  Marek Safar  <marek.safar@gmail.com>
524
525         A fix for bug #359731
526         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
527         expressions.
528
529 2009-01-30  Marek Safar  <marek.safar@gmail.com>
530
531         A fix for bug #470767
532         * statement.cs: Introduced BlockScopeExpression, needed when 
533         expression tree conversion has to emit scope variables.
534
535 2009-01-29  Marek Safar  <marek.safar@gmail.com>
536
537         * class.cs: Remove duplicate CallingConvention.
538
539 2009-01-29  Marek Safar  <marek.safar@gmail.com>
540
541         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
542         when I finally found the right naming convention.
543
544 2009-01-29  Marek Safar  <marek.safar@gmail.com>
545
546         * cs-tokenizer.cs: Put back different open parens optimization.
547
548 2009-01-28  Marek Safar  <marek.safar@gmail.com>
549
550         A fix for bug #470227
551         * cs-tokenizer.cs: Remove too agressive parser optimization.
552
553 2009-01-28  Marek Safar  <marek.safar@gmail.com>
554
555         A fix for bug #324319
556         * class.cs: Remove too early base type resolve.
557
558 2009-01-27  Marek Safar  <marek.safar@gmail.com>
559
560         A fix for bug #324319
561         * ecore.cs: Explicitly type null when assigning to type argument to
562         make pass verifier check.
563
564 2009-01-27  Marek Safar  <marek.safar@gmail.com>
565
566         * anonymous.cs: Fixed recent regression when initializing captured 
567         this.
568
569 2009-01-26  Marek Safar  <marek.safar@gmail.com>
570
571         A fix for bug #469019
572         * anonymous.cs: Use all parent type parameters when instantiating
573         nested generic storey.
574
575 2009-01-26  Marek Safar  <marek.safar@gmail.com>
576
577         * expression.cs: Check for null instance methodgroup expression.
578
579 2009-01-26  Marek Safar  <marek.safar@gmail.com>
580
581         A fix for bug #469244
582         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
583         instance inside a conditional expression.
584
585 2009-01-23  Marek Safar  <marek.safar@gmail.com>
586
587         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
588         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
589         GetElementType and HasElementType. IsValueType clean up.
590
591 2009-01-23  Marek Safar  <marek.safar@gmail.com>
592
593         * nullable.cs: Use common EmitCall.
594         
595         * expression.cs: Emit constraint. for virtual calls only.
596
597 2009-01-23  Marek Safar  <marek.safar@gmail.com>
598
599         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
600         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
601         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
602         checks.
603
604 2009-01-22  Jb Evain  <jbevain@novell.com>
605
606         * anonymous.cs: make anonymous types' ToString implementation
607         match what csc outputs.
608
609 2009-01-21  Marek Safar  <marek.safar@gmail.com>
610
611         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
612         up.
613
614 2009-01-17  Marek Safar  <marek.safar@gmail.com>
615
616         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
617         verifier checks.
618
619 2009-01-16  Marek Safar  <marek.safar@gmail.com>
620
621         * nullable.cs (LiftedBinaryOperator): Check for all possible null
622         expressions.
623
624 2009-01-15  Marek Safar  <marek.safar@gmail.com>
625
626         A fix for bug #466634
627         * statement.cs: Add reference for nested storey when only this
628         is captured.
629
630 2009-01-15  Marek Safar  <marek.safar@gmail.com>
631
632         A fix for bug #466474
633         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
634         was specified.
635
636 2009-01-15  Marek Safar  <marek.safar@gmail.com>
637
638         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
639         Fixed nested stories parent referencing process. Also fixes #463985.
640
641 2009-01-06  Marek Safar  <marek.safar@gmail.com>
642
643         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
644         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
645         implementation. Also fixes #463108.
646
647 2009-01-05  Marek Safar  <marek.safar@gmail.com>
648
649         A fix for bug #416109
650         * decl.cs: Issue correct CLSAttribute warning location.
651
652 2009-01-05  Marek Safar  <marek.safar@gmail.com>
653
654         A fix for bug #456775
655         * attribute.cs: Use attribute owner scope when resolving attribute
656         arguments.
657
658 2009-01-05  Marek Safar  <marek.safar@gmail.com>
659
660         A fix for bug #457257
661         * decl.cs: Fixed incorrect member declaring type comparison.
662
663 2009-01-05  Marek Safar  <marek.safar@gmail.com>
664
665         A fix for bug #460896
666         * driver.cs: Handle /RES resources as embeddable.
667
668 2009-01-05  Marek Safar  <marek.safar@gmail.com>
669
670         A fix for bug #462515
671         * ecore.cs: Report inacessible members upwards.
672
673 2009-01-05  Marek Safar  <marek.safar@gmail.com>
674
675         A fix for bug #463190, #463192
676         * decl.cs, namespace.cs: Also import internal extension classes.
677
678 2009-01-04  Marek Safar  <marek.safar@gmail.com>
679
680         A fix for bug #463415
681         * generic.cs: Use right index for RemoveDependentTypes.
682
683 2009-01-02  Marek Safar  <marek.safar@gmail.com>
684
685         A fix for bug #463196
686         * expression.cs: Fixed enum to null comparison.
687
688 2009-01-02  Marek Safar  <marek.safar@gmail.com>
689
690         A fix for bug #463121
691         * nullable.cs: Fixed nullable user equality operator comparison.
692
693 2009-01-02  Marek Safar  <marek.safar@gmail.com>
694
695         A fix for bug #462950
696         * class.cs, decl.cs: Use full explicit name when defining automatic
697         property backing field.
698
699 2009-01-02  Marek Safar  <marek.safar@gmail.com>
700
701         A fix for bug #462592
702         * pending.cs: Emit type arguments for generic proxy method.
703
704 2008-12-30  Marek Safar  <marek.safar@gmail.com>
705
706         * expression.cs (As): Mutate all type arguments.
707
708 2008-12-29  Marek Safar  <marek.safar@gmail.com>
709
710         A fix for bug #462622
711         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
712         context.
713
714 2008-12-29  Marek Safar  <marek.safar@gmail.com>
715
716         A fix for bug #450782
717         * ecore.cs: Consider more variables of form V.I to be fixed.
718
719 2008-12-29  Marek Safar  <marek.safar@gmail.com>
720
721         A fix for bug #460712
722         * typemanager.cs: Core types could be imported.
723
724 2008-12-28  Marek Safar  <marek.safar@gmail.com>
725
726         A fix for bugs #460847, #460772, #458049, #457339, #447807
727         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
728         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
729         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
730         user lambdas used inside query clauses.
731
732 2008-12-18  Marek Safar  <marek.safar@gmail.com>
733
734         A fix for bug #460229
735         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
736
737 2008-12-18  Marek Safar  <marek.safar@gmail.com>
738
739         A fix for bug #459952
740         * decl.cs, namespace.cs: Use common CheckAccessLevel.
741
742 2008-12-18  Marek Safar  <marek.safar@gmail.com>
743
744         A fix for bug #459630
745         * convert.cs: Enum to valuetype conversion is not allowed.
746
747 2008-12-18  Marek Safar  <marek.safar@gmail.com>
748
749         A fix for bug #457087
750         * generic.cs: Don't crash when constraint comes from type
751         declaration.
752
753 2008-12-16  Marek Safar  <marek.safar@gmail.com>
754
755         A fix for bug #459221
756         * anonymous.cs, statement.cs: Delay only captured this
757         initialization.
758
759 2008-12-12  Marek Safar  <marek.safar@gmail.com>
760
761         A fix for bug #457489
762         * anonymous.cs, statement.cs: Split anonymous storey instantiation
763         and initialization to capture scope initializers correctly.
764
765 2008-12-11  Marek Safar  <marek.safar@gmail.com>
766
767         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
768         ParameterReference refactoring.
769
770 2008-12-03  Marek Safar  <marek.safar@gmail.com>
771
772         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
773         to be imported from any assembly.
774
775 2008-12-03  Marek Safar  <marek.safar@gmail.com>
776
777         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
778         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
779         from anonymous method and lambda expression.
780
781 2008-12-01  Marek Safar  <marek.safar@gmail.com>
782
783         A fix for bug #448560
784         * expression.cs (As): Box any generic type arguments to be
785         verifiable.
786
787 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
788
789         Add tripwire for implicit conversion bugs
790         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
791         for CS1501 error.
792         (MethodGroupExpr.OverloadResolve): Add sanity check between
793         IsApplicable and VerifyArgumentsCompat.
794         (VerifyArgumentsCompat): Report CS1501 where appropriate.
795
796 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
797
798         Fix build break in System.Data_test
799         * convert.cs (ImplicitConversionExists): Move NullLiteral
800         conversions ...
801         (ImplicitStandardConversionExists): ... here.
802
803 2008-11-28  Marek Safar  <marek.safar@gmail.com>
804
805         * literal.cs: Emit correctly explicit null to nullable cast.
806
807 2008-11-28  Marek Safar  <marek.safar@gmail.com>
808
809         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
810         resolve.
811
812 2008-11-28  Marek Safar  <marek.safar@gmail.com>
813
814         A fix for bug #449005
815         * convert.cs, nullable.cs: Use only one implicit nullable
816         conversion.
817
818 2008-11-27  Marek Safar  <marek.safar@gmail.com>
819
820         * convert.cs, literal.cs: More Convert cleanup is needed.
821
822 2008-11-27  Marek Safar  <marek.safar@gmail.com>
823
824         * decl.cs, class.cs: Fixed misleading error message.
825
826 2008-11-26  Marek Safar  <marek.safar@gmail.com>
827
828         A fix for bug #449005
829         * nullable.cs (EmitEquality): Disable optimization for user operator
830         operands.
831
832 2008-11-25  Marek Safar  <marek.safar@gmail.com>
833
834         A fix for bug #447027
835         * anonymous.cs (HoistedVariable): Cache also outer access to deal
836         with context variables stored as expression instances.
837
838 2008-11-25  Marek Safar  <marek.safar@gmail.com>
839
840         A fix for bug #447027
841         * delegate.cs: Fixed delegate VerifyMethod logic.
842
843 2008-11-24  Marek Safar  <marek.safar@gmail.com>
844
845         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
846         but not verifiable.
847
848 2008-11-21  Marek Safar  <marek.safar@gmail.com>
849
850         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
851         member type resolve to follow normal flow, instead of random
852         property access.
853
854 2008-11-21  Marek Safar  <marek.safar@gmail.com>
855
856         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
857         type.
858
859 2008-11-21  Marek Safar  <marek.safar@gmail.com>
860
861         * const.cs: Emit decimal array constant as literal.
862
863 2008-11-20  Marek Safar  <marek.safar@gmail.com>
864
865         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
866
867 2008-11-19  Marek Safar  <marek.safar@gmail.com>
868
869         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
870         into real property (saves 8 MB for corlib compilation).
871
872 2008-11-19  Marek Safar  <marek.safar@gmail.com>
873
874         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
875         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
876         generic-mcs.cs: Small cleanup of TypeArguments.
877
878 2008-11-18  Marek Safar  <marek.safar@gmail.com>
879
880         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
881         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
882         of ConstructedType expression, renamed to GenericTypeExpr.
883
884 2008-11-17  Marek Safar  <marek.safar@gmail.com>
885
886         A fix for bug #445303
887         * location.cs (IsConditionalDefined): Handle undefined global
888         defines.
889
890 2008-11-17  Marek Safar  <marek.safar@gmail.com>
891
892         A fix for bug #444678
893         * expression.cs (TryReduceConstant): Always create new constant
894         instance.
895
896 2008-11-17  Marek Safar  <marek.safar@gmail.com>
897
898         A fix for bug #444673
899         * ecore.cs: Ignore open generic types when used as generic type
900         instance fields.
901
902 2008-11-17  Marek Safar  <marek.safar@gmail.com>
903
904         A fix for bug #445458
905         * expression.cs, cs-parser.jay: Don't crash when an expression
906         statement is null.
907
908 2008-11-17  Marek Safar  <marek.safar@gmail.com>
909
910         A fix for bug #445464
911         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
912         inside unbound type.
913
914 2008-11-14  Jb Evain  <jbevain@novell.com>
915
916         * driver.cs: ignore empty -nowarn argument such as
917         the one in -nowarn:12,13,,.
918
919 2008-11-13  Marek Safar  <marek.safar@gmail.com>
920
921         A fix for bug #444271
922         * anonymous.cs: Rescan parent storeys when best candidate was
923         undone.
924
925 2008-11-13  Marek Safar  <marek.safar@gmail.com>
926
927         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
928         useless UnboundTypeExpression.
929         
930         * attribute.cs: Do check obsolete attribute on generic types.
931
932 2008-11-12  Marek Safar  <marek.safar@gmail.com>
933
934         A fix for bugs #425680, #400139
935         * ecore.cs, expression.cs: Trying to do some almost_matched_members
936         refactoring.
937
938 2008-11-11  Marek Safar  <marek.safar@gmail.com>
939
940         A fix for bug #435747
941         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
942         compound value types assignment. Few micro optimizations added.
943
944 2008-11-10  Marek Safar  <marek.safar@gmail.com>
945
946         A fix for bug #442610
947         * anonymous.cs (MutateConstructor): More SRE hacking.
948
949 2008-11-10  Marek Safar  <marek.safar@gmail.com>
950
951         A fix for bug #442579
952         * ecore.cs: Also initialize expanded form of a method with 1 params
953         parameter.
954
955 2008-11-06  Marek Safar  <marek.safar@gmail.com>
956
957         * expression.cs (UnaryMutator): Do early l-side check.
958
959 2008-11-05  Miguel de Icaza  <miguel@novell.com>
960
961         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
962         Init, otherwise we would crash later on when checking for friend
963         assemblies. 
964
965         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
966         Otherwise we never get any meaningful information as to what
967         failed. 
968
969 2008-11-05  Marek Safar  <marek.safar@gmail.com>
970
971         A fix for bug #436318
972         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
973
974 2008-11-05  Miguel de Icaza  <miguel@novell.com>
975
976         * namespace.cs: Turns out that it was a really bad idea to hide
977         the errors for namespaces not found here in eval mode.    
978
979         * eval.cs: When we process using clauses, only enter those into
980         the list of valid using clauses after they have been validated.   
981
982         The above change gives the proper semantics: it does not
983         senselessly report the same errors with broken using statements by
984         never storing them in the first place when they are invalid.
985
986 2008-11-05  Marek Safar  <marek.safar@gmail.com>
987
988         A fix for bug #421839
989         * cs-parser.jay: Remove expression from coalesce rule to force lower
990         priority than the assignment operator.
991
992 2008-11-05  Marek Safar  <marek.safar@gmail.com>
993
994         A fix for bug #437875
995         * nullable.cs: Compile correctly method group operand used with null
996         coalescing operator.
997
998 2008-11-04  Marek Safar  <marek.safar@gmail.com>
999
1000         A fix for bug #434589
1001         * expression.cs (Binary): Ignore lifted conversions when at least
1002         one operand is of reference type.
1003
1004 2008-11-04  Marek Safar  <marek.safar@gmail.com>
1005
1006         * cs-parser.jay: Better syntax error report.
1007
1008 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1009
1010         A fix for bug #436792
1011         * cs-parser.jay: Use GetLocation to access location.
1012
1013 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1014
1015         A fix for bug #440774
1016         * cs-parser.jay: Also set current_array_type when parsing local
1017         variables types.
1018
1019 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1020
1021         A fix for bug #440785
1022         * expression.cs (As): Don't resolve self modifing expression
1023         multiple times.
1024
1025 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1026
1027         A fix for bug #439447
1028         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1029
1030 2008-11-03  Marek Safar  <marek.safar@gmail.com>
1031
1032         A fix for bug #437571
1033         * cs-parser.jay: Fixes internal error for invalid expression
1034         statements.
1035
1036 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1037
1038         * ecore.cs: Resolve correctly ambiguous params delegate methods.
1039
1040 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1041
1042         * generic.cs, anonymous.cs: Simplified GetDeclarations.
1043
1044 2008-10-17  Marek Safar  <marek.safar@gmail.com>
1045
1046         * cs-tokenizer.cs: More precise cast parsing.
1047
1048 2008-10-16  Martin Baulig  <martin@ximian.com>
1049
1050         * anonymous.cs (AnonymousMethodStorey): Put back the
1051         `hoisted_locals' hashtable and use it in EmitType().
1052
1053 2008-10-15  Marek Safar  <marek.safar@gmail.com>
1054
1055         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
1056         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
1057         ~5MB for corlib.
1058
1059 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1060
1061         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
1062
1063 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1064
1065         * statement.cs: Mutate scope initializers.
1066
1067 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1068
1069         * expression.cs: Use typeless value for This constant.
1070         
1071         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
1072
1073 2008-10-14  Marek Safar  <marek.safar@gmail.com>
1074
1075         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
1076         tokenizer.
1077
1078 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1079
1080         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
1081         type to type cast.
1082
1083 2008-10-13  Marek Safar  <marek.safar@gmail.com>
1084
1085         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
1086         parser and tokenizer. Fixes many ambiguities including #433258.
1087
1088 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1089
1090         * cs-parser.jay: Fixed missing accessor recovery.
1091
1092 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1093
1094         A fix for bug #433701
1095         * expression.cs: Better error message.
1096
1097 2008-10-10  Marek Safar  <marek.safar@gmail.com>
1098
1099         * cs-parser.jay, expression.cs: Start reporting real parser errors.
1100         
1101         * Makefile: Disabled unused debug symbols.
1102
1103         Also fixes: #320556, #321097, #321656, #321876, #351316
1104
1105 2008-10-09  Miguel de Icaza  <miguel@novell.com>
1106
1107         * eval.cs: rename "<interactive>" to "{interactive}", to work
1108         around a requirement in the compiler that this be a valid
1109         filename, and in Windows it is not (433886).
1110
1111 2008-10-09  Marek Safar  <marek.safar@gmail.com>
1112
1113         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
1114
1115 2008-10-08  Marek Safar  <marek.safar@gmail.com>
1116
1117         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
1118         cs-parser.jay: Generic type declaration and type arguments cleanup.
1119
1120 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1121
1122         * cs-parser.jay: Allow parsing weird array creation construct.
1123
1124 2008-10-05  Marek Safar  <marek.safar@gmail.com>
1125
1126         * cs-parser.jay: Conflicts reduction.
1127
1128 2008-10-04  Marek Safar  <marek.safar@gmail.com>
1129
1130         * cs-parser.jay: Conflicts reduction.
1131
1132 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
1133
1134         Fix #398325
1135         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
1136         property.  Add a 'count' hint about the use of the shared vector.
1137         Ensure that we don't leak out dirty bits.
1138         (UsageVector.MergeChild): Throw away information about variables
1139         in child vectors.
1140         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
1141
1142 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1143
1144         A fix for bug #431746
1145         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
1146         parameters when iterator is created.
1147
1148 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1149
1150         A fix for bug #431827
1151         * expression.cs: Fixed right based pointer arithmetic operations
1152         emit.
1153
1154 2008-10-03  Marek Safar  <marek.safar@gmail.com>
1155
1156         A fix for bug #353779
1157         * assign.cs, expression.cs: Fixed compound assignment conversions.
1158
1159 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1160
1161         A fix for bug #375262
1162         * statement.cs: Refactor ArrayForeach to be usable with string
1163         indexer. Optimized single dimentional arrays foreach.
1164
1165 2008-10-02  Marek Safar  <marek.safar@gmail.com>
1166
1167         A fix for bug #431255
1168         * anonymous.cs, expression.cs: Removed broken optimization.
1169
1170 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1171
1172         * anonymous.cs: Use full type parameters of parent generic
1173         containers. Removed unnecessary AddParentStoreyReference call.
1174
1175 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1176
1177         A fix for bug #324702
1178         * class.cs: Use better shorter names for explicit interface member
1179         implementations.
1180
1181         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
1182
1183 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1184         
1185         * expression.cs: Use new interface to check fixed expression.
1186
1187 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1188
1189         A fix for bug #421101
1190         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
1191         interface to check for fixed fixed-buffers.
1192
1193 2008-10-01  Marek Safar  <marek.safar@gmail.com>
1194
1195         A fix for bug #429264
1196         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
1197         
1198         * delegate.cs: Removed unnecessary casts.
1199
1200 2008-09-30  Marek Safar  <marek.safar@gmail.com>
1201
1202         A fix for bug #352151
1203         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
1204         class.cs: Fixed already defined explicit interface members check.
1205
1206 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
1207
1208         cs-tokenizer.cs: Fix typo.
1209
1210 2008-09-28  Miguel de Icaza  <miguel@novell.com>
1211
1212         * eval.cs (InteractiveBase): The quit command now just sets a
1213         flag, instead of calling Environment.Exit(), it is milder on
1214         embedded hosts. 
1215
1216         CompiledMethod is now in Mono.CSharp, not nested inside
1217         the Evaluator, it was inconvenient to use.
1218
1219 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1220
1221         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
1222         code to be invoked without having to reparse.
1223
1224 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1225
1226         * ecore.cs: The recent changes to FieldExpr broke this as well.
1227         Fixes LINQ queries in the interactive shell.
1228
1229         * Multiple files: indentation fixing for the Mono coding
1230         guidelines for the switch statement.
1231
1232         * eval.cs: Make the Evaluator API thread safe.
1233
1234 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1235
1236         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
1237         constructor parsing.
1238
1239 2008-09-26  Marek Safar  <marek.safar@gmail.com>
1240
1241         A fix for bug #325326
1242         * statement.cs: Check possible mistaken empty statement using
1243         explicit blocks only.
1244
1245 2008-09-25  Miguel de Icaza  <miguel@novell.com>
1246
1247         * eval.cs (LoadAssembly, ReferenceAssembly): Call
1248         RootNamespace.ComputeNamespaces to update the internal list of
1249         namespaces, this is no longer done for us.
1250
1251         (InteractiveBase): Use the Evaluator APIs instead of calling into
1252         Driver directly
1253
1254 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1255
1256         A fix for bug #429264
1257         * expression.cs: Missing mutator for access to multidimensional
1258         arrays.
1259
1260 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1261
1262         * class.cs, statement: Emit DebuggerHidden attribute for iterator
1263         entry wrapper.
1264         
1265         * driver.cs: Missing input argument check.
1266
1267 2008-09-25  Marek Safar  <marek.safar@gmail.com>
1268
1269         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
1270         expression.cs, statement.cs, rootcontext.cs, class.cs, 
1271         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
1272         DefineMembers.
1273
1274 2008-09-24  Miguel de Icaza  <miguel@novell.com>
1275
1276         * ecore.cs (FieldExpr): Only initialize eclass when we return a
1277         fully constructed FieldExpr, fixes the regression introduced in
1278         the last commit.
1279         
1280         * ecore.cs, expression.cs: Plug back the eclass initialization as
1281         otherwise it regresses `csharp'. 
1282
1283 2008-09-24  Marek Safar  <marek.safar@gmail.com>
1284
1285         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
1286         ecore.cs, attribute.cs: Moved obsolete method checks from emit
1287         phase to resolve phase. It resolves problems with expression trees
1288         and fixes bugs #323796, #325156.
1289
1290 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1291
1292         * codegen.cs: Report better error when symbol writer is missing.
1293
1294 2008-09-23  Marek Safar  <marek.safar@gmail.com>
1295
1296         * codegen.cs: Set .NET symbol writer.
1297         
1298         * decl.cs: Guard against null generic arguments.
1299         
1300         * report.cs: Don't report exactly same additional details.
1301
1302 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1303
1304         A fix for bug #324917
1305         * cs-parser.jay: Add missing multidimensional non-expression type
1306         ranks.
1307         
1308 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1309
1310         A fix for bug #428191
1311         * anonymous.cs: Create an outer generic fields also for non-storey
1312         anonymous methods.
1313
1314 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1315
1316         A fix for bug #378294
1317         * class.cs: Make fixed size buffers gmcs feature only.
1318
1319 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1320
1321         A fix for bug #355622, #324993
1322         * assign.cs, const.cs, class.cs: Create new EmitContext for each
1323         field initializer.
1324
1325 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1326
1327         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1328         error reporting.
1329
1330 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1331
1332         A fix for bug #416110
1333         * generic.cs: Struct constraint results in default ctor and
1334         ValueType base type constraint to be set.
1335
1336 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1337
1338         A fix for bug #423791
1339         * generic.cs: Fixed params output type type-inference.
1340
1341 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1342
1343         * cs-parser.jay, expression.cs: Fixed few expression crashes.
1344         
1345 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1346
1347         * cs-tokenizer.cs: Don't break on extra partial modifier.
1348
1349 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1350
1351         A fix for bug #427592
1352         * generic.cs: Use common parameter resolve method.
1353
1354 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1355
1356         A fix for bug #414758
1357         * expression.cs, ecore.cs: Fixed crash when accessing non-static
1358         property.
1359
1360 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1361
1362         * driver.cs, namespace.cs: Read types and namespaces after all
1363         requested assemblies are loaded, fixes issues with System.Core
1364         auto-reference, and #419888.
1365
1366 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1367
1368         A fix for bug #417705
1369         * cs-parser.jay: Fixed as/is operator expression split.
1370
1371 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1372
1373         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1374         Fixed expression tree representation of empty new expression and
1375         new initializer expression.
1376
1377 2008-09-18  Miguel de Icaza  <miguel@novell.com>
1378
1379         * eval.cs: Remove warning, keep reference to driver around.
1380
1381         * Hide fields that do not need to be public.
1382
1383 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1384
1385         A fix for bug #426385
1386         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1387         conversion for array elements.
1388
1389 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1390
1391         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1392         void parsing conflicts.
1393
1394 2008-09-15  Marek Safar  <marek.safar@gmail.com>
1395
1396         A fix for bug #425601
1397         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1398         System.Core only when there is no custom ExtensionAttribute
1399         implementation.
1400
1401 2008-09-15  Miguel de Icaza  <miguel@novell.com>
1402
1403         * namespace.cs: Do not report CS0246 (name
1404
1405 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1406
1407         A fix for bug #425669
1408         * generic.cs: Don't cache generic static anonymous method 
1409         containers.
1410
1411 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1412
1413         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1414         conflicting constraints.
1415
1416 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1417
1418         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1419         mcs too.
1420
1421 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1422
1423         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1424         to null pointer conversion fixes.
1425
1426 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1427
1428         * cs-parser.jay, expression.cs: An implicitly typed local variable
1429         declarator cannot use an array initializer.
1430
1431 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1432
1433         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1434
1435 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1436
1437         * generic.cs (InflatedConstraints): Don't crash when constraints
1438         are different.
1439         
1440         * cs-parser.jay: const_declarator is a block.
1441
1442         * constant.cs: Check for not allowed NaN conversions.
1443
1444 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1445
1446         * driver.cs: Drop --shell argument, the compiler is no longer a
1447         REPL. 
1448
1449         * eval.cs: Move most of the code that deals with evaluation into
1450         this file and document the public API from repl.cs
1451
1452         * repl.cs: Remove from here.
1453         
1454 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1455
1456         A fix for bug #424684
1457         * generic.cs: Generic class constraints must come first.
1458
1459 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1460
1461         * cs-parser.jay: Improve error reporting for syntax errors in
1462         statements and expressions, we now report the expected tokens
1463         instead of reporting the useless "; expected".
1464
1465         Drop the strings from the token declaration, it turns out that
1466         they did not do what I thought they did.  Instead they were adding
1467         two sets of tokens to the tables.
1468
1469 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1470
1471         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1472         delegate.cs: Share special type check.
1473
1474 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1475
1476         A fix for bug #423981
1477         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1478
1479 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1480
1481         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1482         ConvertImplicitly.
1483
1484 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1485
1486         A fix for bugs: #324750, #335946
1487         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1488         lookup rule to determine ?-based tokens.
1489
1490 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1491
1492         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1493         expressions (like event adding or removing) end up here, so we
1494         need to treat those as statements.
1495
1496         Add LoadAssembly method.
1497
1498 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1499
1500         * repl.cs: Add Time method.
1501
1502 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1503
1504         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1505
1506 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1507
1508         * repl.cs: Add workaround for old compilers.
1509
1510 2008-09-04  Jb Evain  <jbevain@novell.com>
1511
1512         * repl.cs (PrettyPrint): pretty print everything that
1513         implements IDictionary, as well as IEnumerables. Also,
1514         add a quit helper property.
1515
1516 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1517
1518         * constant.cs: Better error reporting for decimal literals.
1519         
1520         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1521         field attributes.
1522         
1523 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1524                         Miguel de Icaza  <miguel@novell.com>
1525
1526         A fix for bug #422951
1527         * assign.cs (Assign.DoResolve): Perform the type conversions
1528         checks before we attempt to initialize `New' initializers. 
1529
1530 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1531
1532         A fix for bug #422853
1533         * delegate.cs (DelegateCreation): Add special handling for
1534         EmptyExpression.Null instance expression which is just another
1535         hack for undecided member instance exression.
1536
1537 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1538
1539         * expression.cs, ecore.cs: Emit full expression tree for reduced
1540         binary expressions.
1541
1542 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1543
1544         * expression.cs (This): Guard against multi-resolving.
1545         
1546         * ecore.cs, statement.cs (Throw): Simplified.
1547         
1548         * flowanalysis.cs: Also verify event fields.
1549
1550 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1551
1552         * assign.cs (Assign.DoResolve): Perform the type conversions
1553         checks before we attempt to initialize `New' initializers. 
1554
1555         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1556
1557         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1558         public. 
1559
1560         * repl.cs: Update help.
1561
1562 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1563
1564         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1565         handling of the default config handling, including the special
1566         treatment of System.Core assembly. 
1567
1568         Fixes the REPL processing for LINQ.
1569
1570 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1571
1572         A fix for bug #422507
1573         * expression.cs (UnboxCast): Add missing child expression mutator.
1574
1575 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1576
1577         * driver.cs: Don't self reference System.Core assembly.
1578
1579 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1580
1581         A fix for bug #422507
1582         * expression.cs (StringConcat): Add missing type mutator.
1583
1584 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1585
1586         * generic.cs (TypeInferenceContext): Follow equality rule for
1587         constructed type lower bound type inference.
1588
1589 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1590
1591         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1592         <dblank@cs.brynmawr.edu> which updates the cursor position on
1593         refresh.
1594         
1595 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1596
1597         A fix for bug #367145
1598         * driver.cs: Fixed import of extension methods when using -noconfig
1599         option.
1600
1601 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1602
1603         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1604         version from non-generic implementation instead.
1605
1606 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1607
1608         A fix for bug #418908
1609         * class.cs: Use AddScopeStatement for field initializers.
1610
1611 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1612
1613         A fix for bug #415385
1614         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1615
1616 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1617
1618         A fix for bug #421736
1619         * iterators.cs: Don't crash on unreachable iterators.
1620
1621 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1622
1623         A fix for bug #421628
1624         * parameter.cs, attribute.cs: Clone also parameter attributes.
1625
1626 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1627
1628         * namespace.cs (LookupType): In EvalMode, try to replace
1629         the TypeBuilder from our cache with a Type as Reflection.Emit does
1630         not  like to mix code from older assemblies emitted and new
1631         assemblies emitted. 
1632
1633         This sounds like a serious Mono bug that prevents multiple
1634         assemblies to be generated and consumed at the same time.
1635
1636         * cs-parser.jay (push_current_class): Do not make interactive
1637         classes internal or private, make them public as we currently
1638         generate each new class in a new assembly.   
1639
1640 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1641
1642         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1643         remove types that are entered into the global namespace during
1644         parsing so that we can remove them on failure.
1645  
1646         * cs-parser.jay: Parsing: we now keep track of types that are
1647         entered into global variables and queue those in case the parsing
1648         or resolution fail.
1649  
1650         This happens in a few situations: during partial-input, we invoke
1651         the parser repeatedly for example with the string "class X", this
1652         would cause X to be registed, and we need to remove this
1653         registration so that another parse attempt later with say "class X {"
1654         would actually work.
1655  
1656         Additionally, if there is an error in the resolution phase, for
1657         example: "class X : NonExistant {}" th
1658         
1659         * cs-parser.jay: Be more precise with the errors being raised,
1660         instead of flagging all exceptions during parsing to be attributed
1661         to the parsing process, distinguish those from errors happening in
1662         the actions and hint that using -v would produce the actual
1663         exception. 
1664
1665         * repl.cs: Do not load all compiler references on each reset,
1666         doing the partial reset takes care of this.
1667         
1668 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1669
1670         * repl.cs: Add support for loading all the files from
1671         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1672         as shell libraries.
1673
1674         Introduce a micro-parser that is able to deambiguate on its input
1675         whether we are dealing with a compilation unit (namespace, class,
1676         interface, struct, delegate) declaration or a statement.   This
1677         allows both declarations and statements to be entered. 
1678
1679         Set history size by default to 300 lines.
1680
1681         Instead of distinguishing based on the parser.InteractiveResult,
1682         have only two cases: statements were parsed, or a compilation unit
1683         was.   Always pull the Using statement additions from the
1684         compilation unit parse.
1685         
1686         * cs-tokenizer.cs: Rename tokens to better describe their intent
1687         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1688         
1689         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1690         EvalMode is used to trigger the lookup of global variables while
1691         StatementMode is used turn variable declarations into static
1692         fields.
1693
1694         * getline.cs: Allow history size to be set.
1695         
1696 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1697
1698         A fix for bug #360755
1699         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1700
1701 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1702
1703         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1704         
1705         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1706         member name, it is too confusing
1707         
1708         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1709         
1710         * rootcontext.cs: Finally default to warning level 4.
1711
1712 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1713
1714         * class.cs (CheckBase): Ignore overloaded operators.
1715
1716 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1717
1718         A fix for bug #420830
1719         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1720
1721 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #420832
1724         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1725
1726 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1727
1728         A fix for bug #420386
1729         * nullables.cs: Fixed logic of nullable user comparison operators involving
1730         null values.
1731
1732 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1733         
1734         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1735
1736 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1737
1738         * repl.cs: Add support for aborting the running code with C-c. 
1739
1740 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1741
1742         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1743
1744 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1745
1746         * cs-parser.jay (interactive_statement_list): A new set of rules
1747         for hosting statements that uses the "interactive_" prefix.   
1748
1749         * repl.cs: Add support for parsing `using' as a statement or as a
1750         directive.  Deambiguating before passing this to the parser.
1751
1752         We need to distinguish statement_expressions that occur at the
1753         toplevel vs those that occur embedded into expressions.
1754
1755         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1756         that fixes the cursor key handling, and a history bug.
1757         
1758 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1759
1760         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1761         limitations in Console, instead the 2.0 bootstrap libraries now
1762         include the Console bits.
1763
1764         Also, remove the use of Nullables from getline.cs
1765
1766         ------------
1767         
1768         Interactive support for the C# compiler.   Use gmcs --shell to
1769         enter a read-eval-print loop shell.
1770
1771         Docs: http://www.mono-project.com/CsharpRepl
1772         
1773         * sources: include repl.cs here and getline.cs for gmcs.exe,
1774         everything else is getline.cs impaired.
1775
1776         * Makefile: when bootstrapping pass a special flag
1777         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1778         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1779         This distinguishes those two cases.
1780
1781         * repl.cs: Support for a read-eval-print loop.   Will be soon
1782         refactored into eval support and then REPL on top of it.
1783
1784         * ecore.cs: If a simplename lookup fails, before erroring out,
1785         if we are in EvalMode to resolve the name to a declaration in the
1786         Eval-land.    
1787
1788         This means that variable declarations that happened in previous
1789         classes (as repl puts every statement in a separate class) are
1790         made visible in this way.
1791
1792         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1793         triggered an error due to the end of file being reached.   This is
1794         used to do multi-line input, and notify the caller that the user
1795         needs to provide more text before a successful parse.
1796
1797         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1798         to drive the evaluation with a custom wrapper. 
1799
1800         * driver.cs: Add support for --shell, and refactor some code to be
1801         reused from repl.cs
1802         
1803         * namespace.cs: Add support for serializing the contents of the
1804         namespaces and reloading them.  
1805
1806         * getline.cs: A managed implementation of ReadLine under
1807         X11/Apache2 license terms.  Easy to embed in other applications as
1808         well.
1809
1810         * namespace.cs: Add some functions to save and restore the
1811         namespace state.
1812
1813         * rootcontext.cs: New public field.
1814
1815         * cs-tokenizer.cs: Add support for one of the possible characters
1816         we introduce into the token stream.  
1817
1818         This patch does not affect the regular tokenization process, the
1819         only performance hit would happen if there is an invalid character
1820         on the input string.
1821
1822         * support.cs: Move isatty helper routine here.
1823
1824         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1825         code generator for in-memory assemblies.
1826
1827 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1828
1829         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1830         parameter cannot be always used as a type.
1831
1832 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1833
1834         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1835
1836 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1837
1838         * convert.cs: Implement explicit array to IList<T> conversion.
1839
1840 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1841
1842         A fix for bug #362740
1843         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1844
1845 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1846         
1847         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1848         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1849         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1850         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1851         handling to use just one type of infrastructure and deal with generics
1852         more effectivelly.
1853
1854 2008-07-23  Martin Baulig  <martin@ximian.com>
1855
1856         *** Merged this from trunk revision 108527 ***
1857
1858         * statement.cs
1859         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1860         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1861         scope variable.
1862
1863 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1864         
1865         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1866         error checks.
1867
1868 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1869         
1870         * delegate.cs: Fixed compiler crash when creating delegate using partial
1871         method.
1872         
1873         * typemanager.cs: MulticastDelegate is not a delegate.
1874
1875 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1876         
1877         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1878         checks.
1879
1880 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1881
1882         * cs-parser.jay (type): Allow 'var' in mcs too.
1883         (local_variable_type): Likewise.
1884
1885 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1886         
1887         * driver.cs: Removed broken -noconfig variants.
1888
1889 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1890         
1891         A fix for bug #417078
1892         * expression.cs: Emit correctly left side pointer operators.
1893
1894 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1895
1896         * generic.cs, lambda.cs: Inflate method generic arguments only.
1897
1898 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1899
1900         * class.cs: Fixed struct layout check regression.
1901
1902 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1903
1904         * cs-parser.jay, enum.cs: Simplified enum parsing.
1905         
1906         * decl.cs: Check all type parameters conflicts.
1907         
1908         * expression.cs, statement.cs, attribute.cs: More expression checks.
1909
1910 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1911
1912         * generic.cs: Add type inference types restriction.
1913         
1914         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1915         anonymous.cs, expression.cs: Allocate less accessor parameters.
1916
1917 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1918
1919         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1920         classes.
1921
1922 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1923
1924         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1925
1926 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1927
1928         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1929         Also fixes #362146 and #381592.
1930
1931 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1932
1933         * ecore.cs: Reduced constant cannot be used as an attribute value.
1934         
1935         * cs-parser.jay: Base expression has to be a type.
1936         
1937         * expression.cs (Conditional): Uses ReducedExpression.
1938
1939 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1940
1941         A fix for bug #376826
1942         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1943         address of hoisted local variable or parameter cannot be taken.
1944
1945 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1946
1947         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1948         anonymous method inside checked/unchecked expression.
1949
1950 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1951
1952         * typemanager.cs (IsEqual): Guard against null.
1953         
1954         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1955         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1956         routine. Fixed few misleading conversion errors.
1957
1958 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1959
1960         * class.cs: Consider generics when checking cycles in struct layout.
1961
1962 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1963
1964         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1965
1966 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1967
1968         A fix for bug #414165
1969         * anonymous.cs: Use same anonymous implementation method for all anonymous
1970         method emits.
1971
1972 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1973
1974         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1975         constraints.
1976
1977 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1978
1979         * cs-parser.jay: Typeof argument has to be a type expression.
1980         
1981         * namespace.cs: Check alias and namespace definitions collisions.
1982         
1983         * class.cs, pending.cs: Moved explicit interface accessor implementation
1984         check.
1985         
1986         * delegate.cs, expression.cs: Verify special name invocations.
1987         
1988 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1989
1990         * cs-parser.jay: Don't choke on empty generic type arguments.
1991         
1992         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1993         
1994         * expression.cs, ecore.cs: Minor expressions bugs.
1995
1996 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1997
1998         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1999         and added more error handling.
2000         
2001         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2002         
2003         *  modifiers.cs, enum.cs: Fixed.
2004
2005 2008-07-31  Jb Evain  <jbevain@novell.com>
2006
2007         * driver.cs: remove -pkg ability of smcs.
2008
2009 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2010
2011         * statement.cs (Switch): Correctly set empty default target for single
2012         blocks.
2013
2014 2008-07-30  Marek Safar  <marek.safar@gmail.com>
2015
2016         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2017         string switch statement implementation to use string dictionary which
2018         significantly (2-8x) improves performance of generated code.
2019
2020 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2021
2022         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2023         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2024         
2025 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2026
2027         A fix for bug #412595
2028         * typemanager.cs, convert.cs, expression.cs: Some types are never
2029         convertible to each other.
2030
2031 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2032
2033         * nullable.cs (CreateNullConstant): An error messages update.
2034
2035 2008-07-29  Marek Safar  <marek.safar@gmail.com>
2036
2037         A fix for bug #412595
2038         * cfold.cs: Don't cast undefined bool constant.
2039
2040 2008-07-29  Martin Baulig  <martin@ximian.com>
2041
2042         * symbolwriter.cs
2043         (SymbolWriter.Reset): New public static method.
2044
2045         * driver.cs
2046         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
2047
2048 2008-07-28  Marek Safar  <marek.safar@gmail.com>
2049
2050         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
2051         
2052         * expression.cs (ElementAccess): Exact size allocation.
2053
2054 2008-07-26  Marek Safar  <marek.safar@gmail.com>
2055
2056         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
2057
2058 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2059
2060         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
2061         
2062         * class.cs: Removed $PRIVATE$ field hack which caused problems during
2063         flow analysis.
2064
2065 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2066
2067         A fix for bug #412217
2068         * assign.cs: Mutate also assignment type.
2069
2070 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2071
2072         A fix for bug #323644
2073         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
2074         indexers.
2075
2076 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2077
2078         A fix for bug #412134
2079         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
2080         non-enumerable operands when overloading equality or bitwise operators.
2081
2082 2008-07-25  Marek Safar  <marek.safar@gmail.com>
2083
2084         * anonymous.cs: Cache closed generic anonymous method delegates.
2085
2086 2008-07-24  Marek Safar  <marek.safar@gmail.com>
2087
2088         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
2089         anonymous.cs, statement.cs: Always emit anonymous method as static method
2090         when is instance free. Use nesting for nested anynomous methods blocks.
2091         
2092 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2093
2094         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
2095         types.
2096
2097 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2098
2099         * expression.cs: Removed MakeSimpleCall.
2100
2101 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2102
2103         A fix for bug #323012
2104         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
2105         Base method implementing interface has to be public.
2106
2107 2008-07-23  Marek Safar  <marek.safar@gmail.com>
2108
2109         * cs-parser.jay: Don't break on missing argument.
2110
2111 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2112
2113         A fix for bug #320993
2114         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
2115           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
2116
2117 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2118
2119         A fix for bug #320748
2120         * convert.cs: Implicit user operators cannot convert to interfaces
2121
2122 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2123
2124         A fix for bug #312686
2125         * driver.cs: Ignore empty assembly references.
2126
2127 2008-07-22  Marek Safar  <marek.safar@gmail.com>
2128
2129         A fix for bug #387040
2130         * ecore.cs: Skip constrains check for an explicit implementation.
2131
2132 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2133
2134         A fix for bug #409045
2135         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
2136           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
2137           identifiers are file specific unless passed as input arguments.
2138
2139 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2140
2141          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
2142          to emit UnmanagedMarshal data under 2.0 profile.
2143
2144 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2145
2146         A fix for bug #410369
2147         * parameter.cs: Clone correctly ParamsParameter.
2148
2149 2008-07-21  Marek Safar  <marek.safar@gmail.com>
2150
2151         * expression.cs (Argument): Always report type for type based expressions
2152         errors.
2153
2154 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2155
2156         A fix for bug #410666
2157         * anonymous.cs: Correctly initialize generic storey reference.
2158
2159 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2160
2161         * convert.cs: Don't box same type arguments.
2162
2163 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2164
2165         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
2166         Finished missing generic type mutators.
2167
2168 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2169
2170         * iterators.cs, statement.cs: Finished statements CloneTo.
2171
2172 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2173
2174         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
2175         
2176         * expression.cs: Emit optimized default value expressions in expression tree
2177         array initializer.
2178
2179 2008-07-18  Marek Safar  <marek.safar@gmail.com>
2180
2181         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
2182
2183 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2184
2185         A fix for bug #367536
2186         * cs-parser.jay: Check static constructor of generic types for an access
2187         modifier.
2188
2189 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2190
2191         A fix for bug #353800
2192         * lambda.cs: Emit ret for contextual statements.
2193         
2194         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
2195         up emitting redundant ret for all anonymous methods with return.
2196
2197 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2198
2199         A fix for bug #365188
2200         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
2201         create anonymous method storey in unreachable block.
2202
2203 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2204
2205         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
2206         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
2207         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
2208         statement.cs: Fixed relevant defects found by Gendarme.
2209
2210 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2211
2212         A fix for bug #325291
2213         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
2214         statement.cs: Replaced IAnonymousHost with top level block flag.
2215
2216 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2217
2218         * cs-parser.jay: Clean up unused open_parens.
2219
2220 2008-07-17  Marek Safar  <marek.safar@gmail.com>
2221
2222         * ecore.cs: Custom error message for a range variable assignment.
2223
2224 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2225
2226         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
2227         load.
2228
2229 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2230
2231         * literal.cs: Null literal is of object type.
2232
2233 2008-07-16  Marek Safar  <marek.safar@gmail.com>
2234
2235         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
2236         expression of nullable equality comparison.
2237
2238 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2239
2240         * expression.cs(PointerArithmetic): Removed redundant assignment.
2241
2242 2008-07-15  Marek Safar  <marek.safar@gmail.com>
2243
2244         * decl.cs (GetSignatureForError): Report full namespace name for containers.
2245
2246 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2247
2248         A fix for bug #408361
2249         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
2250         they are replaced by GetMethod.
2251
2252 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2253
2254         A fix for bug #408721 by jeremie.laval@gmail.com
2255         * expression.cs (Indirection): Implemented CloneTo.
2256
2257 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2258
2259         * statement.cs (AssignableSlots): Temporary disabled variable initialization
2260         assert check.
2261
2262 2008-07-14  Marek Safar  <marek.safar@gmail.com>
2263
2264         * report.cs (EnableReporting): Don't reinitialize 0-based values.
2265
2266 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2267
2268         * linq.cs: Reset tranparent parameter counter in probing mode.
2269
2270 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2271
2272         * anonymous.cs: Mutate anonymous method type.
2273
2274 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2275
2276         * ecore.cs, anonymous.cs: Mutate field expressions.
2277
2278 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2279
2280         A fix for bug #369670
2281         * linq.cs, statement.cs: Use explicit block for query expressions variables.
2282
2283 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2284
2285         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
2286
2287 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
2288
2289         Fix bug #314902
2290         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
2291         only one '>', and finds a '>>', abort the generic lookahead.
2292
2293 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2294
2295         A fix for bug #319902
2296         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
2297
2298 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2299
2300         A fix for bug #406371
2301         * statement.cs: Moved EmitSymbolInfo to Block.
2302
2303 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2304
2305         * ecore.cs: Report better error for extension method overload failures.
2306
2307 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2308
2309         * expression.cs (Is): No need to box reference values.
2310
2311 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2312
2313         * class.cs: Use event resolve context when initializing CreateEmitContext.
2314
2315 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2316
2317         A fix for bug #394436
2318         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2319         method used inside expression trees. Added more LINQ to expression tree
2320         conversions.
2321
2322 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2323
2324         A fix for bug #378189, #370577
2325         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2326         from expression.
2327
2328 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2329
2330         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2331         hierarchically.
2332
2333 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2334
2335         A fix for bug #406702
2336         * anonymous.cs: Always park anonymous method in the nearest parent storey.
2337
2338 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2339
2340         A fix for bug #406648
2341         * cs-parser.jay: Report nullable use in mcs for some cases.
2342
2343 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2344
2345         * ecore.cs: Improved argument mismatch error messages.
2346
2347 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2348
2349         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2350
2351 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2352
2353         * expression.cs (TypeOf): Mutate type argument.
2354
2355 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2356
2357         * class.cs: Report missing partial modifier for correct type.
2358
2359 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2360
2361         * ecore.cs, expression.cs (VariableReference): Variable property is 
2362         protected.
2363
2364 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2365
2366         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2367         
2368 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2369
2370         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2371         method delegates.
2372
2373 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2374
2375         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2376         anonymous method storey to an instance method when only "this" is hoisted.
2377
2378 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2379
2380         A fix for bug #321615
2381         * expression.cs: Pointer comparisons use unsigned operator.
2382
2383 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2384
2385         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2386
2387 2008-07-02  Marek Safar  <marek.safar@gmail.com>
2388
2389         A fix for bug #404905
2390         * class.cs: Always initialize local unsafe variables.
2391
2392 2008-06-30  Marek Safar  <marek.safar@gmail.com>
2393
2394         A fix for bug #396987
2395         * expression.cs (NewInitialize): Clear local temporary variable for next run
2396
2397 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2398
2399         A fix for bug #401020
2400         * ecore.cs: Both types and modifiers have to match for ref and out arguments
2401
2402 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2403
2404         A fix for bug #398319
2405         * cs-parser.jay: Implemented undocumented base access expression inside
2406         anonymous types.
2407
2408 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2409
2410         A fix for bug #404227
2411         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2412
2413 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2414
2415         A fix for bug #404227
2416         * convert.cs: Fixed explicit array to interface cast.
2417
2418 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2419
2420         A fix for bug #403894
2421         * delegate.cs: Mutate DelegateInvocation type.
2422
2423 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2424
2425         A fix for bug #379348
2426         * delegate.cs: Box a load of generic parameters.
2427
2428 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2429
2430         * expression.cs: Add an array creation arguments mutate.
2431
2432 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2433
2434         A fix for bug #386068
2435         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2436         parameter.
2437
2438 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2439
2440         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2441         CloneTo.
2442
2443 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2444
2445         A fix for bug #403518
2446         * delegate.cs: Type correctly anonymous method new invocation.
2447
2448 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2449
2450         A fix for bug #394826
2451         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2452         calls.
2453
2454 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2455
2456         A fix for bug #394826
2457         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2458         needed.
2459
2460 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2461
2462         * class.cs: Clone indexer parameters for localized capturing.
2463
2464 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2465
2466         A fix for bug #402379
2467         * expression.cs: Don't crash when an object initializer resolve fails.
2468
2469 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2470
2471         A fix for bug #402888
2472         * expression.cs: Mutate conditional expression.
2473
2474 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2475
2476         A fix for bug #401012
2477         * class.cs: Keep StructLayout in shared container.
2478
2479 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2480
2481         A fix for bug #400438
2482         * decl.cs, class.cs: Only properties can be automatically implemented.
2483
2484 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2485
2486         * statement.cs (ChangeToIterator): Copy also labels.
2487
2488 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2489
2490         * ecore.cs: Pass type argument details to parent extension method.
2491
2492 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2493
2494         A fix for bug #375966
2495         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2496
2497 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2498
2499         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2500
2501 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2502
2503         A fix for bug #394347
2504         * anonymous.cs: Cache compatible delegates as compatibility check produces
2505         a new method every time.
2506
2507 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2508
2509         * anonymous.cs: Propagate storey reference for single references.
2510
2511 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2512
2513         A fix for bug #387615
2514         * assign.cs, expression.cs: Correctly clone compound assignment.
2515
2516 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2517
2518         A fix for bug #359611, #359604
2519         * anonymous.cs: Mutate all types of hoisted parameters.
2520
2521 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2522
2523         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2524         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2525         expression.cs, codegen.cs, statement.cs
2526         
2527         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2528         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2529         
2530         ** Anonymous methods, lambda expressions rewrite **
2531         
2532         Anonymous expressions are now resolved when an explicit block is resolved 
2533         and they don't require any registration procedure anymore. Further,
2534         anonymous methods are defined when explicit block is emitted which allows
2535         better control of whole process and opens possibilities for more
2536         optimizations as well as alternative to reverse whole process.
2537         
2538         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2539         process consistent and to correctly emit hoisted generic methods when they
2540         have at least 1 hoisted variable.
2541         
2542 2008-06-17  Martin Baulig  <martin@ximian.com>
2543
2544         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2545         iterator method.
2546         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2547         virtual property; check it in Emit().
2548         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2549         an iterator.
2550         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2551         an iterator.
2552         (Indexer.Define): Likewise.
2553
2554 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2555
2556         * convert.cs: Don't use IsInterface on type arguments.
2557         
2558         * delegate.cs: DelegateInvocation uses MethodInfo.
2559         
2560         * parameter.cs: Removed IsTypeParameter.
2561         
2562         * generic-mcs.cs: More missing stuff.
2563
2564 2008-06-16  Martin Baulig  <martin@ximian.com>
2565
2566         * modifiers.cs
2567         (Modifiers.DEBUGGER_HIDDEN): New public const.
2568
2569         * typemanager.cs
2570         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2571
2572         * class.cs
2573         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2574         (AbstractPropertyEventMethod): Likewise.
2575         (Constructor.Emit): Likewise.
2576         (SourceMethod.SetCompilerGenerated): Removed.
2577
2578         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2579         on MoveNext().
2580
2581         * anonymous.cs
2582         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2583         if we're an `IteratorHost'.
2584         (AnonymousMethodMethod..ctor): Don't set
2585         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2586         not on the method.
2587
2588 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2589
2590         * statement.cs: Clean-up foreach statements.
2591
2592 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2593
2594         * class.cs: Stop using public method which should not exist
2595         (MethodBuilder.SetGenericMethodSignature).
2596
2597 2008-06-11  Martin Baulig  <martin@ximian.com>
2598
2599         * location.cs
2600         (Location.LookupFile): Add `CompilationUnit' argument; when given
2601         a relative file name, make it relative to the directory the .cs
2602         file is located in instead of using the current directory.
2603
2604 2008-06-11  Martin Baulig  <martin@ximian.com>
2605
2606         * class.cs
2607         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2608         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2609         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2610         (SourceMethod.SetCompilerGenerated): Likewise.
2611
2612 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2613
2614         * codegen.cs, driver: Only write symbol file when it's asked for.
2615
2616 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2617
2618         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2619
2620 2008-06-10  Martin Baulig  <martin@ximian.com>
2621
2622         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2623
2624 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2625
2626         A fix for bug #316290
2627         * expression.cs: Include decimal operators in predefined table.
2628         
2629         * parameters.cs: More readonlyness.
2630
2631 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2632
2633         A fix for bug #397213
2634         * cs-parser.jay: One more missing current_local_parameters reset.
2635
2636 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2637
2638         A fix for bug #396633
2639         * class.cs: Host backing field in partial container.
2640
2641 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2642
2643         A fix for bug #397068
2644         * expression.cs: Check both operand types when predefined operator is used.
2645
2646 2008-06-05  Martin Baulig  <martin@ximian.com>
2647
2648         Merged the `debugger-kahalo' branch.
2649
2650         * class.cs
2651         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2652         we're an iterator method.
2653         (SourceMethod): Reflect latest symbol writer changes;
2654         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2655         now `start_row' and `end_row'.
2656         (Constructor.Emit): Fix the logic whether to emit symbol information.
2657
2658         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2659         generated methods.
2660
2661         * location.cs
2662         (CompilationUnit): New public class; derives from `SourceFile'.
2663         (SourceFileEntry.DefineSymbolInfo): New public method.
2664         (SourceFileEntry.SetChecksum): New public method.
2665         (Location): Encode hidden line numbers by using `column == 255';
2666         the .ctor now accepts `column == -1' to mark a hidden line number.
2667         (Location.Hidden): New public property.
2668         (Location.CheckPoint): Add `CompilationUnit'.
2669         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2670         (Location.Push): Add `CompilationUnit compile_unit' argument.
2671         (Location.CompilationUnit): New public property.
2672
2673         * statement.cs
2674         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2675
2676         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2677
2678         * driver.cs: `SourceFile' -> `CompilationUnit'.
2679
2680         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2681
2682         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2683
2684         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2685         `#line hidden'.
2686
2687         * symbolwriter.cs
2688         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2689         new symbol writer API to also pass the file.
2690
2691 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2692
2693         * statement.cs: Emit catch variable assignment using variable expression.
2694         
2695 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2696
2697         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2698         with other variable types.
2699
2700 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2701
2702         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2703         GetLength method emit, it breaks resolve rules.
2704         
2705 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2706             Marek Safar  <marek.safar@gmail.com>
2707                         
2708         A fix for bug #395542
2709         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2710         declaration.
2711         
2712 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2713
2714         A fix for bug #395287
2715         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2716
2717 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2718
2719         A fix for bug #395845
2720         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2721         non-nullable parameter type.
2722         
2723 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2724
2725         * class.cs: Handle contructor initializer as a statement in top-level block.
2726
2727 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2728
2729         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2730         security attributes.
2731
2732 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2733
2734         * ecore.cs, expression.cs: Small IVariable refactoring.
2735
2736 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2737
2738         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2739
2740 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2741
2742         * cs-parser.jay: Removed redundant catch type check.
2743
2744 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2745
2746         A fix for bug #390372
2747         * nullable.cs: Set correct return type.
2748
2749 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2750
2751         A fix for bug #391062
2752         * typemanager.cs: Fixed crash when comparing null types.
2753
2754 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2755
2756         A fix for bug #391871
2757         * cs-parser.jay: Better error handling for invalid catch type.
2758
2759 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2760
2761         A fix for bug #392155
2762         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2763
2764 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2765
2766         A fix for bug #390666
2767         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2768         expressions.
2769
2770 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2771
2772         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2773         in getter.
2774
2775 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2776
2777         A fix for bug #389625
2778         * delegate.cs, generic.cs: Some progress on method group return type
2779         inference.
2780
2781 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2782
2783         A fix for bug #378419
2784         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2785
2786 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2787
2788         * class.cs (Constructor): Added IsCompilerGenerated.
2789
2790 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2791
2792         * expression.cs: Enum binary operators can accept non-enum operand only when
2793         is implicitly convertible to underlying type.
2794
2795 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2796
2797         A fix for bug #389272
2798         * support.cs: Workaround System.InvalidOperationException for enums.
2799
2800 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2801
2802         A fix for bug #389073
2803         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2804
2805 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2806
2807         * driver.cs: Split Parse.
2808         
2809         * location.cs (LookupFile): Uses string.Empty.
2810
2811 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2812
2813         * expression.cs, parameter.cs: Small ParameterReference clean up.
2814
2815 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2816
2817         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2818         hack. Fixes #387502.
2819
2820 2008-05-06  Martin Baulig  <martin@ximian.com>
2821
2822         * class.cs (Constructor.Emit): Fix the logic whether to emit
2823         symbol information.
2824
2825 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2826
2827         Fix #385503
2828         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2829         InvalidOperationException when the iterator is before the start or
2830         after the end.
2831
2832 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2833
2834         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2835         when left is nullable type.
2836
2837 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2838
2839         A fix for bug #386628
2840         * expression.cs (LocalVariableReference): Continue in resolving when
2841         variable is not assigned.
2842
2843 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2844
2845         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2846         nullable operations.
2847
2848 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2849
2850         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2851         it saves many redundant temporary variables for nullable operations.
2852
2853 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2854
2855         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2856         
2857         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2858         method.
2859         
2860         * nullable.cs: Constant coalescing operator optimizations.
2861
2862 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2863
2864         * constant.cs: Use unsigned conversion for values which are unsigned only.
2865
2866 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2867
2868         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2869         coalescing operator as it should be.
2870
2871 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2872
2873         A fix for bug #371016
2874         * expression.cs: All predefined delegate operators require implicit method
2875         group conversion.
2876         
2877 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2878
2879         * constant.cs: Emit long constant as uint when fits the range.
2880         
2881         * convert.cs, expression.cs: Fixed few unsafe conversions.
2882
2883 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2884
2885         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2886
2887 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2888
2889         Fix #385758
2890         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2891         'expr'.
2892         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2893
2894 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2895
2896         * constant.cs, literal.cs: IsLiteral property for error reporting.
2897         
2898         * ecore.cs, expression.cs: Implemented Property expression.
2899
2900 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2901
2902         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2903         
2904         * nullable.cs: Implemented nullable coalescing null operator.
2905
2906         * ecore.cs, expression.cs: Expression trees work.
2907
2908 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2909
2910         * ecore.cs: CreateExpressionTree is finally abstract.
2911
2912         * expression.cs, linq.cs: Updated.
2913
2914 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2915
2916         * expression.cs, ecore.cs: Block base access expression inside expression
2917         tree.
2918
2919 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2920
2921         A fix for bug #385058
2922         * expression.cs: User-defined operator implementations always take
2923         precedence over predefined operator implementations.
2924
2925 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2926
2927         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2928         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2929         expression tree conversions.
2930         
2931 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2932
2933         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2934         operators method details to Operator class.
2935
2936 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2937
2938         * anonymous.cs: Pass unsafe flags to anonymous container.
2939         
2940         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2941         inside expression tree.
2942
2943 2008-04-29  Martin Baulig  <martin@ximian.com>
2944
2945         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2946         (Tokenizer.PopPosition): Also restore the `line'.
2947
2948 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2949
2950         * delegate.cs: Implemented Invoke expression.
2951
2952 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2953
2954         * expression.cs: Fixed equality reference comparison regression.
2955
2956 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2957
2958         * ecore.cs: Clean up EmptyCast hack.
2959         
2960         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2961         using correct conversion rules. Also fixes #383993.
2962
2963 2008-04-28  Martin Baulig  <martin@ximian.com>
2964
2965         * class.cs (Constructor.Emit): Don't emit debugging information
2966         for generated default .ctor's.
2967
2968 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2969
2970         * convert.cs: Empty-cast ushort to int conversion.
2971
2972 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2973
2974         A fix for bug #384191
2975         * ecore.cs, expression.cs: Fixed expression cloning.
2976
2977 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2978
2979         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2980
2981 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2982
2983         Fix #381559, test-638.cs, test-639.cs
2984         * assign.cs (CompoundAssign.Helper): New wrapper.
2985         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2986         access.
2987         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2988         Pass unconverted expressions to the params array creation expression.
2989         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2990         (PropertyExpr.EmitAssign): Likewise.
2991         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2992         element if it is of kind CompoundAssign.Helper.
2993         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2994         first before anything else.
2995         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2996         (ArrayAccess.LoadArrayAndArguments): Simplify.
2997
2998 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2999
3000         * expression.cs: Fixed cloning of typeof(void).
3001
3002 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
3003
3004         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3005         (Assign.Emit): Likewise.  Move it to ...
3006         (CompoundAssign.DoResolve): ... here and ...
3007         (CompoundAssign.Emit): ... here.
3008         (EventAddOrRemove): New helper to handle += and -= on events, and
3009         avoid the use of BinaryDelegates.
3010         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3011         (EventExpr.EmitAddOrRemove): Improve.
3012         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3013
3014         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3015         create VarExprs for 'foo.bar.var'.
3016         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3017         is a highly inappropriate name for its functionality.
3018
3019 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3020
3021         Simplify handling of multiple assignments
3022         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
3023         inheritable-only.
3024         (SimpleAssign): New.  Class to be used for normal assignments.
3025         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3026         * expression.cs, parameter.cs, statement.cs: Likewise.
3027
3028 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3029
3030         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3031         for incompatible underlying types, more to come, uff.
3032
3033 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
3034
3035         Fix gtest-388.cs
3036         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
3037         Handle 'leave_copy'.
3038
3039 2008-04-25  Marek Safar  <marek.safar@gmail.com>
3040
3041         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
3042
3043 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
3044
3045         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
3046         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
3047         * statement.cs (While, Do, For): Allow test to have side effects.
3048         (For.DoEmit): Always emit InitStatement.
3049
3050         Fix test-635.cs
3051         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
3052         Always create SideEffectConstant.
3053         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
3054         of type EnumConstant.
3055
3056         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3057         Handle 'right' being SideEffectConstant of type 'bool'.
3058
3059         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
3060         Use left.EmitBranchable instead of open coding it, so as to
3061         improve optimization opportunities.
3062
3063         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
3064
3065         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
3066         assumptions.
3067         (Expression.EmitSideEffect): Document.
3068
3069 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3070
3071         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
3072
3073 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3074
3075         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
3076
3077 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3078
3079         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
3080         conversion to expression tree.
3081
3082 2008-04-23  Marek Safar  <marek.safar@gmail.com>
3083
3084         * ecore.cs: Removed unused expression.
3085
3086 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3087
3088         * expression.cs: Implemented NegateChecked and New expressions.
3089
3090 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3091
3092         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
3093
3094 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
3095
3096         Fix #351102
3097         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
3098         needing final 'ret' instruction.
3099
3100 2008-04-22  Marek Safar  <marek.safar@gmail.com>
3101
3102         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
3103
3104 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3105
3106         * expression.cs: Emit ldnull and not null expression as an instance argument
3107          of static method expression calls.
3108
3109 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3110
3111         A fix for bug #378200
3112         * expression.cs: Fixed crash when creating parameterless expression tree
3113         method call.
3114
3115 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3116
3117         A fix for bug #375297
3118         * anonymous.cs: Fixed crash when inferring from null argument anonymous
3119         method.
3120
3121 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3122
3123         A fix for bug #377596
3124         * decl.cs, class.cs: Emit delegate type argument attributes.
3125
3126 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3127
3128         A fix for bug #365314
3129         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
3130         
3131 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3132
3133         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
3134         only.
3135
3136 2008-04-21  Marek Safar  <marek.safar@gmail.com>
3137
3138         * generic.cs (TypeParameter): Removed redundant location.
3139
3140 2008-04-19  Marek Safar  <marek.safar@gmail.com>
3141
3142         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
3143         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
3144         FullNamedExpression in all declaration type expression, statements will come
3145         later.
3146
3147 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3148
3149         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
3150         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
3151
3152 2008-04-18  Marek Safar  <marek.safar@gmail.com>
3153
3154         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
3155         code.
3156
3157 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3158
3159         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
3160         constraints.
3161
3162 2008-04-17  Marek Safar  <marek.safar@gmail.com>
3163
3164         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
3165         name expressions.
3166         Also fixes #340463.
3167
3168 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
3169
3170         Hook up 'EmitSideEffect'
3171         * constant.cs (Constant.EmitSideEffect): New.
3172         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
3173         (SideEffectConstant.EmitSideEffect): New.
3174         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
3175         unconditional branch in EmitBranchable.
3176         (FieldExpr.EmitBranchable): New.
3177         * expression.cs (Unary.EmitSideEffect): New.
3178         (Binary.EmitSideEffect): New.
3179         (VariableReference.EmitSideEffect): New.  Do nothing.
3180
3181 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3182
3183         Introduce 'EmitSideEffect'
3184         * ecore.cs (Expression.EmitSideEffect): New.
3185         (TypeCast): Rename from EmptyCast.
3186         (EmptyCast): New.
3187         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
3188         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
3189         * convert.cs, nullable.cs: Update to changes.
3190
3191 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3192
3193         * class.cs, cs-parser.jay: Early check for base types expression.
3194
3195 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3196
3197         * decl.cs (MemberName): Declare PrettyName as obsolete.
3198
3199 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3200
3201         * namespace.cs: Use MemberName comparison.
3202
3203 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
3204
3205         Fix build break
3206         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
3207         FullName.
3208         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
3209         (MemberName.FullyQualifiedName): New.  Provides the functionality
3210         that users assume FullName would have.
3211         * ecore.cs, namespace.cs: Update to changes.
3212
3213         * statement.cs (Using.assign): Make into ExpressionStatement.
3214         (Using.EmitPreTryBody): Simplify.
3215
3216 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3217
3218         * report.cs: ColorFormat is protected.
3219         
3220         * rootcontext.cs: Unused fields clean-up.
3221         
3222         * namespace.cs: Made UsingEntry name private.
3223
3224 2008-04-16  Marek Safar  <marek.safar@gmail.com>
3225
3226         * cs-tokenizer.cs, location.cs: Removed unused field.
3227
3228 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
3229             Raja R Harinath  <harinath@hurrynot.org>
3230
3231         Fix #379822
3232         * constant.cs (SideEffectConstant.value): Rename from 'left'.
3233         (SideEffectConstant.side_effect): Rename from 'right'.
3234         (SideEffectConstant..ctor): Normalize 'side_effect'.
3235         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
3236         value of this constant.
3237         * cfold.cs: Update to changes.
3238
3239 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3240
3241         * cs-paser.jay: Removed unused variable.
3242         
3243         * driver.cs: Made Compile instance method.
3244
3245 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
3246
3247         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
3248
3249 2008-04-15  Marek Safar  <marek.safar@gmail.com>
3250
3251         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
3252
3253 2008-04-13  Jb Evain  <jbevain@novell.com>
3254
3255         * namespace.cs: update the System.Core fullname for 2.1
3256         * driver.cs: update the list of required assemblies for 2.1.
3257         Merged from the Moonlight 2 branch.
3258
3259 2008-04-11  Marek Safar  <marek.safar@gmail.com>
3260
3261         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
3262         types and user defined operators. User operators arguments has to be checked
3263         for null value before invocation, which also means no operator is called
3264         when any argument is not convertible to unwrapped nullable type.
3265         
3266 2008-04-09  Marek Safar  <marek.safar@gmail.com>
3267
3268         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
3269         of Unary expressions to follow operator overloading rules precisely.
3270         Also fixes #321794, #323794
3271         
3272 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3273
3274         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
3275         expression.
3276         
3277 2008-04-08  Marek Safar  <marek.safar@gmail.com>
3278
3279         * expression.cs, ecore.cs: Implemented MemberInit expression.
3280         
3281 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
3282
3283         Fix mono/tests/exception4.cs
3284         * statement.cs (ExceptionStatement, TryCatch): Revert to using
3285         ec.NeedReturnLabel () rather emitting a 'nop'.
3286
3287         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
3288         simple heuristic.
3289         (TryCatch.SomeCodeFollows): Likewise.
3290         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
3291         for 'break', 'continue' and 'return' statements inside a try.
3292         We're fairly sure that the generated IL stream will have more
3293         instructions textually following the try.
3294         (FlowBranchingTryCatch): Likewise.
3295
3296         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3297         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3298         overrides.
3299
3300         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3301         wrapper -- forward everything to CollectionForeach.
3302         (CollectionForeach.NonDisposableWrapper): New.
3303         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3304         instead of a pop + branch to end.
3305
3306 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3307
3308         A fix for bug #377485
3309         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
3310         Propagate location for extension method groups. Report conversion failure at
3311         right place.
3312
3313 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3314
3315         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3316         ListInit and Field expressions.
3317
3318 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
3319
3320         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3321         Since $PC is always -1 inside the body of MoveNext, the fault
3322         handler is a no-op.
3323         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3324         * statement.cs (ExceptionStatement.emit_finally): Likewise.
3325         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3326
3327         The denouement!  Fix #324708
3328         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3329         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3330         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3331         'finally' inside the finally clause.
3332
3333         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3334         inside an iterator.  Don't emit the body of the 'finally' inside
3335         the finally clause yet.
3336
3337         Use the ResumableStatement infrastructure for MoveNext ()
3338         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3339         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
3340         'old_resume_points'.  Move dispatcher upfront.
3341         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3342         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3343         in an enumerator.  This encodes the main fix in this patch series
3344         -- we can only jump into the first instruction of a try from the
3345         outside, but we want to emit try/finally regions in iterators and
3346         resume in the middle of them.
3347
3348 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
3349
3350         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3351         of NeedReturnLabel here.
3352
3353         Introduce a common point for emitting try/finally to IL
3354         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
3355         features of the various subclasses, which are now driven by ...
3356         (ExceptionStatement.EmitPreTryBody): ... this and ...
3357         (ExceptionStatement.EmitTryBody): ... this and the original
3358         EmitFinallyBody.
3359         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3360         Remove DoEmit and update to follow above protocol.
3361
3362         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3363         of the dispatcher are the same, skip emitting the 'switch'.
3364         * iterator.cs (Iterator.EmitDispose): Update to changes.
3365
3366         Clean up handling of 'using' statement
3367         * statement.cs (UsingTemporary): New.  Carved out of ...
3368         (Using): ... this.  Simplify drastically.  Handle exactly
3369         one variable.
3370         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
3371         or Using as appropriate.  If there are multiple variable declared,
3372         create nested Using statements.
3373         (resource_acquisition): Kill.
3374
3375         * statement.cs (ExceptionStatement.EmitForDispose): Use
3376         EmitFinallyBody, not EmitFinally.
3377
3378         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3379         * iterator.cs: Update to changes.
3380
3381         Start using the ResumableStatement infrastructure
3382         * statement.cs (ResumeableStatement.PrepareForDispose): New.
3383         (ResumableStatement.EmitForDispose): New.
3384         (ExceptionStatement): Override them.
3385         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3386         EmitForDispose to create the body of the Dispose method.  Don't
3387         use OldResumePoint.
3388
3389         * iterator.cs (Iterator.AddResumePoint): Move here from ...
3390         * statement.cs (Toplevel.AddResumePoint): ... here.
3391         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3392         * flowanalysis.cs (FlowBranchingIterator): New.
3393         * codegen.cs (EmitContext): Update to changes.
3394
3395         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3396         (Iterator.old_resume_points): Rename from 'resume_points'.
3397         (Iterator.MoveNextStatement): Remove unused class.
3398
3399         New infrastructure for try/finally in iterators (still unused)
3400         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3401         (FlowBranchingToplevel.AddResumePoint): Hook into
3402         ToplevelBlock.AddResumePoint.
3403         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3404         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3405         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
3406         resume points and assign program-counter values.
3407         (ExceptionBlock.AddResumePoint): Collect resume points for
3408         de-muxer at the top of try block.
3409         * iterators.cs (Yield.CheckContext): Simplify.
3410         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3411
3412 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3413
3414         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3415         argument to an ExitStatement.
3416         (FlowBranchingException): Refactor saved origins code.
3417         * statement.cs (ExitStatement): Update to cahges.
3418         * iterator.cs (YieldBreak): Likewise.
3419
3420         * statement.cs (ResumableStatement): New.  Common base class for
3421         YieldReturn and ExceptionStatement.
3422         (ExitStatement): New.  Common base class for Return and YieldBreak.
3423         (Return): Update to changes.
3424         * iterator.cs (YieldBreak): Likewise.
3425         * lambda.cs (ContextualReturn): Likewise.
3426
3427         Fix #377028
3428         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3429         emit a meaningful error message.
3430
3431         Fix #324765, #319508
3432         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3433         (VariableInfo.SetAssigned): Set it.
3434         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3435         determine if CS0219 or CS0168 is appropriate.  Don't use
3436         flow-analysis information.
3437         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3438         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3439         (EmitContext.EndFlowBranching): ... this.
3440
3441 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3442
3443         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3444
3445 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3446
3447         A fix for bug #376508
3448         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3449         ImplicitConversionExists.
3450
3451 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3452
3453         * expression.cs (Binary): Added remaining binary operators to expression
3454         tree builder.
3455
3456         * nullable.cs: Optimize shift with null argument.
3457
3458 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3459
3460         Fix minor IL regression
3461         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3462         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3463         * cs-parser.jay (try_statement): Update to changes.
3464
3465         * statement.cs (TryFinally.need_exc_block): Delete.
3466         (TryFinally): Update to changes.
3467
3468         Now all ExceptionStatements are unconditional
3469         * statement.cs (CollectionForeach.DisposableWrapper): New.
3470         Extract out the try/finally code into a new wrapper.
3471         (CollectionForeach.Resolve): Use it to simplify the code.
3472
3473 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3474
3475         Start at simplifying ExceptionStatement semantics a bit
3476         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3477         * cs-parser.jay (try_statement): Update to changes.
3478         (opt_catch_clauses): Remove.
3479         * flowanalysis.cs: Update to changes.
3480         (FlowBranching.BranchingType.TryCatch): New.
3481         (FlowBranchingTryCatch): New.
3482
3483         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3484         (FlowBranching.CreateBranching): Update to changes.
3485         (FlowBranchingBlock.AddSibling): Add sanity check.
3486         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3487         Update to changes.
3488
3489         * iterators.cs (Iterator.MarkFinally): Remove.
3490         * statement.cs (ExceptionStatement): Update to changes.
3491
3492         Add support for skipping over finally blocks at runtime.  First
3493         in a series to fix #324708
3494         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3495         (Iterator.EmitMoveNext): Initialize it.
3496         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3497         branch over the body of the 'finally' clause.
3498
3499 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3500
3501         Avoid lopsided use of Foo/DoFoo names
3502         * statement.cs (ExpressionStatement.EmitFinallyBody):
3503         Rename from EmitFinally.
3504         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3505         * iterator.cs: Update to changes.
3506
3507 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3508
3509         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3510         based on UserOperatorCall. More binary nullable operators clean up.
3511
3512 2008-04-02  Martin Baulig  <martin@ximian.com>
3513
3514         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3515
3516 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3517
3518         * nullable.cs: Merge user and empty conversions when lifting expression
3519         trees.
3520         
3521         * expression.cs (StringConcat): Implemented expression tree representation.
3522
3523 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3524
3525         * nullable.cs: When lifting null literal and a user operator exists, no call 
3526         is made.
3527         
3528 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3529
3530         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3531         null.
3532
3533 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3534
3535         * nullable.cs, expression.cs: Use namespace instead heavily nested
3536         monster abstract class.
3537
3538 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3539
3540         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3541         lifting of null literal and user operators. Clean up of some temporary
3542         nullable hacks.
3543
3544 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3545
3546         Fix #368224, test-629.cs
3547         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3548         if it crossed an unwind-protect boundary.
3549         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3550         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3551         inside an unwind-protected region.
3552         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3553         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3554         'leave' instead of a 'br' if unwind-protected.
3555         (Iterator.EmitYieldBreak): Likewise.
3556
3557 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3558
3559         * driver.cs: Only define versioninfo resources if no win32 resource
3560         file was specified.
3561
3562 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3563
3564         A fix for bug #372375
3565         * convert.cs: Fixed boxing of nullable types.
3566
3567 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3568
3569         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3570         type.
3571
3572 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3573
3574         A fix for bug #374619
3575         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3576         
3577 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3578
3579         * lambda.cs: Check return type only for invocation.
3580         
3581 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3582
3583         A fix for bug #374214
3584         * ecore.cs: Correctly report argument type mismatch.
3585
3586 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3587
3588         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3589         and not rely on broken IsEnum.
3590
3591 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3592
3593         * nullable.cs: New file, extracted from generic.cs.
3594         
3595         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3596
3597 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3598
3599         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3600         predefined comparison operators and null literals.
3601         
3602         * report.cs: New warning ID.
3603         
3604 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3605
3606         A fix for bug #370577
3607         * lambda.cs: Check return type too.
3608
3609 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3610
3611         A fix for bug #372846
3612         * class.cs: Automatic properties can be declared as unsafe.
3613
3614 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3615
3616         * location.cs: Use string based concatenation.
3617         
3618         * expression.cs: LiftedBinaryOperator is gmcs only.
3619         
3620 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3621
3622         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3623         conversions rules and expression trees.
3624
3625 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3626
3627         * delegate.cs: Use extension method source as delegate target.
3628
3629 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3630
3631         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3632         binary operations to be purely based on binary operations and optimized
3633         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3634         and other ET refactoring.
3635         
3636         * typemanager.cs: Fixed warning.
3637         
3638 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3639
3640         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3641         
3642         * symbolwriter.cs: Fixed.
3643
3644 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3645
3646         * anonymous.cs, driver.cs: Reset anonymous types counters.
3647
3648 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3649
3650         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3651         
3652         * class.cs: Use fullname for all type member definitions.
3653         
3654 2008-02-19  Martin Baulig  <martin@ximian.com>
3655
3656         * class.cs
3657         (IMethodData.EmitExtraSymbolInfo): New interface method.
3658         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3659         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3660         interface method here as an empty public virtual method.
3661
3662         * anonymous.cs
3663         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3664         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3665         CodeGen.SymbolWriter.SetRealMethodName().       
3666
3667 2008-02-18  Martin Baulig  <martin@ximian.com>
3668
3669         * anonymous.cs
3670         (ScopeInfo.EmitType): Override this and emit debugging
3671         information for captured variables.
3672         (RootScopeInfo.EmitType): Override this and emit symbol
3673         information for a captured `this'.
3674
3675 2008-02-15  Martin Baulig  <martin@ximian.com>
3676
3677         * iterators.cs: Emit debugging info.
3678
3679         * codegen.cs
3680         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3681         (EmitContext.OmitDebuggingInfo): New public property.
3682
3683         * statement.cs
3684         (While): Override Emit() and don't emit symbol info there; do it
3685         inside DoEmit() instead.
3686         (Block.Emit): Omit symbol information while emitting the scope
3687         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3688         block logic.
3689         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3690         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3691         .ctor to make `IsIterator' work.
3692
3693 2008-03-14  Martin Baulig  <martin@ximian.com>
3694
3695         * symbolwriter.cs: Added the new symbol writer function from the
3696         debugger's `terrania' branch; temporarily enclose them inside
3697         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3698         my vacations.
3699
3700 2008-03-14  Martin Baulig  <martin@ximian.com>
3701
3702         * symbolwriter.cs
3703         (SymbolWriter): Make this a public static class.
3704
3705         * codegen.cs
3706         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3707         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3708
3709 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3710
3711         A fix for bug #370577
3712         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3713         return type.
3714         
3715 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3716
3717         * typemanager.cs (CSharpName): Made 250 times faster.
3718
3719 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3720
3721         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3722         
3723 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3724
3725         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3726         crash when predefined field does not exist.
3727         
3728 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3729
3730         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3731         
3732 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3733
3734         * class.cs (FixedField): Don't crash when contructors are missing.
3735
3736 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3737
3738         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3739         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3740         check internal types accessibility for internal and external types.
3741         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3742
3743 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3744
3745         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3746         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3747         attribute.cs, statement: Use corect instance of predefined types (work
3748         related to #364674).
3749
3750 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3751
3752         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3753         
3754 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3755
3756         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3757         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3758         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3759         predefined types clean up, delayed predefined types members initialization
3760         (work related to #364674).
3761
3762 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3763
3764         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3765         
3766 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3767
3768         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3769         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3770         predefined types clean up (work related to #364674).
3771
3772 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3773
3774         * ecore.cs: Print an error message instead of throwing exception.
3775         
3776 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3777
3778         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3779         expression.cs, statement.cs: Unififed null literal representation.
3780
3781 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3782
3783         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3784         expression.cs: Refactored binary operators resolve phase and improved speed.
3785         The nullable code is still missing and won't work correctly, more fixes
3786         required.
3787
3788         It also fixes #323726, #324312, #324248, and many other unreported issues.
3789
3790 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3791
3792         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3793         instead of 'gmcs'.
3794
3795 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3796
3797         * ecore.cs: Clean-up and split BetterConversion.
3798         
3799 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3800
3801         Fix #363791
3802         * enum.cs (EnumMember.Value): Only access 'value' if
3803         ResolveValue says it's ok.
3804         (EnumMember.DoResolveValue): Don't set prev_member.value.
3805         (Enum.GetDefinition): Reverse arguments of Equals --
3806         EnumMember.Value can return 'null'.
3807
3808         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3809
3810 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3811
3812         * generic.cs, expression.cs: More ongoing work on expression trees.
3813         
3814 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3815
3816         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3817         handle missing matches when mutiple operators exist.
3818         
3819 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3820
3821         A fix for bug #363218
3822         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3823         initializers.
3824         
3825 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3826
3827         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3828         update. This time to deal correctly with SideEffectConstant expression used
3829         as an argument for another constant folding.
3830
3831 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3832
3833         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3834         MethodBuilder.
3835
3836 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3837
3838         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3839
3840 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3841
3842         A fix for bug #328136
3843         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3844         side is a false constant, because we still need to evaluate the right-hand
3845         side.
3846
3847         * statement.cs (If): Emit two types of boolean constants (simple constant,
3848         side-effect constant).
3849
3850 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3851
3852         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3853
3854         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3855         constants.
3856
3857 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3858
3859         A fix for bug #361457
3860         * ecore.cs (IsApplicable): Params methods have lower priority.
3861
3862         * support.cs: Return correct parameter modifier for params types.
3863
3864 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3865
3866         * generic.cs (TypeParameter): Cache attribute target name.
3867
3868         * support.cs: Removed unused variable.
3869
3870         * typemanager.cs: Removed debugging leftover.
3871
3872         * ecore.cs: Use local type instead of a property;
3873
3874         * class.cs (VerifyMembers): Consider also parent to test whether type member
3875         is local or public.
3876
3877         * expression.cs (FullMethodDesc): Removed.
3878
3879         * attribute.cs (IsValidArgumentType): Made static.
3880
3881 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3882
3883         Cleanup to be more readable.
3884         * Makefile (GMCS_PROFILE): Remove.
3885         (COMPILER_NAME): New helper.
3886
3887 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3888
3889         * cs-tokenizer.cs: if a conditional expression happens inside a
3890         (...) this also means that we do not need to de-ambiguate between
3891         an parenthesized expression and a cast.
3892
3893         Fixes 346484.
3894
3895         * constant.cs (SideEffectConstant): a constant value that happens
3896         to have a side effect.
3897
3898         Fixes the build regressions introduced by the fix for #359789
3899
3900 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3901
3902         * expression.cs (Conditional.Emit): when emitting the ternary
3903         operator, use local variables to generate code verifiable code.
3904
3905         The verifier cannot infer that the type on stack before the
3906         stloc.0 is executed is of type ParentB. This happens because the
3907         stack merge algorithm uses only parent types when deciding which
3908         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3909         335.
3910
3911         This code compiled with mcs is not verifiable under MS. The MS
3912         verifier picks the first common interface of Foo and Bar, which is
3913         wrong, but doesn't use a full join type of the 2 interfaces.
3914
3915         CSC uses a clever hack to compile such code in a verifiable
3916         way. It stores the intermediate values in a local variable with
3917         the expected type.
3918
3919         Fixes: #358102
3920
3921 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3922
3923         * expression.cs: Do not fold BitwiseAnd operators when the left
3924         side is a false constant, because we still need to evaluate the
3925         right-hand side.
3926
3927         Fixes #359789
3928
3929         * support.cs: Instead of throwing an InternalErrorException when
3930         the position of the stream is outside the boundary of our buffer,
3931         reset the state of the reader, and restart the reading from the
3932         beginning of the file.
3933
3934 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3935
3936         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3937
3938 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3939
3940         A fix for bug #361686
3941         * decl.cs: A protected types used inside a private class which parents
3942         derives from the protected class are accessible.
3943
3944 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3945
3946         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3947         the parameterless constructor.
3948
3949 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3950
3951         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3952         lookup methods to use standard member cache when doing member lookup.
3953
3954 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3955
3956         * driver.cs: Don't report full path for referenced module as assembly error.
3957
3958 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3959
3960         * Makefile: Fixed `qh' target to work on all machines.
3961
3962         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3963         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3964         and HasElementType with TypeManager implementation.
3965
3966 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3967
3968         A fix for bugs #325134, #359749
3969         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3970         first binds point to non-method member expression.
3971
3972 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3973
3974         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3975
3976 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3977
3978         A fix for bugs #321394, #323028
3979         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3980         Reworked naive IsAccessibleAs implementation to handle nested types.
3981
3982 2008-02-05  Jb Evain  <jbevain@novell.com>
3983
3984         * class.cs: use generic type comparison for parameters
3985         as well.
3986
3987 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3988
3989         A fix for bug #325372
3990         * class.cs: Use generic type comparison when testing method signatures.
3991
3992 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3993
3994         A fix for bug #357047
3995         * ecore.cs: Applied C# 3.0 changes to better conversion.
3996
3997 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3998
3999         A fix for bug #358374
4000         * cs-parser.jay: Correctly set modifiers for all constructor types.
4001
4002 2008-02-04  Marek Safar  <marek.safar@gmail.com>
4003
4004         A fix for bug #355251
4005         * generic.cs: Added base class constraint based type inference.
4006
4007 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4008
4009         A fix for bug #357255
4010         * decl.cs: One more missing visibility check.
4011
4012 2008-02-01  Marek Safar  <marek.safar@gmail.com>
4013
4014         * support.cs: Fixed broken return.
4015
4016 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4017
4018         * report.cs: Correctly reset warnings count after probing.
4019
4020 2008-01-25  Martin Baulig  <martin@ximian.com>
4021
4022         * namespace.cs
4023         (NamespaceEntry.SymbolFileID): Make this work again after
4024         MemberName.ToString() is gone.
4025
4026 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4027
4028         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4029         expressions.
4030
4031 2008-01-25  Marek Safar  <marek.safar@gmail.com>
4032
4033         * generic.cs: Use full implicit conversion for type inference fixing.
4034
4035 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4036
4037         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4038         Fixed user operator conversions.
4039
4040 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4041
4042         * generic.cs: Do nullable type to null comparison optimization during
4043         resolve phase.
4044
4045 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4046
4047         A fix for bug #355163
4048         * generic.cs: Enabled l-value resolve on nullable expressions.
4049
4050 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4051
4052         A fix for bug #353986
4053         * class.cs: Ingore static ctors with parameters for any further checks.
4054
4055 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4056
4057         A fix for bug #354310
4058         * namespace.cs: Removed redundant check.
4059
4060 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4061
4062         A fix for bug #354928
4063         * expression.cs: ElementInitializers can be resolved only once.
4064
4065 2008-01-24  Marek Safar  <marek.safar@gmail.com>
4066
4067         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
4068         Condition expressions.
4069
4070 2008-01-23  Marek Safar  <marek.safar@gmail.com>
4071
4072         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
4073
4074 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4075
4076         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4077         not allowed.
4078
4079         * generic.cs: Implemented coalesce expression.
4080
4081 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4082
4083         A fix for bug #355145
4084         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
4085         expression tree type inference.
4086
4087 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
4088
4089         Fix #354663
4090         * expression.cs (Binary.IsUnsignedType): Fix typo.
4091
4092 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4093
4094         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
4095
4096 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4097
4098         A fix for bug #355161
4099         * ecore.cs, expression.cs: Wider range of extension method supported
4100         expressions.
4101
4102 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
4103
4104         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
4105         AssemblyBuilder to operate in compiler context. Fixes mcs part of
4106         bug #354970.
4107
4108 2008-01-22  Marek Safar  <marek.safar@gmail.com>
4109
4110         A fix for bug #355148
4111         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
4112
4113 2008-01-22  Miguel de Icaza  <miguel@novell.com>
4114
4115         * expression.cs (CreateExpressionTree): Add support for or and
4116         logical or, and indent following the coding conventions.
4117
4118         * typemanager.cs (LinqExpression): renamed from
4119         ExpressionTreeManager, for a shorter name.
4120
4121         Use TypeManager.CoreLookupType to lookup types from our core
4122         assemblies and turn those into "Type" variables.
4123
4124         Consumers that previously used "Namespace" and "Type" from this
4125         class should instead use the TypeExpression which is a type that
4126         is fully resolved (without involving the regular C# resolution
4127         rules). 
4128
4129         This typically looks like this:
4130
4131         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
4132         new MemberAccess (texpr, name, type_arguments, loc)
4133
4134         This avoids the problem in: #355178
4135
4136 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4137
4138         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
4139         feature in parser only as we do in other cases.
4140         
4141 2008-01-21  Marek Safar  <marek.safar@gmail.com>
4142
4143         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
4144         typemanager.cs: A refactoring of params arguments to reuse existing
4145         expressions (params -> array initializer) to emit params argument instead
4146         of specialized handling.
4147         It was required by expression tree implementation and it has other benefits
4148         as well, we now apply same optimization for params arguments as we do for
4149         array initializers.
4150         
4151 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4152
4153         A fix for bug #353526
4154         * generic.cs: A type inference of params arguments may not required any
4155         temporary array creation.
4156         
4157 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4158
4159         A fix for bug #353534
4160         * generic.cs, ecore.cs, expression.cs: A method group type inference is
4161         supported for delegates only.
4162         
4163 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4164
4165         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
4166         type for more than 1 candidates.
4167         
4168 2008-01-18  Marek Safar  <marek.safar@gmail.com>
4169
4170         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
4171         expressions.
4172         
4173 2008-01-16  Marek Safar  <marek.safar@gmail.com>
4174
4175         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
4176         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
4177         operator) expressions. 
4178                 
4179 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4180
4181         * statement.cs: Avoid declaring an IL variable for this_variable since it is
4182         not accessed from the generated IL.
4183
4184 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4185
4186         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
4187         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
4188         statement.cs: The first expression tree implementation drop, mostly
4189         infrastructure work.
4190
4191 2008-01-14  Marek Safar  <marek.safar@gmail.com>
4192
4193         * ecore.cs (IsNestedChild): Refactored.
4194
4195 2008-01-11  Marek Safar  <marek.safar@gmail.com>
4196
4197         * lambda.cs: Don't use a cast on unknown expression statement.
4198
4199 2008-01-10  Geoff Norton  <gnorton@novell.com>
4200
4201         * cs-tokenizer.cs: One more token to distinguish between method and lambda
4202         arguments
4203
4204 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4205
4206         * doc.cs: Report better /doc crash details.
4207         
4208 2008-01-09  Marek Safar  <marek.safar@gmail.com>
4209
4210         A fix for bug #352536
4211         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
4212
4213 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4214
4215         A fix for bug #352287
4216         * ecore.cs, expression.cs: Do `this' access checking in all member access
4217         expressions.
4218         
4219 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4220
4221         * rootcontext.cs, driver.cs: Switch to linq mode by default.
4222         
4223         * report.cs: Reset message stacks.
4224         
4225 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4226
4227         * generic.cs (InferInPhases): Correctly calculate params position.
4228         
4229 2008-01-08  Marek Safar  <marek.safar@gmail.com>
4230
4231         * cs-tokenizer.cs: No need to parse full string when parsing lambda
4232         arguments.
4233
4234 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4235
4236         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
4237         
4238         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
4239         
4240         * driver.cs: Updated --help option.
4241         
4242 2008-01-07  Marek Safar  <marek.safar@gmail.com>
4243
4244         * generic.cs (InferParamsTypeArguments): Removed.
4245         (InferInPhases): Add params type inference.
4246         (LowerBoundInference): Fixed scoring mechanism.
4247         
4248         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
4249         
4250 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4251
4252         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
4253         byte array for unsigned "baked" assemblies.
4254
4255 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4256
4257         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
4258         array for assemblies that are not strongnamed.
4259
4260 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4261
4262         A fix for bug #351481
4263         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
4264         declaring type for nested generic types.
4265         
4266 2008-01-04  Marek Safar  <marek.safar@gmail.com>
4267
4268         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
4269         instead of ToString.
4270         
4271 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4272
4273         A fix for bug #351047
4274         * expression.cs (Binary.ResolveOperator): Allow equality operators between
4275         null and structs only when equality and inequality operators are defined
4276         either as an user-operators or predefined operators.
4277         
4278 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4279
4280         A fix for bug #351047
4281         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
4282         
4283 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4284
4285         A fix for bug #351257
4286         * cs-tokenizer.cs: Advance line number for '\r' correctly.
4287         
4288 2008-01-03  Marek Safar  <marek.safar@gmail.com>
4289
4290         A fix for bug #351157
4291         * class.cs (Using): Fixed yet another broken cloning.
4292         
4293         (Block): Put back more sensible default value for statements.
4294         
4295 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
4296
4297         * codegen.cs: Allow AssemblyVersion with only major version component.
4298         Fixes bug #351055.
4299
4300 2007-12-29  Marek Safar  <marek.safar@gmail.com>
4301
4302         A fix for bug #324654
4303         * class.cs: Use FullName property as member name.
4304
4305 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4306
4307         A fix for bug #342117
4308         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4309         constructor constraint.
4310
4311 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4312
4313         A fix for bug #338273
4314         * class.cs (ProbertyBase): Access modifier checks are required for overrides
4315         only.
4316
4317 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4318
4319         A fix for bug #350839
4320         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4321
4322 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4323
4324         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4325         GHOP:
4326         
4327         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4328
4329         * statement.cs: Changed some Hashtables to use HybridDictionaries
4330         instead. It was observed that some HashTables only contained a few
4331         items in the vast majority of cases. Since HybridDictionary is
4332         more efficient on small sets (<10 elements), "known_variables"
4333         from class ExplicitBlock as well as "labels" and "constants " from
4334         class Block were changed to HybridDictionaries. 
4335
4336         Atsai results: (56216kb->54987kb)
4337
4338         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4339
4340
4341 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4342
4343         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4344         GHOP:
4345         
4346         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4347         
4348         * expression.cs: foreach loop to for loop, saved on allocation of
4349         enumerator (59333kb->59141kb)
4350
4351         * statement.cs. Changed foreach loops to for loops, saved on
4352         allocation of enumerator (59141kb->59006kb)
4353
4354         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4355         when constructed with no specified capacity. This was causing a
4356         few ArrayLists to allocate more memory than they would potentially
4357         need in the Block class and MemberCache class. Setting the
4358         ArrayLists to construct with a capacity of 1 saves some
4359         memory. (56216kb->55585kb)
4360
4361 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4362
4363         A fix for bug #347189 (2nd issue)
4364         * expression.cs (MemberAccess): Nested type can be found in base non-generic
4365         type.
4366
4367 2007-12-27  Miguel de Icaza  <miguel@novell.com>
4368         
4369         * report.cs: Do not use colors if stdout and stderr are not a
4370         terminal.
4371
4372 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4373
4374         A fix for bug #346998
4375         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4376         overloads.
4377
4378 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4379
4380         A fix for bug #343465
4381         * class.cs: Explicit method name for nested types uses dots only.
4382
4383 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4384
4385         A fix for bug #343707
4386         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4387
4388 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4389
4390         * ecore.cs: Report type inference errors only when arguments count matches
4391         parameter count.
4392         
4393         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4394         
4395         * expression.cs, report.cs: New warning.
4396         
4397         * typemanager.cs: Catch anonymous method type too.
4398
4399 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4400
4401         A fix for bug #346379
4402         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4403
4404 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4405
4406         A fix for bug #347359
4407         * expression.cs (Invocation): Don't resolve already resolved expression.
4408
4409 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4410
4411         A fix for bug #347189
4412         * class.cs (FixedField): Use non-dependent code only in the define phase.
4413
4414 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4415
4416         A fix for bug #348076
4417         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4418
4419 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4420
4421         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4422         discovered extension methods.
4423
4424 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4425
4426         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4427         method.
4428
4429 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4430
4431         * report.cs (ErrorMessage): Add support for using colors on
4432         terminals that support it. 
4433
4434 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4435
4436         * ecore.cs: Use information about expanded params for error reporting.
4437
4438 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4439
4440         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4441         and logic for params overloads.
4442         
4443 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4444
4445         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4446         as this is also created from the parser.  Fixes #349034
4447
4448 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4449
4450         * statement.cs (Throw.CloneTo): it is valid to have empty
4451         expressions for throw. 
4452
4453 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4454
4455         * cs-parser.jay: Set delegate constraint parsing region correctly.
4456
4457 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4458
4459         A fix for bug #345467
4460         * typemanager.cs (IsEqual): Compare generic parameters position only.
4461         
4462 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4463
4464         * expression.cs (BaseAccess): Type arguments can be null.
4465
4466 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4467
4468         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4469         consistent even when an error has occured.
4470         (Switch.Resolve): Likewise.
4471
4472 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4473
4474         A fix for bug #334505
4475         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4476         overrides.
4477         
4478 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4479
4480         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4481         refactorings required to resolve extension methods correctly when mixing
4482         generics and non-generics members.
4483         
4484 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4485
4486         A fix for bug #342584
4487         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4488         conversion.
4489         
4490 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4491
4492         A fix for bug #342512
4493         * delegate.cs: Use delegate argument expression when is available. Don't
4494         emit virtual call when class is sealed.
4495         
4496 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4497
4498         A fix for bug #325423
4499         * assign.cs (FieldInitializer): Use resolved expression for emit.
4500         
4501         * class.cs: Print less confusing error message.
4502         
4503 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4504
4505         * cs-tokenizer.cs: Removed GMCS ifdefs.
4506         
4507         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4508         mcs.
4509         
4510         * cs-parser.jay: Disabled nullable check.
4511         
4512         * generic-mcs: Copied more generic stuff.
4513                 
4514 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4515
4516         * gcs-parser.jay: Merged to cs-parser.jay.
4517         
4518         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4519         * *.csproj, *.sources: Updated to use only jay parser file.
4520
4521 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4522
4523         * gcs-parser.jay: Added nullable and default expression feature checks.
4524         
4525 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4526
4527         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4528         it fixes many TODOs and hidden bugs.
4529         
4530         * expression: Removed duplicate error check.
4531
4532 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4533
4534         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4535         implicitly type local variable only when it is used in a declaration.
4536
4537 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4538
4539         * attribute.cs: Use CS0612 for empty strings.
4540
4541 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4542
4543         * lambda.cs, statement.cs: Contextual return may act as a statement.
4544
4545 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4546
4547         A fix for a regression cause by #324222
4548         * class.cs: Don't report unused even when it implements an interface.
4549         
4550 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4551
4552         A fix for bug #341205
4553         * ecore.cs, expression.cs: Method group expression cannot do static
4554         method access with an instance reference check before overloading takes
4555         a place.
4556         
4557 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4558
4559         A fix for bug #325359
4560         * class.cs: Use predictable name for automatically generated property.
4561         
4562 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4563
4564         A fix for bug #324996
4565         * expression.cs (Is): Handle case where D is nullable and T is not
4566         correctly.
4567         
4568         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4569         
4570 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4571
4572         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4573         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4574         Flush small error reporting changes.
4575         
4576 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4577
4578         A fix for bug #324996
4579         * expression.cs: Rewrote Is expression implementation to work with
4580         generics, nullable types, anonymous method. A const result expression 
4581         uses existing infrastructure instead of custom not fully-featured one.
4582         
4583 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4584
4585         A fix for bug #340202
4586         * class.cs: Consider generics for volatile field.
4587
4588 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4589
4590         A fix for bug #335594
4591         * expression.cs: Use conversion rules when handling string addition.
4592         
4593 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4594
4595         A fix for bug #336651
4596         * expression.cs: Fixed a crash when probing is on.
4597         
4598 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4599
4600         A fix for bug #324242
4601         * covert.cs: Added a conversion from any nullable-type with an 
4602         underlying enum-type to the type System.Enum.
4603         
4604 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4605
4606         A fix for bug #324222
4607         * class.cs: Report all non-used event fields.
4608         
4609 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4610
4611         A fix for bug #325161
4612         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4613         qualifier for generic types.
4614         
4615 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4616
4617         A fix for bug #322971
4618         * expression.cs, ecore.cs: Added intermediate result value check for
4619         indexers. 
4620         
4621 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4622
4623         A fix for bug #324754
4624         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4625         when it was requested.
4626
4627 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4628
4629         A fix for bug #325101
4630         * expression.cs: Do type not value comparison for `is' expression.
4631
4632 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4633
4634         A fix for bug #320236
4635         * convert.cs: Don't apply user conversion on underlying target type.
4636
4637 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4638
4639         * expression.cs: Don't use unresolved expression for error reporting.
4640  
4641 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4642
4643         A fix for bugs #337712, #324490
4644         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4645         overloading resolution too.
4646         
4647         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4648         the process consistent and more robust.
4649         
4650         * expression.cs, linq.cs, report.cs: Update.
4651
4652 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4653
4654         A fix for bug #332909
4655         * attribute.cs: Resolve attributes in correct context using error
4656         handling procedure.
4657         
4658         * rootcontext.cs: Define Obsolete attribute members as core members.
4659         
4660 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4661
4662         * statement.cs: Removed unused methods.
4663         
4664 2007-10-31  Wade Berrier  <wberrier@novell.com>
4665
4666         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4667         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4668         during 'make dist')
4669
4670 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4671
4672         A fix for bug #338102
4673         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4674         methods registered as non-generics.
4675         
4676 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4677
4678         A fix for bugs #337712, #324490
4679         * delegate.cs: Delegate covariance and contravariance is not allowed for
4680         value types.
4681         
4682 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4683
4684         A fix for bug #337719 
4685         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4686         `from' keyword.
4687         
4688 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4689  
4690         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4691
4692 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4693  
4694         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4695         query expressions.
4696
4697 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4698
4699         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4700
4701 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4702  
4703         A fix for bug #334652
4704         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4705         extension methods when we have not found the best candidate in normal
4706         container.
4707
4708 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4709
4710         * AssemblyInfo.cs: Keep up-to-date.
4711
4712 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4713
4714         * Makefile: Fixed generics compiler name.
4715         
4716 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4717
4718         * lambda.test: removed, lambda parsing is done differently.
4719         
4720         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4721
4722 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4723
4724         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4725
4726 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4727
4728         * Makefile, *.sources : All C# compilers are in mcs folder.
4729         
4730         * *.cs: Use existing 2_1 define for smcs.
4731
4732 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4733
4734         A fix for bug #335847
4735         * assign.cs, expression.cs: Couple of changes to avoid creating a
4736         temporary variable for each object initializer assignment statement. It
4737         simplifies struct initialization too, otherwise two temporary variables
4738         would be required.
4739         Implemented optimization of redundant default element initializers.
4740         
4741 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4742
4743         A fix for bug #336766
4744         * expression.cs (Class.CheckBase): Use generic name when method is
4745         generic.
4746         
4747 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4748
4749         A fix for bug #334737
4750         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4751         variable and not variable argument for prepared copies.
4752
4753 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4754
4755         A fix for bug #325110
4756         * class.cs, expression.cs, attribute.cs: Use open generic method when
4757         checking conditional attribute.
4758         
4759 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4760
4761         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4762         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4763         FeatureIsNotAvailable.
4764
4765 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4766
4767         ** C# 3.0 Partial methods
4768         
4769         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4770         methods support. Because of member cache issue with generics only
4771         non-generics partial methods are fully supported.
4772         
4773 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4774         
4775         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4776         generics and to use member cache for member checking. It also improves
4777         performance and fixes remaining overloads issues.
4778         
4779 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4780         
4781         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4782         roottypes.cs, typemanager.cs:
4783                 
4784         A member cache creation logic changed to add members immediately and
4785         not rely on fallback. The member cache is now only prefered way
4786         how to access and find type declaration members. It saves 5 MB of memory
4787         during MWF compilation and makes code ready for more optimizations and
4788         clean-ups, it's also a pre-requirement for partial methods.
4789         
4790 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4791
4792         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4793         handling for generic parameters.
4794
4795 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4796         
4797         * class.cs (FixedField): Removed redundant volatile check.
4798         
4799 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4800         
4801         * class.cs, decl.cs: Fixed overload members verification to do only one
4802         check per possible collision.
4803         
4804 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4805         
4806         A fix for bug #325478
4807         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4808         and create only one disposable flags container.
4809         
4810 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4811         
4812         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4813         * statement.cs (Fixed): Fixed variables cloning.
4814         
4815 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4816         
4817         A fix for bug #333342
4818         * class.cs (EventField): Don't mark value type event as synchronized. 
4819         
4820 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4821         
4822         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4823         inference to identify best candidate method correctly.
4824         (ProperyExpr): A range variable is read only and cannot be modified.
4825         
4826 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4827         
4828         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4829         logic to identify best candidate method correctly.
4830         
4831 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4832         
4833         * location.cs (Equals, GetHashCode): Removed.
4834         
4835 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4836         
4837         * report.cs: Implemented message recorder. It is used mainly for lambda
4838         expressions to capture otherwise swallowed error messages.
4839         
4840         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4841
4842         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4843         and not at the top.
4844         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4845                 
4846         * expression.cs (MemberAccess): Always report lookup failure.
4847         
4848         * location.cs: Implemented Equals, GetHashCode.
4849         
4850         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4851         
4852 2007-10-10  Jb Evain  <jbevain@novell.com>
4853
4854         * codegen.cs: re-enable assembly version check.
4855
4856 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4857         
4858         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4859         checks.
4860         
4861         * namespace.cs (UsingAlias): Do correct version check.
4862         
4863 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4864         
4865         * expresison.cs, ecore.cs: Issue extension method error message when
4866         appropriate.
4867         
4868         * rootcontext.cs: Added ISO_2 compiler mode option.
4869
4870 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4871         
4872         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4873          message.
4874         
4875 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4876         
4877         * attribute.cs (GetString, GetBoolean): Work with both literal and
4878         constant.
4879         
4880         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4881         Moved method overload specific methods to MethodGroupExpr.
4882         
4883         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4884         it should be less memory consuming.
4885         
4886 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4887
4888         * codegen.cs: remove the assembly version check until the buildbot is
4889         fixed.
4890
4891 2007-10-07  Jb Evain  <jbevain@novell.com>
4892
4893         * attribute.cs (Attribute.GetString): if the value
4894         expression is a StringConstant, return its string value.
4895
4896 2007-10-07  Jb Evain  <jbevain@novell.com>
4897
4898         * typemanager.cs: add `assembly_version_attribute_type`.
4899         * codegen.cs: on attribute emission, check that the
4900         AssemblyVersionAttribute doesn't overflow.
4901
4902 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4903         
4904         A fix for bug #324677
4905         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4906         parent container of a scope container with currently resolved one. 
4907         
4908 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4909         
4910         A fix for bug #325534
4911         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4912         only.
4913         
4914 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4915         
4916         A fix for bug #327504
4917         * class.cs (Operator.Define): Refactored implicit and explicit user
4918         operator conversion rules.
4919         
4920 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4921         
4922         A fix for bug #327520
4923         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4924         
4925 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4926         
4927         A fix for bug #328022
4928         * class.cs (MethodData.Define): Use correct method to check whether
4929         a method implementents an accessor.
4930         
4931 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4932         
4933         A fix for bug #330069
4934         * statement.cs (Fixed.Resolve): Read the first array element only when
4935         an array is instantiated. 
4936         
4937 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4938         
4939         * expression.cs, assign.cs, generics.cs: Print correct operator when
4940         compound assignment is used.
4941         
4942 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4943         
4944         A fix for bug #325841
4945         * expression.cs (ArrayAccess): Use full argument cloning only for
4946         string compound concatenation.
4947         
4948 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4949         
4950         A fix for bug #328774
4951         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4952         assignment.
4953         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4954         assignment.
4955
4956 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4957
4958         Fix #328490
4959         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4960         Event accessibility checks here.  Remove some bogus code that
4961         accidently made GenericMethods work.
4962         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4963
4964 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4965         
4966         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4967         
4968         * statement.cs (Block): Refactored AddVariable to allow error handling
4969         customization.
4970         
4971         * generic.cs: New stub.
4972         
4973 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4974         
4975         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4976         flag.
4977         
4978 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4979
4980         * class.cs: Use partial container to record whether any partial part
4981         contains static field initializer and therefore default contructor has
4982         to be defined.
4983         
4984 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4985
4986         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4987         mono-list when only one of two partial parts has defined accessibility
4988         modifier.
4989         
4990 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4991
4992         A fix for bug #82845
4993         
4994         * class.cs (TypeContainer): Set correct resolve context for all field
4995         initializers.
4996         
4997 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4998
4999         * assign.cs: Fixed a crash when field is resolved twice with an error.
5000         
5001         * codegen.cs: Changed InFieldInitializer to be flag.
5002         
5003         * anonymous.cs, ecore.cs, expression.cs: Update after
5004         IsInFieldInitializer rename.
5005         
5006         * const.cs: Removed unused parameter.
5007         
5008         * class.cs: Changed the way how we resolve and emit field initializers.
5009         The field initilizers have to have access to contructor block to emit
5010         compiler generated code.
5011
5012 2007-09-13  Marek Safar  <marek.safar@gmail.com>
5013
5014         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5015         generics use TypeContainer instead.
5016         
5017 2007-09-12  Marek Safar  <marek.safar@gmail.com>
5018         
5019         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5020
5021         * lambda.cs (ResolveParameters): Use more powerful
5022         InflateGenericArgument.
5023         
5024         * parameters.cs: Better exception message.
5025                 
5026 2007-09-10  Marek Safar  <marek.safar@gmail.com>
5027
5028         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5029         correct expression block type. 
5030         
5031         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
5032         
5033         * expression.cs (Invocation): Extracted method group resolve to
5034         DoResolveOverload.
5035         
5036 2007-09-07  Marek Safar  <marek.safar@gmail.com>
5037
5038         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
5039         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
5040         
5041         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
5042         generic extension methods.
5043
5044 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5045
5046         A fix for bug #82676 (Do I get it right now?)
5047         * convert.cs (Binary.ResolveOperator): An interface is converted to the
5048         object before a standard conversion is applied.
5049         
5050 2007-09-06  Marek Safar  <marek.safar@gmail.com>
5051
5052         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
5053         #82676.
5054         
5055 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5056
5057         A fix for bug #82676
5058         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
5059         non-generic interface types.
5060         
5061 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5062
5063         A fix for bug #82690
5064         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
5065         
5066 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5067
5068         A fix for bug #82571
5069         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
5070         modifier for container based methods.
5071         
5072 2007-09-05  Marek Safar  <marek.safar@gmail.com>
5073
5074         A fix for bug #82676
5075         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
5076         any interface-type T means to any of interface type T.
5077
5078 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5079
5080         * namespace.cs: We have 2 versions of System.Core assembly.
5081
5082 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5083
5084         A fix for bug #82652
5085         * class.cs (Class.GetClassBases): Compare types and not expressions.
5086
5087 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5088
5089         A fix for bug #82620
5090         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
5091         actually never worked before.
5092         (IndexerAccess): Emit prepared arguments before they are modified.
5093         
5094 2007-09-04  Marek Safar  <marek.safar@gmail.com>
5095
5096         A fix for bug #82563
5097         * assign.cs: Revert wrong fix.
5098         
5099         * expression.cs (VariableReference.EmitAssign): Handle ref reference
5100         correctly.
5101         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
5102         Instead of ldelema/stdind we have to use temporary variables to handle
5103         cases like String.Concat (params string[]).
5104         
5105 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5106
5107         * class.cs: EmitAttributes to Emit rename.
5108         
5109         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
5110         null.
5111         (MemberCore.HasClsCompliantAttribute): Don't depend on 
5112         GetClsCompliantAttributeValue execution.
5113         
5114 2007-08-31  Marek Safar  <marek.safar@gmail.com>
5115
5116         * anonymous.cs: Use shorter type prefix.
5117         
5118         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
5119         when exist.
5120         
5121         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
5122         variables when probing is on.
5123         
5124         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
5125         unresolved variables.
5126         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
5127         handle transparent identifiers.
5128         
5129 2007-08-26  Marek Safar  <marek.safar@gmail.com>
5130
5131         * attribute.cs (IsClsCompliant): Add nullable types test.
5132         
5133 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5134
5135         * doc.cs : catch other types of exception than XmlException to
5136           report CS1570. Fixed bug #82565.
5137
5138 2007-08-23  Marek Safar  <marek.safar@gmail.com>
5139
5140         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
5141         The number of delegate parameters has to match.
5142         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
5143         arrays.
5144
5145 2007-08-21  Marek Safar  <marek.safar@gmail.com>
5146
5147         * anonymous.cs (AnonymousMethod): Generate private anonymous method
5148         to fix problem with private arguments.
5149
5150 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5151
5152         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
5153         
5154         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
5155         
5156         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
5157         empty. Add cloning suport.
5158         
5159         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
5160
5161 2007-08-20  Marek Safar  <marek.safar@gmail.com>
5162
5163         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
5164         to create EmptyCast. It handles EmptyConstantCast specialization for
5165         constants.
5166         
5167 2007-08-18  Marek Safar  <marek.safar@gmail.com>
5168
5169         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
5170         (EmitArrayArgument): One routine for array arguments.
5171         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
5172         
5173 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5174
5175         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
5176
5177 2007-08-17  Marek Safar  <marek.safar@gmail.com>
5178
5179         * anonymous.cs: MemberLookupFinal update.
5180
5181         * class.cs (ConstructorInitializer): Is expression based.
5182         
5183         * delegate.cs: MethodGroupExpr update.
5184         
5185         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
5186         messages.
5187         (Error_MemberLookupFailed): Customizable error override.
5188         (MethodGroupExpr): Keep queried type for later usage.
5189         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
5190         resolve.
5191         
5192         * expression.cs: Error_MemberLookupFailed refactoring.
5193         (New.DoResolve): Resolve as much as possible.
5194         (ElementInitializer.Error_MemberLookupFailed): Object initializer
5195         customization for invalid member types.
5196
5197         * statement.cs: MethodGroupExpr update.
5198         
5199 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5200
5201         * modifier.cs (Check): Check all modifiers and not only accessibility
5202         ones.
5203
5204 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5205
5206         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
5207         type and not an expression.
5208
5209 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5210
5211         * statement.cs (Catch.Clone): Type and variable can be null.
5212
5213 2007-08-16  Marek Safar  <marek.safar@gmail.com>
5214
5215         A fix for bug #81979
5216         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
5217         I am really not sure whether this is the best fix.
5218         
5219         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
5220         only once.
5221         
5222 2007-08-14  Marek Safar  <marek.safar@gmail.com>
5223
5224         ** C# 3.0 Object and collection initializers (major re-write)
5225         
5226         * assign.cs (DoResolve): Initializers are not assign related.
5227         
5228         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
5229         used during collection or object initialization.
5230         
5231         * expression.cs (Error_InvalidArguments): Add initializers specific
5232         messages. More will come later because it requires some general
5233         refactoring.
5234         (New.DoResolve): Better error handling for unsafe types.
5235         (EmptyExpressionStatement): New class.
5236         (ElementInitializer): An object initializer expression.
5237         (CollectionElementInitializer): A collection initializer expression.
5238         (CollectionOrObjectInitializers): A block of object or collection
5239         initializers.
5240         (NewInitialize): New expression with element/object initializers.
5241         
5242         * statement.cs: Reverted object/collection initializer hacks.
5243         
5244         * typemanager.cs (CSharpName): Filter __arglist type.
5245         
5246 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5247
5248         ** C# 3.0 Anonymous Types (update to the latest standard)
5249         
5250         * expression.cs (Binary.ResolveOperator): Threat all null based types
5251         same.
5252         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
5253         (AnonymousTypeParameter): Updated.
5254         
5255         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
5256         (AnonymousTypeClass): New anonymous type container.
5257         
5258         * class.cs (AddField): Return operation result.
5259         
5260         * generic.cs: Another empty TypeArguments overload.
5261         
5262         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
5263         are stored at top of normal hierarchy.
5264         
5265         * typemanager.cs (CSharpName): Filter anonymous types.
5266         
5267 2007-08-09  Marek Safar  <marek.safar@gmail.com>
5268
5269         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
5270         as single Concat call. How could we miss that :-(
5271         
5272 2007-08-08  Marek Safar  <marek.safar@gmail.com>
5273
5274         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
5275         
5276 2007-08-07  Miguel de Icaza  <miguel@novell.com>
5277
5278         * expression.cs: Fix the previous commit, the creation of the
5279         arguments array list needs also to be conditional on the arguments
5280         not being null.
5281
5282         * class.cs: Add a little bit of help to help narrow down problems.
5283
5284         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
5285         not try to copy in that case. 
5286
5287         * driver.cs: When building SMCS, include a new different set of
5288         default assemblies here.   Do this here so we can control whether
5289         to include the default assemblies with /noconfig.
5290
5291 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5292
5293         A fix for bug #81979
5294         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
5295         only.
5296
5297 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5298
5299         A fix for bug #82300
5300
5301         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5302         we are in probing scope.
5303
5304 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5305
5306         A fix for bug #82301
5307
5308         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5309         (Statement.CloneTo): Clone and not map children blocks.
5310
5311 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5312
5313         A fix for bug #82299
5314
5315         * expression.cs (LocalVariableReference.CloneTo): Remap local info
5316         variable too.
5317         
5318         * statement.cs (Statement.CloneTo): Clone variables before statements
5319         to allow remaping of local variables.
5320
5321 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5322
5323         A fix for bug #82296
5324
5325         * anonymous.cs,
5326         * report.cs: Log crash details for future clone problems.
5327         
5328         * statement.cs (Return.Clone): Don't clone non-existent expression.
5329
5330 2007-08-03  Raja R Harinath  <harinath@gmail.com>
5331
5332         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5333         (Class.AddBasesForPart): Move CS0537 check here from ...
5334         * cs-parser.jay (class_declaration): ... here.  Move calling of
5335         'AddBasesForPart' to ...
5336         (class_bases): ... here.
5337         (struct_declaration, interface_declaration): Update to changes.
5338
5339 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5340
5341         A fix for bug #81923
5342
5343         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5344         conversion is allowed.
5345
5346 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5347
5348         A fix for bug #81564
5349
5350         * ecore.cs (EventExpr): Add IsBase handling.
5351
5352         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5353         too.    
5354         
5355 2007-08-02  Raja R Harinath  <harinath@gmail.com>
5356
5357         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5358         * cs-parser.jay: Some whitespace cleanups.
5359         (current_delegate): New.
5360         (type_name): New.
5361         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5362         a dummy code block, and use 'type_name' instead of 'member_name'.
5363         (interface_declaration, class_declaration): Likewise.
5364         (delegate_declaration): Likewise.  Rearrange slightly and use
5365         'current_delegate'.
5366         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5367         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
5368
5369 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5370
5371         A fix for bug #82039
5372
5373         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5374         available.
5375
5376         * typemanager.cs (CSharpName): Split to string overload.
5377
5378 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5379
5380         * expression.cs,
5381         * report.cs: Updated warning CS0472.
5382
5383 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5384
5385         A fix for bug #82181
5386         * cs-parser.jay,
5387         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5388
5389 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5390
5391         A fix for bug #82277
5392         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5393
5394 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5395
5396         ** C# 3.0 Type Inference (major bits are working)
5397         
5398         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5399         (.ImplicitStandardConversionExists): Uses compatible.
5400         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5401         (.InferReturnType): New method.
5402         (.Compatible): Refactored.
5403         (.ResolveParameters): Uses factory to create resolved parameters.
5404         (.CompatibleMethod): Add probing mode support.
5405         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5406         clearly distinguish between 2 different operations.
5407         (LambdaMethod): Moved to lambda.cs.
5408         (AnonymousMethod): Removed unused fields and methods.
5409         (AnonymousDelegate): Simplified.
5410         
5411         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5412         
5413         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5414         
5415         * delegate.cs (Delegate): New mehods to reduce code duplication.
5416         (.GetConstructor): New method.
5417         (.GetInvokeMethod): New method.
5418         (DelegateCreation): Updated.
5419         
5420         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5421         does not exist.
5422         (OverloadResolve): Made probing little bit faster.
5423         
5424         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5425         when probing is on.
5426         
5427         * generic.cs (TypeInferenceContext): Dummy implementation.
5428         
5429         * iterators.cs: Updated after Resolve/Define rename.
5430         
5431         * lambda.cs (LambdaExpression)
5432         (.ResolveParameters): Handles both type of arguments and type inference too.
5433         
5434         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5435         (InflateTypes): Updated.
5436         
5437         * support.cs (InflateTypes): Changed signature and updated.
5438         
5439         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5440         (MemberLookup_FindMembers): More MS tricks.
5441         (GetParameterData): Ditto.
5442         (GetDelegateParameters): Uses quick path for dynamic types.
5443         
5444 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5445
5446         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5447         only.
5448
5449 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5450
5451         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5452         syntax.
5453         
5454 2007-07-26  Jb Evain  <jbevain@novell.com>
5455
5456         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5457         which takes a boolean 'report_errors', similar to the GetMethod.
5458         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5459         in .net 2.1, do not report errors here.
5460
5461         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5462         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5463         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5464         in .net 2.1.
5465
5466         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5467         of the type InternalsVisibleToAttribute before the first call
5468         to CoreLookupType which is allowed to fail (third boolean parameter
5469         to true). Because, during the resolution for a type that is not
5470         immediately found, we try to check if the type is not defined in
5471         a friend assembly, and to do so, we need the
5472         InternalVisibleToAttribute.
5473
5474 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5475
5476         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5477         feature that allows structs to be compared against null and inline
5478         the result as true or false.
5479
5480         Notice that the same code is not permitted inside a generic block
5481         of code that would do:
5482
5483         class Foo<T> where T : struct {
5484             bool Eval (T x)
5485             {
5486                  return x == null;
5487             }
5488         }
5489
5490         It is only allowed if the type of T is not bound (no where
5491         clause).   In my opinion, this CSC 2 behavior is broken but people
5492         seem to be using it (IronRuby does, a few bug reports on bugzilla
5493         have it and some people have complained about it).
5494
5495         All of the users that depend on this behavior have code that is
5496         very likely broken. 
5497         
5498         * report.cs (Warning, Error): make these take object arguments,
5499         not strings, as that allows us to take advantage of Format.
5500
5501 2007-07-20  William Holmes  <billholmes54@gmail.com>
5502
5503         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5504           Left member variable for the Count.
5505         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5506           MemberName.CountTypeArguments to avoid a NRE. 
5507
5508         This code is contributed under the MIT X11 license
5509
5510 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5511
5512         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5513
5514 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5515
5516         * doc.cs : generic method arguments are written as ``x while generic
5517           type arguments are `x. Combined with the previous change, fixed bug
5518           #79706.
5519
5520 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5521
5522         Fix #82120
5523         * expression.cs (Binary.ResolveOperator): When converting
5524         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5525
5526 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5527
5528         * doc.cs : when T: or whatever x: is specified, it does not really
5529           check the doc comment's syntax correctness. Fixed bug #82006.
5530
5531 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5532
5533         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5534         LambdaExpression better.
5535         
5536         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5537         
5538         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5539         
5540         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5541         as it can be generated.
5542         
5543         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5544         modifiers.
5545         
5546         * lambda.cs (LambdaExpression): Refactored to share same code with
5547         AnonymousMethodExpression.
5548         
5549 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5550
5551         * anonymous.cs (MakeName): Include host name for easier debugging.
5552         (LambdaMethod): New class for lambda spcecific stuff.
5553         
5554         * attribute.cs: Set EmitContext return type.
5555
5556         * class.cs: Set EmitContext return type.
5557         
5558         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5559         with null/void meaning.
5560         
5561         * iterators.cs (ContainerType): Implemented.
5562         
5563         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5564         
5565         * statement.cs (Return): Updated to lambda expressions.
5566         (Block.CloneTo): Parent can be null.
5567                 
5568 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5569
5570         A fix for bug #81917
5571         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5572         
5573         * class.cs (FixedField): Check whether field is in unsafe scope.
5574
5575         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5576         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5577
5578         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5579         FieldExpr.
5580         
5581         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5582                 
5583 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5584
5585         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5586         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5587         from Report class.
5588
5589 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5590
5591         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5592         
5593 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5594
5595         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5596         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5597         
5598         * codegen.cs(EmitContext): Add ProbingMode flag.
5599         
5600         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5601         
5602         * driver.cs: For now set both warning values.
5603         
5604         * ecore.cs (SimpleName): Name is readonly.
5605         (MethodGroup.OverloadResolve): One quick path for probing.
5606         
5607         * expression.cs (Unary): Set Oper r/o.
5608         (Binary): Set Oper r/o.
5609         (ParameterReference): Set few instance variables as r/o.
5610         (ParameterReference.DoResolveBase): Don't capture aruments when 
5611         the probing is on.
5612         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5613         (Arglist): arguments are private.
5614         (SizeOf): type is private and r/o.
5615         (MemberAccess): arguments are private.
5616
5617         * report.cs: Enhanced reporting on/off capabilities.
5618         
5619         * lambda.cs: Uses ec.IsInProbingMode.
5620         (ContextualReturn): Derives from return.
5621         
5622         * rootcontext.cs: For now set both warning values.
5623         
5624         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5625         copy if one exists.
5626         (Return.Resolve): Don't die immediately.
5627         (Block.Resolve): Speed-up probing.
5628         (Block.CloneTo): Clone only child blocks.
5629
5630 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5631
5632         * iterators.cs: reverted Miguel's latest change (r81925) as it
5633         breaks the build in System.
5634
5635 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5636
5637         * iterators.cs (Yield.CheckContext): Check for the iterator type
5638         also here as we can call into Yield even in codepaths that are not
5639         directly checked by
5640         (MethodOrOperator is the only path that was checked).
5641
5642         In addition to the standard check, use a more specific check for
5643         constructors to report a more verbose error. 
5644
5645 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5646
5647         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5648         report the warning and continue 
5649
5650         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5651         values on the stack on the call to Emit.   Use EmitStatement if
5652         possible, or using Emit + Pop if not possible.   Fixes #82064
5653
5654 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5655
5656         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5657         avoid try...finally in some cases.
5658
5659 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5660
5661         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5662         
5663         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5664         instead of method. Re-use standard error handling.
5665         (ConstructorInitializer.Emit): Simplified.
5666         
5667         * delegate.cs: Updated after Invocation.EmitCall change.
5668         
5669         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5670         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5671         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5672         method and don't permanently changing input arguments.
5673         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5674         is resolved it has one of the candidates is the best one which is later
5675         used to emit. Removed a few unused method.
5676         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5677
5678         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5679         (Binary.ResolveOperator): Ditto.
5680         (ConditionalLogicalOperator.DoResolve): Ditto.
5681         (Invocation): Uses method group.
5682         (Invocation.DoResolve): Simplified.
5683         (Invocation.EmitCall): Removed useless is_static.
5684         (Invocation.Emit): Delegate to method group.
5685         (Invocation.EmitStatement): Simplified.
5686         (New): Uses method group.
5687         (MemberAccess.DoResolve): Don't destroy original expression.
5688         
5689         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5690         
5691 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5692
5693         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5694         
5695         * anonymous.cs,
5696         * lambda.cs: Add custom error message type.
5697
5698 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5699
5700         * lambda.cs: Simplified little bit.
5701         
5702         * parameter.cs: Introduced ImplicitLambdaParameter.
5703         (Parameters.CreateFullyResolved): New factory instead of ctor.
5704         
5705         * anonymous.cs,
5706         * class.cs,
5707         * delegate.cs: Updated parameter creation.
5708         
5709 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5710
5711         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5712         arguments.
5713         
5714         * generic.cs: Synchronized with gmcs.
5715         
5716 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5717
5718         * class.cs (Indexer): Check return type as soon as possible.
5719         
5720         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5721         members too.
5722         
5723         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5724         
5725         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5726         
5727         * parameter.cs (Parameter): Use expression type when it is available.
5728         
5729         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5730         method modifier for the first parameter only.
5731
5732 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5733
5734         A fix for bug #81938
5735         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5736         
5737         * constant.cs: Tide up an exception message.
5738
5739 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5740
5741         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5742         an uninitialized variable is used.
5743         
5744         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5745
5746 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5747
5748         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5749         not found error handling.
5750
5751         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5752         simplified.
5753         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5754         (ArrayCreation.DoResolve): Simplified.
5755         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5756         its own resolve process.
5757         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5758
5759 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5760
5761         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5762         more error details.
5763         
5764 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5765
5766         * cs-tokenizer.cs: Removed var related stuff.
5767         
5768         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5769         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5770         a type and a keyword at same time.
5771         
5772         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5773         matches to "var".
5774         
5775         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5776         implicitly typed arrays, more changes will follow.
5777         
5778         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5779         
5780 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5781
5782         * ecore.cs (VarExpr): Removed Handled field.
5783         
5784         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5785         build-in assign functionality.
5786         (ForEach.Resolve): Removed all implicitly typed local variable code and
5787         simplified.
5788         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5789         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5790
5791 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5792
5793         * assign.cs: Removed implicitly typed local variable check.
5794         
5795         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5796         referencing implicitly typed local variable.
5797         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5798         variable here.
5799         
5800         * statement.cs (Fixed): Removed unsupported implicitly typed local
5801         variable code.
5802
5803 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5804
5805         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5806
5807 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5808
5809         A fix for bugs #81855 and #76274
5810         * attribute.cs (AttachTo): Always set owner for global attributes to
5811         prefined owner.
5812         
5813         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5814         usefull too.
5815         
5816         * cs-parser.jay: Assembly and module attributes must precede all other
5817         elements except using clauses and extern alias declarations.
5818
5819 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5820
5821         A fix for bug #81748
5822         * cs-tokenizer.cs,
5823         * expression.cs: More checks for non ISO-1 features.
5824
5825 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5826
5827         A fix for bug #81807
5828         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5829         present inside switch statement and it is required by nullable check.
5830
5831 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5832
5833         A fix for bug #81840
5834         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5835         when type matching fails.
5836         
5837         * namespace.cs: Tiny error message change.
5838
5839 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5840
5841         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5842         reporting. Added automatic property check.
5843         
5844         * class.cs: Updated after CheckAbstractAndExtern relocation.
5845         (AEventPropertyAccessor.GetSignatureForError): Customized.
5846         
5847 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5848
5849         * class.cs (DefineBaseTypes): Base type can be undefined.
5850         
5851         * ecore.cs (TypeLookup): Minor refactoring.
5852         (DoResolveAsTypeStep): Removed redundant check.
5853
5854         * namespace.cs (Lookup): Removed redundant check.
5855                 
5856         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5857         ResolveAsTypeTerminal step.
5858         (BootstrapCorlib_*): Simplified.
5859         (PopulateCoreType): Core types can be now external.
5860
5861 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5862
5863         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5864          verification only.
5865          (InferTypeArguments): Infers anonymous expression type arguments.
5866          (Compatible): Split to Compatible and InferTypeArguments. 
5867         
5868         * lambda.cs: Updated.
5869
5870 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5871
5872         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5873
5874 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5875
5876         Fix #80477, cs0135-2.cs, cs0135-3.cs
5877         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5878         names to the "known" variables list.
5879         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5880         parameter names are also "known".
5881         (Block.CheckError136): Remove.
5882         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5883         null.
5884
5885 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5886
5887         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5888
5889 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5890
5891         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5892         internal error not an user error.
5893          
5894         * expression.cs (IsApplicable): Refactored to make debugging easier.
5895
5896         * support.cs: More tricks for non-mono runtimes.
5897         
5898         * typemanager.cs (CoreLookupType): Made public.
5899         (InitSystemCore): All linq specific stuff moved to linq.cs
5900
5901 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5902
5903         * typemanager.cs (CSharpSignature): One more missing build-in types
5904         replacement.
5905         More tricks for non-mono runtime.
5906
5907 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5908
5909         * statement.cs (Block.CheckError136_InParents): Remove.
5910         (Block.AddVariable): Use GetParameterInfo instead.
5911         (ToplevelBlock.ProcessArguments): Likewise.
5912
5913 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5914
5915         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5916         information too.
5917         (ToplevelBlock.GetParameterInfo): Split out of ...
5918         (ToplevelBlock.GetParameterRefernce): ... this.
5919         (ToplevelBlock.ParameterMap): Remove.
5920         * expression.cs (ParameterReference): Update to use
5921         ToplevelParameterInfo.
5922
5923         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5924         regression.
5925
5926         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5927         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5928
5929         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5930         (ToplevelBlock.ProcessParameters) ... here.
5931         (ToplevelBlock..ctor): Invoke it.
5932
5933         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5934         new parameters.
5935
5936         * statement.cs (IKnownVariable): New interface.
5937         (LocalInfo): Implement it.
5938         (ToplevelParameterInfo): New class.
5939         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5940         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5941         GetKnownVariableInfo.
5942
5943 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5944
5945         Partly speed up CS0136 error checks.
5946         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5947         'recurse' parameter.
5948         (Block.DoCheckError136): Only check errors in parameters.  Move
5949         local variable checks ...
5950         (Block.AddVariable): ... here, and ...
5951         (ToplevelBlock.ResolveMeta): ... here.
5952
5953 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5954
5955         * statement.cs (Block.IsChildOf): Remove.
5956
5957         * statement.cs (Statement.Clone): Move special case code ...
5958         (Block.CloneTo): ... here.
5959
5960 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5961
5962         * statement.cs (ToplevelBlock.container): Remove field.  It's
5963         redundant with 'Parent'.
5964         (ToplevelBlock.ContainerBlock): Remove accessor.
5965         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5966         child with parent here, ...
5967         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5968         current_block.
5969         (start_anonymous): Don't save current_block.
5970         (top_current_block): Remove.
5971
5972         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5973         (Block.Resolve): Update to changes.
5974         (Block..ctor): Move setting of "correct" 'Toplevel'
5975         and 'Explicit' fields to ...
5976         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5977
5978 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5979
5980         Kill Block.Implicit
5981         * statement.cs (Block.Implicit): Remove.
5982         (Block): Update to changes.
5983         * flowanalysis.cs: Likewise.
5984
5985         Mildly speed up CheckInvariantMeaningInBlock
5986         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5987         Recursively call AddKnownVariable to all enclosing blocks.
5988         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5989         Remove recursive calls.
5990         (Block): Update to changes.
5991
5992         New ExplicitBlock invariants
5993         * statement.cs (Block.Explicit): New field.  It points to the
5994         immediately enclosing non-implicit block.
5995         (Block..ctor): Maintain the invariant.
5996         * cs-parser.jay: Take advantage of invariant.
5997
5998         Introduce ExplicitBlock
5999         * statement.cs (ExplicitBlock): New.
6000         (ToplevelBlock): Derive from it.
6001         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6002         sense of flag.
6003         (Block.Implicit): Update to changes.
6004         * cs-parser.jay: Update to changes.
6005
6006         Remove unused field
6007         * codegen.cs (EmitContext.IsLastStatement): Remove.
6008         * statement.cs (Block.DoEmit): Update to changes.
6009
6010 2007-05-25  Raja R Harinath  <rharinath@novell.com>
6011
6012         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6013         modifying current_block directly.
6014
6015 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
6016         
6017         * class.cs: Implemented automatic properties (C# 3.0)
6018           Thanks to Marek for the help.
6019
6020 2007-05-23  Raja R Harinath  <rharinath@novell.com>
6021
6022         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6023         variable as assigned, note also that all its components are
6024         assigned too.
6025         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
6026
6027 2007-05-19  Marek Safar  <marek.safar@gmail.com>
6028
6029         * anonymous.cs, class.cs: Emit Compiler generated attribute when
6030         member is marked as compiler generated.
6031         
6032         * decl.cs (MemberCore): Refactored ModFlags into property.
6033
6034         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
6035         (Check): Check only accessibility modifiers.
6036
6037 2007-05-18  Raja R Harinath  <rharinath@novell.com>
6038
6039         Track all assignable slots in one bit array
6040         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
6041         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
6042         logic from VariableMap constructor here.  Use the same 'offset'
6043         variable that's later used for computing offsets of local
6044         variables.
6045         * flowanalysis.cs (UsageVector.parameters): Remove.
6046         (UsageVector): Update to changes.
6047         (VariableMap): Remove.
6048
6049         Avoid creating ParameterMap in every block
6050         * statement.cs (Block.ParameterMap): Move ...
6051         (ToplevelBlock.ParameterMap): ... here.
6052         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
6053         only once.
6054         * flowanalysis.cs (FlowBranching.param_map): Remove.
6055         (FlowBranching.UsageVector): Update to changes.
6056         (FlowBranchingToplevel.CheckOutParameters): Likewise.
6057
6058         * statement.cs (Block.CloneTo): Clone Toplevel field too.
6059
6060         * expression.cs (ParameterReference): Distinguish between block
6061         where parameter was referenced and declared.
6062
6063 2007-05-18  Marek Safar  <marek.safar@gmail.com>
6064
6065         * flowanalysis.cs, statement.cs: Put back improved error handling.
6066
6067 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
6068         
6069         * assign.cs:
6070         * expression.cs:
6071           Imporved object and collection initialization (C# 3.0).
6072
6073 2007-05-15  Marek Safar  <marek.safar@gmail.com>
6074
6075         A fix for bug #81380
6076         * expression.cs (Is.DoResolve): Only value types have constant `is'
6077         behaviour.
6078
6079 2007-05-15  Raja R Harinath  <rharinath@novell.com>
6080
6081         * statement.cs (ToplevelBlock.child): Remove.
6082
6083 2007-05-15  Raja R Harinath  <harinath@gmail.com>
6084
6085         Rationalize ResolveMeta: refactoring
6086         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
6087         out constant handling code into ...
6088         (Block.DoResolveConstants): ... this.
6089
6090         Rationalize ResolveMeta: kill local_map
6091         * statement.cs (Block.local_map, Block.LocalMap): Remove.
6092         (Block.AssignableSlots): New.
6093         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
6094         for locals -- move code from VariableMap here.  Avoid unnecessary
6095         allocations.
6096         * flowanalysis.cs (FlowBranching.local_map): Remove.
6097         (FlowBranching..ctor): Use Block.AssignableSlots.
6098         (VariableMap): Remove unused constructors.
6099
6100 2007-05-11  Raja R Harinath  <rharinath@novell.com>
6101
6102         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
6103
6104 2007-05-11  Marek Safar  <marek.safar@gmail.com>
6105
6106         * typemanager.cs (IsFriendAssembly): Should not be called for building
6107         assembly.
6108
6109 2007-05-09  Marek Safar  <marek.safar@gmail.com>
6110
6111         * literal.cs (NullConstant): Print null in all cases.
6112         
6113         * expression.cs (Binary.ResolveOperator): Implemented delegate
6114          comparison based on C# 2.0 changes.
6115
6116 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
6117
6118         This code is contributed under the MIT X11 license
6119         
6120         The following enables support for several C# 3.0 language features:
6121         
6122         * cs-tokenizer.cs: Added support for the "var" keyword.
6123         
6124         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
6125           Added VarExpr class to facilitate type inferencing.
6126         
6127         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
6128           to support anonymous types.
6129         
6130         * assign.cs: Added support for type inferencing and initialization.
6131         
6132         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
6133         
6134         * expression.cs: Added implicit array support to ArrayCreation.
6135           Added 5 types and 1 interface:
6136           
6137           IInitializable                Implementing classes can inject initializing
6138                                         statements after object instantiation.
6139           
6140           Initializer                   Stores data for object initialization.
6141           
6142           AnonymousType                 An expression for anonymous types.
6143           
6144           AnonymousTypeParameter        Stores data about an anonymous type's field.
6145           
6146           NewInitialize                 An expression for object initialization.
6147           
6148           CollectionInitialize          An expression for collection initialization.
6149         
6150         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
6151           statements.
6152
6153 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6154
6155         A fix for bug #81500
6156         * cs-tokenizer.cs: Add special handling for coalescing operator.
6157
6158 2007-05-06  Marek Safar  <marek.safar@gmail.com>
6159
6160         A fix for bug #81529
6161         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
6162         its value from base class until it is redefined.
6163
6164 2007-05-02  Raja R Harinath  <rharinath@novell.com>
6165
6166         Fix regression in cs0631-3.cs
6167         * cs-parser.jay (operator_declarator): Add opt_attributes to error
6168         fallback.  Make error fallback catch more cases.
6169
6170 2007-05-01  Miguel de Icaza  <miguel@novell.com>
6171
6172         * cs-parser.jay: Allow parameters in operator declarations to have
6173         attributes. 
6174
6175 2007-04-27  Miguel de Icaza  <miguel@novell.com>
6176
6177         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
6178         exists. 
6179
6180         * lambda.cs (ContextualReturn.Resolve): An expression is valid
6181         inside the ContextualReturn, it does not have to be an
6182         ExpressionStatement. 
6183
6184 2007-04-24  Miguel de Icaza  <miguel@novell.com>
6185
6186         * lambda.cs (ContextualReturn.Resolve): if the return type is not
6187         set, set it.
6188
6189 2007-04-23  Miguel de Icaza  <miguel@novell.com>
6190
6191         * anonymous.cs (AnonymousContainer): split the virtual Resolve
6192         method in two methods: ResolveNoDefine and Resolve.
6193
6194         ResolveNoDefine will stop just after ResolveTopBlock has been
6195         called.   
6196
6197         Resolve will then continue by creating a method and issuing the
6198         call to method.Define ().
6199
6200         (AnonymousMethod): Split and implement the new Resolve and
6201         ResolveNoDefine as well.
6202
6203         * lambda.cs (LambdaExpression): Split the anonymous method
6204         resolution code into a separate routine (CoreCompatibilityTest)
6205         from DoCompatibleTest.
6206
6207         (LambdaExpression.TryBuild): New method, this method tries to
6208         build the LambdaExpression with the given set of types to be used
6209         as the types for the various parameters of the lambda expression. 
6210
6211         If the compilation succeed with the given types, the infered type
6212         of the Anonymous method is returned, otherwise null is returned.
6213
6214 2007-04-23  Marek Safar  <marek.safar@gmail.com>
6215
6216         A fix for bug #81414
6217         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
6218
6219 2007-04-22  Miguel de Icaza  <miguel@novell.com>
6220
6221         * cs-tokenizer.cs: Change various identifiers here from the
6222         camelCasing to the recommended Linux-like style for instance
6223         variables from the Coding Guidelines. 
6224
6225 2007-04-19  Martin Baulig  <martin@ximian.com>
6226
6227         * convert.cs
6228         (Convert.ImplicitReferenceConversionCore): Allow conversions from
6229         System.Enum to System.ValueType.
6230
6231 2007-04-13  Martin Baulig  <martin@ximian.com>
6232
6233         Rewrote implicit reference conversions.  We need to distinguish
6234         between implicit reference conversions (13.1.4) and implicit
6235         boxing conversions (13.1.5).
6236
6237         According to the spec, there's an an implicit conversion
6238         "From a one-dimensional array-type S[] to IList<T> and base
6239         interfaces of this interface, provided there is an implicit
6240         reference conversion from S to T."  Note that this does not
6241         include boxing conversions.
6242
6243         * convert.cs
6244         (Convert.ImplicitTypeParameterBoxingConversion): New method.
6245         (Convert.ImplicitReferenceConversion): Split into
6246         ImplicitReferenceConversionCore() and
6247         ImplicitBoxingConversionExist().
6248         (Convert.ImplicitReferenceConversionExists): Use the new
6249         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
6250
6251 2007-04-12  Martin Baulig  <martin@ximian.com>
6252
6253         * convert.cs (Convert.ImplicitReferenceConversion): Move the
6254         `TypeManager.null_type' checks up to the top of the method.
6255
6256 2007-04-11  Marek Safar  <marek.safar@gmail.com>
6257
6258         A fix for bug #81350
6259         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
6260         extension methods.
6261
6262 2007-04-11  Martin Baulig  <martin@ximian.com>
6263
6264         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
6265         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
6266         to make this work for generic classes; fixes #79561.
6267
6268 2007-04-11  Martin Baulig  <martin@ximian.com>
6269
6270         * expression.cs (As): Add support for nullable types; fixes #79371.
6271
6272 2007-04-11  Martin Baulig  <martin@ximian.com>
6273
6274         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
6275         `type.FullName' is null; fixes #80243.
6276
6277 2007-04-11  Martin Baulig  <martin@ximian.com>
6278
6279         * expression.cs (Invocation.IsApplicable): Don't modify the method
6280         if type inference succeeded, but the method was not applicable.
6281         Fixes #81250.
6282
6283 2007-04-10  Marek Safar  <marek.safar@gmail.com>
6284
6285         A fix for bug #81324
6286         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
6287         internal and external namespaces containers.
6288
6289 2007-04-10  Martin Baulig  <martin@ximian.com>
6290
6291         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
6292         TypeManager.DropGenericMethodArguments() so we also call
6293         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
6294
6295 2007-04-10  Martin Baulig  <martin@ximian.com>
6296
6297         * iterators.cs (Iterator.CreateIterator): Don't crash if
6298         `method.ReturnType' is null.  This happens if something went wrong
6299         while resolving that typ (we already reported an error in this case).
6300
6301 2007-04-10  Martin Baulig  <martin@ximian.com>
6302
6303         * expression.cs (New.DoResolve): Don't call CheckComImport() on
6304         generic interfaces; report the CS0144 directly.
6305
6306 2007-04-10  Martin Baulig  <martin@ximian.com>
6307
6308         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6309         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6310
6311 2007-04-10  Martin Baulig  <martin@ximian.com>
6312
6313         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6314
6315 2007-04-09  Raja R Harinath  <rharinath@novell.com>
6316
6317         A better fix
6318         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6319         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6320
6321         Fix #81338
6322         * statement.cs (For.Resolve): If resolution fails, use
6323         KillFlowBranching.
6324
6325 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6326
6327         * anonymous.cs (MakeName): Make faster and zero-based.
6328         (VerifyExplicitParameterCompatibility): Back to mode where generic
6329         parameter is ignored.
6330         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6331
6332         * class.cs (EmitType): Method can emit another new method.
6333
6334         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6335
6336         * driver.cs: Updated.
6337
6338         * lambda.cs: Reuse predefined empty parameters.
6339
6340         * parameter.cs: Updated
6341
6342         * support.cs: Implemented InflateTypes.
6343
6344         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6345         (InitSystemCore): Introduced to isolate 3.0 dependencies.
6346
6347 2007-04-03  Martin Baulig  <martin@ximian.com>
6348
6349         Fix #80632.
6350
6351         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6352         version of TypeManager.IsOverride() which also works with generic
6353         types.  
6354
6355 2007-04-03  Martin Baulig  <martin@ximian.com>
6356
6357         Fix #81044.
6358
6359         * convert.cs
6360         (Convert.ExplicitReferenceConversion): We need to cast when
6361         converting from IList<T> to S[].
6362
6363 2007-04-01  Marek Safar  <marek.safar@gmail.com>
6364
6365         * decl.cs (FindExtensionMethods): Consider all candidates with same name
6366         at this level.
6367         
6368         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6369
6370 2007-03-31  Marek Safar  <marek.safar@gmail.com>
6371
6372         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6373         argument and return type inferring.
6374
6375         * codegen.cs (InferReturnType): Flag whether return can be inferred.
6376         (ReturnType): Turned to property.
6377
6378         * statement.cs (Return): Implemented return type inferring.
6379
6380         * support.cs (ReflectionParameters): Use local types if possible.
6381
6382 2007-03-30  Raja R Harinath  <rharinath@novell.com>
6383
6384         * flowanalysis.cs (FlowBranching.Reachability): Remove.
6385         (FlowBranching.UsageVector): Update to changes.
6386
6387         Prepare to kill 'Reachability'
6388         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6389         argument of constructor.
6390
6391 2007-03-29  Raja R Harinath  <rharinath@novell.com>
6392
6393         Prepare to kill 'Reachability'
6394         * flowanalysis.cs (UsageVector.is_unreachable): New.
6395         (UsageVector): Update to maintain 'is_unreachable' in parallel to
6396         'reachability', and verify they're consistent.
6397
6398         Fix #81121
6399         * expression.cs (New.EmitStatement): Handle type parameters here too.
6400
6401 2007-03-29  Martin Baulig  <martin@ximian.com>
6402
6403         Fix #79148.
6404
6405         * anonymous.cs
6406         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6407         CompilerGeneratedClass.
6408         (ScopeInfo.EmitScopeInstance): Make this protected.
6409         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6410         `ec.CurrentAnonymousMethod.Scope == Scope'.
6411
6412         * statement.cs (Block.ScopeInfo): Make this a property.
6413
6414 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6415
6416         Prepare to kill 'Reachability'
6417         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6418         (FlowBranching.UsageVector.Reachability): Remove property.
6419         (FlowBranching.UsageVector.IsUnreachable): New property.
6420         (FlowBranching.UsageVector.ResetBarrier): New.
6421         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6422         * codegen.cs, statement.cs: Update to changes.
6423
6424 2007-03-27  Martin Baulig  <martin@ximian.com>
6425
6426         Fix #81209.
6427
6428         * decl.cs
6429         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6430         generic types.
6431
6432 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6433
6434         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6435         instead of TriState.  Remove all mention of TriState.
6436
6437         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6438         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6439         and maintain invariants.
6440
6441 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6442
6443         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6444
6445 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6446
6447         * expression.cs: Stop using obsolete 2.0 opcodes.
6448
6449 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6450
6451         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6452         one of the latests Martin's fixes.
6453
6454 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6455
6456         * expression.cs: On BigEndian systems, swap the bytes, temporary
6457         solution until we get a new bitconverter class.
6458
6459 2007-03-23  Martin Baulig  <martin@ximian.com>
6460
6461         Fix #81158.
6462
6463         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6464         "Method" and "Method`1".  Normally, a cache lookup is done on the
6465         "Method" form (ie. without the generic arity), but this one makes
6466         lookups on the full form work as well.
6467
6468 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6469
6470         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6471         unused properties.
6472
6473 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6474         * class.cs: 
6475         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6476         ordered_member_list, to TypeBuilder to store members to be defined
6477         in the order they were parsed in.
6478         - ordered_explicit_member_list contains all properties indexers
6479           and methods that are defined as explicit implementation of an
6480           interface or base class.
6481         - ordered_member_list contains all properties indexers and methods
6482           that are not defined as explicit implementation of an interface
6483           or base class.
6484
6485         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6486         functionality in these removed classes has been replaced with 
6487         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6488         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6489
6490         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6491         to CheckForDuplications inside GetMethod and SetMethod Define Method
6492         to handle method property and indexer name conflicts.
6493
6494         Fixes #79434
6495
6496         All code is contributed under the MIT/X11 license.
6497
6498 2007-03-20  Martin Baulig  <martin@ximian.com>
6499
6500         * class.cs (TypeContainer.Interfaces): Removed; they're now
6501         included in `TypeContainer.Types'.
6502
6503 2007-03-20  Martin Baulig  <martin@ximian.com>
6504
6505         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6506
6507         * class.cs (TypeContainer.CreateType): New public method.  This is
6508         now called before DefineType() to create the TypeBuilders.
6509         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6510         has already been created by CreateType().
6511         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6512         don't resolve our base classes here; this has been moved into
6513         DefineBaseTypes().  We're now called from CreateType().
6514         (TypeContainer.DefineBaseTypes): New private method; resolve our
6515         base classes here.  We're now called from DefineType().
6516
6517         * rootcontext.cs
6518         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6519         our types first to create all the TypeBuilders.  After that, call
6520         TypeContainer.DefineType() on all the types which'll resolve their
6521         base classes and setup the resolve order.
6522
6523 2007-03-20  Martin Baulig  <martin@ximian.com>
6524
6525         * class.cs (TypeContainer.Enums): Removed; they're now included in
6526         `TypeContainer.Types'.  
6527
6528 2007-03-20  Martin Baulig  <martin@ximian.com>
6529
6530         * class.cs
6531         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6532         (TypeContainer.DoResolveMembers): Call DefineType() on our
6533         `compiler_generated' classes; moved here from DefineNestedTypes().
6534
6535         * rootcontext.cs
6536         (RootContext.ResolveTree): Call ResolveMembers() on all
6537         TypeContainer's in the `type_container_resolve_order'.
6538
6539 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6540
6541         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6542
6543 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6544
6545         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6546         implementation flags.
6547
6548 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6549
6550         * class.cs: More optimizations for type parameters.
6551
6552 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6553
6554         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6555
6556         * ecore.cs, parameter.cs: More common code for both corlibs.
6557
6558         * typemanager.cs (IsGenericMethod): Simplified.
6559
6560 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6561
6562         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6563         'returns'.
6564         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6565
6566         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6567         unconditionally.  Simplify explanation.
6568         (Try.Resolve, Using.Resolve): Likewise.
6569
6570 2007-03-15  Martin Baulig  <martin@ximian.com>
6571
6572         Fix #80731.
6573
6574         * decl.cs (DeclSpace): If we're a partial class, use our
6575         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6576
6577 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6578
6579         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6580         'throws'.
6581         (FlowBranching.UsageVector): Update to changes.
6582         (FlowBranching.MergeSiblings): Likewise.
6583         * statement.cs: Likewise.
6584
6585 2007-03-15  Martin Baulig  <martin@ximian.com>
6586
6587         Fix #79302.
6588
6589         * decl.cs
6590         (MemberCache): Added a special .ctor for type parameters.
6591
6592         * typemanager.cs
6593         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6594         `MemberCache'.  
6595
6596 2007-03-09  Martin Baulig  <martin@ximian.com>
6597
6598         * enum.cs (Enum): Make this a TypeContainer.
6599         (EnumMember): Derive from `Const'.
6600
6601         * const.cs
6602         (Const.DoResolveValue): New protected virtual method; move most of
6603         the functionality of ResolveValue() here so we can override it in
6604         `EnumMember'.
6605         (Const.CreateConstantReference): Make this virtual.
6606
6607         * class.cs (Kind): Add `Kind.Enum'.
6608         (TypeContainer.Emit): Don't emit the enums here; they're already
6609         in the `RootContext.typecontainer_resolve_order'.
6610
6611         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6612         here; they're already in the `typecontainer_resolve_order'.
6613
6614         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6615         TypeManager.DropGenericTypeArguments().
6616
6617         * typemanager.cs
6618         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6619         (TypeManager.IsEnumType): Likewise.
6620         (TypeManager.EnumToUnderlying): Likewise.
6621         (TypeManager.IsEqual): Add support for enums.
6622
6623 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6624
6625         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6626         DefaultParameterValueAttribute to be undefined, say if System.dll
6627         is not referenced.
6628
6629 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6630
6631         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6632         any mscorlib.
6633
6634 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6635
6636         * class.cs, parameter.cs: Unified parameters verification.
6637
6638 2007-03-08  Martin Baulig  <martin@ximian.com>
6639
6640         * cs-parser.jay (constructor_header): Pass the location to the
6641         newly created TopLevelBlock.
6642
6643 2007-03-07  Martin Baulig  <martin@ximian.com>
6644
6645         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6646
6647 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6648
6649         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6650         with the changes from David, fixes the build.
6651
6652 2007-03-05  David Mitchell  <dmitchell@logos.com>
6653
6654         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6655         and its base interfaces to a one-dimensional array type S[],
6656         provided there is an implicit or explicit reference conversion
6657         from S to T.
6658
6659 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6660
6661         * cs-tokenizer.cs: Implemented basic linq grammar.
6662
6663         * driver.cs: Set linq lang version on demand.
6664
6665 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6666
6667         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6668
6669 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6670
6671         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6672         (Fixes #80455)
6673
6674         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6675         here.
6676         Check property and event extern attributes.
6677
6678         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6679         charset.
6680
6681 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6682
6683         A fix for bug #80407
6684         * ecore.cs: Don't report ambiguity error when methods have same parent.
6685
6686 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6687
6688         A fix for bug #80878
6689         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6690
6691 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6692
6693         * attribute.cs: Enable ExtensionAttribute presence test.
6694
6695 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6696
6697         * class.cs: Warn about missing GetHashCode only when Equals is override.
6698
6699         * decl.cs: Check accessibility of type arguments.
6700
6701         * typemanager.cs: Correctly report nullable array.
6702
6703 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6704
6705         * class.cs, report.cs: Capture more details when things go wrong.
6706
6707 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6708
6709         A fix for bug #80650
6710         * cs-parser.jay: Anonymous container starts at constructor declaration
6711         and not at block beginning because it has to be usable in constructor
6712         initializer.
6713
6714         * statement.cs: Use context location and not block one for error reporting.
6715
6716 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6717
6718         A fix for bug #78712
6719         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6720         too.
6721
6722 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6723
6724         A fix for bug #80493 by Atsushi Enomoto
6725         * cs-parser.jay: Ignore invalid attribute target.
6726
6727 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6728  
6729         * cs-tokenizer.cs: Ignore '\0' as white space character.
6730
6731 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6732
6733         * cs-parser.jay: Add support for lambda expressions to the mcs
6734         compiler as well.
6735
6736         * lambda.cs: Only clone when we are probing, not on the final call
6737         (Compatible is the final call). 
6738
6739         * statement.cs (CloneContext): Introduce class to provide block
6740         remapping during clone.
6741
6742         All statements Clone themselves now.
6743
6744         (Clone): special handling for blocks, when we clone a block, we
6745         register the block inside this routine, as children of the block
6746         might trigger a lookup. 
6747         
6748         * expression.cs: Add support for CloneContext in all expressions. 
6749         
6750 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6751  
6752         A fix for bug #80493
6753         * statement.cs: Report ambiguous warning when interfaces are not related.
6754
6755 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6756
6757         C# 3.0 extension methods.
6758
6759         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6760         cannot be used directly.
6761
6762         * class.cs (Class.Emit): Emit extension attribute if any class method
6763         is extension method.
6764         (Method.Define): Add basic extension method validation conditions.
6765         (Method.Emit): Emit extension attribute for method.
6766
6767         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6768         extension method exists. Currently we follow same approach as Microsoft
6769         does, emit even if a method or a class are private but this can change
6770         later.
6771
6772         * cs-parser.jay: Add handling of `this' keyword in method parameters
6773         context.
6774
6775         * decl.cs (DeclSpace.IsStaticClass): New property.
6776         (MemberCache.FindExtensionMethods): Looks for extension methods with
6777         defined name and extension type.
6778
6779         * doc.cs: Updated after OverloadResolve changes.
6780
6781         * driver.cs: Add new soft reference to System.Core.dll.
6782
6783         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6784         (ExtensionMethodGroupExpr): Represents group of extension methods.
6785
6786         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6787         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6788         to MethodGroupExpr and made non-static for easier customization.
6789         (Invocation.DoResolve): Add extension method lookup when no standard
6790         method was found.
6791         (MemberAccess.DoResolve): Try extension methods if no member exists.
6792
6793         * modifiers.cs: Add METHOD_EXTENSION modifier.
6794
6795         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6796         as well as candidate extension type.
6797         (ComputeNamespaces): When assembly constains extension methods registers
6798         them.
6799         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6800         extension method lookup.
6801         (Namespace.LookupExtensionMethod): Looks for extension method in this
6802         namespace.
6803         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6804         find a method which matches name and extensionType.
6805
6806         * parameter.cs (Parameter): Add This modifer.
6807         (HasExtensionMethodModifier): New property.
6808         (Resolve): Add extension parameter check.
6809         (ModFlags): turned to property to exclude this modifier as it is not real
6810         parameter modifier.
6811         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6812
6813         * support.cs (ParameterData): Add ExtensionMethodType.
6814         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6815
6816         * typemanager.cs: Add type and ctor extension attribute type.
6817
6818 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6819
6820         * report.cs (DisableErrors, EnableErrors): used to prevent error
6821         output when we are "trying" to compile various methods with
6822         different types. 
6823
6824         * ecore.cs (Expression): Add Clone method that calls the virtual
6825         CloneTo method.  The current CloneTo method in Expression throws
6826         an exception so we can track down all the places where this must
6827         be implemented (not using abstract, because that would be a lot of
6828         up-front-work before we can start testing the implementation
6829         idea). 
6830
6831         Important: we only need Clone capabilities for expressions created
6832         by the parser, as the expressions we will be cloning are
6833         expressions in the pre-resolved state.   This vastly simplifies
6834         the work required. 
6835         
6836         (SimpleName): Add CloneTo that does nothing.
6837         (EmptyCast): Add CloneTo.
6838         
6839         * expression.cs (Binary): Implement CloneTo.
6840         (Invocation.IsApplicable): Store the current ec in
6841         EmitContext.TempEc and restore it on return.  This is used so we
6842         do not have to sprinkle hundres of methods with an extra
6843         EmitContext, we know that the only user is the lambda expression
6844         ImplicitConversionExists code. 
6845         
6846         (Argument): Add Cloning capabilities.
6847         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6848         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6849         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6850         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6851         IndexerAccess): Add Clone capability.
6852
6853         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6854
6855         (Argument): Add cloning capability.
6856
6857         * assign.cs (Assign): Implement CloneTo.
6858
6859         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6860         
6861         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6862         version by calling Convert with the EmitContext (that we are
6863         currently storing in ec, this is not great, but will do for now,
6864         to avoid passing EmitContext parameters to hundreds of functions
6865         that do not need them now).
6866
6867         (SetExpression): Remove, it is not needed.
6868         
6869         (ContextualReturn): Implement CloneTo.
6870
6871         * statement.cs (Statement): Implement cloning infrastructure,
6872         similar to expressions.
6873
6874         (Block): Partial implementation of Clone for statements.
6875
6876         (Return): Implement clone.
6877         
6878         * constant.cs (Constant.CloneTo): New method, does nothing.
6879
6880         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6881         solution, until we decide how to exactly do this.  
6882         
6883 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6884  
6885         A fix for bug #80493
6886         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6887         a property is override we need to use second accessor.
6888
6889 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6890  
6891         A fix for bug #80418
6892         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6893         methods.
6894
6895 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6896
6897         Another fix for bug #80749
6898         * pending.cs: Abstract class has priority over interfaces.
6899
6900 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6901
6902         Another fix for bug #80749
6903         * pending.cs: Abstract class has priority over interfaces.
6904
6905 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6906
6907         Another fix for bug #80749
6908         * pending.cs: Abstract class has priority over interfaces.
6909
6910 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6911
6912         Another fix for bug #80749
6913         * pending.cs: Abstract class has priority over interfaces.
6914
6915 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6916
6917         * class.cs Better error message.
6918
6919         * driver.cs: Add shorter versions of -optimize option.
6920
6921 2007-02-13  Martin Baulig  <martin@ximian.com>
6922
6923         * class.cs (Constructor.Emit): Check the return value of
6924         ec.ResolveTopBlock() and return on error.
6925
6926 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6927
6928         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6929         message to fix error message regression.
6930
6931 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6932
6933         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6934
6935 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6936
6937         A fix for bug #80749
6938         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6939         its parent container.
6940
6941         * class.cs (DefineFieldInitializers): Each initializer can has different
6942         resolve context.
6943
6944         * const.cs: Updated.
6945
6946 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6947
6948         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6949         now all the heavy lifting to check that embedded statements or
6950         expressions have the right form is done in the ContextualReturn.
6951
6952         (ContextualReturn): New class.  
6953
6954         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6955         method that can be invoked to report 201, so we do not replicate
6956         this everywhere.
6957
6958         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6959         
6960         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6961         treating tabs as spaces. 
6962
6963 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6964
6965         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6966         * assign.cs: Use full implicit conversion for right side check.
6967
6968 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6969
6970         * statement.cs (Switch): Switch over boolean type is not standardized.
6971
6972 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6973
6974         A fix for bug #80755
6975         * decl.cs (FindBaseEvent): Don't use method cache for events.
6976
6977 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6978
6979         * cs-parser.jay: Better syntax error handling.
6980
6981         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6982         instead of underlying type value.
6983
6984 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6985
6986         * driver.cs: Check define identifier before is registered.
6987
6988         * namespace.cs: Use existing error message.
6989
6990         * report.cs: New warning.
6991
6992 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6993
6994         A fix for bug #80742
6995         * expression.cs: Delegate Invoke method can be called directly.
6996
6997 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6998
6999         A fix for bug #80676
7000         * class.cs (IsEntryPoint): The Main method can have params modifier.
7001
7002 2007-02-04  Miguel de Icaza  <miguel@novell.com>
7003
7004         * parameter.cs (Parameter, Parameters): Add Clone method.
7005
7006         * anonymous.cs (Compatible): Turn method into virtual method, so
7007         LambdaExpression can implement a different behavior.
7008
7009         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7010         out the basic checking here, so it can be used by
7011         LambdaExpressions.
7012         
7013         * lambda.cs: Introduce "Compatible" function that will do the
7014         heavy lifting.
7015
7016 2007-02-02  Marek Safar  <marek.safar@gmail.com>
7017
7018         * attribute.cs: Unified one error message.
7019
7020         * class.cs (Class): Use type attributes and not properties to test static
7021         class.
7022         (IsEntryPoint): Don's pass local variable.
7023
7024         * convert.cs: Removed duplicate check.
7025
7026         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7027
7028         * driver.cs: Don't crash when soft reference does not exist.
7029
7030         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7031         (UsingEntry): Removed redundant allocation.
7032
7033         * parameter.cs: Add fast path for type parameters.
7034
7035         * support.cs: Don't allocate attribute when it's not used.
7036
7037 2007-01-30  Miguel de Icaza  <miguel@novell.com>
7038
7039         * anonymous.cs
7040         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
7041         this into a virtual method, so we can override it in LambdaExpression.
7042
7043         * driver.cs: Improve diagnostics in case of failure. 
7044
7045         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
7046         write a function that is slightly more complex and that parses:
7047
7048         type identifier [, type identifier]* )
7049
7050         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
7051         this expression:
7052
7053                 (canEmpty ? i >= 0 : i > 0)
7054
7055 2007-01-30  Raja R Harinath  <rharinath@novell.com>
7056
7057         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
7058         exception on possibly valid code.
7059
7060 2007-01-29  Raja R Harinath  <rharinath@novell.com>
7061
7062         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
7063         Push/PopPosition.
7064         (parse_opt_type_arguments): Remove.  It's almost the same as
7065         parse_less_than.
7066         (parse_namespace_or_typename): Use parse_less_than.
7067
7068 2007-01-28  Miguel de Icaza  <miguel@novell.com>
7069
7070         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
7071         this bug took a few hours to find, because the state saved and
7072         restored by PushPosition and PopPosition was ignoring the state of
7073         parse_generic_less_than.
7074
7075         I can also now remove the handling of OP_LT and OP_GT, this solves
7076         the big mistery.
7077         
7078         * cs-tokenizer.cs: store the location for the ARROW token, we use
7079         that in the parser.
7080
7081         (PushPosition, PopPosition): save/restore also `current_token',
7082         restore `parse_generic_less_than' (was missing).
7083
7084         (parse_opt_type_arguments): use parse_type, not
7085         parse_namespace_or_typename to parse types.
7086
7087         * lambda.cs: Empty new file, will eventually have the lambda
7088         expression implementation.
7089
7090         * lambda.test: used to test the internal tokenizer. 
7091
7092         * report.cs (FeatureIsNotISO1): Rename from
7093         FeatureIsNotStandardized, because it was about the language level
7094         (1 vs 2) it was not about standarization.
7095
7096         (FeatureRequiresLINQ): New.
7097
7098         * support.cs (SeekableStreamReader): Only require that the reader
7099         is a TextReader, not a StreamReader, so we can plug StringReader. 
7100
7101         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
7102         given position in the input stream the following tokens can be
7103         parsed as a type followed by an identifier.
7104
7105         (is_punct): after a '(' if parse_type_and_parameter returns true,
7106         then return a special token OPEN_PARENS_LAMBDA which is used to
7107         avoid reduce/reduce errors in the grammar for the
7108         lambda_expression rules.
7109
7110         (parse_type): implement a type parser inside the
7111         tokenizer, the parser only returns true or false depending on
7112         whether the input at a given position can be parsed as a type.
7113
7114         (peek_token): new method used during type parsing.
7115
7116 2007-01-28  Raja R Harinath  <rharinath@novell.com>
7117
7118         Fix #80531
7119         * anonymous.cs (ScopeInfo.InflateParameters): New.
7120         (AnonymousContainer.Resolve): Use it to redirect types of
7121         delegate parameters.
7122
7123 2007-01-27  Raja R Harinath  <rharinath@novell.com>
7124
7125         Fix #80530
7126         * expression.cs (Error_InvalidArguments): Don't use two different
7127         messages for CS1503.  Use ExtraInformation and
7128         SymbolRelatedToPreviousError instead.
7129
7130         Fix #80358
7131         * decl.cs (DeclSpace.initialize_type_params): Don't access
7132         'type_params' of a partial class directly.
7133
7134 2007-01-26  Miguel de Icaza  <miguel@novell.com>
7135
7136         * constant.cs: Removed a handful of out-of-range checks that were
7137         not necessary. 
7138
7139 2007-01-25  Marek Safar  <marek.safar@gmail.com>
7140
7141         * expression.cs (CheckUselessComparison): Add additional check for char
7142         constants.
7143
7144         * namespace.cs: Fixed typo.
7145
7146 2007-01-23  Miguel de Icaza  <miguel@novell.com>
7147
7148         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
7149         gone, instead we inline the test, preventing the needless casts to
7150         longs, ulongs and doubles for the parameters, avoiding calls to
7151         methods that overchecked stuff, and instead inlined things
7152         nicely. 
7153
7154 2007-01-20  Marek Safar  <marek.safar@gmail.com>
7155
7156         * cs-parser.jay: Better parameter error handling.
7157
7158 2007-01-17  Marek Safar  <marek.safar@gmail.com>
7159
7160         A fix for bug #80368, #80522
7161         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
7162         whether array initializer contains constants only.
7163         (ArrayCreation.Emit): Use better formula to decide when
7164         are array initializers for static initialization.
7165         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
7166         have to emit even constants otherwise they are pre-initialized.
7167
7168 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
7169             Raja R Harinath  <rharinath@novell.com>
7170
7171         Fix emit order of 'get' vs. 'set'.
7172         * support.cs (Accessors): New.
7173         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
7174         Note the order in which accessors are declared in the source.
7175         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
7176         Refactored from Property.Define and Indexer.Define.
7177         (PropertyBase.DefineAccessors): New helper that calls the above in
7178         appropriate order as noted by the parser.
7179         (Property.Define, Indexer.Define): Update to changes.
7180         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
7181
7182 2007-01-17  Raja R Harinath  <rharinath@novell.com>
7183
7184         Fix cs0029-6.cs and gcs0029-2.cs (regression)
7185         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
7186         there's an implicit conversion from the current type to the target
7187         type before converting the underlying constant.
7188
7189 2007-01-16  Marek Safar  <marek.safar@gmail.com>
7190
7191         * const.cs (ResolveValue): Updated after constant conversion was made more
7192         generic.
7193
7194         * constant.cs (GetAttributableValue): constant to object conversion is
7195         used for attributes only.
7196         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
7197         constant conversions.
7198         (LongConstant.ConvertImplicitly): Ditto.
7199
7200         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
7201         (ImplicitConversionStandard): Handle constant conversion as extra step.
7202         It solves the issue when constant conversion was called indirectly like
7203         inside array initializer and constant folding was skipped.
7204
7205         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
7206         this change.
7207
7208         * statement.cs(ImplicitConversionStandard): Updated after constant
7209         conversion was made more generic.
7210
7211 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
7212
7213         * expression.cs (As.DoResolve): Use GenericConstraints instead of
7214         Constraints, solves the problem where the compiler incorrectly
7215         reported that a type parameter was not constrained to a class (Bug
7216         80518)
7217
7218 2007-01-14  Marek Habersack  <grendello@gmail.com>
7219
7220         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
7221
7222 2007-01-14  Marek Safar  <marek.safar@gmail.com>
7223
7224         A fix for bug #80368
7225         * assign.cs (FieldInitializer): New class implements field
7226         initializer statement.
7227
7228         * attribute.cs: Update after FieldMember rename.
7229
7230         * class.cs (PropertyBasedMember): New common class for property based
7231         types.
7232         (InterfaceMemberBase): New base class for all members which can be used as
7233         an interface members.
7234         (MethodCore): Moved really common code to InterfaceMemberBase.
7235         (Method.Define): Equal and GetHasCode detection is relevant for methods
7236         only.
7237         (MethodData.Define): Don't assume that public event implements an
7238         interface automatically.
7239         (MethodData.DefineMethodBuilder): Issue an error even if only extern
7240         modifier is used.
7241         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
7242         (FieldMember): Merged with FieldBase.
7243         (EventProperty.AEventPropertyAccessor): New specialization to check whether
7244         event extern modifier can be used.
7245         (EventField.EventFieldAccessor): Moved event field specific code here.
7246         (Event.AllowedModifiers): Even event can be extern.
7247         (Event.FindOutBaseMethod): New override specific to events.
7248         (Indexer.parameters): Reintroduce parameters because base class holds
7249         only properties common data.
7250         (Indexer.CheckForDuplications): Indexers are threated as methods so we
7251         need do extra parameters check.
7252
7253         * const.cs: Update after FieldMember rename.
7254
7255         * decl.cs (MemberCache.FindBaseEvent): New method.
7256
7257         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
7258         to reflect that indexer is now derived from PropertyBased.
7259
7260         * ecore.cs (GetMemberType): Made public.
7261         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
7262         obsolete event.
7263
7264         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
7265         
7266         * typemanager.cs (CSharpSignature): Correctly print event accessors.
7267         (RegisterEvent): Removed.
7268         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
7269         (GetPrivateFieldOfEvent): Renamed to GetEventField.
7270
7271 2007-01-11  Raja R Harinath  <rharinath@novell.com>
7272
7273         Fix #80249
7274         * statement.cs (CollectionForeach.TryType): Prefer generic
7275         GetEnumerator over non-generic variant.  Fix code to follow comments.
7276
7277 2007-01-09  Raja R Harinath  <rharinath@novell.com>
7278
7279         Fix #80446
7280         * support.cs (ReflectionParameter): Don't use an invalid index on
7281         the generic parameter data.
7282
7283 2007-01-08  Miguel de Icaza  <miguel@novell.com>
7284
7285         * driver.cs: Just add a tiny bit of infrastructure.
7286
7287 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7288
7289         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
7290         where field type is struct from current assembly.
7291         
7292         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
7293         it is possible.
7294
7295 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7296
7297         A fix for bug #80381
7298         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7299         the core types.
7300
7301         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7302         messages.
7303         (Namespace.LookupType): Always use core types from corlib when speficied.
7304
7305         * report.cs: A new warning.
7306
7307         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7308         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7309         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7310
7311         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7312         (InitCoreTypes): Set expression type of object_type and value_type
7313         immediately after lookup.
7314
7315 2007-01-01  Miguel de Icaza  <miguel@novell.com>
7316
7317         * cs-tokenizer.cs: Accept Pc class characters (Connector
7318         Punctuation) as valid identifiers.  Fixes #78259
7319
7320         * expression.cs (Invocation.DoResolve): Moved the check for the
7321         use of `this' for doing method calls to the Invocation resolution
7322         step, after overload resolution has taken place instead of doing
7323         the check at the low-level `This.DoResolve' level.
7324
7325         The `This.DoResolve'(appens before overload resolution, so it has
7326         no way of knowing if the method that will be called will be
7327         instace or static, triggering an erroneous report for cs0188 (Bug
7328         78113).
7329
7330         We now do the check for instance method invocations after we know
7331         what method will be called.
7332
7333         (This.CheckThisUsage): Move the actual use of this structure
7334         checking into its own method and expose it. 
7335
7336         * Everywhere that called Error_ValueCannotBeConverted: pass a new
7337         EmitContext.
7338
7339         Exceptions: Null.ConvertImplicitly,
7340         Constant.ImplicitConversionRequired as there are too many call
7341         sites for passing the ec. 
7342
7343         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7344         EmitContext, if the value is null, then we do not try to provide
7345         the extra information from the error (If a userdefined conversion
7346         exists, as UserDefinedConversion requires a non null-EmitContext).
7347
7348         Fixes: #80347
7349
7350 2006-12-30  Raja R Harinath  <rharinath@novell.com>
7351
7352         * flowanalysis.cs (MyBitVector): Document some invariants.
7353         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7354         introduced below, and add a couple of others, 
7355
7356 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7357
7358         * attribute.cs (GetMethodObsoleteAttribute): Uses new
7359         GetPropertyFromAccessor and GetEventFromAccessor.
7360         
7361         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7362         overrides non-obsolete one.
7363         (Indexer.Define): Error message has been moved to the parser.
7364
7365         * cs-parser.jay: Better syntax errors handling.
7366
7367         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7368         when an invocation has no arguments.
7369
7370         * ecore.cs: Removed not used caching.
7371
7372         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7373         implementation.
7374
7375         * report.cs: Add a new warning.
7376
7377         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7378
7379         * typemanager.cs (enumeration_type): Removed.
7380         (CSharpSignature): Reuses IsSpecialMethod.
7381         (IsEqual): Hack for MS BCL.
7382         (GetPropertyFromAccessor): New method.
7383         (GetEventFromAccessor): New method.
7384         (IsSpecialMethod): Fixed to handle more cases.
7385
7386 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7387
7388         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7389         Made white spaces array static.
7390
7391         * ecore.cs (RemoveGenericArity): Optimized.
7392
7393         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7394         10 times faster).
7395         (MyBitVector.initialize_vector): Simplified.
7396
7397 2006-12-22  Miguel de Icaza  <miguel@novell.com>
7398
7399         * ecore.cs: Am not entirely happy with this hack, but it seems to
7400         address the issue in 80257 (a small test case for
7401         CreativeDocs.NET). 
7402
7403         I set the MethodGroupExpr.Type to an internal compiler type
7404         (itself in this case) to force the resolution to take place.   Why
7405         it does not take place with a null is beyond me.
7406
7407 2006-12-20  Marek Safar  <marek.safar@gmail.com>
7408
7409         A fix for bug #80288
7410         * expression.cs (ResolveOperator): Consider user defined conversion for
7411         logical and operator too.
7412         (EmitBranchable): Optimization for logical and when full constant folding
7413         could not be applied but one operand is constant.
7414
7415 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7416
7417         * class.cs (GetClassBases): Write 5 times every day, will never use
7418         FullName for error reporting.
7419
7420         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7421
7422 2006-12-19  Martin Baulig  <martin@ximian.com>
7423
7424         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7425         the symbol file info here.
7426
7427 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7428
7429         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7430         of `elseif' is taking then following sections are not taking.
7431         Fixes an issue reported on mono mailing list.
7432
7433 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7434
7435         A fix for bug #80300
7436         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7437         a caller is not taking.
7438
7439 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7440
7441         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7442         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7443         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7444         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7445         * class.cs: Update to changes.
7446
7447 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7448
7449         A fix for bug #79934
7450         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7451         partial container.
7452
7453         * class.cs (ResolveMembers): Register an iterator in current container and
7454         not in shared one.
7455
7456 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7457
7458         Fix test-543.cs
7459         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7460         satisfy a params annotated parameter.
7461
7462 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7463
7464         A fix for bug #77014
7465         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7466         paramters correctly and not rely on hacks in Parameters class.
7467         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7468         at any possition.
7469         (Invocation.VerifyArgumentsCompat): Ditto.
7470         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7471         any possition.
7472
7473         * parameter.cs (HasParams): Don't assume that params is the last one.
7474
7475         * support.cs (ReflectionParameters.ctor): Look for params attribute
7476         correctly.
7477         (ReflectionParameters.ParameterType): Removed hack when we returned last
7478         parameter for out of range parameters.
7479         (ParameterName, ParameterModifier): Ditto.
7480
7481 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7482
7483         A fix for bug #79987
7484         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7485         when assembly is not CLS compliant but type is. I have no idea why is this
7486         allowed.
7487
7488         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7489
7490 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7491
7492         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7493         in struct constructors, they are basically no-ops.
7494
7495 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7496
7497         * cs-tokenizer.cs (Position): Save preprocessor status too.
7498
7499 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7500
7501         A fix for bug #77794
7502         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7503
7504 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7505
7506         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7507         Fixes #69299.
7508         (pp_expr): Report error for an invalid expression.
7509         (handle_preprocessing_directive): Simplified; add more error checking.
7510
7511 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7512
7513         A fix for bug #74939
7514         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7515         directives handling.
7516
7517 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7518
7519         A fix for bugs #80093, and #75984
7520         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7521         logic, it seems to me as it worked before "by coincidence".
7522         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7523         (cleanup): Enabled endif check.
7524
7525 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7526
7527         A fix for bug #80162
7528         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7529         enumerators are never ambiguous.
7530
7531 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7532
7533         Fix #80060
7534         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7535
7536 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7537
7538         A fix for bug #80144
7539         * class.cs (EventProperty.Define): Explicit implementation means
7540         that an even is used.
7541
7542 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7543
7544         Fixes the operators implementation (part II)
7545
7546         * cfold.cs (DoConstantNumericPromotions): Renamed to
7547         DoBinaryNumericPromotions and simplified.
7548         (BinaryFold): Couple of conversion fixes; simplified.
7549
7550         * constant.cs, ecore.cs, literal.cs
7551         (ToType): Renamed to ConvertImplicitly.
7552         (Reduce): Renamed to ConvertExplicitly.
7553
7554         * class.cs, convert.cs: Updated.
7555
7556         * expression.cs: TryReduce doesn't throw an exception.
7557
7558 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7559
7560         A fix for bug #80108
7561         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7562         compatible.
7563
7564 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7565
7566         Fixes unary operators implementation (part I)
7567         Also fixes #80026
7568
7569         * cfold.cs (Error_CompileTimeOverflow): Made internal
7570
7571         * const.cs (IConstant): Changed to use reference to constant and
7572         not constant itself.
7573         Updated IConstant implementations.
7574
7575         * constant.cs (CreateConstant): New factory method.
7576         Updated IConstant implementation.
7577
7578         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7579
7580         * ecore.cs: Updated to use CreateConstantReference.
7581
7582         * enum.cs: Reflects IConstant changes.
7583
7584         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7585
7586         * literal.cs (NullConstant): Change to be independently usable.
7587
7588 2006-11-29  Martin Baulig  <martin@ximian.com>
7589
7590         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7591         we need to emit the scope initializer before calling the base .ctor.
7592
7593         * anonymous.cs: Merged back from the new anonymous methods branch.
7594         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7595
7596         * expression.cs (ParameterReference.DoResolveBase): Create a
7597         "normal" ScopeInfo when capturing parameters rather than using the
7598         root scope; this makes things work with anonymous methods having
7599         parameters.
7600
7601         * statement.cs
7602         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7603
7604 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7605
7606         A fix for bug #79987
7607         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7608         check to a base class.
7609         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7610         only when assembly has missing attribute.
7611         * report.cs: Update.
7612
7613 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7614
7615         * cs-tokenizer.cs: Merged with gmcs version.
7616
7617 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7618
7619         * cs-tokenizer.cs,
7620         * cs-parser.jay: Better error message when partial keyword is misplaced.
7621
7622 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7623
7624         A fix for bug #79810
7625         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7626         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7627         a RuntimeWrappedException by default.
7628
7629 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7630
7631         A fix for bug #79843
7632         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7633         implementation.
7634         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7635
7636 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7637
7638         * driver.cs, namespace.cs: Uses faster IndexOf version.
7639
7640 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7641
7642         A fix for bug #79941
7643         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7644         operators.
7645         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7646         even if internal name is different.
7647         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7648         (UserDefinedConversion): Simplified as the operators cannot be internal.
7649         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7650         conversions.
7651         (MethodLookup): Replaced EmitContext with parentType.
7652         * expression.cs: Updated.
7653
7654 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7655
7656         * driver.cs (BadAssembly): Handle all the ugliness of
7657         DefineDynamicAssembly.
7658
7659 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7660
7661         Address parts of #58244 -- most of what's left is in the runtime
7662         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7663         CS1509 error checks, and handle them for all assembly loads, not
7664         just the first invocation.
7665         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7666         * codegen.cs (AssemblyClass.AddModule): ... here.
7667
7668 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7669
7670         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7671         IEnumerable<T> is ambiguous.
7672
7673 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7674
7675         A fix for bug #67689
7676         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7677         GetEnumerator is ambiguous.
7678
7679         * report.cs: Add new warning.
7680
7681 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7682
7683         A fix for bug #78602
7684         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7685         to protected member can be nested type.
7686
7687 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7688
7689         A fix for bug #78965
7690         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7691         to protected member must derive from current type.
7692
7693 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7694
7695         assign.cs: Reuses error method.
7696
7697         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7698         instead of type for constants.
7699         (Expression.Error_ValueAssignment): Common error method.
7700
7701         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7702         for any assignment.
7703
7704 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7705
7706         A fix for bug #79081
7707         * expression.cs (MemberAccess.DoResolve): Check nested type
7708         accessibility.
7709
7710 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7711
7712         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7713
7714 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7715
7716         A fix for bug #76591
7717         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7718
7719 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7720
7721         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7722         type forwarder of the same type multiple times.
7723
7724 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7725
7726         Fix #78820
7727         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7728         instance as an rvalue, even when we later resolve as an lvalue.
7729
7730 2006-10-25  Martin Baulig  <martin@ximian.com>
7731
7732         * anonymous.cs: Fix #79673.
7733
7734 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7735
7736         A fix for bug #79666
7737         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7738         ignored when is optimized (= default value) as its value is already set.
7739
7740 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7741
7742         A fix for bug #79724
7743         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7744         TypeContainer for type lookup.
7745
7746 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7747
7748         A fix for bug #79231
7749         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7750         * expression.cs (OverloadResolve): Always convert type name for
7751         an error message.
7752         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7753         other member.
7754
7755 2006-10-18  Martin Baulig <martin@ximian.com>
7756
7757         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7758
7759 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7760
7761         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7762         an int32, but requesting an int64 from the conversion
7763
7764 2006-10-12  Martin Baulig  <martin@ximian.com>
7765
7766         * anonymous.cs
7767         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7768         
7769 2006-10-12  Martin Baulig  <martin@ximian.com>
7770
7771         * statement.cs
7772         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7773
7774 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7775
7776         * convert.cs: Remove broken code: I was doing the "Existance"
7777         tests for Implicit conversions.
7778
7779 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7780
7781         * convert.cs: Added one missing case in
7782         ImplicitStandardConversionExists uint64 to intptr.
7783
7784         Fixes #59800
7785         
7786         * typemanager.cs (uintptr_type): another core known type.   
7787
7788         * ecore.cs (OperatorCast): routine used to do cast operations that
7789         depend on op_Explicit.  We could change some of the Decimal
7790         conversions to use this.
7791
7792         This one has a probe mechanism that checks both types for an op_
7793         which it coudl be used to eliminate two classes: CastToDecimal
7794         and CastFromDecimal.
7795
7796         * convert.cs: Implement the conversions documented in #59800
7797         
7798 2006-10-10  Martin Baulig  <martin@ximian.com>
7799
7800         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7801         before RootScope.ResolveMembers().
7802
7803         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7804         `CurrentType' if appropriate.
7805
7806 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7807
7808         A fix for bug #78568
7809         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7810         when contains binary operators.
7811         * cs-parser.jay: Updated.
7812
7813 2006-10-09  Martin Baulig  <martin@ximian.com>
7814
7815         * delegate.cs
7816         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7817         moved that into Define() and also do the other type parameter
7818         checks there.  Fixes #79094.  Added gtest-292.cs.
7819
7820         * expression.cs
7821         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7822         since that doesn't include type parameters; don't use `Ldelema'
7823         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7824
7825 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7826
7827         A fix for #77796
7828         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7829         conversion is allowed.
7830
7831 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7832
7833         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7834         error reporting when no error occurs.
7835
7836 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7837
7838         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7839         does not exist.
7840
7841 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7842
7843         Fix #79584
7844         * class.cs (DefineTypeBuilder): Check circular dependencies before
7845         setting the parent of the TypeBuilder.
7846         (CheckRecursiveDefinition): Don't use 'BaseType', since
7847         it may not be valid until after DefineTypeBuilder.  Use
7848         'base_type' instead.
7849
7850 2006-10-04  Martin Baulig  <martin@ximian.com>
7851
7852         Merged the Anonymous Methods patch.
7853
7854         * anonymous.cs, iterators.cs: The new anonymous methods code.
7855
7856         * statement.cs (Variable): New public abstract class.
7857         (LocalInfo.Variable): New public property.
7858         (LocalInfo.ResolveVariable): New public method.
7859         (Block.Flags): Add `IsIterator'.
7860         (Block.AddVariable): Improved the CS0136 check.
7861         (Block.AnonymousChildren): New public property.
7862         (Block.AddAnonymousChild): New public method.
7863         (ToplevelBlock): Update to use the new anonymous method framework.
7864         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7865         `ToplevelBlock'; this is required to correctly implement the
7866         CS0136 check.
7867         (Fixed, Using): Use `TemporaryVariable' instead of directly
7868         creating the `LocalBuilder'.
7869
7870         * parameter.cs (Parameter.ResolveVariable): New public method.
7871         (Parameters.ResolveVariable): Likewise.
7872
7873         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7874
7875         * class.cs (TypeContainer): Replaced the `iterators' list and
7876         corresponding methods with a list of `CompilerGeneratedClass'es.
7877         (TypeContainer.ResolveMembers): New public method.
7878         (Method): `IIteratorContainer' has been replaced by
7879         `IAnonymousHost'.
7880
7881         * expression.cs (VariableReference): New public abstract base
7882         class for `LocalVariableReference', `ParameterReference' and
7883         `This'.
7884
7885         * codegen.cs (EmitContext): Removed `capture_context',
7886         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7887         (EmitContext.EmitThis): Removed.
7888
7889         * cs-parser.jay: Replace `iterator_container' with
7890         `anonymous_host'.       
7891
7892 2006-10-04  Martin Baulig  <martin@ximian.com>
7893
7894         * generic.cs (GenericMethod): Don't make this abstract.
7895         (Constraints.Clone): Added dummy implementation.
7896
7897 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7898
7899         Fix #79577
7900         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7901         'declspaces'.  Avoid allocating arrays willy-nilly.
7902
7903         Fix #79553
7904         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7905         cases out of the switch.
7906
7907 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7908
7909         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7910         message when non-generic type is used with the type arguments.
7911         * expression.cs: Updated.
7912
7913 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7914
7915         Fix #79013
7916         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7917         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7918         Change semantics slightly.  Don't insist on having only one
7919         temporary EmptyExpression -- just throttle the creation of new ones.
7920
7921         Fix #79451
7922         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7923         non-interfaces too.  If no methods are found, don't try to create
7924         a MethodGroupExpr.
7925
7926 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7927
7928         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7929         generic type.
7930
7931         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7932         us produce better error message.
7933
7934 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7935
7936         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7937         of the `|' operator.
7938
7939         * report.cs: A new warning added.
7940
7941 2006-09-27  Martin Baulig  <martin@ximian.com>
7942
7943         * generic.cs (GenericMethod): Don't make this abstract.
7944
7945 2006-09-27  Martin Baulig  <martin@ximian.com>
7946
7947         * report.cs
7948         (InternalErrorException): Added overloaded ctor taking a params array.
7949
7950 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7951
7952         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7953         Fixed the cases when same error was reported twice.
7954
7955         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7956         now report symbol information.
7957
7958 2006-09-25  Martin Baulig  <martin@ximian.com>
7959
7960         * class.cs: Completely unified with the gmcs version.
7961
7962 2006-09-25  Martin Baulig  <martin@ximian.com>
7963
7964         * typemanager.cs (TypeManager.IsNullableType): New public function.
7965         (TypeManager.IsNullableTypeOf): Likewise.
7966         (TypeManager.IsNullableValueType): Likewise.
7967
7968         * class.cs (MethodCore): Added the `GenericMethod' argument from
7969         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7970
7971 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7972
7973         * convert.cs: Unify with gmcs version.
7974
7975 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7976
7977         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7978         verify them as well.
7979
7980         * report.cs: New warning.
7981
7982 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7983
7984         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7985         for anonymous block with out argument.
7986
7987 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7988
7989         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7990         not used private events only.
7991
7992 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7993
7994         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7995
7996         * const.cs (Const.Define): Check for constant type.
7997         (Const.IsConstantTypeValid): Looks for valid constant types.
7998
7999         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8000
8001         * ecore.cs (EmptyConstantCast): New common class for all constant based
8002         EmptyCast(s).
8003
8004         * expression.cs (Is.DoResolve): Handle null constant especially.
8005         (New.DoResolve): Check for new void().
8006         (MemberAccess.DoResolve): Cope with all kind of nulls.
8007
8008         * literal.cs (NullConstant): Uses EmptyConstantCast.
8009         (NullDefault): Based on EmptyConstantCast.
8010         (NullLiteral): Uses EmptyConstantCast.
8011
8012         * statement.cs (Block.ResolveMeta): Check for constant type.
8013
8014 2006-09-22  Martin Baulig  <martin@ximian.com>
8015
8016         * delegate.cs, attribute.cs: Merged with the gmcs versions.
8017
8018 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8019
8020         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8021         not the null type.
8022
8023         Fix part of #79451
8024         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8025         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
8026         code slightly.
8027
8028 2006-09-22  Martin Baulig  <martin@ximian.com>
8029
8030         * ecore.cs: Merged with the gmcs version.
8031
8032         * generic.cs (ConstructedType): New dummy class.
8033         (TypeArguments): Don't make this abstract.
8034
8035         * typemanager.cs
8036         (TypeManager.IsGenericTypeDefinition): New method.
8037         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
8038
8039 2006-09-22  Raja R Harinath  <rharinath@novell.com>
8040
8041         * expression.cs (ComposedCast): Check for arrays of TypedReference
8042         before creating the type, not after.
8043
8044 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
8045
8046         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
8047         after ToType change.
8048
8049         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
8050         when constant must be implicitly convertible.
8051
8052         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
8053
8054         * ecore.cs (NullCast): Derives from NullConstant.
8055
8056         * expression.cs (Is.DoResolve): Removed useless variables.
8057         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
8058         (New.Constantify): Add enum support.
8059         (MemberAccess.DoResolve): Add warning when accessing null constant or
8060         variable.
8061
8062         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
8063         property.
8064
8065         * literal.cs (NullConstant): New abstract class with common
8066         functionality for all null specializations.
8067         (NullDefault): Represents default(X) when result can be
8068         reduced to null.
8069         (NullLiteral): Updated.
8070
8071         * report.cs: Add new warning.
8072
8073 2006-09-21  Martin Baulig  <martin@ximian.com>
8074
8075         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
8076
8077 2006-09-21  Martin Baulig  <martin@ximian.com>
8078
8079         * generic.cs (GenericConstraints): New dummy class.
8080         (Constraints): Likewise.
8081         (TypeParameter): Likewise.
8082         (TypeParameterName): Likewise.
8083         (GenericMethod): Likewise.
8084
8085         * typemanager.cs (TypeManager.GetGenericArguments): New method.
8086
8087         * decl.cs: Merged with the gmcs version.
8088
8089 2006-09-21  Raja R Harinath  <rharinath@novell.com>
8090
8091         * generic.cs (TypeParameter): Implement IMemberContainer.
8092         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
8093
8094         * rootcontext.cs: Unify with gmcs version.
8095
8096         * report.cs: Unify with gmcs version.
8097         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
8098         from gmcs/generics.cs.
8099         * generics.cs (TypeParameter): New dummy class.
8100
8101         * support.cs: Unify with gmcs version.
8102
8103 2006-09-20  Raja R Harinath  <rharinath@novell.com>
8104
8105         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
8106         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
8107
8108         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
8109         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
8110         * mcs.exe.sources: Add generic.cs.
8111
8112         * codegen.cs: Unify with gmcs version.
8113
8114         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
8115         (EmitContext): Add GenericDeclContainer implementation.
8116         * decl.cs (MemberCore, DeclSpace): Likewise.
8117         * namespace.cs: Remove #ifdef GMCS_SOURCE.
8118
8119         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
8120         MCS TypeManager has a corresponding dummy method.
8121
8122 2006-09-19  Martin Baulig  <martin@ximian.com>
8123
8124         * expression.cs: Completely merged with the gmcs version.
8125
8126 2006-09-19  Martin Baulig  <martin@ximian.com>
8127
8128         * expression.cs (Invocation): Merged with the gmcs version.
8129         (ArrayAccess.GetStoreOpcode): Likewise.
8130
8131 2006-09-19  Martin Baulig  <martin@ximian.com>
8132
8133         * typemanager.cs
8134         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
8135         (TypeManager.IsGenericMethodDefinition): Likewise.
8136
8137 2006-09-19  Martin Baulig  <martin@ximian.com>
8138
8139         * typemanager.cs
8140         (TypeManager.IsEqual): Moved the gmcs implementation here.
8141         (TypeManager.DropGenericTypeArguments): Likewise.
8142         (TypeManager.DropGenericMethodArguments): Likewise.
8143         (TypeManager.GetTypeArguments): Moved here from gmcs.
8144         (TypeManager.HasGenericArguments): Likewise.
8145
8146 2006-09-19  Martin Baulig  <martin@ximian.com>
8147
8148         * expression.cs (Binary): Merged with the gmcs version.
8149
8150 2006-09-19  Martin Baulig  <martin@ximian.com>
8151
8152         * expression.cs (Probe, As, Is): Merged with the gmcs version.
8153
8154 2006-09-19  Martin Baulig  <martin@ximian.com>
8155
8156         * typemanager.cs: Merged with the gmcs version.
8157
8158 2006-09-16  Raja R Harinath  <rharinath@novell.com>
8159
8160         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
8161         * driver.cs: Likewise.
8162
8163 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
8164
8165         A fix for #79401
8166         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
8167         only if parent type is class.
8168         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
8169         update.
8170
8171 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
8172
8173         * cs-parser.jay,
8174         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
8175         keywords are used.
8176         * typemanager.cs(CSharpName): Converts NullType to null.
8177
8178 2006-09-15  Martin Baulig  <martin@ximian.com>
8179
8180         * typemanager.cs
8181         (TypeManager.GetMethodName): Added mcs implementation.
8182         (TypeManager.IsEqual): Likewise.
8183
8184         * ecore.cs
8185         (SimpleName.RemoveGenericArity): Added dummy implementation.
8186
8187         * pending.cs: Merged with the gmcs version.     
8188
8189 2006-09-15  Martin Baulig  <martin@ximian.com>
8190
8191         * statement.cs: Merge with the gmcs version.
8192
8193 2006-09-15  Martin Baulig  <martin@ximian.com>
8194
8195         * statement.cs (Switch): Merge with the gmcs implementation
8196         (without nullables), which is newer.
8197
8198 2006-09-15  Martin Baulig  <martin@ximian.com>
8199
8200         * statement.cs (Block.Variables): Make this public.
8201         (ToplevelBlock.Parameters): Make this a property.
8202         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
8203
8204 2006-09-15  Martin Baulig  <martin@ximian.com>
8205
8206         * namespace.cs: Merge with the gmcs version.
8207
8208 2006-09-15  Martin Baulig  <martin@ximian.com>
8209
8210         * decl.cs (MemberName): Minor code cleanups.
8211
8212 2006-09-15  Martin Baulig  <martin@ximian.com>
8213
8214         * parameter.cs: Merge with the gmcs version.
8215
8216 2006-09-15  Martin Baulig  <martin@ximian.com>
8217
8218         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
8219         and an error in mcs.
8220
8221 2006-09-15  Martin Baulig  <martin@ximian.com>
8222
8223         * flowanalysis.cs: Merged from GMCS; added the generics code into
8224         a `GMCS_SOURCE' conditional so we can share this file.
8225
8226 2006-09-08  Martin Baulig  <martin@ximian.com>
8227
8228         * typemanager.cs (TypeManager.interlocked_type): New public field.
8229         (TypeManager.int_interlocked_compare-exchange): New public field.
8230         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
8231         enumerator types here and call InitGenericCoreTypes().
8232         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
8233         after calling InitEnumUnderlyingTypes().
8234
8235         * rootcontext.cs
8236         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
8237         `classes_second_stage'. 
8238
8239 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
8240
8241         * assign.cs, ecore.cs, expression.cs: Share error message text.
8242         * class.cs (FieldMember.Define): Check for varible of static type.
8243         * driver.cs (LoadAssembly): Uses error output for errors.
8244         * statement.cs: Updated.
8245
8246 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
8247
8248         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
8249         type instance.
8250
8251 2006-09-07  Martin Baulig  <martin@ximian.com>
8252
8253         * driver.cs
8254         (MainDriver): Revert r62663 from Marek; see #70506 for details.
8255
8256 2006-08-29  Miguel de Icaza  <miguel@novell.com>
8257
8258         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
8259         
8260 2006-08-17  Miguel de Icaza  <miguel@novell.com>
8261
8262         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8263         #52019 and #79064, the use of the \uXXXX sequence in source code
8264         to represent unicode characters.
8265
8266 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
8267
8268         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
8269         support.
8270         * class.cs, ecore.cs, statement.cs: Merged to one error message.
8271
8272 2006-08-13  Miguel de Icaza  <miguel@novell.com>
8273
8274         * assign.cs: Catch attempts to assign to a method groups in += and
8275         report as 1656
8276
8277 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
8278
8279         A fix for #79056
8280         * cs-parser.jay: Don't destroy current array type by typeof of array's.
8281
8282 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
8283
8284         * class.cs (Method.Define): Issue a warning when generic method looks like
8285         an entry point.
8286         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
8287         as well.
8288
8289 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
8290  
8291         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
8292         looking for ctor.
8293         * decl.cs (MemberCache.FindMembers): When container is interface we need to
8294         search all base interfaces as a member can be ambiguous.
8295         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
8296         Constructor member type filter. 
8297         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8298         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8299         reporting for returned memberinfos.
8300         * report.cs: Updated.
8301         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8302         version to work on all runtimes.
8303         (TypeManager.RealMemberLookup): Removed members filtering.
8304
8305 2006-08-08  Raja R Harinath  <rharinath@novell.com>
8306
8307         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8308         (PropertyExpr.EmitAssign): Likewise.
8309         * expression.cs (Indirection.EmitAssign): Likewise.
8310         (LocalVariableReference.EmitAssign): Likewise.
8311         (ParameterReference.EmitAssign): Likewise.
8312         (Invocation.EmitArguments): Likewise.
8313         (ArrayAccess.EmitAssign): Likewise.
8314         (IndexerAccess.EmitAssign): Likewise.
8315         (This.EmitAssign): Likewise.
8316         (ConditionalLogicalOperator.Emit): Likewise.
8317
8318         Fix #79026
8319         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
8320         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
8321         leave it in after returning it.
8322         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
8323
8324 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
8325
8326         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8327         message.
8328
8329 2006-08-03  Raja R Harinath  <rharinath@novell.com>
8330
8331         Fix cs0146-3.cs and cs0146-4.cs.
8332         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8333         enclosing types don't depend on the current type.
8334
8335 2006-08-02  Raja R Harinath  <rharinath@novell.com>
8336
8337         Fix #77963
8338         * class.cs (TypeContainer.DoDefineMembers): Use
8339         FindBaseMemberWithSameName on Parent, since we're interested in
8340         whether we hide inherited members or not.
8341         (FindBaseMemberWithSameName): Make slightly more robust.
8342
8343         Fix the non-generic testcase from #77396
8344         * decl.cs (DeclSpace.DeclContainer): Remove override.
8345
8346         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8347         declspaces for doppelgangers too.
8348         (UsingEntry): Implement IResolveContext.
8349         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
8350         'this' as the resolve context.
8351         (LocalAliasEntry): Likewise.
8352
8353         Implement parts of #77403
8354         * roottypes.cs (RootDeclSpace): New.  Used to represent the
8355         toplevel declaration space.  Each namespace declaration introduces
8356         a "partial" root declaretion space.
8357         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8358         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8359         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8360         from 'current_namespace.SlaveDeclSpace'.
8361         (namespace_declaration): Likewise.
8362         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8363         check.  It can't happen now.
8364         * decl.cs (DeclSpace.LookupType): Likewise.
8365         * driver.cs (MainDriver): Sanity check.
8366
8367 2006-08-01  Raja R Harinath  <rharinath@novell.com>
8368
8369         * decl.cs (DeclSpace.FindNestedType): Remove.
8370         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8371         LookupTypeContainer to get the container of the nested type.
8372         * class.cs (TypeContainer.FindNestedType): Make non-override.
8373
8374 2006-07-31  Raja R Harinath  <rharinath@novell.com>
8375
8376         * decl.cs (DeclSpace.PartialContainer): Move field from ...
8377         * class.cs (TypeContainer.PartialContainer): ... here.
8378         (TypeContainer.AddBasesForPart): New helper.
8379         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
8380         instead.
8381         * cs-parser.jay (current_class): Convert to DeclSpace.
8382         (struct_declaration, interface_declaration, class_declaration):
8383         Use AddBasesForPart instead of .Bases directly.
8384         * const.cs, iterators.cs: Update to changes.
8385
8386 2006-07-28  Raja R Harinath  <rharinath@novell.com>
8387
8388         * class.cs (TypeContainer.AddMemberType): Rename from
8389         AddToTypeContainer.
8390         (TypeContainer.AddMember): Rename from AddToMemberContainer.
8391         (AddTypeContainer): New.  Combine AddClassOrStruct and
8392         AddInterface.
8393         (AddPartial): Update.  Add 'is_partial' argument.
8394         * roottypes.cs: Update to changes.
8395         * cs-parser.jay (push_current_class): New helper for handling
8396         current_container and current_class.
8397         (struct_declaration, interface_declaration, class_declaration):
8398         Use it.
8399
8400 2006-07-26  Raja R Harinath  <rharinath@novell.com>
8401
8402         * roottypes.cs: Rename from tree.cs.
8403
8404         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8405         * tree.cs (Tree, ITreeDump): Remove types.
8406         * rootcontext.cs (tree, Tree): Remove fields.
8407         (root, ToplevelTypes): New.
8408         * *.cs: Update to rename.
8409
8410         * tree.cs (Tree.RecordDecl): Remove.
8411         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8412         namespace here.
8413         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8414
8415 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8416
8417         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8418         DoFlowAnalysis and OmitStructFlowAnalysis here.
8419         (ec.With): Rename from WithUnsafe and generalize.
8420         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8421         (ec.WithFlowAnalyis): New.
8422         * ecore.cs, expression.cs, statement.cs: Update.
8423
8424 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8425
8426         * statement.cs (Block.ResolveMeta): Simplify slightly.
8427
8428         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8429         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8430         check_state to flags.
8431         (CheckState, ConstantCheckState): Update.
8432         (InUnsafe): New read-only property.
8433         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8434         arbitrary flags.
8435         (WithUnsafe): New helper similar to WithCheckState.
8436         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8437         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8438
8439 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8440
8441         Make comparisons use the same IL irrespective of whether they're
8442         in a 'checked' or 'unchecked' context: one of the issues in #78899
8443         * codegen.cs (EmitContext.CheckState): Make read-only property.
8444         (EmitContext.ConstantCheckState): Likewise.
8445         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8446         helper that implement a save/restore stack for CheckState
8447         values.  This is the only way to change check-state.
8448         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8449         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8450         (CheckedExpr.EmitBranchable): New forwarding method.
8451         (UnCheckedExpr): Likewise.
8452         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8453         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8454         (Checked.Resolve, checked.DoEmit): Likewise.
8455
8456 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8457
8458         * anonymous.cs: Cache the resolved anonymous delegate, and return
8459         this so that the ResolveTopBlock is only triggered once, not
8460         twice.
8461
8462         Currently we trigger ResolvetopBlock twice due to a first pass of
8463         argument check compatibility, and a second pass that does the
8464         actual resolution.   
8465         
8466 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8467
8468         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8469         modifiers.
8470         * rootcontext.cs (Reset): Add helper_classes.
8471
8472 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8473
8474         A fix for #78860
8475         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8476         correctly.
8477
8478 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8479
8480         * statement.cs (Lock): Handle expressions of type
8481         TypeManager.null_type specially.  Fixes #78770
8482
8483 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8484
8485         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8486         to an event.
8487
8488 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8489
8490         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8491         for accessors as well.
8492         * ecore.cs (EventExpr): Add AccessorTable.
8493
8494 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8495
8496         A fix for #78738
8497         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8498         for CS0122 where appropriate.
8499         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8500         level attributes.
8501         (Filter): Assembly can be null in the case of top level attributes.
8502
8503 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8504
8505         A fix for #78690
8506
8507         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8508         is done at global level.
8509
8510 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8511
8512         A fix for #77002, Implemented TypeForwarder support.
8513
8514         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8515         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8516         * typemanager.cs (): Add type_forwarder_attr_type.
8517
8518 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8519
8520         * report.cs: Add CS0469 warning.
8521
8522 2006-06-21  Martin Baulig  <martin@ximian.com>
8523
8524         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8525         the `try'-block, so we also report CS0016 etc. there.
8526
8527 2006-06-21  Martin Baulig  <martin@ximian.com>
8528
8529         * delegate.cs
8530         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8531
8532 2006-06-21  Martin Baulig  <martin@ximian.com>
8533
8534         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8535         also report CS1686 for parameters.
8536
8537 2006-06-21  Martin Baulig  <martin@ximian.com>
8538
8539         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8540         instead of an error if the value is not implicitly convertible to
8541         the switch types; fixes #77964.
8542
8543 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8544
8545         Fix #78673
8546         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8547         FieldBuilder is null.
8548
8549         Fix #78662
8550         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8551         'left' and 'right' before error-checking.
8552
8553 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8554
8555         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8556         Fixed bug #78601.
8557         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8558         (FieldExpr.DoResolve): likewise.
8559         (PropertyExpr.InstanceResolve): likewise.
8560         (EventExpr.InstanceResolve): likewise. 
8561
8562 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8563
8564         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8565         attribute applicable tests for attribute argument.
8566
8567 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8568
8569         Fix #78079
8570         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8571         (Binary.OverloadResolve_PredefinedIntegral): New.
8572         (Binary.OverloadResolve_PredefinedFloating): New.
8573         (Binary.OverloadResolve_PredefinedString): New.
8574         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8575         Follow the standard more closely, and treat numeric promotions in
8576         terms of overload resolution.
8577         (Binary.CheckShiftArguments): Simplify.
8578
8579 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8580
8581         * flowanalysis.cs (MyBitVector): Simplify representation.
8582         (MyBitVector.Clone): Avoid allocating BitArray.
8583         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8584         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8585         (*): Update.  Change all references to MyBitVector.And and
8586         MyBitVector.Or to &= and |=.
8587
8588 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8589
8590         Fix cs0231-[34].cs.
8591         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8592         to param arguments too.
8593
8594 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8595
8596         * cs-parser.jay: Catch another parsing form for arglist being
8597         followed by other arguments.  Fixes #78313.
8598
8599 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8600
8601         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8602         checking of out parameters to ...
8603         (FlowBranchingToplevel.Merge): ... here.
8604         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8605         set, propagate the origin upward, and only complain if there was
8606         no other error.
8607         (FlowBranchingException.AddContinueOrigin): Likewise.
8608         (FlowBranchingException.AddReturnOrigin): Likewise.
8609         (FlowBranchingException.AddGotoOrigin): Likewise.       
8610
8611 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8612
8613         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8614         unreachable, skip it.
8615         (FlowBranchingException.Merge): Always propagate jumps, even if
8616         the finally block renders subsequent code unreachable.
8617
8618 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8619
8620         Fix #77601
8621         * statement.cs (Goto.Resolve): Move responsibility for resolving
8622         'goto' to FlowBranching.AddGotoOrigin.
8623         (Goto.SetResolvedTarget): New.  Callback to set the
8624         LabeledStatement that's the target of the goto.
8625         (Goto.DoEmit): Use Leave instead of Br when crossing an
8626         unwind-protect boundary.
8627         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8628         LookupLabel and adjust to new semantics.
8629         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8630         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8631         Goto.SetResolvedTarget to update target.
8632         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8633         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8634         AddBreakOrigin & co.  Delay propagation until ...
8635         (FlowBranchingException.Merge): ... this.
8636
8637         * statement.cs (Block.Resolve): Always depend on flow-branching to
8638         determine unreachability.  Kill workaround that originally emitted
8639         only one statement after an "unreachable" label (see infloop in
8640         test-515.cs).
8641
8642         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8643         This is still "wrong", but anything better would probably need a
8644         multi-pass algorithm.
8645         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8646         usage vector.  Force current usage vector to be reachable, to
8647         optimistically signify backward jumps.
8648         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8649         detected.
8650         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8651         detected, return the original salted-away usage vector instead,
8652         updated with appropriate changes.  Print unreachable warning if
8653         necessary.
8654         * statement.cs (Block.Resolve): Don't print unreachable warning on
8655         a labeled statement.
8656
8657 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8658
8659         * driver.cs: Pass filename without path to AssemblyBuilder's 
8660         AddResourceFile. Fixes bug #78407.
8661
8662 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8663
8664         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8665         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8666         (FlowBranching.MergeChild): Overwrite
8667         reachability information from Labeled branchings too.
8668
8669 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8670
8671         * statement.cs (Goto.Resolve): Merge jump origins here ...
8672         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8673
8674         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8675         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8676         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8677         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8678         here, ...
8679         * statement.cs (Goto.Resolve): ... not here.
8680         (Goto.Emit): Remove CS1632 check.
8681
8682 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8683
8684         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8685         error message.
8686
8687 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8688
8689         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8690         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8691         (FlowBranchingException.Label): Likewise.
8692
8693         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8694         given value.
8695         (MyBitVector.Or): Use it to avoid losing information (Count).
8696         (FlowBranching.MergeOrigins): Likewise.
8697
8698         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8699         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8700         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8701         (UsageVector.ToString): Simplify.
8702         (UsageVector.MergeSiblings): Move here from ...
8703         (FlowBranching.Merge): ... here.
8704         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8705         not a MyBitVector.
8706
8707 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8708
8709         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8710         null bitvector is treated as all-true.
8711
8712         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8713         (MyBitVector): Rationalize invariants.  'vector != null' implies
8714         that we have our own copy of the bitvector.  Otherwise,
8715         'InheritsFrom == null' implies all inherited bits are true.
8716
8717 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8718
8719         * statement.cs (LocalInfo): Add IsConstant.
8720         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8721         local variable for constants.
8722
8723 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8724
8725         * flowanalysis.cs (MyBitVector.Empty): New.
8726         (MyBitVector): Don't allow InheritedFrom to be null.
8727         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8728         (UsageVector, FlowBranching): Update to changes.
8729
8730         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8731         recursion.  The 'Parent == null' condition isn't sufficient for
8732         anonymous methods.
8733         (FlowBranching.AddBreakOrigin): Likewise.
8734         (FlowBranching.AddContinueOrigin): Likewise.
8735         (FlowBranching.AddReturnOrigin): Likewise.
8736         (FlowBranching.StealFinallyClauses): Likewise.
8737         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8738         (FlowBranching.CheckOutParameters): Likewise.
8739         (FlowBranchingToplevel): Terminate all the above recursions here.
8740         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8741         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8742
8743         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8744         toplevel block.
8745         (FlowBranchingToplevel): New.  Empty for now.
8746         (FlowBranching.MergeTopBlock): Update.
8747         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8748         branching for the anonymous delegate.
8749         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8750
8751         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8752         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8753         information at the start of the merge.  Reorganize.
8754
8755 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8756
8757         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8758
8759 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8760
8761         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8762         to newly introduced ctor.
8763
8764         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8765         message to one place.
8766         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8767         global namespace.
8768
8769 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8770
8771         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8772
8773         * ecore.cs (Expression.ResolveAsConstant): Updated.
8774
8775         * statement.cs (ResolveMeta): Updated.
8776
8777 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8778
8779         * cs-parser.jay: __arglist cannot be used in initializer.
8780
8781 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8782
8783         A fix for #77879
8784         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8785         private types.
8786
8787 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8788
8789         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8790         (LabeledStatement): Add 'name' parameter.
8791         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8792         (Block.AddLabel): Update to changes.
8793         * cs-parser.jay (labeled_statement): Likewise.
8794
8795         * flowanalysis.cs (BranchingType.Labeled): New.
8796         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8797         (FlowBranchingLabeled): New.  Does nothing for now, but will
8798         eventually handle 'goto' flows.
8799         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8800         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8801         that's terminated ...
8802         (Block.Resolve): ... here.
8803
8804         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8805         (UsageVector.MergeFinallyOrigins): Likewise.
8806         (FlowBranching.InTryOrCatch): Likewise.
8807         (FlowBranching.AddFinallyVector): Likewise.
8808         (FlowBranchingException): Update to changes.
8809
8810         Fix #78290
8811         * statement.cs (Return.Resolve): Move error checking to ...
8812         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8813         (FlowBranchingException): Handle return origins like break and
8814         continue origins.
8815         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8816
8817 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8818
8819         A fix for #76122
8820         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8821         filter.
8822
8823 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8824
8825         A fix for #77543
8826         * class.cs (MethodData.Define): Do public accessor check only when method
8827         implements an interface.
8828
8829 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8830
8831         Remove special handling of 'break'
8832         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8833         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8834         (UsageVector.Break): Remove.
8835         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8836         reachability.
8837         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8838
8839         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8840         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8841
8842 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8843
8844         A fix for #75726
8845         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8846         be the interface member.
8847
8848 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8849
8850         A fix for #60069
8851         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8852         for emitting small (int) values.
8853
8854 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8855
8856         Fix #59427
8857         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8858         control-flow passes through the 'finally' after merging-in all the
8859         control-flows from 'try' and the 'catch' clauses.
8860
8861         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8862         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8863         always true at the only non-recursive entry point.
8864         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8865         FlowBranchingBreakable.
8866         (FlowBranchingLoop): Remove.
8867         * statement.cs (Return.DoResolve): Update to changes.
8868
8869         Fix #76471, #76665
8870         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8871         (FlowBranching.CreateBranching): Handle it: create a
8872         FlowBranchingContinuable.
8873         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8874         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8875         except that it handles the 'continue' command.
8876         (FlowBranching.UsageVector.MergeOrigins): Rename from
8877         MergeBreakOrigins.
8878         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8879         except that it overrides AddContinueOrigin.
8880         (FlowBranchingException): Override AddContinueOrigin, similar to
8881         AddBreakOrigin.
8882         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8883         Create a new branching around the embedded statement.
8884         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8885         control flow after the embedded statement.
8886         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8887
8888         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8889         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8890         FlowBranchingBreakable.
8891         (FlowBranchingSwitch): Remove.
8892
8893         Fix test-503.cs
8894         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8895         error reporting to ...
8896         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8897         Rename from 'AddBreakVector'.  Add new location argument.  Return
8898         a bool indicating whether the 'break' crosses an unwind-protect.
8899         (FlowBranchingException.AddBreakOrigin): Add.
8900         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8901         flowbranching after updating with the effects of the 'finally'
8902         clause.
8903         (FlowBranchingBreakable): New common base class for
8904         FlowBranchingLoop and FlowBranchingSwitch.
8905
8906         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8907         embedded statement.
8908         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8909
8910 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8911
8912         * statement.cs (Do.Resolve): If the loop is infinite, set the
8913         barrier.
8914         (While.Resolve, For.Resolve): Set a barrier after the embedded
8915         statement.  There's no direct control flow that goes from the end
8916         of the embedded statement to the end of the loop.
8917         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8918         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8919         above ensure that the reachability is correctly computed.
8920
8921         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8922         (UsageVector.MergeBreakOrigins): If the current path is
8923         unreachable, treat it as if all parameters/locals are initialized.
8924         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8925         infinite loops before merging-in break origins.
8926
8927         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8928         (Reachability.Reachable): Split part into ...
8929         (Reachability.Unreachable): ... this.  Simplify.
8930         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8931
8932         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8933         (Reachability.SetThrowsSometimes): Likewise.
8934         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8935         TriState.Always, use corresponding property.
8936         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8937         (Block.Resolve): Likewise.  Remove some redundant checks.
8938
8939 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8940
8941         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8942         (Reachability.Meet): Don't bother checking AlwaysThrows --
8943         barrier is always set.
8944         (FlowBranchingBlock.Merge): Likewise.
8945
8946 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8947
8948         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8949         checks for unreachable.
8950
8951 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8952
8953         A fix for #77980
8954         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8955
8956         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8957         whether field is really assigned.
8958
8959 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8960
8961         * flowanalysis.cs (Reachability): Make 4-argument constructor
8962         private.
8963         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8964         (Reachability.Always): Rename from the highly misleading
8965         'Reachability.Never'.
8966         (FlowBranching.Merge): Update to changes.  Mark an impossible
8967         situation with a 'throw'.
8968         (*): Update to changes.
8969
8970 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8971
8972         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8973         Remove 'Undefined'.
8974         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8975         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8976         (*): Update to changes.
8977         * statement.cs: Update to changes.
8978
8979 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8980
8981         A fix for #78049
8982         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8983
8984 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8985
8986         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8987         dummy UsageVector.
8988
8989         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8990         argument to two arguments: an usage-vector and a bool.  Move call
8991         to FlowBranching.Merge () ...
8992         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8993
8994         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8995         handling of loop and switch reachability to ...
8996         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8997
8998 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8999
9000         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9001         handling to FlowBranchingLoop.InLoop.
9002         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9003
9004 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
9005
9006         A fix for #78115
9007         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9008         anonymous method is allowed from AnonymousContainer here.
9009
9010         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9011
9012 2006-04-24  Raja R Harinath  <rharinath@novell.com>
9013
9014         Fix #78156
9015         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9016
9017 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
9018
9019         A fix for #49011.
9020         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9021         (DoubleConstant.Reduce): Ditto.
9022
9023 2006-04-23  Raja R Harinath  <rharinath@novell.com>
9024
9025         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9026         Remove 'lvalue_right_side' argument.  Move parts to ...
9027         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9028         (LocalVariable.DoResolveLValue): ... these.
9029
9030 2006-04-21  Raja R Harinath  <rharinath@novell.com>
9031
9032         Fix cs1655.cs
9033         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
9034         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
9035         (LocalVariableReference.DoResolveBase): Use it to implement new
9036         CS1655 check.
9037         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
9038         (Argument.Resolve): Simplify.  Move CS1510 check ...
9039         * ecore.cs (Expression.ResolveLValue): ... here.
9040         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
9041         (PropertyExpr.DoResolveLValue): Likewise.
9042         (FieldExpr.Report_AssignToReadonly): Likewise.
9043         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
9044         LValueMemberAccess or LValueMemberOutAccess on instance depending
9045         on it.
9046         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
9047         DoResolve as appropriate.
9048
9049 2006-04-20  Raja R Harinath  <rharinath@novell.com>
9050
9051         Fix #75800
9052         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
9053         implicit conversions on 'out' and 'ref' arguments.
9054
9055         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
9056         improve clarity.  Remove dead code.
9057
9058         Fix #66031
9059         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
9060         (Catch.Resolve): Resolve VarBlock if it exists.
9061
9062 2006-04-19  Miguel de Icaza  <miguel@novell.com>
9063
9064         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
9065         twice, this was some residual code, the enumerator was emitted
9066         properly in the two branche of if later.
9067
9068 2006-04-19  Raja R Harinath  <rharinath@novell.com>
9069
9070         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
9071         cast is never an lvalue.
9072         (Cast.DoResolve, Cast.ResolveRest): Combine.
9073         (Argument.Emit): Simplify slightly.  Move 'Expr is
9074         IMemoryLocation' check ...
9075         (Argument.Resolve): ... here.
9076         (Argument.Error_LValueRequired): Remove.  Inline into only user.
9077
9078         Simplifications.  Fix cs0191-2.cs
9079         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
9080         CS1649 and CS1651 to ...
9081         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
9082         the actual selection of the error code and message to a lookup
9083         table.  Add a dummy return value to simplify callsites.
9084         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
9085         readonly fields of other instances of the same type.  Move CS0197
9086         warning from ...
9087         * expression.cs (Argument.Resolve): ... here.  Simplify code.
9088         Ensure that ec.InRefOutArgumentResolving is only set during LValue
9089         resolution of an out or ref argument.  The code simplification
9090         above uses this invariant.
9091
9092 2006-04-18  Raja R Harinath  <rharinath@novell.com>
9093
9094         Possibly fix #77752.  Fix cs1690-[4-7].cs.
9095         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
9096         CheckMarshallByRefAccess.  Drop parameter.
9097         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
9098         warning.
9099         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
9100         InstanceExpression.
9101         * report.cs (AllWarnings): Add CS1690.
9102         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
9103         for ref access too.
9104         (LocalVariableReference.DoResolveBase): Update.
9105
9106 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9107
9108         * class.cs (MethodOrOperator): Moved common parts from method class.
9109         detect obsolete attributes.
9110         (Method.Define): Simplified as it reuses code from base.
9111         (Constructor.ValidAttributeTargets): Fixed issue found during
9112         refactoring.
9113         (Destructor.ValidAttributeTargets): Fixed issue found during
9114         refactoring.
9115         (Operator): Finished refactoring set off by #78020. Operator class is now
9116         ordinary method class.
9117
9118         * anonymous.cs: Updated.
9119
9120         * decl.cs (DeclSpace): Add IsGeneric
9121
9122 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9123
9124         * class.cs (Constructor.Emit): Don't emit the attributes twice.
9125
9126 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9127
9128         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
9129         detect obsolete attributes.
9130         (Method.CreateEmitContext): Moved to MethodOrOperator.
9131
9132 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
9133
9134         A fix for #78048.
9135         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
9136         customized exception to make crash detection easier.
9137         (MethodOrOperator): Started to work on new base class for methods and
9138         operators.
9139         (Method): Derives from MethodOrOperator.
9140         (Constructor.Emit): Emits its own attributes.
9141         (AbstractPropertyEventMethod.Emit): Ditto.
9142         (Operator): Derives from MethodOrOperator, will refactor fully in extra
9143         patch.
9144         (Operator.Emit): It's temporary more tricky than should be.
9145         
9146         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
9147
9148         * report.cs (InternalErrorException): Add ctor with inner exception.
9149
9150 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
9151
9152         A fix for #76744.
9153         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
9154         only not visible.
9155
9156 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
9157
9158         A fix for #77916.
9159         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
9160         array.
9161
9162 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
9165         attribute is present and Guid not.
9166         (Interface.ApplyAttributeBuilder): Ditto.
9167
9168         * attribute.cs: Add error message.
9169
9170 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
9171
9172         A fix for #78020.
9173
9174         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
9175         sources (it's composite) so hold them in extra array as they are used in
9176         Emit phase only. It worked in the previous versions by mistake.
9177         (Attribute.Emit): Emit attribute for more owners when exist.
9178
9179         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
9180         it has now different behaviour.
9181
9182 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
9183
9184         * constant.cs (Constant.IsDefaultInitializer): New method.
9185
9186         * class.cs: Updated.
9187
9188         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
9189         re-initialize default values. It saves KBs almost for every assembly.
9190         Thanks Zoltan for the idea.
9191         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
9192         (ArrayCreation.DoResolve): Resolve only once.
9193         (ArrayCreation.Emit): Emit static initializer only when it is faster.
9194         (ArrayCreation.GetAttributableValue): Cope with optimized values.
9195
9196 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
9197
9198         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
9199         From #77961.
9200
9201 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9202
9203         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
9204         in an embedded statement too.
9205
9206 2006-04-01  Raja R Harinath  <rharinath@novell.com>
9207
9208         Fix #77958
9209         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
9210
9211 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
9212
9213         A fix for #77966.
9214
9215         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
9216         was not specified.
9217
9218         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
9219
9220 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
9221
9222         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
9223         phase.
9224
9225         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
9226         LocalTemporary change.
9227
9228         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
9229         TypeContainer.
9230         (ClassOrStruct.DefineFieldInitializers): Implemented static field
9231         initializers optimization.
9232         (ClassOrStruct.TypeAttr): Moved from modifiers.
9233         (Constructor.CheckBase): Don't crash when static ctor has parameters.
9234         (FieldBase.ResolveInitializer): Resolves initializer.
9235         (FieldBase.HasDefaultInitializer): New property.
9236
9237         * cs-parser.jay: Removed message.
9238
9239         * expression.cs (CompilerGeneratedThis): New specialization.
9240
9241         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
9242
9243 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
9244
9245         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
9246
9247 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9248
9249         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
9250         be now EnumConstants only.
9251
9252 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
9253
9254         * attribute.cs, driver.cs: Reset more caches.
9255
9256 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9257
9258         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
9259
9260 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9261
9262         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
9263         for easier reuse. Updated all overrides.
9264         (IntegralConstant): New base class for all integral constants.
9265         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
9266         of the constant range, report custom error.
9267         (UIntConstant.Reduce): Fixed uint conversion.
9268
9269         * ecore.cs, literal.cs: Reduce updates.
9270
9271 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9272
9273         A fix for #75813.
9274
9275         * class.cs (Constructor.Define): Removed extra if for default ctors.
9276         A patch from Atsushi Enomoto.
9277
9278 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
9279
9280         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
9281         GetAttributableValue.
9282
9283         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
9284         when required.
9285
9286         * convert.cs (ImplicitConversionRequired): Error message moved to
9287         DoubleLiteral.
9288
9289         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
9290         automatic implicit conversion of an output value.
9291         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
9292
9293         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
9294         conversion.
9295         (TypeOf.GetAttributableValue): Add extra handling for object type.
9296
9297         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9298         special error message.
9299
9300 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
9301
9302         * class.cs (Constructor.Emit): Don't crash when struct ctor is
9303         InternalCall.
9304         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9305         compatible with MS runtime.
9306
9307 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
9308
9309         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9310         attribute arguments here.
9311
9312         * class.cs (Indexer.Define): The check was moved to attribute class.
9313
9314 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
9315
9316         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9317         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9318         easier.
9319
9320 2006-03-22  Raja R Harinath  <rharinath@novell.com>
9321
9322         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
9323         mcs to keep code differences small.
9324         * attribute.cs (Attribute.GetParameterDefaultValue): New.
9325         * typemanager.cs (parameter_default_value_attribute_type): New.
9326         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
9327         CS1908 check.
9328
9329 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9330
9331         * expression.cs (StringConcat.Append): Reverted back to no warning state.
9332
9333 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9334
9335         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9336
9337         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9338         the blocks too.
9339
9340 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
9341
9342         * doc-bootstrap.cs : fix build.
9343
9344 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9345
9346         * expression.cs (StringConcat.Append): Issue a warning when empty string
9347         is going to append.
9348
9349 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * assign.cs (CompoundAssign.ResolveSource): Removed.
9352
9353         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9354         clean up.
9355
9356         * class.cs (TypeContainer.FindMethods): Removed.
9357         (TypeContainer.CheckMemberUsage): Made static.
9358
9359         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9360
9361         * constant.cs (CheckRange): Removed unused type argument.
9362         (CheckUnsigned): Removed unused type argument.
9363
9364         * cs-parser.jay: Updated after MemberAccess clean up.
9365         Uses Length for empty string test.
9366
9367         * cs-tokenizer.cs: Uses Length for empty string test.
9368         (IsCastToken): Made static.
9369         (is_hex): Made static.
9370         (real_type_suffix): Made static.
9371
9372         * decl.cs (SetupCache): Made static.
9373         (OnGenerateDocComment): Removed unused ds argument.
9374
9375         * delegate.cs (VerifyDelegate): Removed unused argument.
9376
9377         * doc.cs: Uses Length for empty string test.
9378
9379         * driver.cs: Uses Length for empty string test.
9380
9381         * enum.cs (IsValidEnumType): Made static
9382
9383         * expression.cs (EnumLiftUp): Removed unused argument.
9384         (ResolveMethodGroup): Ditto.
9385         (BetterConversion): Ditto.
9386         (GetVarargsTypes): Ditto.
9387         (UpdateIndices): Ditto.
9388         (ValidateInitializers): Ditto.
9389         (MemberAccess.ctor): Ditto.
9390         (GetIndexersForType): Ditto.
9391
9392         * flowanalysis.cs: (MergeFinally): Removed unused argument.
9393
9394         * iterators.cs: Updated after MemberAccess clean up.
9395
9396         * location.cs: Uses Length for empty string test.
9397
9398         * namespace.cs: Uses Length for empty string test.
9399
9400          * report.cs (CheckWarningCode): Made static.
9401
9402         * statement.cs (LabeledStatement): Removed unused argument.
9403
9404         * typemanager.cs (FilterNone): Removed.
9405
9406 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9407
9408         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9409         obsolete.
9410
9411         * class.cs: Updated.
9412
9413 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9414
9415         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9416
9417 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9418
9419         A fix for #77822.
9420
9421         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9422         reporting, it's more tricky than I thought.
9423
9424 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9425
9426         A fix for #77816.
9427
9428         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9429         host container.
9430         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9431         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9432         Add more error reporting; Fixed issue with params.
9433
9434         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9435
9436         * cs-parser.jay: AnonymousMethod requires host container.
9437
9438         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9439
9440 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9441
9442         * class.cs: Change 'TypeContainer ds' constructor argument to
9443         'DeclSpace parent'.  Some classes were missed below due to
9444         different naming convention.
9445
9446         * class.cs (MemberCore.Parent): Delete.  This makes the
9447         ParentContainer changes below enforceable by the compiler.
9448
9449         Treat pointers to enclosing declaration space as 'DeclSpace', not
9450         'TypeContainer'.
9451         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9452         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9453
9454         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9455         of TypeContainer.
9456         (Block.AddThisVariable): Likewise.
9457         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9458         (AbstractPropertyEventMethod.Emit): Likewise.
9459         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9460         (GetMethod.Define, SetMethod.Define): Likewise.
9461         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9462         (DelegateMethod.EmitMethod): Likewise.
9463
9464         Fix regression test-partial-13.cs.
9465         Rationalize use of PartialContainer.  Ensure that the partial
9466         class semantics can be tied to type-correctness, i.e., any
9467         violation will cause a compile error.
9468         * class.cs, const.cs: Access all fields that belong to class
9469         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9470         Resolve()-like functions still use 'Parent'.
9471
9472         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9473         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9474         (PropertyMethod.CheckModifiers): Remove unused argument.
9475         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9476         DeclSpace.
9477
9478 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9479
9480         Make semantics of PartialContainer simpler.
9481         * decl.cs (DeclSpace.IsPartial): Remove.
9482         * class.cs (TypeContainer.IsPartial): Likewise.
9483         (TypeContainer..ctor): Set PartialContainer to point to self.
9484         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9485         (TypeContainer.FindNestedType): Likewise.
9486         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9487
9488 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9489
9490         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9491
9492 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9493
9494         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9495         classes.
9496
9497 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9498
9499         * class.cs (Operator.Define): An error for base conversion was not
9500         reported correctly.
9501
9502 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9503
9504         * iterator.cs : yield break is allowed in try statement which has
9505           catch clauses. Fixed bug #77767.
9506
9507 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9508
9509         A fix for #77593, #77574.
9510
9511         * class.cs (MethodCore.CheckBase): Another if for operator.
9512
9513 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9514
9515         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9516         were not resolved
9517
9518         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9519         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9520         conversion test.
9521         
9522         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9523         not needed.
9524
9525         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9526         Updated after another emitcontext usage was clean up. It should help us to
9527         synchronize with gmcs easier.
9528
9529 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9530
9531         A fix for #77353.
9532
9533         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9534         (Event.Define): ditto
9535         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9536
9537         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9538         Removed redundant code and set NewSlot for Invoke method too.
9539
9540         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9541         (Parameters.MergeGenerated): New method. Use this method when you merge
9542         compiler generated argument with user arguments.
9543
9544 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9545
9546         * attribute.cs (ResolveAsTypeTerminal): Removed.
9547
9548         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9549         specialization for predefined types; 30% speed up.
9550         Finally placed obsolete check to right place.
9551         (Expression.ResolveType): Removed.
9552
9553         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9554         Updated after ResolveType was removed.
9555
9556         * expression.cs (Cast.ctor): Check void cast.
9557         (Binary.ResolveAsTypeTerminal): Is never type.
9558         (Conditional.ResolveAsTypeTerminal): Is never type.
9559
9560         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9561
9562 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9563
9564         Fix #77679.
9565         * expression.cs (ParameterReference.DoResolveBase): Change return
9566         type to bool.
9567         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9568         Update.
9569
9570         Fix #77628.
9571         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9572
9573         Fix #77642.
9574         * typemanager.cs (GetFullNameSignature): Don't nullref on
9575         protected accessors.
9576
9577 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9578
9579         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9580         these two separated members to simplify the code.
9581         (Attribute.Resolve): Refactored to use new fields and methods.
9582         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9583         implemented obsolete attribute checking.
9584         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9585         implemented obsolete checking again. It look line never ending quest ;-)
9586         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9587
9588         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9589
9590         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9591
9592         *class.cs (Property.Define): Add RegisterProperty call.
9593
9594         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9595         argument groups (only 2).
9596
9597         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9598         encoding expression to arguments.
9599         (Expression.ExprClassToResolveFlags): Just turned to property.
9600
9601         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9602         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9603         optimized as well as implemented support for zero-length attributes.
9604
9605         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9606         Add caching of PropertyInfo's.
9607
9608 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9609
9610         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9611         error multiple times.
9612
9613 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9614
9615         New partial class implementation.
9616         A fix for #77027, #77029, #77403
9617
9618         * attribute.cs (Attributable): Made attributes protected.
9619
9620         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9621         the replacements of ClassPart and PartialContainer.
9622         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9623         (TypeContainer.AddInterface): Ditto.
9624         (TypeContainer.AddPartial): The main method for partial classes. It checks
9625         for errors and merges ModFlags and attributes. At the end class is added to
9626         partial_parts list.
9627         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9628         required here.
9629         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9630         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9631         from the rest of partial classes.
9632         (TypeContainer.GetClassBases): Simplified.
9633         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9634         DefineType.
9635         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9636         (TypeContainer.HasExplicitLayout): Uses Flags now.
9637         (PartialContainer): Removed.
9638         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9639         (StaticClass): Was merged with Class.
9640         (Class.GetClassBases): class and static class bases are verified here.
9641         (Class.TypeAttr): Added static attributes when class is static.
9642         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9643         (MemberBase): In some cases we need to call parent container for partial
9644         class. It should be eliminated but it's not easy now.
9645
9646         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9647
9648         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9649         partial classed to accumulate class comments.
9650         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9651
9652         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9653
9654         * driver.cs (MainDriver): Tree.GetDecl was removed.
9655
9656         * modifiers.cs (Modifiers): Add partial modifier.
9657
9658         * tree.cs (Tree.decl): Removed.
9659         (RootTypes): Started to use this class more often for root types
9660         specializations.
9661
9662 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9663
9664         A fix for #77615
9665
9666         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9667         external interface does not have an attribute.
9668
9669 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9670
9671         Another prerequisites for new partial classs implementation.
9672         
9673         * attribute.cs (Attribute.Equal): Implemented.
9674         (Attribute.Emit): Changed as attributes can be applied more than twice.
9675         (Attributes.Emit): Check for duplicate attributes here.
9676
9677         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9678         as a parameter, clean-up.
9679
9680 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9681
9682         A fix for #77485
9683
9684         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9685         contains obsolete attribute check which can in some cases look for base
9686         type of current class which is not initialized yet.
9687         (TypeContainer.BaseType): Replacement of ptype.
9688
9689         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9690
9691 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9692
9693         First of prerequisites for new partial classs implemention.
9694         
9695         * attribute.cs (Attributable): Extended by ResolveContext;
9696         Attributes finally have correct context for resolving in all cases.
9697         (AttachTo): Attribute owner is assigned here.
9698
9699         * codegen.cs (IResolveContext): Introduce new interface to hold
9700         all information needed in resolving phase.
9701         (EmitContext): Implements IResolveContext; more clean-up needed here.
9702         
9703         * decl.cs (MemberCore): Implemented IResolveContext.
9704
9705         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9706         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9707         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9708         Refactored to use new IResolveContext instead of EmitContext; cleanup
9709
9710 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9711
9712         * codegen.cs (EmitScopeInitFromBlock): check here the
9713         capture_context, there is no need to make two calls to the
9714         EmitContext. 
9715
9716         * anonymous.cs: Add some debugging messages that might help me
9717         track other instances of this problem in the future (the
9718         regression of test 467).
9719
9720         * cs-parser.jay: track the variable block, as we need to initalize
9721         any captured variables declared in this block for the "catch"
9722         portion of the "Try" statement.
9723
9724         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9725         scope initialization for captured variables. 
9726
9727         Also, move the emit for the variables after the block location has
9728         been marked.
9729
9730 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9731
9732         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9733
9734 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9735
9736         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9737         commit yesterday, the initialization for the roots is necessary.
9738         What is not necessary is the scope activation.
9739
9740 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9741
9742         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9743         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9744         CS0206 checks.
9745         (Argument.Resolve): Remove CS0206 checks.
9746
9747 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9748
9749         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9750         scopes for all the roots, the scopes will now be emitted when the
9751         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9752
9753         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9754         code.  This reduces a lot of existing cruft.
9755         
9756         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9757         that the ScopeInfo is generated as we enter the scope, not at the
9758         time of use, which is what we used to do before.
9759
9760         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9761         every time a Block is about to be emitted if we have a
9762         CaptureContext. 
9763
9764 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9765
9766         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9767         (Reset): Update.
9768         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9769
9770         * typemanager.cs (cons_param_array_attribute): Make private.
9771         (Reset): Set it to null.
9772         (InitCoreHelpers): Don't initialize it.
9773         (ConsParamArrayAttribute): New.  Initialize it as needed.
9774         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9775
9776 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9777
9778         * expression.cs: There might be errors reported during the
9779         selection of applicable methods.  If there are errors, do not
9780         continue execution as it will lead the compiler to crash.
9781
9782 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9783
9784         * expression.cs: Member access is not allowed on anonymous
9785         methods.  Fixes #77402.
9786
9787 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9788
9789         Fix #77401
9790         * cs-parser.jay (VariableDeclaration): Don't set
9791         current_array_type to null.
9792         (field_declaration, event_declaration, declaration_statement):
9793         Set it to null here.
9794
9795 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9796
9797         * typemanager.cs (GenericParameterPosition): New.
9798         * doc.cs: Use it.
9799
9800 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9801
9802         * doc.cs : To process "include" elements, first we should create
9803           another list than XmlNodeList, because it could result in node
9804           removal, which could result in that the XmlNodeList gives up
9805           yielding next node.
9806
9807           (Also made code identical to gmcs again.)
9808
9809 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9810
9811         * ecore.cs: Introduce an error report that we were not catching
9812         before, if not silent, we must report the error.  Gonzalo ran into
9813         it.
9814
9815 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9816
9817         A fix for bug: #76957
9818         
9819         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9820         ComputeMethodHost before creating the method, this is a new
9821         requirement. 
9822
9823         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9824         that this method references (RegisterScope).  The actual scope
9825         where the method is hosted is computed with the ComputeMethodHost
9826         before we create the method.
9827
9828         Moved the Deepest routine here.
9829
9830         (AnonymousContainer.ComputeMethodHost): New routine used to
9831         compute the proper ScopeInfo that will host the anonymous method.
9832
9833         (ScopeInfo): Deal with multiple roots.  The problem was that we
9834         did not have a unique root where all ScopeInfos could be hanged
9835         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9836         of roots.  
9837
9838         Remove AdjustMethodScope which is now computed at the end.  Remove
9839         LinkScope which did a partial link, instead link all ScopeInfos
9840         before code generation from the new "LinkScopes" routine. 
9841
9842         Simplify all the Add* routines as they no longer need to maintain
9843         the tree, they just need to record that they are using variables
9844         from a ScopeInfo.
9845
9846         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9847         routines to produce the forest of ScopeInfo trees.
9848
9849         * class.cs (TypeContainer.AppendMethod): This is just like
9850         AddMethod, but ensures that an interface implementation method
9851         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9852         methods, but at the end.
9853
9854         We use this functionality to ensure that the generated MoveNext
9855         method in the iterator class is resolved/emitted before the
9856         enumerator methods created.   
9857
9858         This is required because the MoveNext method computes the right
9859         ScopeInfo for the method.  And the other methods will eventually
9860         need to resolve and fetch information computed from the anonymous
9861         method. 
9862
9863 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9864             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9865
9866         Fix rest of #76995.
9867         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9868         the 'aliases' hash.
9869         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9870         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9871
9872 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9873
9874         Fix #76656, cs0231-2.cs.
9875         * cs-parser.jay (formal_parameter_list): Make error case catch
9876         more issues.
9877         (parenthesized_expression_0): Add CS1026 check.
9878         (invocation_expression): Remove unused { $$ = lexer.Location }.
9879
9880 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9881
9882         Fix #76824.
9883         * cs-parser.jay (statement_expression): Don't list out the
9884         individual statement-expressions.  Convert syntax error into
9885         CS0201 check.
9886
9887 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9888
9889         Fix #76874.
9890         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9891         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9892         CheckIntermediateModification.
9893         (FieldExpr.DoResolve): Add new two-argument version that
9894         allows us to resolve the InstanceExpression as an lvalue.
9895         The one-argument variant is now just a wrapper.
9896         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9897         Resolve the lhs as an lvalue if the it has a value type.
9898         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9899         from Assign.DoResolve.
9900         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9901         resolved as an lvalue.
9902         (PropertyExpr.DoResolve): Update.
9903         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9904         has a value type.  Move CS1612 check here from
9905         CheckIntermediateModification.
9906         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9907         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9908         'right_side' of a ResolveLValue on an 'out' argument.
9909         (EmptyExpression.LValueMemberAccess): New.  Used as the
9910         'right_side' of a propagated ResolveLValue on a value type.
9911         (LocalVariableReference.DoResolveBase): Recognize
9912         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9913         Add CS1654 check.
9914         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9915         EmptyExpression.Null.
9916
9917 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9918
9919         * typemanager.cs : added IsGenericParameter(). In mcs it always
9920           return false.
9921         * doc.cs : for generic parameters, use GenericParameterPosition,
9922           not FullName.
9923
9924 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9925
9926         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9927
9928 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9929
9930         This fixes the problem where we used ldfld instead of ldflda to
9931         load the "THIS" pointer on captured parameters, when THIS is a
9932         value type.  See bug #77205.
9933         
9934         * iterators.cs (CapturedThisReference.Emit): Pass false to
9935         EmitThis (we do not need the address).
9936
9937         * codegen.cs (EmitThis): it needs to know whether we need the
9938         address of `this' or not.  This is used by value types.  
9939
9940         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9941         every other call passes false.
9942
9943 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9944
9945         Fix #77221.
9946         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9947         GetOverride.
9948         * expression.cs (Invocation.OverloadResolve): Update.
9949         (Invocation.DoResolve): Avoid double resolution of invocation.
9950
9951 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9952
9953         Fix #77180.
9954         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9955         unary negation of floating point types as 0-expr; negation cannot
9956         overflow in floating point types.
9957
9958         Fix #77204.
9959         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9960         on operands of 'void' type.
9961
9962         Fix #77200.
9963         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9964         and ExclusiveOr for boolean constants too.
9965
9966 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9967
9968         Fix #75636.
9969         * expression.cs (Invocation.OverloadResolve): Replace reflected
9970         override methods with their base virtual methods, rather than
9971         skipping over them.
9972         * typemanager.cs (TypeManager.GetOverride): New.
9973
9974 2006-01-05  Jb Evain  <jbevain@gmail.com>
9975
9976         * class.cs (Property.Define, Indexer.Define): do not tag the
9977         properties as SpecialName | RTSpecialName.
9978
9979 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9980
9981         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9982         doing a low-level comparission of parameter types.  It was lacking
9983         a check for __argslist. 
9984
9985 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9986
9987         * expression.cs (ParameterReference.DoResolveBase): Allow
9988         reference parameters if they are local to this block. 
9989
9990         This allows the ref and out parameters of a delegate to be used in
9991         an anonymous method, for example:
9992
9993         delegate void set (out int x);
9994
9995         set s = delegate (out int x){
9996                 x = 0;
9997         };
9998
9999         This is used by functionality introduced late in the C# language.
10000         
10001         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10002         method that take ref and out parameters. 
10003
10004         Fixes #77119 which was a late change in the spec.
10005
10006 2005-12-23  Miguel de Icaza  <miguel@novell.com>
10007
10008         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10009         parent if its the same scope.  Fixes #77060.
10010
10011 2005-12-21  Miguel de Icaza  <miguel@novell.com>
10012
10013         * driver.cs: Report the case of no source files and no -out:
10014         argument provided.
10015
10016 2005-12-20  Raja R Harinath  <rharinath@novell.com>
10017
10018         Fix #77035.
10019         * expression.cs (ComposedCast.GetSignatureForError): Define.
10020
10021 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10022
10023         Fix #76995
10024
10025         * namespace.cs (NamespaceEntry): Add extern_aliases as a
10026         ListDictionary, to contain the ExternAliasEntry entries (in
10027         addition to the NamespaceEntry.aliases hashtable). This field is
10028         shared between the original entry and its doppelganger (bodyless 
10029         copy of it).
10030         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10031         extern_aliases field.
10032         (NamespaceEntry.Lookup): Move the IsImplicit check after the
10033         lookup in extern_aliases.
10034
10035 2005-12-16  Raja R Harinath  <rharinath@novell.com>
10036
10037         Fix #77006.
10038         * class.cs (TypeContainer.Mark_HasEquals): New.
10039         (TypeContainer.Mark_HasGetHashCode): New.
10040         (ClassPart): Override them.
10041         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
10042
10043         Fix #77008.
10044         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
10045         'parent' argument to the base constructor.
10046
10047         Remove all mention of TypeContainer from decl.cs.
10048         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
10049         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
10050         (DeclSpace.DeclSpace): Likewise.
10051         (DeclSpace.DefineMembers): Remove unused argument.
10052         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
10053         debugging check -- we don't care if the debug code throws an
10054         InvalidCastException instead of an InternalErrorException.
10055         * class.cs (TypeContainer.DefineMembers): Update to changes.
10056         (TypeContainer.DoDefineMembers): Likewise.
10057         (TypeContainer.GetMethods): Likewise.
10058         (PropertyMember.Define): Likewise.
10059         (MemberBase.Parent): New property that forwards to
10060         MemberCore.Parent, but ensures that we get a TypeContainer.
10061         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
10062         (RootContext.PopulateTypes): Likewise.  Remove special case code
10063         for !RootContext.StdLib: DefineMembers is idempotent.
10064
10065 2005-12-14  Miguel de Icaza  <miguel@novell.com>
10066
10067         * convert.cs (ExplicitConversionCore): Check the return value from
10068         ExplicitConversionCore which can return null on failure.  Fixes #76914
10069
10070 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
10071
10072         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
10073
10074 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
10075
10076         * doc.cs : The search for referenced namespace was insufficient to
10077           get global one as it used to do. Fixed bug #76965.
10078
10079 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
10080
10081         * doc.cs : check name in cref in the last phase that whether it is
10082           namespace or not.
10083
10084 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10085
10086         * cs-tokenizer.cs : reverted the latest change: it somehow broke
10087           Mono.C5.
10088
10089 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10090
10091         * doc.cs : so it turned out that we cannot skip override check for 
10092           interface members. Fixed bug #76954.
10093
10094 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
10095
10096         * cs-tokenizer.cs : fixed bug #75984:
10097           - #warning and #error should not be handled when the source line
10098             is disabled.
10099           - #line is not checked strictly when the source line is disabled.
10100           - #define and #undef is on the other hand checked strictly at any
10101             state.
10102
10103 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
10104
10105         * cs-tokenizer.cs : missing Location (actually, filename) in one of
10106           CS1027 report.
10107
10108 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10109
10110         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
10111
10112         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
10113         event initializers.
10114         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
10115         (FieldBase.Initializer): Initializer is now optional.
10116         (EventField.Define): Only event field can have initializer.
10117
10118         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
10119
10120         * const.cs (Const): Reuse initializer.
10121
10122         * cs-parser.jay: Updated after FieldBase changes.
10123         Added current_array_type to simplify array initializers.
10124
10125         * ecore.cs (NullCast.IsDefaultValue): Implemented.
10126
10127         * expression.cs, iterators.cs: Updated.
10128
10129         * namespace.cs (NamespaceEntry): Made UsingFound private.
10130
10131 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10132
10133         * parameterCollection.cs: Obsolete, removed.
10134         * parser.cs: Obsolete, removed.
10135
10136 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
10137
10138         Fix #76849.
10139         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
10140
10141         * enum.cs (Enum.Define): Set obsolete context here.
10142
10143 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10144
10145         * doc.cs :
10146           - FindDocumentedMember() now expects 1) paramList as null
10147             when "we don't have to check the number of parameters" and
10148             2) Type.EmptyTypes when "there is no arguments".
10149           - Introduced FoundMember struct to hold the exact type which was
10150             used to find the documented member (the above change broke
10151             test-xml-044; it might be better just to use DeclaringType than
10152             what MS does, like this change does, but it depends on usage.)
10153
10154 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
10155
10156         * doc.cs : documented member might be from DeclaringType for nested
10157           types. Fixed bug #76782.
10158
10159 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
10160
10161         * anonymous.cs: Have the param code handle leaving copies on the
10162         stack etc. Allows anonymous params to take part in the assignment
10163         code (++, +=, etc). Fixes bug #76550
10164
10165         * expression.cs: Handle the prepare_for_load/leave_copy by passing
10166         it down to the anon code.
10167
10168         * iterators.cs: Use dummy var here
10169
10170         * codegen.cs: Handle new vars
10171
10172 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10173
10174         Fix #76849.
10175         * class.cs (MethodData.Define): Set proper Obsolete context.
10176
10177         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
10178         obsolete context.
10179         (FieldExpr.DoResolve): Ditto.
10180
10181 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
10182
10183         Fix #76849.
10184         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
10185         parent is not obsolete.
10186
10187 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
10188
10189         * doc.cs : (FindDocumentedMember) find parameterless members first
10190           and get CS0419 in the early stage. Fixed first case of bug #76727.
10191
10192 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
10193
10194         Fix #76859.
10195         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
10196         no error was reported.
10197
10198         *expression.cs (Binary.DoResolve): left can be null.
10199
10200 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
10201
10202         Fix #76783.
10203         * class.cs (MethodData.Emit): Parameters should be labeled first.
10204
10205 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
10206
10207         Fix #76761.
10208         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
10209
10210 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
10211
10212         * attribute.cs (AreParametersCompliant): Moved to Parameter.
10213
10214         * class.cs (MethodCore): Parameter clean up.
10215         (IMethodData): Added ParameterInfo.
10216         (MethodData): Parameter clean up.
10217         (Indexer.Define): Parameter clean up.
10218
10219         * anonymous.cs,
10220         * codegen.cs,
10221         * cs-parser.jay,
10222         * decl.cs,
10223         * doc.cs,
10224         * ecore.cs,
10225         * flowanalysis.cs,
10226         * iterators.cs,
10227         * pending.cs,
10228         * statement.cs,
10229         * typemanager.cs: Parameter clean up.
10230
10231         * delegate.cs (Define): Get rid of duplicated code.
10232
10233         * expression.cs (ParameterReference): Removed useless parameters
10234         and simplified.
10235         (Invocation): Ditto.
10236
10237         * parameter.cs (ParamsParameter): New class, params specialization.
10238         (ArglistParameter): Attemp to separate arglist.
10239         (Parameter): Refactored to be reusable and faster.
10240         (Parameter.Modifier): Made understandable.
10241         (Parameters): Changed to be used as a class for `this' assembly
10242         parameters. Refactored to use new specialized classes.
10243
10244         * support.cs (ParameterData): Added Types property.
10245         (InternalParameters): Deleted.
10246
10247 2005-08-20  Martin Baulig  <martin@ximian.com>
10248
10249         Merging this patch from GMCS to fix #75867.
10250
10251         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10252         scope if we don't already have it.
10253
10254 2005-11-17  Martin Baulig  <martin@ximian.com>
10255
10256         * anonymous.cs
10257         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10258         inherit the scope from our parent.  Fixes #76653.
10259
10260 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10261
10262         * doc.cs : the previous patch does not actually fix the bug.
10263           PropertyInfo override check is now implemented and really fixed it.
10264         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
10265
10266 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10267
10268         * doc.cs : apply "override filter" also to properties.
10269           Fixed bug #76730.
10270
10271 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
10272
10273         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
10274           no need to check overrides. For classes, omit those results from 
10275           interfaces since they must exist in the class. Fixed bug #76726.
10276
10277 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10278
10279         * typemanager.cs : (GetFullNameSignature) differentiate indexers
10280           with different parameters. Fixed the second problem in #76685.
10281
10282 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10283
10284         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
10285           get expected 'protected' access in CheckValidFamilyAccess()).
10286           Fixed bug #76692.
10287
10288 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
10289
10290         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
10291           Fixed bug #76705.  CS1569 was incorrectly commented out.
10292
10293 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10294
10295         * doc.cs : use Invocation.IsOverride() to do real override check.
10296         * expression.cs : made Invocation.IsOverride() internal.
10297
10298 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10299
10300         * doc.cs : use TypeManager.FindMembers() instead of (possible)
10301           TypeBuilder.FindMembers() and filter overriden base members out.
10302           Fixed bug #76990.
10303
10304 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10305
10306         * doc.cs : ref/out parameters are represented as '@' (instead of
10307           '&' in type FullName). Fixed bug #76630 (additionally crefs).
10308
10309 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10310
10311         * doc.cs : when there was no '.' in cref to methods in doc comment,
10312           then parameters were missing in the output. Fixed bug #76691.
10313
10314 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10315
10316         * driver.cs : don't output docs when there is an error.
10317           Fixed bug #76693.
10318
10319 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10320
10321         * doc.cs :
10322           Now it should detect indexers. Fixed primary concern in bug #76685.
10323           Fixed CS0419 message to not show the identical member signature in
10324           the message.
10325
10326 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10327
10328         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10329           instead of Type.FindMembers() since it does not handle events.
10330           Fixed bug #71604.
10331
10332 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
10333
10334         * codegen.cs: Fixed typo (speficied -> specified).
10335
10336 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10337
10338         Fix #76369.
10339         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10340
10341 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10342
10343         * attribute.cs: Changed error message.
10344
10345         * cs-tokenizer.cs: One more check.
10346
10347 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10348
10349         * statement.cs (Block.Resolve): Ignore empty statement.
10350
10351 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10352
10353         * report.cs: Made error/warning methods more strict to avoid
10354         their misuse.
10355
10356         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10357         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10358         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10359         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10360
10361 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
10362
10363         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10364         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10365
10366         * class.cs (TypeContainer.IsComImport): New property.
10367         (Constructor.Define): Create proper ctor for ComImport types.
10368
10369         * expression.cs (New.CheckComImport): Fixed.
10370
10371 2005-11-07  Miguel de Icaza  <miguel@novell.com>
10372
10373         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10374         that a parameter has been captured does not mean that we do not
10375         have to do the rest of the processing.  This fixes the second part
10376         of #76592.  If there was another anonymous method capturing
10377         values in the past, the Scope would never be set for the second
10378         method that captured the same parameter.
10379
10380         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10381         properly manipulate the stack.   Second part of fix for #76592.
10382
10383         * expression.cs (New): Add support for invoking "new" on
10384         interfaces that have been flagged with the ComImport attribute and
10385         the CoClass.  Fixes #76637 
10386
10387         * statement.cs (Try.DoEmit): When a variable is captured, do not
10388         try to emit the vi.LocalBuilder variable as it has been captured.
10389         Create a temporary variable and store the results on the
10390         FieldBuilder.  Fixes #76642
10391
10392 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
10393
10394         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10395
10396         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10397
10398         * expression.cs (Binary.DoResolve): Added && optimalization.
10399     
10400         * typemanager.cs (AddUserType): Removed useless argument.
10401
10402 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
10403
10404         * statement.cs (Block.variables): Uses ListDictionary.
10405
10406 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10407
10408         Fix #75969.
10409         * class.cs (PartialContainer.EmitType): Customized to emit
10410         security attributes.
10411         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10412         for partial classes.
10413
10414 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10415
10416         Fix #76599.
10417         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10418         access has to be fixed.
10419         
10420         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10421
10422 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10423
10424         Fix #76590.
10425         * ecore.cs (NullCast.Reduce): Implemented.
10426
10427         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10428         constant type.
10429         
10430         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10431         properly.
10432         (Foreach.Resolve): Catch null properly.
10433
10434 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10435  
10436         * cs-tokenizer.cs: Warning text fix.
10437
10438         * driver.cs: AllWarningNumbers exposed on public interface.
10439
10440         * report.cs (): Reviewed warning numbers.
10441         (IsValidWarning): Use binary search.
10442
10443 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10444  
10445         * driver.cs: Implemeted resource visibility.
10446         (Resources): New class for code sharing between /res: and
10447         /linkres:
10448  
10449 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10450
10451         Fix #76568.
10452         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10453         folding.
10454         
10455         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10456         contants only.
10457         
10458         * ecore.cs (NullCast): Child is contant only.
10459         
10460         * literal.cs (NullLiteral.Reduce): null can be converted to any
10461         reference type.
10462
10463 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10464
10465         * driver.cs: Use Encoding.Default as default code page instead
10466           of ISO-28591.
10467
10468 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10469
10470         Fix #76085.
10471         * expression.cs (Invocation.Error_InvalidArguments): Handle
10472         __arglist parameters.
10473         (Invocation.VerifyArgumentsCompat): Likewise.
10474         * support.cs (ReflectionParameters.GetSignatureForError): Print
10475         __arglist parameters.
10476         (InternalParamters.GetSignatureForError): Likewise.
10477         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10478
10479 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10480
10481         * attribute.cs (GetPropertyValue): Made public.
10482
10483         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10484         Resolve.
10485         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10486         attribute.
10487         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10488         is not defined.
10489         
10490         * driver.cs: Reflect method name change.
10491         
10492         * statement.cs (Try.Resolve): Warn when try has both general
10493         exception handlers.
10494         
10495         * typemanager.cs: runtime_compatibility_attr_type new predefined
10496         type.
10497
10498 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10499
10500         Fix #76419.
10501         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10502         treat it as an empty parameter list.
10503
10504 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10505
10506         Fix #76271.     
10507         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10508         ResolveAsTypeStep silent.
10509         * statement.cs (Block.AddConstant): Mark block as used.
10510         (Block.ResolveMeta): Avoid piling on error messages
10511         if a constant initializer resolution fails.
10512
10513 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10514
10515         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10516         Remove.
10517         (NamespaceEntry.VerifyAllUsing): New.
10518         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10519         behaviour.  Delegates actual resolution of alias to ...
10520         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10521         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10522         Update.
10523         * driver.cs (Driver.MainDriver): Update.
10524         
10525         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10526         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10527         property.
10528         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10529         Remove.
10530         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10531         RootNamespace.DefineNamespacesForAll.
10532
10533 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10534
10535         * typemanager.cs (assemblies, external_aliases, modules)
10536         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10537         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10538         overhead.  Move resposibility ...
10539         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10540         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10541
10542 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10543
10544         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10545         cached_namespaces.  Improve usage.
10546         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10547         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10548         Move from GlobalRootNamespace and simplify.
10549         (RootNamespace.Global): Make instance variable.
10550         (RootNamespace.RootNamespace): Add "alias name" parameter.
10551         (GlobalRootNamespace): Simplify drastically.
10552         (Namespace.Lookup): Don't use GetNamespace.
10553         * typemanager.cs (GetRootNamespace): Rename from
10554         ComputeNamespaceForAlias.
10555         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10556
10557 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10558
10559         * anonymous.cs (AnonymousContainer): Don't crash when container
10560         doesn't exist.
10561
10562 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10563
10564         * expression.cs (Binary.DoResolve): Warn when comparing same
10565         values.
10566
10567 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10568
10569         Fix #76486.
10570         * expression.cs (Binary.DoResolve): It looks like there are no
10571         convetsion rules in enum context.
10572
10573 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10574
10575         Add support for extern alias qualifiers.
10576         * typemanager.cs: Move some LookupTypeReflection code
10577         to namespace.cs, to have cleaner code. Added some methods
10578         to help us keep track of the extern aliased references.
10579         * driver.cs: Add suport for extern alias assemblies on command
10580         line and check for their warnings/errors. Also keep track of the
10581         extern aliased assemblies.
10582         * namespace.cs: Move the global functionality of Namespace
10583         to GlobalRootNamespace/RootNamespace. Now the global namespace
10584         is GlobalRootNamespace.Globa. Also the code moved from 
10585         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10586         Finally added LocalAliasEntry (AliasEntry before) and
10587         ExternAliasEntry, to handle alias statements.
10588         * cs-parser.jay: Add support in the grammar for extern alias
10589         statement.
10590         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10591         Update callings to Namespace (now in GlobalRootNamespace).
10592
10593 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10594
10595         Fix #76371.
10596         * class.cs (TypeContainer.DefineType): Move updating of
10597         topological sort earlier in the code.
10598         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10599
10600 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10601
10602         Fix #76273.
10603         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10604         
10605         * constant.cs (Constant.TryReduce): Moved from Cast class.
10606         (Reduce): Made little bit more OO and fixed missing conversions.
10607         
10608         * ecore.cs (Reduce): Implemented.
10609         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10610         
10611         * literal.cs (Reduce): Implemented.
10612         
10613         * class.cs: Reverted Miguel's wrong commit.
10614
10615 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10616
10617         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10618
10619 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10620
10621         * cs-parser.jay, expression.cs : CS0214 was missing error location
10622           for constants. Fixed bug #76404.
10623
10624 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10625
10626         Fix #76370.
10627         * convert.cs (ExplicitConversionCore): Fixed object->enum
10628         conversion.
10629
10630 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10631
10632         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10633         InstanceExpression.
10634         (PropertyExpr.EmitCall): Likewise.
10635         * expression.cs (Invocation.EmitArguments): Handle case where
10636         arguments == null.
10637         (Invocation.EmitCall): Avoid allocating temporary variable if
10638         there are no arguments.
10639
10640 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10641
10642         Fix #76323.
10643         * convert.cs (ImplicitConversionStandard): Move conversion of
10644         void* to arbitrary pointer types ...
10645         (ExplicitConversionStandard): .. here.
10646         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10647         error to always print typenames.
10648
10649 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10650
10651         * convert.cs (GetConversionOperator): Rename from
10652         GetConversionOperators.  Move operator selection code from ...
10653         (UserDefinedConversion): ... here.
10654
10655 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10656
10657         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10658         conversion.
10659
10660 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10661
10662         * assign.cs (Assign.DoResolve): Error method changed.
10663
10664         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10665         
10666         * const.cs (ResolveValue): Reset in_transit immediately.
10667         
10668         * constant.cs: Error method changed.
10669         
10670         * convert.cs: Removed useless location parameter.
10671         (ExplicitNumericConversion): Don't do double enum check.
10672         (ExplicitConversionCore): Renamed from ExplicitConversion.
10673         (ExplicitUnsafe): Extracted from ExplicitConversion.
10674         (ExplicitConversion): Uses for error reporting.
10675         
10676         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10677         error messages.
10678         (ResolveBoolean): Uses common error method.
10679         (CastToDecimal): Get rid of ec.
10680         (CastFromDecimal): Optimized.
10681         (ConvCast): Get rid of ec.
10682         
10683         * enum.cs (ResolveValue): Reset in_transit immediately.
10684         (Emit): Return after first error.
10685         
10686         * expression.cs: Convert changes.
10687         
10688         * literal.cs: Error method changed.
10689         
10690         * statement.cs: Error method changed.
10691
10692 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10693
10694         * support.cs (SeekableStreamReader.Position): Don't error out when
10695         the requested position is just beyond the end of the current
10696         buffered data.
10697
10698 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10699
10700         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10701         try to keep in sync with the byte count of the underlying Stream.
10702         However, this limits us to a window size of 2048 characters: i.e.,
10703         the maximum lookahead of our lexer/parser can be 2048 characters.
10704
10705 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10706
10707         Fix #76255.
10708         * driver.cs: Fix compilation files with full root path.
10709
10710 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10711
10712         * report.cs (SymbolRelatedToPreviousError): Format the output so
10713         it does not use an open parenthesis that is never closed. 
10714
10715         * driver.cs: Follow coding guidelines
10716
10717 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10718
10719         Fix #72930.
10720         * const.cs (Const.ResolveValue): Check for assigning non-null
10721         value to reference type.
10722
10723 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10724
10725         * anonymous.cs: Implemented ExprClassName.
10726         
10727         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10728         delegate.
10729         
10730         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10731         check.
10732         
10733         * class.cs (StaticClass.DefineContainerMembers): Report protected
10734         members as error.
10735         
10736         * codegen.cs: if(ed) PRODUCTION.
10737         
10738         * convert.cs (Error_CannotImplicitConversion): Better error
10739         distinction.
10740         
10741         * cs-parser.jay: More error checks.
10742         
10743         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10744         
10745         * driver.cs (CSCParseOption): Enabled wrong option check.
10746         
10747         * ecore.cs (Expression.ExprClassName): Turned to property.
10748         (MemberExpr.CheckIntermediateModification): For checking boxed
10749         value types     modification.
10750         
10751         * statement.cs (Fixed.Resolve): Expression type must be
10752         convertible to fixed type.
10753         (CollectionForeach.GetEnumeratorFilter,TryType):
10754         Small refactoring for easier error checking.
10755
10756 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10757
10758         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10759         attributes.
10760         
10761         * class.cs (GeneratedBaseInitializer): New class for customization
10762         compiler generated initializers.
10763         (MemberBase.DoDefine): Check Obsolete attribute here.
10764         (FieldMember.DoDefine): Ditto.
10765         
10766         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10767         constants.
10768         
10769         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10770         (MemberCore.GetObsoleteAttribute): Removed argument.
10771         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10772         (MemberCore.CheckObsoleteType): New helper.
10773         
10774         * delegate.cs,
10775         * enum.cs,
10776         * statement.cs: Updates after MemberCore changes.
10777         
10778         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10779         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10780         
10781         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10782         obsolete attribute for compiler construct.
10783         (As.DoResolve): Cache result.
10784         
10785         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10786
10787 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10788
10789         Fix #76133.
10790         * expression.cs (This.VerifyFixed): In a value type T, the type of
10791         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10792         value type R, 'this' is treated as a value parameter.
10793
10794 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10795
10796         * statement.cs (Lock): Use the TemporaryVariable class instead of
10797         manually using local variables as those do not work when variables
10798         are captured.
10799
10800         * ecore.cs: Moved the TemporaryVariable class from being a nested
10801         class inside Foreach to be a public class that can be employed in
10802         other places. 
10803
10804 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10805
10806         * cs-parser.jay: interface_accessors replaced by
10807         accessor_declarations.
10808
10809         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10810         location.
10811         
10812         * statement.cs (GotoCase.Resolve): Convert null constant to
10813         null case.
10814         (SwitchLabel.ResolveAndReduce): Ditto.
10815         (SwitchLabel.NullStringCase): Custom null stamp.
10816         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10817         
10818         typemanager.cs (CSharpSignature): Don't skip first argument
10819         for full names.
10820
10821 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10822
10823         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10824
10825         * location.cs (InEmacs): in this mode, do not report column
10826         location as it confuses Emacs.
10827
10828 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10829
10830         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10831         expression.cs, iterators.cs, literal.cs: Store constants and
10832         literals location.
10833         
10834         * class.cs (MemberBase.ShortName): Pass location.
10835         
10836         * cs-parser.jay: Some location fixes.
10837         
10838         * ecore.cs (Expression.Location): Made virtual.
10839
10840 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10841
10842         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10843         if the underlying types are the same, otherwise we need to produce
10844         code that will do the proper cast.
10845
10846         This was exposed by Marek's constant rewrite which produced
10847         invalid code for the call site:
10848
10849         enum X : long { a }
10850         void Method (X v) {}
10851
10852         Method ((X) 5)
10853
10854         This fixes test-49.cs
10855
10856 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10857
10858         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10859           Type/Object should be allowed as well. Fixed bug #75968.
10860
10861 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10862
10863         * expression.cs : (Binary.DoResolve): when one is enum constant and
10864           another is constant 0, then return enum one *as enum type*.
10865           Fixed bug 74846.
10866
10867 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10868
10869         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10870         internal.
10871
10872         Fix #75941.
10873         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10874         flow-branching for LocalVariableReferences in case we were invoked
10875         from a MemberAccess.
10876         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10877         Carved out of ...
10878         (LocalVariableReference.DoResolveBase): ... this.
10879         (MemberAccess.Resolve): Do the check that was disabled during
10880         SimpleNameResolve.
10881
10882 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10883
10884         * class.cs :
10885           (PartialContainer.Create): check abstract/sealed/static strictly
10886           but abstract/sealed can exist only at one side. Fixed bug #75883.
10887
10888 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10889
10890         Fix #75945.
10891         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10892         specified, don't default to UnmanagedType.I4.
10893
10894 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10895
10896         * expression.cs : conditional operator should check possibly
10897           incorrect assign expression. Fixed bug #75946.
10898
10899 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10900
10901         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10902           Reverting the change. gmcs is much complex than mcs on this matter.
10903
10904 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10905
10906         * cs-tokenizer.cs : To read another token ahead of the actual 
10907           consumption, use new SavedToken and cache token instead of moving
10908           back the stream with SeekableStreamReader (it seemed problematic).
10909         * cs-parser.jay,
10910           driver.cs : Thus use StreamReader directly.
10911         * support.cs : Thus removed SeekableStreamReader.
10912
10913 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10914
10915         Fix #75934.
10916         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10917         (ScopeInfo.EmitScopeType): Use it to construct field names from
10918         names of captured locals.
10919
10920         Fix #75929.
10921         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10922         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10923         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10924         (ExplicitConversion): Remove enum cases already handled by
10925         implicit conversion.  Move implicit conversion check to the beginning.
10926         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10927         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10928         Don't treat System.Enum as a struct.
10929
10930 2005-08-30  Jb Evain  <jbevain@gmail.com>
10931
10932         * attribute.cs: handles as expression in parameters.
10933
10934 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10935
10936         Fix #75802.
10937         * class.cs (TypeContainer.VerifyClsName): Don't use a
10938         PartialContainer when verifying CLS compliance.
10939         (AbstractPropertyEventMethod): Set Parent here, ...
10940         (PropertyMethod): ... not here.
10941
10942 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10943
10944         * attribute.cs : escaped attribute name should not be allowed to be
10945           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10946
10947 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10948
10949         Fix #75927.
10950         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10951         when converting a long constant to unsigned long.
10952         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10953         detect where IsApplicable and VerifyArgumentsCompat disagree.
10954
10955 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10956         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10957
10958         Fix #75848.
10959         * class.cs (TypeContainer.CanElideInitializer): New helper.
10960         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10961         can safely emitting the initializer of a field.
10962
10963 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10964
10965         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10966           allowed inside a switch (without loop). Fixed bug #75433.
10967
10968 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10969
10970         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10971         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10972
10973 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10974
10975         * driver.cs : kinda reverting the default encoding changes (not exact 
10976           revert since I noticed that "codepage:reset" might not work fine).
10977
10978 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10979
10980         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10981           Location. Now getter and setter store location correctly.
10982           (errors/cs0111-12.cs now reports the expected location.)
10983
10984 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10985
10986         * driver.cs : Use default encoding on the environment.
10987           Removed (now that) extra parameter for SeekableStreamReader.
10988         * support.cs : (SeekableStreamReader) third .ctor() argument for
10989           StreamReader is not required (always true). preamble size could
10990           be acquired in simpler and safe way.
10991
10992 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10993
10994         * cs-parser.jay: report CS0642 at warning level 3
10995           and report CS0642 for an if else statement also
10996           fixes bug #74745. Patch by John Luke (and a bit
10997           modified by me).
10998           Removed extra CS0642 warning check for "while",
10999           "for" and "fixed".
11000         * statement.cs: In Block.Resolve(), CS0642 check
11001           is reimplemented to check a sequence of an empty
11002           statement and a block.
11003
11004           Both fix bug #66777.
11005
11006 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
11007
11008         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11009         detection until I fix it.
11010         
11011         * cs-tokenizer.cs: Changed error message.
11012         
11013         * cs-parser.jay: Fixed 2 error locations.
11014         
11015         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11016         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11017         properties.
11018         
11019         * enum.cs (GetSignatureForError): Fixed.
11020         
11021         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11022         method detection.
11023         
11024         * class.cs,
11025         * typemanager.cs (RegisterProperty): Removed.
11026         
11027         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11028
11029 2005-08-24  Raja R Harinath  <rharinath@novell.com>
11030
11031         Fix #75874.
11032         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
11033         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
11034
11035 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11036
11037         * expression.cs : tiny fix is required for not warning positive ulong.
11038           See test-441.cs.
11039
11040 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11041
11042         * expression.cs : add CS0652 check for constant and integral
11043           expression. Fixed bug #53974.
11044
11045 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11046
11047         * expression.cs : in DoNumericPromotions(), check if there is implicit
11048           conversion overload for string (to check CS0034). Fixed bug #52492.
11049
11050 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11051
11052         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
11053
11054 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11055
11056         * ecore.cs : report location when it is *not* Null.
11057
11058 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
11059
11060         * codegen.cs,
11061           ecore.cs,
11062           flowanalysis.cs,
11063           expression.cs:
11064           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
11065           correctly. Fixed bug #75721.
11066
11067 2005-08-23  Raja R Harinath  <rharinath@novell.com>
11068
11069         * support.cs (SeekableStreamReader.Position): Avoid an expensive
11070         loop that performs 'min (pos, char_count)'.
11071
11072         Fix #75862.
11073         * expression.cs (Unary.ResolveOperator): Don't discard implicit
11074         converted value in Operator.OnesComplement.
11075
11076 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
11077
11078         * anonymous.cs: If the anon method is pulled into a helper class,
11079         it needs to be `internal' not `private'. Fixes runtime behavior on
11080         msft. bug #75704
11081
11082 2005-08-20  Martin Baulig  <martin@ximian.com>
11083
11084         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11085         scope if we don't already have it.
11086
11087         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
11088         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
11089         fixes #75867.
11090
11091 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
11092
11093         Fix #75803
11094         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
11095         is a partial class.
11096
11097 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
11098
11099         The big constants rewrite
11100         Fix #75746, #75685 and more
11101         As a side effect saved 1MB for MWF ;-)
11102         
11103         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
11104         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
11105         enum based for corlib compilation.
11106         
11107         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
11108         subtractions.
11109         
11110         * class.cs (FixedField.Define): Use ResolveAsConstant.
11111         
11112         * const.cs (IConstant): Interface constants and enums.
11113         (Const.ResolveValue): New method for constant resolvning.
11114         (ExternalConstant): Constants from imported assemblies.
11115         
11116         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
11117         conversion; like enums.
11118         (Constant.ToType): Converts this constant to different type.
11119         (Constant.Increment): Adds 1.
11120         
11121         * convert.cs (ImplicitConversionRequired): Simplified.
11122         
11123         * cs-parser.jay: Create EnumMember directly.
11124         
11125         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
11126         
11127         * doc.cs (GenerateEnumDocComment): Removed.
11128         
11129         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
11130         (ConvertIntLiteral): Removed.
11131         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
11132         
11133         * enum.cs (EnumMember): Implement IConstant.
11134         (Enum.IsValidEnumConstant): Removed.
11135         (Enum.GetNextDefaultValue): Removed.
11136         (Enum.FindMembers): Updated.
11137         (Enum.GenerateDocComment): Iterate enum members.
11138         
11139         * expression.cs (Cast.TryReduce): Handle enums correctly.
11140         (New.Constantify): Made public.
11141         (MemberAccess.DoResolve): Removed contant specific if(s).
11142         
11143         * literal.cs (NullLiteral): Implement new abstract methods.
11144         
11145         * statement.cs (GotoCase.Resolve): Use new constant methods.
11146         (SwitchLabel.ResolveAndReduce): Use new constant methods.
11147         
11148         * typemanager.cs (LookupEnum): Removed.
11149         (IsEnumType): Fixed to work with corlib.
11150         (RegisterConstant): Removed.
11151         (LookupConstant): Removed.
11152         (GetConstant): Changed to work with IConstant.
11153
11154 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
11155
11156         * location.cs : Fixed overflown (>255) column number.
11157
11158 2005-08-03  Raja R Harinath  <rharinath@novell.com>
11159
11160         First cut of the qualified-alias-member feature.
11161         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
11162         token.
11163         * cs-parser.jay (DOUBLE_COLON): New token.
11164         (namespace_or_type_name): Add rule for recognizing
11165         qualified-alias-members.
11166         (primary_expression): Likewise.
11167         (element_access): Allow QualifiedAliasMember as a possible
11168         type-bearing expression.
11169         (local_variable_type, local_variable_pointer_type): Likewise.
11170         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
11171         aliases in the current and enclosing namespace declarations.
11172         (NamespaceEntry.UsingAlias): Add CS0440 warning.
11173         * decl.cs (MemberName.is_double_colon): New.
11174         (MemberName.MemberName): Add new constructor for alias-member.
11175         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
11176         * expression.cs (QualifiedAliasMember): New expression type.
11177
11178 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11179
11180         * location.cs : it borked when no argument was specified.
11181
11182 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11183
11184         * location.cs : tiny ToString() format fix.
11185
11186 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11187
11188         * statement.cs : oops, it was missing.
11189
11190 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
11191
11192         A set of fixes for precise line/column location.
11193
11194         * location.cs :
11195           "token" field now holds a file/line "delta", a line number offset 
11196           from the segment, and a column number. See also:
11197           http://lists.ximian.com/pipermail/mono-devel-list/2004-
11198           December/009508.html
11199           Removed static IsNull. Use instance IsNull property instead.
11200         * cs-tokenizer.cs :
11201           For some tokens it stores Location. For Identifier it stores
11202           LocatedToken which is a pair of string name and location.
11203           Column numbers are adjusted only at getChar().
11204         * report.cs :
11205           Use Location.ToString() for reporting (it now contains column).
11206         * cs-parser.jay :
11207           Largely modified to use LocatedToken instead of
11208           string (IDENTIFIER), and to acquire Location from some tokens.
11209         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
11210           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
11211           codegen.cs :
11212           Now MemberName holds Location. DeclSpace.ctor() receives Location
11213           as a parameter. Removed extra parameters to all derived classes.
11214           Replaced Location.IsNull() with instance property.
11215         * assign.cs, expression.cs :
11216           Added .ctor() overload that omits Location.
11217         * attribute.cs :
11218           Added "nameEscaped" flag that indicates the identifier was escaped
11219           in the source file. This fixes bug #57047.
11220
11221 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
11222
11223         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
11224         New method, looking for lo-case imported cls type.
11225
11226         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
11227         here.
11228
11229         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
11230
11231         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
11232
11233         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
11234         all_imported_types.
11235         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
11236
11237         Optimized to save 3.5 MB for SWF compilation.
11238
11239 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11240
11241         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
11242         (PartialContainer.Create): Moved logic AddToContainer.
11243         (PartialContainer.MarkForDuplicationCheck): Shares name.
11244         
11245         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
11246         place.
11247         
11248         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
11249         initialization.
11250         (Namespace.GetSignatureForError): New method.
11251         
11252         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
11253         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
11254
11255 2005-08-01  Raja R Harinath  <rharinath@novell.com>
11256
11257         Fix #75669.
11258         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
11259         member lookup rather than qualifier_type, since qualifier_type can
11260         be null.
11261
11262 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
11263
11264         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
11265         enum member.
11266
11267 2005-07-31  Miguel de Icaza  <miguel@novell.com>
11268
11269         * statement.cs: Copy the local exception into the exception
11270         captured local.  Fixes 75674
11271
11272 2005-07-31  Raja R Harinath  <harinath@gmail.com>
11273
11274         Fix #75658.
11275         * expression.cs (Invocation.OverloadResolve): Don't report error
11276         CS1501 if error CS1502 has been reported.
11277         (New.DoResolve): Delegate CS1501 reporting to
11278         Invocation.OverloadResolve.
11279
11280         Fix #75656.
11281         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
11282         invariant-meaning-in-block property in an enclosing block if
11283         necessary.
11284
11285 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
11286
11287         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
11288         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
11289         (Switch.CheckSwitch): Just save 50kb for SWF.
11290
11291 2005-07-27  Martin Baulig  <martin@ximian.com>
11292
11293         * anonymous.cs (CaptureContext.AddField): Added
11294         `AnonymousContainer am' argument; compute its toplevel scope if
11295         it's not already computed.  Fixes #75649.
11296
11297 2005-07-26  Raja R Harinath  <rharinath@novell.com>
11298
11299         Fix #75628.
11300         * class.cs (Constructor.Emit): Reset block to null if the block
11301         resolve fails.
11302
11303 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11304
11305         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11306
11307 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11308
11309         * class.cs (MethodData.Define): Check whether accessor implementing
11310         interface is public.
11311
11312         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11313
11314 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
11315
11316         Fix #57245
11317         * namespace.cs (LookupType): Moved same type check to...
11318         
11319         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11320         with the same name.
11321
11322 2005-07-21  Raja R Harinath  <rharinath@novell.com>
11323
11324         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11325         already found a typebuilder.
11326         * class.cs (MethodCore.IsDuplicateImplementation): Compare
11327         MemberNames, not strings.
11328
11329         * const.cs (Error_ExpressionMustBeConst): 
11330         Rename from Error_EpressionMustBeConst.
11331         * const.cs, class.cs, statement.cd: Update.
11332
11333 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
11334
11335         Fix #65573
11336
11337         * const.cs (Const.LookupConstantValue): Report missing contant expression
11338         everytime.
11339         (Error_EpressionMustBeConstant): Only one error method.
11340
11341         * class.cs, statement.c: Updated.
11342
11343 2005-07-20  Raja R Harinath  <rharinath@novell.com>
11344
11345         * statement.cs (Block.Flags): Add back HasVarargs.
11346         (Block.flags): Make protected.
11347         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11348
11349         * typemanager.cs (types, typecontainers, user_types): Remove.
11350         (UserTypes, TypeContainers): Likewise.
11351         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11352         (CleanUp, Reset): Update.
11353         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
11354         (GetNestedType): Use Type.GetNestedType.
11355         (CoreLookupType): Take two arguments, the namespace and the
11356         basename of the type.  Update to use the Namespace.Lookup
11357         mechanism.
11358         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11359         (RealMemberLookup): Use IsNestedChildOf instead of playing with
11360         string concatenation and substring matches.
11361         * class.cs, enum.cs, delegate.cs: Update to changes.
11362
11363 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
11364
11365         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11366         Expression and made virtual.
11367
11368         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11369         (ImplicitStandardConversionExists): Fixed `byte' typo ?
11370
11371         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11372
11373         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11374         error message.
11375
11376         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11377         change.
11378
11379 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
11380
11381         Fix #57707
11382         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11383         AssemblyCultureAttribute is not used on executable.
11384
11385         * rootcontext.cs,
11386         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11387
11388 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11389
11390         Fix #60638.
11391         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11392         New.  Reports CS0252/CS0253.
11393         Mostly taken from preliminary patch by Duncak Mak.
11394         (Binary.DoResolveOperator): Store results of operator lookup.
11395         Use them to detect if we need to warn about unintended reference
11396         comparisons.
11397
11398 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11399
11400         Fix #72969.
11401         * namespace.cs (Namespace.Lookup): Add back location parameter.
11402         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
11403         * delegate.cs, ecore.cs, expression.cs: Update to changes.
11404
11405         * codegen.cs (EmitContext.DeclSpace): Make readonly.
11406         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11407         (Namespace.LookupType): ... this.
11408         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11409         of namespaces.
11410         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11411         purported to handle pointers.
11412         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11413         CoreLookupType.
11414
11415 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11416
11417         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11418         type as namespace.
11419
11420 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11421
11422         * namespace.cs (Namespace.Lookup): Drop location parameter.
11423         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11424         (NamespaceEntry.Lookup): ... this.
11425         (NamespaceEntry.Error_AmbiguousTypeReference):
11426         Move here from DeclSpace.
11427         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11428         names ...
11429         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11430         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11431         Move to NamespaceEntry.
11432         * delegate.cs, expression.cs: Update to changes.
11433
11434 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11435
11436         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11437         CheckAttributeType and refactored.
11438         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11439         ResolveAsTypeTerminal error handling.
11440         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11441         handling.
11442         (GetSignatureForError): Print errors in same way.
11443
11444         * class.cs,
11445         * codegen.cs: Reflect attribute GetSignatureForError change.
11446
11447         * ecore.cs,
11448         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11449
11450         * namespace.cs (UsingEntry): Refactored to make fields private.
11451
11452         * assign.cs,
11453         statement.cs: Error_UnexpectedKind has extra parameter.
11454
11455 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11456
11457         * ecore.cs (IAlias): Remove.
11458         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11459         that implement the interface.
11460         * namespace.cs (Namespace): Likewise.
11461         (Namespace.declspaces): Renamed from 'defined_names'.
11462         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11463         DeclSpace instead of an IAlias.
11464         * tree.cs (Tree.AddDecl): Update.
11465
11466 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11467
11468         * statement.cs (Block.Flags); Remove HasVarargs.
11469         (Block.HasVarargs): Move to ToplevelBlock.
11470         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11471         (Block.Variables): Make protected.  Initialize variable hashtable
11472         if necessary.
11473         (Block.AddVariable): Update.
11474         (Block.Resolve): Update to changes.
11475         (ToplevelBlock.HasVarargs): New boolean.
11476         (ToplevelBlock.ThisVariable): Move here from Block.
11477         (ToplevelBlock.AddThisVariable): Likewise.
11478         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11479         * expression.cs (This.ResolveBase): Update to changes.
11480         (ArglistAccess.DoResolve): Likewise.
11481
11482 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11483
11484         Fix #75321
11485         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11486
11487         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11488         not used and not used & assigned.
11489         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11490
11491 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11492
11493         Fix #75053
11494         * expression.cs (Is.DoResolve): null is never provided type.
11495
11496 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11497
11498         Fix #52496
11499         * cs-parser.jay: Less strict event error rule to catch more errors.
11500
11501 2005-07-08  Martin Baulig  <martin@ximian.com>
11502
11503         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11504         gettter (allowed) or setter (not allowed).
11505
11506         * class.cs (Accessor): Implement IIteratorContainer.
11507         (Accessor.Yields): New public field.
11508         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11509         per-accessor basis.
11510
11511         * cs-parser.jay
11512         (get_accessor_declaration, set_accessor_declaration): Set the
11513         `yields' flag on the accessor, not the property.
11514         (property_declaration): Do the iterators check on a per-accessor
11515         basis and not for the whole property.
11516
11517 2005-07-08  Martin Baulig  <martin@ximian.com>
11518
11519         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11520         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11521
11522 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11523
11524         Fix #74975
11525         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11526         (ExtractSecurityPermissionSet): Cope with self referencing security
11527         attributes properly.
11528
11529         * driver.cs (SetOutputFile): Made public property OutputFile.
11530
11531 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11532
11533         Fix #75486.
11534         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11535         has_nonstatic_fields.  Make into a FieldBase pointer.
11536         (TypeContainer.AddField): Add CS0282 check.
11537         (TypeContainer.EmitType): Update.
11538
11539 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11540
11541         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11542         compare if they start with __.
11543
11544 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11545
11546         * statement.cs (Switch.SwitchGoverningType): Only look at
11547         UserCasts that don't need implicit standard conversions to one of
11548         the allowed switch types (Fixes test-322.cs).
11549         (LocalInfo.Resolve): Re-enable sanity-test.
11550
11551 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11552
11553         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11554         
11555         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11556         
11557         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11558
11559 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11560
11561         Fix #75472.
11562         * ecore.cs (SimpleName.GetSignatureForError): Add.
11563         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11564         (MemberAccess.GetSignatureForError): Add.
11565
11566 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11567  
11568         The big error and warning messages review.
11569         
11570         * anonymous.cs,
11571         * assign.cs,
11572         * attribute.cs,
11573         * class.cs,
11574         * codegen.cs,
11575         * convert.cs,
11576         * cs-parser.jay,
11577         * cs-tokenizer.cs,
11578         * decl.cs,
11579         * delegate.cs,
11580         * doc.cs,
11581         * driver.cs,
11582         * ecore.cs,
11583         * enum.cs,
11584         * expression.cs,
11585         * flowanalysis.cs,
11586         * iterators.cs,
11587         * literal.cs,
11588         * location.cs,
11589         * modifiers.cs,
11590         * namespace.cs,
11591         * parameter.cs,
11592         * pending.cs,
11593         * report.cs,
11594         * rootcontext.cs,
11595         * statement.cs,
11596         * support.cs,
11597         * tree.cs,
11598         * typemanager.cs: Updated.
11599         
11600         * class.cs: (MethodCore.SetYields): Moved here to share.
11601         (PropertyMethod.Define): Moved iterator setup here.
11602         
11603         * iterators.cs: Add orig_method to have full access to parent
11604         container.
11605
11606 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11607
11608         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11609         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11610         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11611         variable of struct type.
11612         * expression.cs (Unary.ResolveOperator): Update to change.
11613         (Indirection.VerifyFixed): Likewise.
11614         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11615         (ParameterReference.VerifyFixed): Value parameters are fixed.
11616         (This.VerifyFixed): Treat 'this' as a value parameter.
11617         * statement.cs (LocalInfo.IsFixed): Remove.
11618
11619 2005-07-01  Martin Baulig  <martin@ximian.com>
11620
11621         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11622         `ec.EmitThis ()' to get the correct scope.
11623
11624 2005-07-01  Martin Baulig  <martin@ximian.com>
11625
11626         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11627         instance is a ParameterReference; fixes #75299.
11628
11629 2005-07-01  Martin Baulig  <martin@ximian.com>
11630
11631         Reverted Marek's latest patch (r46725):
11632         - it contains structural changes which are neither mentioned in
11633           the ChangeLog nor explained anywhere; for example the additional
11634           argument of EmitContext's and Iterator's .ctor's and the
11635           TypeContainer.DefineMembers() change.
11636         - structural changes like this should go in in seperate patches
11637           and not be hidden in a huge patch which just seems to affect
11638           warnings and errors.
11639           a big and hard to understand patch.
11640         - it breaks iterators and causes regressions, for instance in
11641           test-iter-03.cs.      
11642
11643 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11644
11645         Fix #75412.
11646         * expression.cs (Indexers.map): Remove.
11647         (Indexers.Append): Filter out inaccessible setters and getters.
11648         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11649
11650         Fix #75283.
11651         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11652         Refactored from ...
11653         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11654         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11655         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11656         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11657
11658 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11659
11660         Fix #75322
11661         * class.cs (FieldBase.GetInitializerExpression): One more field
11662         for backup.
11663
11664 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11665
11666         * pending.cs: Do not define a proxy if the base method is virtual,
11667         it will be picked up by the runtime (bug 75270).
11668
11669 2005-06-08  Martin Baulig  <martin@ximian.com>
11670
11671         The big Iterators rewrite :-)
11672
11673         * iterators.cs: Rewrite this to use the anonymous methods framework.
11674
11675         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11676         before the TypeContainers; see 2test-21.cs.
11677
11678         * class.cs
11679         (TypeContainer.DefineType): Don't create a new EmitContext if we
11680         already have one (this only happens if we're an Iterator).
11681         (TypeContainer.Define): Also call Define() on all our iterators.
11682         (Method.CreateEmitContext): Added support for iterators.
11683
11684         * anonymous.cs
11685         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11686         (AnonymousContainer.CreateMethodHost): Moved here from
11687         AnonymousMethod and made abstract.
11688         (AnonymousContainer.CreateScopeType): New abstract method.
11689         (AnonymousContainer.IsIterator): New public property.
11690         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11691         get the ScopeTypeBuilder rather than manually defining it here. 
11692         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11693         iterators here.
11694
11695         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11696         before RootContext.DefineTypes().
11697
11698         * codegen.cs (EmitContext.RemapToProxy): Removed.
11699         (EmitContext.CurrentAnonymousMethod): Changed type from
11700         AnonymousMethod -> AnonymousContainer.
11701         (EmitContext.ResolveTopBlock): Protect from being called twice.
11702         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11703         (EmitContext.EmitThis): Removed the iterators hacks; use the
11704         anonymous methods framework for that.
11705
11706         * statement.cs
11707         (ToplevelBlock.Container): Make this a property, not a field.
11708         (ToplevelBlock.ReParent): New public method; move the
11709         ToplevelBlock into a new container.
11710         (Foreach.TemporaryVariable): Simplify.
11711
11712 2005-06-05  Martin Baulig  <martin@ximian.com>
11713
11714         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11715         (Block.AddTemporaryVariable): New public method; creates a new
11716         `LocalInfo' for a temporary variable.
11717         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11718         variables here.
11719         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11720         non-iterator variables.
11721
11722 2005-06-05  Martin Baulig  <martin@ximian.com>
11723
11724         * statement.cs (Foreach.TemporaryVariable): Create the
11725         LocalBuilder in the Emit phase and not in Resolve since in some
11726         situations, we don't have an ILGenerator during Resolve; see
11727         2test-19.cs for an example.
11728
11729 2005-06-04  Martin Baulig  <martin@ximian.com>
11730
11731         **** Merged r45395 from GCS ****
11732
11733         The big Foreach rewrite - Part II.
11734
11735         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11736         with `PropertyInfo ienumerator_getcurrent'.
11737
11738         * codegen.cs (VariableStorage): Removed.
11739
11740         * statement.cs
11741         (Foreach): Derive from Statement, not ExceptionStatement.
11742         (Foreach.CollectionForeach): New nested class.  Moved all the code
11743         dealing with collection foreach here.
11744         (Foreach.ForeachHelperMethods): Removed.
11745         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11746
11747 2005-05-23  Martin Baulig  <martin@ximian.com>
11748
11749         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11750         don't need to.  Fix #75014.
11751
11752 2005-05-20  Martin Baulig  <martin@ximian.com>
11753
11754         Merged r44808 from GMCS.
11755
11756         * class.cs (TypeContainer.CircularDepException): Removed.
11757         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11758         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11759         (CS0146) and interface (CS0529) dependencies here.
11760
11761 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11762
11763         * expression.cs (Invocation.EmitCall): Fix initialization
11764         'this_call' to reflect current behaviour.  Fix indentation.
11765
11766         * convert.cs (FindMostEncompassedType): Add two trivial special
11767         cases (number_of_types == 0 || number_of_types == 1).
11768         (FindMostEncompasingType): Likewise.
11769
11770 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11771
11772         Some cleanups preparing for the fix of #75283.
11773         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11774         error testing.
11775         (EventExpr.InstanceResolve): Likewise.
11776         (EventExpr.DoResolve): Remove redundant checks.
11777
11778 2005-06-10  Duncan Mak  <duncan@novell.com>
11779
11780         * cs-tokenizer.cs (process_directives): New flag for controlling
11781         the processing of preprocessor directives.
11782         (x_token): After seeing a '#', return Token.NONE instead of going
11783         to handle_preprocessing_directive() when not processing
11784         directives. This avoids unnecessary processing during the token peek in
11785         is_punct().
11786
11787         This fixes #74939.
11788
11789         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11790         the existing error reporting methods instead of Report.Error.
11791
11792         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11793         after Raja's rewrite.
11794
11795 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11796
11797         * class.cs: Small fix.
11798
11799 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11800
11801         Fix #75160.
11802         * class.cs (GetPartialBases): Fix return value check of
11803         part.GetClassBases.
11804
11805 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11806
11807         Ensure that partial classes are registered in their enclosing
11808         namespace.  Initial part of fix of #75160.
11809         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11810         Register declspace with namespace here, not in
11811         DeclSpace.RecordDecl.
11812         * cs-parser.jay: Pass namespace to RecordDecl.
11813         * class.cs (PartialContainer.Create): Likewise.
11814         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11815         called.
11816         * decl.cs (Declspace.RecordDecl): Remove.
11817         * namespace.cs (NamespaceEntry.DefineName): Remove.
11818
11819 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11820
11821         * rootcontext.cs: Reset TargetExt as well.
11822
11823 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11824
11825         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11826         -langversion:ISO-1.
11827
11828 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11829
11830         Fix #75080, cs0119.cs.
11831         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11832         of ...
11833         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11834         allowing ExprClass.Type and ExprClass.Namespace for
11835         ResolveFlags.VariableOrValue.
11836         (Expression.Resolve) [1-argument variant]: Change default resolve
11837         flags based on language version.
11838         (Expression.Error_UnexpectedKind): Use a simple string array
11839         rather than an ArrayList.
11840         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11841         not ExprClass.Type.
11842         (TypeOfVoid.DoResolve): Likewise.
11843         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11844         flags argument -- it always has the same value.
11845
11846 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11847
11848         Fix #75081.
11849         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11850         Use it in the error message.
11851         * assign.cs, expression.cs, statement.cs: Update.
11852
11853 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11854
11855         Fix #75088.
11856         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11857         the "almostMatchedMember" case too.
11858         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11859         that failed the accessibility checks to 'almost_match'.
11860
11861 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11862
11863         * attribute.cs: Use internal MethodBuilder methods to set
11864         ExactSpelling and SetLastError on PInvoke methods, instead
11865         of passing them via charset.  Fixes #75060.
11866
11867 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11868
11869         * parameter.cs (Parameter): Remove TODO comment.
11870         (Parameter.DefineParameter): Remove Location parameter.
11871         (Parameters.LabelParameters): Likewise.
11872         * class.cs (Constructor.Emit): Update to change.
11873         (MethodData.Emit): Likewise.
11874         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11875         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11876
11877 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11878
11879         * parameter.cs,
11880           Removed Parameters.Location and added Parameter.Location instead.
11881           Removed Location parameter from Emit() and GetSignature().
11882         * anonymous.cs,
11883           class.cs,
11884           cs-parser.jay,
11885           delegate.cs,
11886           iterators.cs,
11887           statement.cs :
11888           Modified all related calls.
11889
11890 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11891
11892         Improve user-defined conversion handling.
11893         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11894         applicable operators.
11895         (AddConversionOperators): New.  Helper for GetConversionOperators.
11896         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11897         there is only one most encompassed/encompassing type.
11898         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11899         "applicable operator" handling.
11900         (UserConversion): Move cache here from GetConversionOperators.
11901         Directly cache the chosen operator, rather than the whole
11902         MethodGroup.
11903         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11904         case.  Allow conversion of decimal to sbyte and byte too.
11905         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11906         New static methods.  Used to avoid allocating EmptyExpressions in
11907         convert.cs.
11908
11909 2005-05-24  Duncan Mak  <duncan@novell.com>
11910
11911         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11912         another class, used in Convert.ExplicitNumericConversion.
11913         (CastToDecimal): New class, similar to above, but casts to
11914         System.Decimal, used in Convert.ImplicitNumericConversion and also
11915         in explicit convesion from double/float to decimal.
11916
11917         * convert.cs (ImplicitNumericConversion): Handle implicit
11918         conversions to System.Decimal.
11919         (ExplicitNumericConversion): handle explicit conversions to
11920         System.Decimal.
11921
11922         This fixes #68711.
11923         
11924 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11925
11926         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11927         know the type at this stage, just break through.   Fixes #75008 
11928
11929 2005-05-19  Martin Baulig  <martin@ximian.com>
11930
11931         * delegate.cs
11932         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11933         to disable error reporting.
11934
11935         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11936         here since we don't want to report an error; see the new test-336.cs.
11937
11938 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11939
11940         * statement.cs (ToplevelBlock.GetParameterReference)
11941         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11942         Move here from class Block.
11943         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11944         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11945
11946 2005-05-18  Martin Baulig  <martin@ximian.com>
11947
11948         Fix #74978.
11949
11950         * flowanalysis.cs
11951         (FlowBranching.Reachability): Add non-static public And() and Or()
11952         methods.
11953         (FlowBranchingSwitch): New class; do the `break_origins' thing
11954         like in FlowBranchingLoop.
11955         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11956         reachability, not just locals and parameters.
11957         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11958         switch; MergeBreakOrigins() now takes care of that.
11959
11960 2005-05-18  Martin Baulig  <martin@ximian.com>
11961
11962         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11963         a loop and may leave it, reset the barrier; fixes #74974.
11964
11965 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11966         
11967         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11968         is back.
11969         
11970         * cs-parser.jay: Catch more lexical errors.
11971         
11972         * report.cs: Add one more Error method.
11973         
11974         * rootcontext.cs,
11975         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11976
11977 2005-05-17  Martin Baulig  <martin@ximian.com>
11978
11979         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11980         #70970. 
11981
11982 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11983
11984         Fix test-382.cs.  Emit values of decimal constants.
11985         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11986         Carved out of ...
11987         (TypeContainer.AddField): ... this.
11988         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11989         with initializers to include 'Const's.
11990         (ClassPart.RegisterFieldForInitialization): Forward to
11991         PartialContainer.
11992         * const.cs (Const.Const): Pass initializer to base class.
11993         (Const.Define): In case of decimal constants, register them for
11994         initialization in a static constructor.
11995
11996 2005-05-14  Martin Baulig  <martin@ximian.com>
11997
11998         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11999         do not call ResolveUnreachable() on unreachable statements in
12000         here, see the comment in the source code.
12001
12002 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12003
12004         Fix #74934.
12005         * expression.cs (BinaryResolveOperator): If one of the operands of
12006         an equality comparison is 'null' and the other is a pointer type,
12007         convert the null to a NullPointer.
12008         * convert.cs (ImplicitReferenceConversion): If the expression is a
12009         NullLiteral and the target type is a pointer type, return a
12010         NullPointer instead.
12011         (ImplicitConversionStandard): Likewise.
12012
12013 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
12014         
12015         * cs-parser.jay: Set readonly context based on special constructs.
12016         
12017         * expression.cs (LocalVariableReference.DoResolveBase): Improved
12018         readonly variable error handling.
12019         
12020         * rootcontext.cs (EmitCode): Don't verify members when error
12021         occurred.
12022         
12023         * statement.cs (LocalInfo): Add reaodnly context information.
12024         (SetReadOnlyContext, GetReadOnlyContext): New methods.
12025
12026 2005-05-13  Raja R Harinath  <rharinath@novell.com>
12027
12028         * statement.cs (Block.Resolve): Revert change below.  Modify fix
12029         for #74041 to initialize 'resolved' to false only for explicit
12030         blocks.  Fixes #74873.
12031
12032 2005-05-12  Raja R Harinath  <harinath@gmail.com>
12033
12034         Fix #74920.
12035         * typemanager.cs (unmanaged_enclosing_types): New.
12036         (IsUnmanagedType): Avoid infloops by using
12037         'unmanaged_enclosing_types' to talk with recursive invocations.
12038
12039 2005-05-13  Martin Baulig  <martin@ximian.com>
12040
12041         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
12042         instance variable, not a local.  Fix #74873.
12043         (Block.ResolveUnreachable): Set it to true here.
12044
12045 2005-05-11  Duncan Mak  <duncan@novell.com>
12046
12047         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
12048         continuing to process for 'arg'.
12049         (handle_preprocessing_directive): Check the argument of the #endif
12050         directive and report error CS1025 if there are any trailing
12051         characters.
12052
12053         According to the C# spec, having even whitespace after the #endif
12054         directive is illegal; however, because we call arg.TrimEnd ()
12055         beforehand, we have the same behavior as csc, allowing whitespace
12056         after the directive.
12057
12058         Fixes #74892.
12059
12060 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
12061
12062         Fix #74863.
12063         
12064         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
12065         (Constructor.GetObsoleteAttribute): Implemented correctly.
12066
12067 2005-05-10  Martin Baulig  <martin@ximian.com>
12068
12069         * support.cs (ReflectionParameters.ParameterModifier): Use
12070         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
12071         and `ParameterAttributes.In'.  Fixes #74884.
12072
12073 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
12074
12075         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
12076         
12077         * expression.cs (Argument.GetParameterModifier): Turned to property.
12078         (Invocation.Error_InvalidArguments): Add more descriptive errors.
12079         
12080         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
12081         its C# equivalent.
12082         
12083 2005-05-09  Raja R Harinath  <rharinath@novell.com>
12084
12085         Fix #74852.
12086         * decl.cs (MemberCache.AddMethods): Register override methods,
12087         rather than non-override methods.
12088         * typemanager.cs (RegisterOverride): New.
12089         (IsOverride): Update.
12090
12091 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
12092
12093         Fix #73105.
12094         
12095         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
12096         recursive declaration.
12097         
12098         * statement.cs (Block.ResolveMeta): Report any error in resolving.
12099         
12100 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
12101
12102         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
12103         
12104         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
12105
12106 2005-05-05  Raja R Harinath  <rharinath@novell.com>
12107
12108         Fix #74797.
12109         * decl.cs (DeclSpace.FamilyAccessible): 
12110         Use TypeManager.IsNestedFamilyAccessible.
12111
12112         Fix reopened #64812.
12113         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
12114         internal'.
12115
12116 2005-05-04  Raja R Harinath  <rharinath@novell.com>
12117             Abin Thomas  <projectmonokochi@rediffmail.com>
12118             Anoob V E  <projectmonokochi@rediffmail.com>
12119             Harilal P R  <projectmonokochi@rediffmail.com>
12120
12121         Fix #64812.
12122         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
12123         allow access to all static members.
12124
12125 2005-05-04  Martin Baulig  <martin@ximian.com>
12126
12127         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
12128
12129 2005-05-04  Martin Baulig  <martin@ximian.com>
12130
12131         Fix #74655.
12132
12133         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
12134         section at the end; make things work if `default' is not the last
12135         section.        
12136
12137 2005-05-04  Martin Baulig  <martin@ximian.com>
12138
12139         Fix #70400.
12140
12141         * statement.cs (Switch): Replaced the `got_default' field with a
12142         `default_section' one.
12143         (Switch.CheckSwitch): Set `default_section' here.
12144         (Switch.Resolve): If we're a constant switch and the constant is
12145         not found, use the default section.
12146
12147 2005-05-03  Martin Baulig  <martin@ximian.com>
12148
12149         * expression.cs (ArrayAccess.EmitGetLength): New public method.
12150
12151         * statement.cs (Foreach.ArrayForeach): New nested class.
12152         (Foreach.TemporaryVariable): New nested class.
12153         (Foreach.EmitArrayForeach): Removed; this is now in the new
12154         ArrayForeach class.
12155
12156 2005-05-03  Raja R Harinath  <rharinath@novell.com>
12157
12158         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
12159         more conservative.
12160         (VerifyPendingMethods): Revert change below.
12161
12162         * typemanager.cs (IsOverride, RegisterNonOverride): New.
12163         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
12164         that used to trigger warning -28.  Remove warning -28.
12165         * expression.cs (Invocation.OverloadResolve): Use
12166         TypeManager.IsOverride to distinguish override methods.
12167
12168         Fix #74773.
12169         * pending.cs (VerifyPendingMethods): If a base type implements the
12170         requested interface, don't bother checking individual methods of
12171         the base type.  As a side-effect, this prevents the creation of
12172         unnecessary proxies.
12173
12174 2005-05-02  Martin Baulig  <martin@ximian.com>
12175
12176         Fix #70182.
12177
12178         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12179         Also `And' the locals if the old vector is null.
12180         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
12181         null; in this case we basically reset all the variables.        
12182
12183 2005-05-02  Martin Baulig  <martin@ximian.com>
12184
12185         Fix #74529.
12186
12187         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
12188         Added `FlowBranching branching' argument; always `and' the
12189         variables instead of `or'ing them unless we're an infinite loop.
12190
12191         * statement.cs (While.Resolve): Create a new sibling unless we're
12192         infinite.       
12193
12194 2005-05-02  Martin Baulig  <martin@ximian.com>
12195
12196         Fix #70140.
12197
12198         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
12199         arguments; use it instead of creating a new TopLevelBlock.
12200         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
12201         our ConstructorInitializer.
12202
12203         * statement.cs
12204         (TopLevelBlock.TopLevelBranching): New public property.
12205         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
12206         and create our `TopLevelBranching'.
12207
12208         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
12209         anonymous method host, use `block.TopLevelBranching' rather than
12210         creating a new branching.
12211
12212 2005-04-20  Miguel de Icaza  <miguel@novell.com>
12213
12214         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
12215         a ScopeInfo, if any of the current children is a child of the new
12216         entry, move those children there.
12217
12218 2005-04-30  Martin Baulig  <martin@ximian.com>
12219
12220         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
12221         at the beginning of a SwitchSection.  Fix #73335.
12222
12223 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
12224
12225         Fix #74378
12226         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
12227         
12228         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
12229         (FieldExpr.DoResolve): Obsolete members are ignored for field
12230         initializers.
12231         
12232 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
12233
12234         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
12235         of arrays detection.
12236
12237         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
12238         verification.
12239         (Field.VerifyClsCompliance): Volatile fields are not compliant.
12240
12241         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
12242         arrays report.
12243
12244 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
12245
12246         * cs-parser.jay: Use the prefered version of -unsafe in error
12247         message.
12248
12249 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
12250
12251         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
12252         circumstances.
12253
12254 2005-04-20  John Luke  <john.luke@gmail.com>
12255
12256         * driver.cs: fix typo in error message, --outout to --output
12257
12258 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
12259
12260         * codegen.cs (InRefOutArgumentResolving): New field.
12261         
12262         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
12263         fields outside contructor.
12264         
12265         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
12266         
12267 2005-04-19  Miguel de Icaza  <miguel@novell.com>
12268
12269         * anonymous.cs (CaptureContext.EmitParameterInstance): The
12270         parameter code was not completed ever, so it was not as up-to-date
12271         as local variables.  Must finish it.
12272
12273         The bug fix was to compare the Toplevel of the block, not the
12274         current block.  Thanks for Ben for pointing this out. 
12275
12276 2005-04-19  Raja R Harinath  <rharinath@novell.com>
12277
12278         * decl.cs (AddMethods): Use the declaring type of the problem
12279         method to determine if we want to squash a warning.
12280
12281 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
12282
12283         * attribute.cs: Removed debug output.
12284
12285         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
12286         
12287         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
12288         Report.Stderr.
12289         
12290 2005-04-18  Raja R Harinath  <rharinath@novell.com>
12291
12292         Fix #74481.
12293         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
12294         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
12295         all null comparisons against reference types.
12296
12297 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
12298
12299         Fix# 74565
12300         * class.cs (TypeContainer.CircularDepException) New nested
12301         exception class.
12302         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12303         (TypeContainer.DefineType): Removed error, reset InTransit before
12304         exit.
12305         (Class.DefineType): Throw exception when is in Transit.
12306         Catch exception and report error.
12307         (Struct.DefineType): Throw exception when is in Transit.
12308         Catch exception and report error.
12309         (Interface.DefineType): Throw exception when is in Transit.
12310         Catch exception and report error.
12311
12312         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12313         handle nested exception handlers.
12314
12315         * flowanalysis.cs (InTryWithCatch): New method, search for try with
12316         a catch.
12317
12318         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12319         InFinally and InCatch storage.
12320
12321         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12322         (Catch.Resolve): Set and Restore ec.InCatch.
12323         (Try.Resolve): Set and Restore ec.InFinally.
12324         (Try.HasCatch): True when try has catch.
12325
12326 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
12327
12328         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12329           for the same event member, so exclude such cases from warning 419.
12330           Fixed bug #74633.
12331
12332 2005-04-16  Miguel de Icaza  <miguel@novell.com>
12333
12334         * expression.cs (Binary.ResolveOperator): Apply patch from John
12335         Luke to fix bug 59864: operators &, | and ^ on enumerations
12336         require that the same enum type on both sides.
12337
12338         * driver.cs: Add warnings to old flag usage, this is to assist
12339         people who produce Makefiles and hope that the Makefiles will be
12340         used on Windows.
12341
12342         * class.cs (TypeContainer.EmitType): Moved the definition of the
12343         special $PRIVATE$ field from the resolve phase to the Emit phase.
12344         During resolve we do not know if we are a struct with
12345         HasExplicitLayout, we know this only after the attributes for the
12346         type are emitted.
12347
12348         Set the FieldOffset to zero on the dummy field that we create for
12349         the class.   Fixes 74590.
12350
12351 2005-04-16  Raja R Harinath  <rharinath@novell.com>
12352
12353         Fix #73834.
12354         * ecore.cs (PropertyExpr.resolved): New.
12355         (DoResolve): Use it to handle a case of double resolution here.
12356         Handle a case of identical-name-and-type-name.
12357         * expression.cs (ArrayCreation.CheckIndices): Avoid double
12358         resolution by storing the results of expression resolution back
12359         into the "probes" array.
12360
12361 2005-04-15  Raja R Harinath  <rharinath@novell.com>
12362
12363         Fix cs0208-7.cs and cs0208-8.cs.
12364         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12365         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
12366         error reporting to point out the reason a struct is not unmanaged.
12367
12368 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12369
12370         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
12371           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12372
12373 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12374
12375         Fix #74528.
12376         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12377         IdenticalNameAndTypeName here.
12378         (EventExpr.InstanceResolve): Likewise.
12379
12380 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
12381
12382         C# 2.0 DefaultCharSetAttribute implementation
12383         
12384         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12385         which allows us to set GlobalNamespace for every resolve.
12386         (Attribute.ResolveArguments): Cut from Resolve.
12387         (Attribute.GetCharSetValue): Returns CharSet named argument.
12388         (Attribute.DefinePInvokeMethod): Gets default charset from
12389         module settings.
12390         (GlobalAttribute.ResolveAsTypeStep): Override.
12391         (GlobalAttribute.ResolveArguments): Override.
12392         
12393         * class.cs (TypeAttr): Is protected.
12394         
12395         * codegen.cs (ModuleClass.DefaultCharSet): New member.
12396         (ModuleClass.DefaultCharSetType): New memeber.
12397         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12398         
12399         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12400         charset from module.
12401         
12402         * delegate.cs (TypeAttr): Override.
12403         (Delegate.DefineType): Use this TypeAttr.
12404         
12405         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12406         at very early stage (before types are defined) to resolve model
12407         module attributes. It will probably not work with corlib but it
12408         should be ok.
12409         
12410         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12411         charset from module.
12412         
12413         * typemanager.cs (default_charset_type): New type.
12414
12415 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12416
12417         * decl.cs (MemberCache.AddMethods): Don't warn if
12418         System.Object.Finalize has buggy MethodAttributes.
12419
12420         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12421         removed below.
12422
12423 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12424
12425         * doc.cs : detect ambiguous reference to overloaded members.
12426           Fixed bug #71603. MS 1.1 csc does not detect it.
12427
12428 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12429
12430         * doc.cs : delegates must not be referenced with parameters.
12431           Fixed bug #71605.
12432
12433 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12434
12435         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12436
12437 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12438
12439         * driver.cs (MainDriver): Stop processing if the CLS stage found
12440         errors. 
12441
12442         (CompilerCallableEntryPoint.InvokeCompiler): Always
12443         reset after execution;   Take a TextWriter argument for the
12444         output.
12445
12446         * report.cs: Use the error stream instead of hardcoding stderr. 
12447
12448 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12449
12450         * class.cs: Reduce code paths to test, too small of an
12451         optimization to make it worth the extra testing.  Always perform
12452         it. 
12453
12454 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12455
12456         Fix #74510.
12457         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12458         operators that had errors reported on them.
12459
12460 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12461
12462         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12463         argument types.
12464         (Attribute.Resolve): Add named argument type checking.
12465         
12466         * class.cs (FixedField.Define): Use IsPrimitiveType
12467         
12468         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12469         
12470         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12471         unsafe parameter types.
12472         
12473         * statement.cs (Using.ResolveExpression): Add better error description.
12474         
12475         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12476         
12477 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12478
12479         Fix #74484.
12480         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12481         AttributeUsageAttribute in the emitcontext of the attribute class,
12482         not in the emitcontext of the attributable entity it was attached to.
12483         * cs-parser.jay: Use 'current_class', not 'current_container',
12484         when creating a GlobalAttribute.
12485
12486 2005-04-08  Alp Toker  <alp@atoker.com>
12487
12488         * pending.cs: The fix to #58413 failed to compile methods implementing
12489         interfaces with/without params modifiers and vice versa, even though
12490         params modifiers aren't part of the signature. Make the modifier check
12491         less strict as in csc.
12492
12493 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12494             Anoob V E  <projectmonokochi@rediffmail.com>
12495             Harilal P R  <projectmonokochi@rediffmail.com>
12496
12497         Fix #58413.
12498         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12499         modifiers of pending methods.
12500         (PendingImplementation.PendingImplementation): Initialize it.
12501         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12502         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12503         with ParameterData.  Add check for modifiers.
12504         * class.cs (MethodData.Define): Update to changes.
12505
12506 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12507
12508         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12509
12510 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12511
12512         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12513         property.
12514         
12515         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12516         
12517         * rootcontext.cs,
12518         * typemanager.cs: Registered RequiredAttributeAttribute.
12519         
12520 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12521
12522         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12523         Warning CS0169 is back at level 3.
12524         (IMethodData.SetMemberIsUsed): New method.
12525         
12526         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12527         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12528         
12529         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12530
12531         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12532         contants.
12533         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12534         is used.
12535         
12536         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12537         is used.
12538         
12539         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12540         to avoid the problems with nested types.
12541
12542 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12543             Anoob V.E  <projectmonokochi@rediffmail.com>
12544             Harilal P.R  <projectmonokochi@rediffmail.com>
12545             Raja R Harinath  <rharinath@novell.com>
12546
12547         Fix #73820.
12548         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12549         attribute.
12550         * typemanager (GetConstructor): Make public.
12551
12552 2005-04-05  John Luke  <john.luke@gmail.com>
12553             Raja R Harinath  <rharinath@novell.com>
12554
12555         Fix #62232.
12556         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12557         struct too.  Return false quicker in a few cases.
12558         (VerifyUnManaged): Use it.
12559
12560 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12561
12562         Fix #74041.
12563         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12564         not 'unreachable_seen'.
12565
12566 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12567
12568         * attribute.cs (Attribute.GetValue): Removed unused.
12569         
12570         * codegen.cs (CodeGen.TrimExt): Removed unused.
12571         
12572         * cs-parser.jay (output): Removed unused.
12573         
12574         * cs-tokenizer.cs (hex_digits): Removed unused.
12575         
12576         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12577         
12578         * expression.cs (Indirection.LoadExprValue): Removed unused.
12579         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12580         
12581         * iterators.cs (Iterator.param_types): Removed unused.
12582         
12583         * statement.cs (Goto.block): Removed unused.
12584         (ToplevelBlock.did): Removed unused.
12585         (Switch.ResolveConstantSwitch): Removed unused.
12586
12587 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12588
12589         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12590         resetting thingy.
12591
12592 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12593
12594         Fix #74232 and cs0208-3.cs.
12595         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12596         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12597         unmanaged type.  Don't use FieldBuilders when 't' is a
12598         TypeBuilder.  Use ModFlags and MemberType fields.
12599         * class.cs (MemberBase.member_type): Rename from MemberType.
12600         (MemberBase.MemberType): New property.  Determines member_type on
12601         demand.
12602         (MemberBase.DoDefine): Don't initialize MemberType here.
12603         (FieldMember.Define): Likewise.
12604
12605 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12606
12607         Fix #74241
12608         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12609         Attributes are emitted there.
12610         
12611 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12612
12613         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12614         keyword in 'partial enum' too.
12615         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12616         is not allowed).
12617         Report from Kamil Skalski <nazgul@omega.pl>.
12618
12619         Fix #74309.
12620         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12621         have partial containers too.
12622
12623         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12624         in block' checks to Block.CheckInvariantMeaningInBlock.
12625         * statement.cs (Block.GetKnownVariableInfo): Make private.
12626         (Block.IsVariableUsedInChildBlock): Remove.
12627         (Block.IsVariableUsedInBlock): Likewise.
12628         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12629         conflicting declaration.
12630         (Block.AddVariable): Make error messages less long-winded and more
12631         specific.  Show location of conflicting declaration.
12632         * parameter.cs (Parameters.Location): New readonly property.
12633
12634 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12635
12636         Clean up semantics of invoking ResolveMemberAccess.
12637         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12638         can have an instance, ensure that we pass in a non-TypeExpression
12639         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12640         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12641         argument.  Update to changes and simplify.
12642         (FieldExpr.Emitinstance): Remove CS0120 check.
12643         (PropertyExpr.EmitInstance): Likewise.
12644         * expression.cs (Argument.Resolve): Likewise.
12645         (Invocation.DoResolve): Update to changes in semantics of
12646         InstanceExpression.
12647
12648 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12649
12650         Fix #74241
12651         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12652         customization.
12653         
12654         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12655
12656 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12657
12658         Fix difference in behaviour with commandline invocation.
12659         * driver.cs (Driver.Reset): New.
12660         (CompilerCallableEntryPoint): Call it.
12661
12662         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12663         variable" warnings if the boolean expression failed to resolve.
12664
12665 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12666
12667         * attribute.cs: Fix the union of several permissions when some of them
12668         are unrestricted (so the result isn't an unrestricted permission set).
12669         Fix #74036.
12670
12671 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12672
12673         * ecore.cs (MemberExpr): New class.  Convert from interface
12674         IMemberExpr.
12675         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12676         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12677         error checks.
12678         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12679         (MethodGroupExpr.IsExplicitImpl): Remove.
12680         (Expression.GetFieldFromEvent): Remove.
12681         (SimpleName.MemberStaticCheck): Remove.
12682         (SimpleName.DoSimpleNameResolve): Update to changes.
12683         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12684         (MemberAccess.IdenticalNameAndTypeName): Remove.
12685         (MemberAccess.error176): Move to MemberExpr.
12686         (MemberAccess.DoResolve): Update to changes.
12687         (BaseAccess.DoResolve): Likewise.
12688
12689 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12690
12691         C# 2.0 Conditional attribute class implementation
12692         
12693         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12694         Analyzes class whether it has attribute which has ConditionalAttribute
12695         and its condition is not defined.
12696         
12697         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12698         (Class.IsExcluded): New method. Search for at least one defined
12699         condition in ConditionalAttribute of attribute class.
12700
12701 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12702
12703         * ecore.cs (PropertyExpr): Derive from Expression, not
12704         ExpressionStatement.
12705         (PropertyExpr.EmitStatement): Remove.
12706
12707 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12708
12709         Fix #74060.
12710         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12711         internal field "value__" of an enum be private.  The examples for
12712         "value__" that I found on MSDN all used FieldAttributes.Private.
12713
12714         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12715         Don't mention IL method attribute names.
12716
12717         Fix #47991.  Remove a TODO.
12718         * statement.cs (Block.Toplevel): Make into a field.
12719         (Block.Parameters): Move into ToplevelBlock.
12720         (Block.known_variables): Rename from child_variable_names.
12721         (Block.Block): Remove variants that take Parameters.  Initialize
12722         'Toplevel' with the immediately surrounding toplevel block.
12723         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12724         LocalInfo parameter.
12725         (Block.GetKnownVariableInfo): New.
12726         (Block.IsVariableNameUsedInChildBlock): Update.
12727         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12728         the block, even though it may not be in scope.
12729         (Block.AddVariable): Remove Parameters parameter.  Use
12730         Toplevel.Parameters instead.
12731         (Block.AddConstant): Remove Parameters parameter.
12732         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12733         (Block.IsParamaterReference): Likewise.
12734         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12735         (ToplevelBlock.Parameters): New.  Moved from Block.
12736         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12737         initialize Parameters to a non-null value.
12738         * cs-parser.jay: Update to changes.
12739         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12740         simple names that mean different things in the same block.  Use
12741         Block.IsVariableNameUsedInBlock.
12742
12743 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12744
12745         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12746         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12747         GetTypeHandle.  It is possible for a reflected type to derive from
12748         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12749         System.Array during mscorlib compilation).
12750         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12751         contain a method_hash, don't create one either.  Don't create a
12752         deep copy of the base cache's method_hash.
12753         (MemberCache.SetupCache): Rename back from DeepCopy.
12754         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12755         already initialized.  If we see an override function, add its
12756         underlying base virtual function to the member_hash too.
12757
12758         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12759
12760 2005-03-26  Raja R Harinath  <harinath@acm.org>
12761
12762         Fix #73038.
12763         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12764         fails to resolve, ensure that the LHS is still resolved as an
12765         lvalue.
12766
12767 2005-03-25  Raja R Harinath  <harinath@acm.org>
12768
12769         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12770         ec.ContainerType.
12771         (Enum.current_ec): Remove.
12772         (Enum.LookupEnumValue): Remove EmitContext argument.
12773         Just uses the one created during DefineType.
12774         (Enum.FindMembers): Update.
12775         * expression.cs (MemberAccess.DoResolve): Update.
12776
12777 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12778
12779         * assign.cs (Assign.DoResolve): Check for CS1717 when
12780         source and target are same (uses Equals).
12781
12782         * expression.cs (LocalVariableReference, ParameterReference,
12783         This): Implemented Equals, GetHashCode.
12784
12785         * statement.cs (Block.GetParameterReference): Removed useless
12786         local variable.
12787
12788 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12789
12790         Fix cs0128.cs
12791         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12792         blocks before deciding whether the error is cs0136 or cs0128.
12793
12794         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12795         (using_alias_directive, using_namespace_directive): Pass
12796         MemberName, not an expression to Namespace.UsingAlias and
12797         Namespace.Using.
12798         (MakeName): Use the MemberName of the namespace.
12799         * namespace.cs (Namespace.MemberName): New.
12800         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12801         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12802         Likewise.
12803         * decl.cs (MemberName.Name): Make readonly.
12804         (MemberName.FromDotted): New "constructor".
12805         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12806         (MemberCore.Name): Compute from MemberName on demand.
12807         (MemberCore.SetMemberName): Provide a way to change the
12808         MemberName.
12809         (MemberCore.AddToContainer): Don't take a fullname parameter.
12810         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12811         fully qualified name of the container to the member name.
12812         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12813         only if the type is a member of the root container.
12814         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12815         MemberName.Left rather than searching for an embedded ".".
12816         (PartialContainer.CreatePart): Update to changes in RootContext.
12817         (MemberBase.ShortName): Turn into a property.  Use
12818         MemberCore.SetMemberName.
12819         (MemberBase.ExplicitInterfaceName): Remove.
12820         (MemberBase.UpdateMemberName): Remove.
12821         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12822         (PropertyBase.SetMemberName): New override.
12823         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12824         (Tree.GetDecl): New.
12825         (Tree.AllDecls): Rename from Decls.
12826         * attribute.cs, enum.cs, report.cs: Update to changes.
12827         * driver.cs (MainDriver): Use MemberName.FromDotted on
12828         RootContext.MainClass.
12829
12830 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12831
12832         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12833         checks.
12834
12835         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12836
12837 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12838
12839         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12840         property accessor modifiers.
12841
12842         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12843         fixed buffer attribute (CS1716).
12844         (PropertyMethod.HasCustomAccessModifier): When property accessor
12845         has custom modifier.
12846
12847         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12848         modifiers.
12849         (PropertyExpr.DoResolveLValue): Add CS0272.
12850
12851 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12852
12853         * convert.cs: When converting to a pointer, use the proper Conv.U
12854         or Conv.I depending on the source data type.
12855
12856         * cs-tokenizer.cs: Make the size for large decimal constants,
12857         fixes #72957.
12858
12859 2005-03-17  Martin Baulig  <martin@ximian.com>
12860
12861         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12862         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12863
12864 2005-03-17  Martin Baulig  <martin@ximian.com>
12865
12866         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12867         to bool so we can return an error condition.
12868         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12869         returned an error.
12870
12871 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12872
12873         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12874         attributes.
12875
12876 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12877
12878         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12879         Refactor to avoid traversing the list of assemblies, and to avoid
12880         string concatenation.
12881         * typemanager.cs (guid_attr_type): Remove.
12882         (negative_hits, pointers, references): Remove hashes.
12883         (type_hash): New.
12884         (GetConstructedType): New.  Uses type_hash to handle constructed
12885         types (arrays, references, pointers).
12886         (GetReferenceType, GetPointerType): Use it.
12887         (GetNestedType): New.  Uses type_hash to handle nested types of
12888         reflected types.
12889         (LookupType, LookupTypeDirect): Remove.
12890         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12891         'types' hash and LookupTypeReflection directly.
12892         (params_string, params_object): Use GetConstructedType.
12893         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12894         top-level types.
12895         (Namespace.Lookup): Use cached_types.
12896         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12897         provided by old TypeManager.LookupType.
12898         * rootcontext.cs (MakeFQN): Remove.
12899         * decl.cs (DeclSpace.MakeFQN): Likewise.
12900         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12901         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12902         TypeManager.GetConstructedType.
12903         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12904
12905 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12906
12907         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12908         indexers.
12909
12910         * cs-parser.jay: Reports CS1527 for any namespace element.
12911
12912         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12913         Added CS0407.
12914
12915         * expression.cs (ParameterReference.IsAssigned): Changed error to
12916         CS0269.
12917         (Error_WrongNumArguments): Moved CS0245 detection here.
12918
12919         * statement.cs (Return.Resolve): Add CS1622 report.
12920
12921 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12922
12923         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12924
12925 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12926
12927         * attribute.cs expression.cs: Get rid of some allocations.
12928
12929 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12930
12931         * doc.cs : just eliminate the latest change.
12932
12933 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12934
12935         * doc.cs : commented out the latest change. It breaks xml-030.cs
12936
12937 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12938
12939         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12940           fail. So invoke CreateType() in FindDocumentedType().
12941
12942 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12943
12944         * cs-tokenizer.cs : added IsKeyword().
12945         * doc.cs : Detect keyword incorrectly used as identifier.
12946           Allow identifiers prefixed by @.
12947
12948 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12949
12950         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12951         It caused exception in namespace resolving (again!).
12952         
12953         * class.cs (Class.ctor): Removed exit.
12954         (PropertyMethod.ctor): ditto.
12955         
12956         * codegen.cs (Codegen.Reset): Reset static data.
12957         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12958         
12959         * cs-tokenizer.cs (Cleanup): Removed.
12960         
12961         * driver.cs (GetSystemDir): Rewrote to one line command.
12962         It caused problem with unloaded dynamic modules.
12963         (UnixParseOption): Removed Exit.
12964         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12965         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12966         Now can be mcs used as library.
12967         
12968         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12969         empty location.
12970         
12971         * location.cs (Reset): Reset static data.
12972         
12973         * namespace.cs (Reset): Reset static data.
12974         
12975         * report.cs (Report.Reset): Reset static data.
12976         
12977         * rootcontext.cs (RootContext.Reset): Reset static data.
12978         
12979         * tree.cs (RootTypes.ctor): Use Location.Null
12980         
12981         * typemanager.cs (TypeManager.Reset): Reset static data.
12982         (CoreLookupType): Removed Exit.
12983         (TypeHandle.Reset): Reset static data.
12984         
12985 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12986
12987         Fix #73516.
12988         * typemanager.cs (ComputeNamespaces): Import namespaces from
12989         referenced modules too.
12990
12991 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12992
12993         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12994         than '.'.
12995
12996 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12997
12998         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12999         enclosing DeclSpace.  This ensures that a name-lookup populates
13000         more caches and there are fewer 'TypeExpression's.  Carve out
13001         nested type lookup into ...
13002         (LookupNestedTypeInHierarchy): ... this.
13003
13004 2005-03-09  Raja R Harinath  <rharinath@novell.com>
13005
13006         Clean up a few partial-class semantics.  
13007         Fixes test-357.cs and cs1618-2.cs.
13008         * cs-parser.jay (struct_declaration): Use 'current_class' as
13009         parent of newly-created struct.  Remove call to Register ().
13010         Use 'pop_current_class' to complete handing the current struct.
13011         (interface_declaration): Likewise.
13012         (class_declaration): Likewise.
13013         (enum_declaration): Use 'current_class' as parent of newly created
13014         enum.
13015         (delegate_declaration): Likewise.
13016         (pop_current_class): New function.  This is used to handle closing
13017         up the 'current_class' and 'current_container', and pointing them
13018         to the enclosing class/container.
13019         (CSharpParser): Initialize 'current_class' too.
13020         * decl.cs (MemberCore): Add check for invariant: a partial
13021         container is not a parsed entity, and thus does not enclose any
13022         parsed members.
13023         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13024         (DeclSpace.BaseTypeExpr): Use it.
13025         (DeclSpace.LookupType): Add check for invariant.
13026         * class.cs (TypeContainer): Add check for invariant: a nested
13027         class should have the same NamespaceEntry as its enclosing class.
13028         (TypeContainer.EmitFieldInitializers): Make virtual.
13029         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13030         MemberCore.
13031         (TypeContainer.Register): Remove.
13032         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
13033         null.  Use TypeResolveEmitContext for resolving base types and
13034         interfaces.  Move initialization of Parts.TypeBuilder here from
13035         ...
13036         (TypeContainer.DefineNestedTypes): ... here.
13037         (PartialContainer): Take a Namespace not a NamespaceEntry.
13038         (PartialContainer.Create): Don't use Register.  Call the
13039         appropriate Add... function directly.
13040         (ClassPart): Take both the PartialContainer and the enclosing
13041         class as constructor arguments.
13042         (ClassPart.EmitFieldInitializers): Override.
13043         (ClassPart.PartFindNestedTypes): Remove.
13044         (FieldBase.GetInitializerExpression): Resolve the initializer
13045         expression in the emit context of the enclosing class.
13046         * tree.cs (RootTypes): Remove Register ().
13047         
13048 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
13049
13050         * cs-parser.jay: Removed CS0134.
13051         
13052         * driver.cs: Removed CS1901.
13053         
13054         * expression.cs (SizeOf.DoResolve): Don't report CS0233
13055         for predefined types.
13056
13057 2005-03-07  Duncan Mak  <duncan@novell.com>
13058
13059         * codegen.cs (Save):  Catch UnauthorizedAccessException as
13060         well. Fixes bug #73454.
13061
13062 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
13063
13064         * cs-tokenizer.cs (xtoken): Add CS1035.
13065         
13066         * class.cs (MethodData.Define): Add CS0683.
13067         (FieldMember.ctor): Add CS0681.
13068
13069 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13070
13071         * ecore.cs (SimpleName.DoResolve): Rename from
13072         SimpleName.DoResolveAllowStatic.
13073         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
13074         Pass 'intermediate' flag to MemberStaticCheck.
13075         (SimpleName.MemberStaticCheck): Skip "static check" only in case
13076         of "intermediate" lookups via MemberAccess.
13077         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
13078         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
13079
13080 2005-03-07  Raja R Harinath  <rharinath@novell.com>
13081
13082         Fix #73394.
13083         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
13084         slipped in because of variable names that are identical to a
13085         builtin type's BCL equivalent ('string String;', 'int Int32;').
13086         (PropertyExpr.EmitInstance): Likewise.
13087
13088 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
13089
13090         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
13091         
13092         * report.cs (warning_ignore_table): Made public.
13093
13094 2005-03-04  Raja R Harinath  <rharinath@novell.com>
13095
13096         Fix #73282.
13097         * class.cs (MethodData.Emit): Pass 'container' to
13098         container.GetObsoleteAttribute instead of 'container.Parent'.
13099
13100 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
13101
13102         * cs-parser.jay: Add 1534 error test.
13103
13104         * iterators.cs (Yield.CheckContext): Add error 1629.
13105         (Iterator.ctor): Save unsafe modifier.
13106         (MoveNextMethod.DoEmit): Restore unsafe context.
13107
13108         * namespace.cs (UsingAlias): Better error message.
13109
13110 2005-03-03  Dan Winship  <danw@novell.com>
13111
13112         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
13113         the warning message [#73219]
13114
13115 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13116
13117         Fix compile with MCS 1.0.0.0.
13118         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
13119         w_restore to not depend on string constant folding.
13120
13121 2005-03-03  Raja R Harinath  <rharinath@novell.com>
13122
13123         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
13124         CS0246 check to users who passed 'silent = false'.
13125         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
13126         check.
13127         (SimpleName.SimpleNameResolve): Update.
13128         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
13129         (MemberAccess.IdenticalNameAndTypeName): Update.
13130         * doc.cs (FindDocumentedTypeNonArray): Update.
13131
13132 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
13133
13134         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
13135         * parameters.cs (ComputeAndDefineParameters): Remove.
13136         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
13137         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
13138         Use GetParameterInfo.
13139
13140 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
13141
13142         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
13143
13144 2005-03-02  Raja R Harinath  <rharinath@novell.com>
13145
13146         Unify DeclSpace.LookupType and DeclSpace.FindType.
13147         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
13148         is in charge of defining nested types on demand.
13149         (DeclSpace.LookupType): Use it when the current_type is a
13150         TypeBuilder.  Use LookupTypeDirect for reflected types.
13151         (DeclSpace.FindType): Remove.
13152         (DeclSpace.LookupInterfaceOrClass): Likewise.
13153         (DeclSpace.DefineTypeAndParents): Likewise.
13154         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
13155         DeclSpace.LookupType.
13156         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
13157         * typemanager.cs (LookupType): Simplify.
13158         (AddUserType): Remove type from negative_hits.
13159         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
13160         * class.cs (TypeContainer.FindMembers): Move handling of nested
13161         types ...
13162         (TypeContainer.FindMembers_NestedTypes): ... here.
13163         (TypeContainer.FindNestedType): Implement override.
13164         (ClassPart.FindNestedType): Delegate to PartialContainer.
13165         (ClassPart.PartFindNestedType): Looks up the nested types of the
13166         part alone.
13167
13168 2005-03-02  Martin Baulig  <martin@ximian.com>
13169
13170         * class.cs (TypeContainer.DoDefineMembers): We also need a default
13171         static constructor in static classes.
13172
13173 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
13174
13175         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
13176         sizeParamIndex is not specified.
13177
13178 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
13179
13180         Fix #73117
13181         * report.cs (WarningMessage.IsEnabled): Missing null check.
13182
13183 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13184
13185         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
13186         in the fields and not in the properties.
13187
13188 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
13189
13190         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
13191         fields as well.
13192
13193 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13194
13195         * attribute.cs: Small refactoring (improved robustness).
13196         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
13197         (ValidateGuid): Removed.
13198         (Resolve): Removed referenced to above mentioned.
13199         (GetAttributeUsage): Made private and changed to work without
13200         class assistance.
13201         (GetIndexerAttributeValue): Don't crash.
13202         (GetConditionalAttributeValue): Ditto.
13203         (GetClsCompliantAttributeValue): Ditto.
13204         (ExtractSecurityPermissionSet): All attributes exceptions are
13205         error 648.
13206         (GetPropertyValue): New helper.
13207         (GetMethodImplOptions): New method.
13208         (DefinePInvokeMethod): Reuse common code. Implemented handling of
13209         some missing properties.
13210         
13211         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
13212         (Method.ApplyAttributeBuilder): Updated.
13213         
13214         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
13215         exception.
13216
13217 2005-02-28  Raja R Harinath  <rharinath@novell.com>
13218
13219         Fix #73052.
13220         * report.cs (Report.SymbolRelatedToPreviousError): Handle
13221         non-simple types (array, pointer, reference).
13222
13223 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
13224
13225         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
13226
13227         * class.cs (MethodCore.IsDuplicateImplementation): Special error
13228         for operators.
13229         (Method.CheckBase): Catch wrong destructor here.
13230         (MethodData.Define): Add errors 550, 668.
13231
13232         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
13233
13234         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
13235
13236         * pending.cs (VerifyPendingMethods): Add error 551.
13237
13238         * typemanager.cs (CSharpName): Next error report helper.
13239
13240 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
13241
13242         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
13243         attributes. Removed useless attribute double check.
13244         It saves almost 2MBs for corlib.
13245
13246 2005-02-25  Raja R Harinath  <rharinath@novell.com>
13247
13248         Fix #72924.
13249         * statement.cs (ExpressionStatement.Resolve): Make robust to being
13250         called twice in case of error.
13251
13252 2005-02-23  Chris Toshok  <toshok@ximian.com>
13253
13254         Fix compiler portions of #72827.
13255         * statement.cs (Block.Emit): call Begin/EndScope on the
13256         EmitContext instead of the ILGenerator.
13257
13258         * codegen.cs (EmitContext.BeginScope): new method, call
13259         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
13260         we have one.)
13261         (EmitContext.BeginScope): same, but EndScope and CloseScope
13262
13263         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
13264         offset and call the superclass's OpenScope(int) with it.
13265         (SymbolWriter.CloseScope): get the current il
13266         offset and call superclass's CloseScope(int) with it.
13267
13268 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
13269
13270         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
13271         CS1677 for out and ref as well.
13272
13273         * class.cs (Method.Define): Add error CS1599 detection.
13274         
13275         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
13276         
13277         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
13278         
13279         * delegate.cs (Delegate.Define): Add error CS1599 detection.
13280         
13281         * support.cs.cs (ModifierDesc): New helper method.
13282
13283 2005-02-23  Raja R Harinath  <rharinath@novell.com>
13284             Abin Thomas  <projectmonokochi@rediffmail.com>
13285             Anoob V E  <projectmonokochi@rediffmail.com>
13286             Harilal P R  <projectmonokochi@rediffmail.com>
13287
13288         Fix #57851, #72718.
13289         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
13290         MemberLookup (used for error reporting) actually returns a result.
13291         Fix error report number (122, not 112).
13292
13293 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
13294             Anoob V E  <projectmonokochi@rediffmail.com>
13295             Harilal P R  <projectmonokochi@rediffmail.com>
13296
13297         Fix #71134.
13298         * pending.cs (PendingImplementation.GetAbstractMethods):
13299         Find NonPublic members too.
13300
13301 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
13302
13303         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13304         Fixed error 217.
13305         
13306         * class.cs (MethodCore.CheckMethodAgainstBase):
13307         Add error 239 report.
13308
13309 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13310
13311         Fix #68955.
13312         * expression.cs (Invocation.IsApplicable): Make public.
13313         (Invocation.IsParamsMethodApplicable): Likewise.
13314         * delegate.cs (Delegate.VerifyApplicability): Don't use
13315         Invocation.VerifyArgumentCompat for parameter applicability
13316         testing.  Use Invocation.IsApplicable and
13317         Invocation.IsParamsMethodApplicable.
13318
13319 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13320
13321         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13322         
13323         * class.cs (Operator.Define): Add error 217 report.
13324         
13325 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13326
13327         * namespace.cs (UsingEntry.Resolve): Undo change below.
13328
13329 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13330
13331         Fix #72756.
13332         * ecore.cs (Expression.MemberLookupFailed): Add argument to
13333         disable the error message when the extended MemberLookup also
13334         fails.
13335         (Expression.MemberLookupFinal): Update.
13336         (SimpleName.DoSimpleNameResolve): Update.
13337         * expression.cs (MemberAccess.ResolveNamespaceOrType):
13338         Don't use MemberLookupFinal.
13339         (New.DoResolve): Update.
13340         (BaseAccess.CommonResolve): Update.
13341
13342 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13343
13344         Fix #72732.
13345         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13346         occured previously, don't resolve again.
13347
13348 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13349
13350         Fix #69949
13351         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13352         argument. Call ResolveAttributeUsage for unresolved.
13353         when types doesn't match ctor arguments.
13354         
13355         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13356         for nested attribute classes.
13357         (Class.attribute_usage): Removed.
13358         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13359         for attribute class.
13360         
13361         * ecore.cs (IsAttribute): Removed.
13362         
13363         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13364         
13365         * rootcontext.cs (RegisterAttribute): Removed, attributes are
13366         now normal types.
13367         (attribute_types): Removed.
13368         (EmitCode): Global attributes are emited as the latest.
13369
13370 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
13371
13372         * class.cs (EmitFieldInitializers): Don't emit field initializer
13373         for default values when optimilization is on.
13374         
13375         * constant.cs (Constant.IsDefaultValue): New property.
13376         
13377         * driver.cs: Add /optimize handling.
13378         
13379         * constant.cs,
13380         * ecore.cs,
13381         * literal.cs: Implement new IsDefaultValue property.
13382         
13383         * rootcontext.cs (Optimize): New field, holds /optimize option.
13384
13385 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13386
13387         Fix crasher in re-opened #72347.
13388         * namespace.cs (Namespace.Lookup): Return null if
13389         DeclSpace.DefineType returns null.
13390
13391         Fix #72678.
13392         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13393
13394 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13395
13396         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
13397         now returns null if it cannot resolve to an lvalue.
13398         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13399         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13400         returned null.  Remove check for SimpleName.
13401         (EventExpr.DoResolveLValue): New.
13402         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13403         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
13404         error from ...
13405         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
13406         avoid CS0131 error.
13407         (Unary.ResolveOperator): Move CS0211 check ...
13408         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
13409         CS0131 error.
13410         (Unary.DoResolveLValue): Simplify.
13411         (AddressOf.DoResolveLValue): New.
13412         (ArrayAccess.DoResolveLValue): New.
13413
13414 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13415
13416         * attribute.cs (Attribute.Resolve): Add arguments casting for
13417         when types doesn't match ctor arguments.
13418
13419 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13420
13421         Fix parts of #63202.
13422         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13423         lookup of operator in base type.  Ensure that all checks happen
13424         when the operator resolves to an "op_..." method.
13425
13426 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13427
13428         Fix #71992.
13429         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13430         'ignore_cs0104' parameter.  Pass it to ...
13431         (NamespaceEntry.Lookup): ... this.
13432         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13433         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13434         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13435         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13436         Update.  Request that cs0104 errors be ignored.
13437         (ComposedCast.ResolveAsTypeStep): Update.
13438
13439 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13440
13441         Fix #59209.
13442         * expression.cs (Invocation.BetterFunction): Remove support for
13443         comparing virtual functions and their overrides.
13444         (Invocation.IsOverride): New.
13445         (Invocation.OverloadResolve): Don't consider 'override' functions
13446         during candidate selection.  Store them in a lookaside list.
13447         If the selected method is a 'virtual' function, use the list to
13448         find any overrides that are closer to the LHS type.
13449
13450 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13451
13452         * expression.cs (New.DoResolve): Add complex core type reduction.
13453         (New.Constantify): Converts complex core type syntax like 'new int ()'
13454         to simple constant.
13455         
13456 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13457
13458         * decl.cs (EntryType.EntryType): New constructor to create an
13459         updated copy of a cache entry.
13460         (MemberCache.AddMethods): Use it.
13461         (MemberCache.ClearDeclaredOnly): Remove.
13462         (MemberCache.MemberCache): Update.
13463
13464 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13465
13466         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13467         variable.  This one is represents the actual low-level declaration
13468         of the method, as opposed to the semantic level `IsStatic'.   
13469
13470         An anonymous method which is hosted into a static method might be
13471         actually an instance method.  IsStatic would reflect the
13472         container, while MethodIsStatic represents the actual code
13473         generated.
13474
13475         * expression.cs (ParameterReference): Use the new MethodIsStatic
13476         instead of IsStatic.
13477
13478         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13479         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13480         set on the current EmitContext. 
13481
13482         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13483         resolve our casted expression as an LValue.  This triggers the
13484         proper LValue processing that is later required by Assign.
13485
13486         This fixes 72347.
13487
13488         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13489
13490 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13491
13492         C# 2.0 Fixed buffer implementation
13493
13494         * anonymous.cs: Update after RegisterHelperClass renaming.
13495
13496         * attribute.cs (AttributeTester.fixed_buffer_cache):
13497         Cache of external fixed buffers.
13498         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13499         implementation if field is fixed buffer else null.
13500
13501         * class.cs
13502         (TypeContainer.AddField): Accept FieldMember instead of Field.
13503         (FieldBase.IsFieldClsCompliant): Extracted code from
13504         VerifyClsCompliance descendant customization.
13505         (FixedField): New class handles fixed buffer fields.
13506         (FixedFieldExternal): Keeps information about imported fixed
13507         buffer.
13508         (IFixedField): Make access to internal or external fixed buffer
13509         same.
13510
13511         * cs-parser.jay: Add fixed buffer parsing.
13512
13513         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13514         buffer.
13515
13516         * expression.cs (Indirection): Extended implementation to accept
13517         fixed buffer field.
13518         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13519         (ElementAccess.MakePointerAccess): Get type as parameter.
13520         (DoResolve): Add fixed buffer field expression conversion.
13521         (DoResolveLValue): Ditto.
13522         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13523         (ArrayPtr): Derives from FixedBufferPtr.
13524         (ArrayPtr.Emit): Add extra emit for array elements.
13525
13526         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13527
13528         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13529         for compiler generated types.
13530         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13531
13532         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13533         and consume less memory.
13534         (Fixed.Resolve): Add fixed buffer case.
13535
13536         * typemanager.cs (compiler_generated_attr_ctor,
13537         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13538         (HasElementType): Add our own implementation to work on every
13539         runtime.
13540
13541 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13542
13543         * anonymous.cs (CaptureContext): Track whether `this' has been
13544         referenced.   
13545
13546         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13547         only captured `this' if it was implicitly done (instance
13548         methods/variables were used). 
13549
13550         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13551         `this' must be captured.
13552
13553 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13554  
13555         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13556         is null it means that there has been no need to capture anything,
13557         so we just create a sibling.
13558
13559         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13560
13561         Just a partial fix.  The other half is fairly elusive.
13562         
13563 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13564
13565         Fix #52586, cs0121-4.cs.
13566         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13567         and return a hashtable.
13568         (MemberCache.ClearDeclaredOnly): New.
13569         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13570         the method_hash of a base type too.
13571         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13572         type methods.  Overwrite entries with the same MethodHandle so
13573         that the ReflectedType is correct.  The process leaves in base
13574         virtual functions and their overrides as distinct entries.
13575         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13576         matters since it was boxed in a ArrayList before.
13577         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13578         modifier.
13579         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13580         case of a virtual function and its override (choose the overload
13581         as better).
13582         (Invocation.OverloadResolve): Avoid 'override' members during
13583         'applicable_type' calculation.
13584
13585 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13586
13587         Combine two near-redundant caches.
13588         * typemanager.cs (method_params): Rename from method_internal_params.
13589         (TypeManager.GetParameterData): New.  Replace
13590         Invocation.GetParameterData.
13591         (TypeManager.LookupParametersByBuilder): Remove.
13592         * expression.cs (Invocation.method_parameter_cache): Remove.
13593         (Invocation.GetParameterData): Remove.
13594         Update to changes.
13595         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13596         Update to changes.
13597
13598 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13599
13600         Fix #72015.
13601         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13602         TypeManager.multicast_delegate_type is null, resolve it by looking
13603         up "System.MulticastDelegate".
13604         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13605
13606 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13607             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13608             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13609
13610         Fix cs0164.cs.
13611         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13612         (LabeledStatement.AddReference): New.  Set 'referenced'.
13613         (Goto.Resolve): Use it.
13614
13615 2005-02-05  John Luke  <john.luke@gmail.com>
13616
13617         * driver.cs: remove duplicate -doc line in Usage ()
13618
13619 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13620
13621         * location.cs (Location.AddFile): Fix CS2002 error report.
13622
13623 2005-02-02  Martin Baulig  <martin@ximian.com>
13624
13625         * delegate.cs (Delegate.DefineType): Report an internal error if
13626         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13627         details.        
13628
13629 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13630
13631         Fix a crasher in a variant of #31984.
13632         * const.cs (Constant.CheckBase): New override that defers the
13633         new-or-override check in case the base type hasn't been populated
13634         yet.
13635         (Constant.Define): Ensure the new-or-override check is performed.
13636
13637 2005-02-01  Duncan Mak  <duncan@ximian.com>
13638
13639         * const.cs (LookupConstantValue): Check that `ce' is not null
13640         before calling GetValue ().
13641
13642 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13643
13644         Fix test-334.cs (#69519).
13645         * cs-parser.jay (using_alias_directive): Pass in an expression to
13646         NamespaceEntry.UsingAlias.
13647         (using_namespace_directive): Pass in an expression to
13648         NamespaceEntry.Using.
13649         (namespace_name): Don't flatten to a string.
13650         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13651         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13652         ResolveAsTypeStep.
13653         (NamespaceEntry.UsingEntry): Likewise.
13654         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13655         changes.
13656         (NamespaceEntry.LookupForUsing): Remove.
13657         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13658         names.
13659         (NamespaceEntry.Lookup): Remove support for dotted names.
13660
13661 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13662
13663         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13664         split into two.
13665         (NamespaceEntry.ImplicitParent): Compute on demand.
13666         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13667         parallels the current.
13668         (NamespaceEntry.LookupForUsing): Use it.
13669         (NamespaceEntry.Lookup): If the current namespace-entry is
13670         implicit, don't search aliases and using tables.
13671
13672 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13673
13674         Fix #31984.
13675         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13676         BaseCache here.
13677         (TypeContainer.BaseCache): Compute on demand.
13678         (TypeContainer.FindMembers): Define constants and types if they're
13679         not already created.
13680         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13681         check.
13682         * const.cs (Constant.Define): Make idempotent.
13683
13684 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13685
13686         * pending.cs: Produce better code (no nops produced by using Ldarg
13687         + value).
13688         
13689         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13690         i - 1' it should be arg + 1.
13691
13692         Fixes bug #71819.
13693
13694 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13695
13696         * attribute.cs (Attribute.CheckAttributeType): Make private
13697         non-virtual.
13698         (Attribute.ResolveType): Make virtual.
13699         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13700         handling of RootContext.Tree.Types.
13701
13702 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13703
13704         Update attribute-handling to use the SimpleName/MemberAccess
13705         mechanisms.
13706         * cs-parser.jay (attribute): Pass in an expression to the
13707         constructors of Attribute and GlobalAttribute.
13708         * attribute.cs (Attribute): Take an expression for the name.
13709         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13710         passed in attribute name expression.
13711         (Attribute.CheckAttributeType): Use it.
13712         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13713         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13714         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13715         argument to prevent error messages if the lookup fails.
13716
13717 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13718
13719         * expression.cs (Indirection): Implemented IVariable interface
13720         to support indirection in AddressOf operator.
13721         (PointerArithmetic.Emit): Add optimalization for case where
13722         result can be precomputed.
13723
13724 2005-01-26  Martin Baulig  <martin@ximian.com>
13725
13726         * class.cs (TypeContainer.AttributeTargets): Return the correct
13727         AttributeTargets depending on our `Kind' instead of throwing an
13728         exception; fixes #71632.
13729
13730 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13731
13732         Fix #71257
13733         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13734         constant members.
13735
13736 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13737
13738         Fix #71602.
13739         * expression.cs (MemberAccess.DoResolve): Don't complain with
13740         cs0572 when the LHS of a member access has identical name and type
13741         name.
13742
13743 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13744
13745         Fix #71651, #71675
13746         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13747         CreatePermission.
13748         Create custom PermissionSet only for PermissionSetAttribute.
13749
13750 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13751
13752         Fix #71649
13753         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13754         delegates in static class.
13755
13756 2005-01-24  Martin Baulig  <martin@ximian.com>
13757
13758         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13759         merging an implicit block, just use its reachability.
13760
13761         * statement.cs (Block.Resolve): Make the unreachable code check
13762         work wrt. implicit blocks; see test-337 from #63842.
13763
13764 2005-01-21  Alp Toker  <alp@atoker.com>
13765  
13766         * cs-parser.jay: destructor_declaration's container is PartialContainer
13767         not Class when partial types are used, so use Kind prop instead of
13768         'is'.
13769         
13770 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13771
13772         * cs-parser.jay: Improve error reporting when an interface
13773         declares new types.
13774
13775 2005-01-20  Dick Porter  <dick@ximian.com>
13776
13777         * support.cs: SeekableStreamReader fix from Sandor Dobos
13778         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13779         chars are read.  Fixes bug 70369.
13780
13781 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13782
13783         * cs-parser.jay (catch_clause): Simplify current_block handling
13784         somewhat.
13785
13786 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13789         code with ImplicitStandardConversion to handle the implicit
13790         conversion of method groups into valid delegate invocations. 
13791
13792         The problem is that in parameter handling we were using this code
13793         path.  Fixes bug #64698
13794
13795 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13796
13797         * cs-parser.jay: Fix several infelicities.
13798         - Avoid assigning to the parser value stack.  Code like 
13799           '$3 = null' is unclean.  Synthesize a value for the code block
13800           instead. 
13801         - Avoid using oob_stack for storing location information.  Use ...
13802         (_mark_): ... this.  New (empty) rule.  Saves the current location
13803         in $$.
13804         (foreach_statement): Avoid using oob_stack for current_block
13805         handling.  Use technique used in for_statement and
13806         using_statement.  Synthesize a value for the code block to store
13807         additional intermediate information.
13808
13809 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13810
13811         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13812         of a different type is only allowed to private fields of a
13813         containing type, not on fields of a base class.
13814
13815         See test-174.cs and error cs0122-9.cs
13816
13817 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13818
13819         Fix test-335.cs (bug #58126).
13820         * cs-parser.jay (argument): Split out non-expression parts of the
13821         rule into 'non_simple_argument'.
13822         (invocation_expression): Support parenthesized invocations with
13823         multiple arguments, and with single non-simple arguments.
13824
13825 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13826
13827         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13828         places.
13829
13830 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13831
13832         Fix cs0038-1.cs, cs1640-6.cs.
13833         * ecore.cs (Expression.Resolve): Remove special-case for
13834         SimpleName in error-handling.
13835         (Expression.almostMatchedMembers): Relax access permission to
13836         protected.
13837         (Expression.MemberLookupFailed): Handle duplicates in
13838         almostMatchedMembers list.
13839         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13840         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13841         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13842         overload if the passed in MemberInfo is a MethodBase.
13843
13844 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13845
13846         Fix #70749
13847         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13848         for non-CAS & merge permission sets properly.
13849
13850 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13851
13852         Improve standard-compliance of simple name and member access 
13853         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13854         * ecore.cs (FullNamedExpression): New abstract base class 
13855         for Namespaces and TypeExpressions.
13856         (ResolveFlags.SimpleName): Remove.
13857         (SimpleName): Remove support for dotted names.
13858         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13859         DeclSpace.FindType and DeclSpace.LookupType.
13860         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13861         (Expression.ExprClassName): Make member function.
13862         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13863         a namespace.  Remove creation of dotted "SimpleName"s.
13864         (MemberAccess.DoResolve): Likewise.
13865         * decl.cs (DeclSpace.Cache): Make private.
13866         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13867         (DeclSpace.FindType): Update.
13868         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13869         FullNamedExpression.
13870         * namespace.cs (Namespace): Derive from FullNamedExpression
13871         so that it can be part of expression resolution.
13872         (Namespace.Lookup): Return an FullNamedExpression.
13873         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13874         namespace.
13875         * rootcontext.cs (NamespaceLookup): Remove.
13876         (LookupType): Move to DeclSpace.
13877         * attribute.cs (CheckAttributeType): Update.
13878         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13879         (FindDocumentedTypeNonArray): Likewise.
13880
13881 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13882
13883         Fix cs0509.cs, cs1632.cs.
13884         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13885         is the same as IsInterface.
13886         (TypeContainer.GetClassBases): Likewise.
13887         * statement.cs (LabeledStatement.ig): New field.
13888         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13889         label.
13890         (LabeledStatement.DoEmit): Check that the label was created with
13891         the same ILGenerator.
13892
13893 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13894
13895         Fix #71058
13896         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13897         accessors to its properties.
13898
13899         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13900         from accessors to property.
13901         
13902 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13903
13904         Fix #70722
13905         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13906         only for overrides.
13907         
13908 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13909
13910         * attribute.cs: Check for null and empty strings.  
13911
13912         I have lost another battle to Paolo.
13913
13914 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13915
13916         Fix #70942
13917         * class.cs (PropertyMethod): Set Parent field in ctors.
13918         (SetMethod.InternalParameters): Add unsafe switch hack.
13919         Override MarkForDuplicationCheck where it is appropriate.
13920
13921         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13922         It says whether container allows members with the same name.
13923         Base default is no.
13924         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13925         Removed is_method parameter.
13926
13927 2005-01-06  Duncan Mak  <duncan@ximian.com>
13928
13929         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13930         because the previous change led to incorrect reporting of CS1032
13931         ("Cannot define/undefine preprocessor symbols after first token in
13932         file"). Instead of using `tokens_seen' as the only flag that
13933         triggers CS1040, introduce `comments_seen'. This new flag is used
13934         to signify having seen comments on the current line, so it is
13935         unset after a newline.
13936
13937 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13938
13939         * doc.cs : When searching for a type, find nested type too.
13940           This fixes bug #71040.
13941
13942 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13943
13944         * doc.cs :
13945           - Warn missing member comment on those classes which also does not
13946             have doc comments. Fixed bug #71041.
13947           - Don't warn missing doc comment on default constructor.
13948             Fixed bug #71042.
13949
13950 2005-01-06  Duncan Mak  <duncan@ximian.com>
13951
13952         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13953         comments, set `tokens_seen' to true. This allows us to detect
13954         misplaced preprocessor directives (i.e. not at the beginning of
13955         the a line, nor after whitespaces). In that case, report error
13956         CS1040. This fixes bug #56460.
13957
13958         * cs-parser.jay (interface_member_declaration): Add checks for
13959         IsExplicitImpl, and report CS0541 error if an interface member is
13960         defined as an explicit interface declaration.
13961
13962 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13963
13964         Fix #70817
13965         * class.cs (PropertyMethod): Set Parent field in ctors.
13966         (SetMethod.InternalParameters): Add unsafe switch hack.
13967         
13968         * decl.cs (MemberCore.Parent): Cannot be readonly.
13969
13970 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13971
13972         * decl.cs (DeclSpace.ResolveType): Remove.
13973         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13974         Merge in code from ...
13975         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13976         * class.cs, enum.cs: Update to changes.
13977
13978 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * anonymous.cs: Ensure that we init the scope of our parent if it
13981         has not been initialized yet.
13982
13983 2004-12-30  Duncan Mak  <duncan@ximian.com>
13984
13985         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13986         if field.FieldBuilder is null. Fixes #70758.
13987
13988         * convert.cs: Fixed some typos and updated some of the comments.
13989         (ImplicitStandardConversionExists):
13990         (TryImplicitIntConversion): If `target_type' is an interface and
13991         the type of `ic' implements this interface, return true or a new
13992         BoxedCast instead of null. This fixes #70468.
13993
13994 2004-12-29  Duncan Mak  <duncan@ximian.com>
13995
13996         * expression.cs (Argument.Emit): Check that Expr is
13997         IMemoryLocation before casting to it, and report CS1510 otherwise.
13998
13999         This fixes #70402.
14000
14001 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
14002
14003         * statement.cs (Block.ThisVariable): remove the recursion here, to
14004         make the --profile more sane.
14005
14006 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
14007
14008         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14009         assembly, by JB Evain.
14010
14011 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14012
14013         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
14014           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14015         "parent" refers to enclosing type/class.  "base" refers to superclass.
14016
14017 2004-12-17  Raja R Harinath  <rharinath@novell.com>
14018
14019         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14020         Ensure that we only have GlobalAttributes.
14021         * attribute.cs (Attribute.Emit): Make non-virtual.
14022         (GlobalAttribute.Emit): Remove.
14023         (Attribute.Resolve): Make virtual.
14024         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
14025         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14026         the argument. Don't create one.
14027         (Attribute.GetObsoleteAttribute): Likewise.
14028         (Attribute.GetClsCompliantAttributeValue): Likewise.
14029         * class.cs, decl.cs: Update to changes.
14030
14031 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
14032
14033         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
14034         
14035         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
14036         
14037         * statement.cs (Foreach.Resolve): Add error 186 report.
14038
14039 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
14040
14041         * expression.cs (Conditional.DoResolve): Add warning 429.
14042         
14043         * statement.cs (If.Resolve): Add warning 665.
14044
14045 2004-12-16  Raja R Harinath  <rharinath@novell.com>
14046
14047         New invariant: RootContext.Tree.Types.NamespaceEntry == null
14048         except when in the parser, and in GlobalAttribute.
14049         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
14050         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
14051         RootContext.Tree.Types.NamespaceEntry once work is done.
14052         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
14053         and resets RootContext.Tree.Types.NamespaceEntry.
14054
14055 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
14056
14057         * cs-parser.jay: Don't create a block for every variable.
14058
14059 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
14060
14061         * location.cs: Provide extra information.
14062
14063         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
14064         variables from the captured environment, it is the ldarg_0.
14065
14066 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14067
14068         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
14069         find a conclusion.
14070         
14071         * class.cs: Changed warning level for 169 to avoid developer
14072         displeasure from warning flooding. It will be changed back when they
14073         fix most of current BCL warnings.
14074         
14075         * RootContext.cs: Pushed default WarningLevel to 3.
14076         
14077         * statement.cs: Removed unused variable.
14078
14079 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
14080
14081         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
14082         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
14083         Add error 502 report.
14084         (StaticClass.DefineType): Add error 441 report.
14085         (Class.AllowedModifiersProp): New virtual property as temporary
14086         extension to AllowedModifiers.
14087         (Class.DefineType): Add error 418 report. Moved ModFlags check here
14088         to share implementation with StaticClass and don't call virtual
14089         methods from ctor.
14090         
14091         * driver.cs (MainDriver): Add error 1558 test.
14092
14093         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
14094         report. Moved error 36 test here.
14095
14096         * statement.cs (Throw.Resolve): Add error 724 report.
14097
14098         * typemanager.cs: Add out_attribute_type core type.
14099         
14100 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
14101
14102         * class.cs (TypeContainer.VerifyClsCompliance): Add error
14103         3018 report.
14104         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
14105
14106         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
14107         3017 report.
14108         
14109         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
14110
14111         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
14112         Add error 3023 report.
14113         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
14114
14115         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
14116         implementation.
14117
14118 2004-12-12  John Luke  <john.luke@gmail.com>
14119
14120         * driver.cs (AddArgs): take -- into account when
14121         adding arguments, fixes bug 65710 
14122
14123 2004-12-12  Martin Baulig  <martin@ximian.com>
14124
14125         * expression.cs (Unary.TryReduceNegative): Added support for
14126         SByteConstant and ByteConstant.
14127         (Unary.Reduce): Check error values from TryReduceNegative().
14128
14129 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
14130
14131         * attributes.cs (Attribute.Resolve): Avoid multiple error report
14132         and report exception as error 182.
14133
14134 2004-12-10  Raja R Harinath  <rharinath@novell.com>
14135
14136         * driver.cs (Main): Fix message when there are warnings.
14137
14138 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
14139
14140         * delegate.cs: Fixed my fix from yesterday, sorry about that.
14141
14142 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
14143
14144         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
14145         Reduced number of warnings.
14146         
14147         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
14148
14149 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * driver.cs: Removed message.
14152
14153         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
14154
14155 2004-12-08    <vargaz@freemail.hu>
14156
14157         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
14158
14159 2004-12-08  Martin Baulig  <martin@ximian.com>
14160
14161         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
14162         instead of a CS3002 for properties and indexer.
14163
14164 2004-12-08  Martin Baulig  <martin@ximian.com>
14165
14166         * decl.cs (MemberName.ToString): Make this work again.
14167
14168 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
14169
14170         * attribute.cs (Resolve): Add error 591 detection.
14171
14172         * class.cs (FieldMember.Define): Add error 1547 detection.
14173         (Indexer.Define): Add error 620 detection.
14174         (Operator.Define): Add error 590 detection.
14175
14176         * ecore.cs: Missing argument for error 79.
14177
14178         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
14179         detection.
14180
14181 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
14182
14183         Fix #70106
14184         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
14185         only.
14186
14187 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
14188
14189         * cs-parser.jay : handle doc comments on implicit/explicit operators.
14190           Some operator comments were suppressed.
14191         * doc.cs : Implicit/explicit operator name in doc comments are like
14192           "op_Explicit(type)~returnType", so added suffix handling.
14193
14194 2004-12-07  Martin Baulig  <martin@ximian.com>
14195
14196         * decl.cs
14197         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
14198         (MemberCore.GetClsCompliantAttributeValue): Likewise.
14199         (DeclSpace.ec): New protected field; store the EmitContext here.
14200         (DeclSpace.EmitContext): New public property; moved here from
14201         `TypeContainer'.
14202         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
14203         EmitContext.
14204
14205         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
14206         (Enum.Emit): Don't create a new EmitContext.
14207
14208         * delegate.cs (Delegate.DefineType): Always create the
14209         EmitContext.
14210
14211         * iterators.cs (Iterators.DefineIterator): Create a new
14212         EmitContext and store it in `ec'.
14213
14214 2004-08-24  Martin Baulig  <martin@ximian.com>
14215
14216         * typemanager.cs
14217         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
14218         this for accessibility checks.
14219         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
14220         IsNestedFamilyAccessible.
14221         (TypeManager.IsSubclassOf): New method, do what the name actually
14222         says.   
14223
14224 2004-12-06  Raja R Harinath  <rharinath@novell.com>
14225
14226         Fix crash on cs0657-17.cs.
14227         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14228         Use RootContext.Tree.Types, not 'new RootTypes ()'.
14229         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
14230         the case where the NamespaceEntry gets overwritten.
14231
14232 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
14233
14234         Fixed #69195, #56821
14235         * ecore.cs (ResolveBoolean): Tiny refactoring.
14236
14237         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
14238         of right expression resolving when left is false constant and
14239         operator is LogicalAnd OR true constant and operator is LogicalOr.
14240
14241         * statement.cs (ResolveUnreachable): Always reports warning.
14242
14243 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * class.cs: Distinguish between 1721 and 1722 (just a little help
14246         for the programmer).
14247
14248 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * delegate.cs: Only allow this on new versions of the language. 
14251
14252 2004-12-02  Duncan Mak  <duncan@ximian.com>
14253
14254         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
14255         Expression class.
14256         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
14257         here as a static method. Take an additional bool out parameter
14258         `must_do_cs1540_check' for signaling to InstanceResolve.
14259         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
14260         member field from PropertyExpr class and made it an argument of
14261         the method instead.
14262         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
14263         check for MarshalByRefObject, and report CS0122 instead of CS1540.
14264         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
14265         and `remove_accessor' as well as InstanceResolve: report CS0122
14266         where applicable.
14267
14268         Fixes #70129.
14269
14270 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14271
14272         Fix test-327.cs, test-328.cs, and put in early infrastructure
14273         for eventually fixing #52697.
14274         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
14275         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
14276         from other methods.
14277         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
14278         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
14279         (VerifyUsing, error246): Update.
14280         * rootcontext.cs (RootContext.NamespaceLookup): Just use
14281         'NamespaceEntry.LookupNamespaceOrType'.
14282
14283 2004-12-03  Martin Baulig  <martin@ximian.com>
14284
14285         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14286         method as our child, call AnonymousMethod.Compatible() on it.
14287
14288 2004-12-03  Raja R Harinath  <rharinath@novell.com>
14289
14290         Disable XML documentation support in 'basic' profile.
14291         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
14292         Redirect XmlElement to System.Object.
14293         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
14294         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
14295         * mcs.exe.sources: Add doc-bootstrap.cs.
14296         * doc-bootstrap.cs: New file.  Contains empty stub implementation
14297         of doc.cs.
14298
14299 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
14300
14301         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14302           comments are allowed.
14303
14304 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14305
14306         * delegate.cs: Add checks for subtypes in paramaters and return values
14307         in VerifyMethod () to add support for Covariance/Contravariance
14308         in delegates.
14309         
14310 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
14311
14312         * report.cs: Remove extra closing parenthesis.
14313
14314         * convert.cs (Error_CannotImplicitConversion): If the name of the
14315         types are the same, provide some extra information.
14316
14317         * class.cs (FieldBase): Use an unused bit field from the field to
14318         encode the `has_offset' property from the FieldMember.  This saves
14319         a couple of Ks on bootstrap compilation.
14320
14321         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14322         method as our child, return the AnonymousMethod resolved
14323         expression.
14324
14325         * expression.cs (New.DoResolve): Allow return values from
14326         NewDelegate to also include AnonymousMethods.
14327
14328         Fixes #70150.
14329
14330 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
14331
14332         Fix bug #70102
14333         * attribute.cs (Resolve): Improved implementation of params
14334         attribute arguments.
14335
14336         * support.cs (ParameterData): Add HasParams to be faster.
14337
14338 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
14339
14340         all things are for /doc support:
14341
14342         * doc.cs: new file that supports XML documentation generation.
14343         * mcs.exe.sources: added doc.cs.
14344         * driver.cs:
14345           Handle /doc command line option.
14346           Report error 2006 instead of 5 for missing file name for /doc.
14347           Generate XML documentation when required, after type resolution.
14348         * cs-tokenizer.cs:
14349           Added support for picking up documentation (/// and /** ... */),
14350           including a new XmlCommentState enumeration.
14351         * cs-parser.jay:
14352           Added lines to fill Documentation element for field, constant,
14353           property, indexer, method, constructor, destructor, operator, event
14354           and class, struct, interface, delegate, enum.
14355           Added lines to warn incorrect comment.
14356         * rootcontext.cs :
14357           Added Documentation field (passed only when /doc was specified).
14358         * decl.cs:
14359           Added DocComment, DocCommentHeader, GenerateDocComment() and
14360           OnGenerateDocComment() and some supporting private members for
14361           /doc feature to MemberCore.
14362         * class.cs:
14363           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14364         * delegate.cs:
14365           Added overriden DocCommentHeader.
14366         * enum.cs:
14367           Added overriden DocCommentHeader and GenerateDocComment().
14368
14369 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14372         unwrapping the enumeration values, chain to
14373         DoConstantNumericPromotions again, so we can promote things to the
14374         fundamental types (takes care of enums that are bytes, sbytes).
14375
14376         Fixes bug #62054.
14377
14378 2004-12-01  Raja R Harinath  <rharinath@novell.com>
14379
14380         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14381         Fix long-standing bug in type-lookup.  Use FindType instead of
14382         LookupType when ec.ResolvingTypeTree.
14383         (Attribute.ResolveType, Attribute.Resolve)
14384         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14385         Update to changes.
14386         (Attributes.Search): Remove internal version.  Update.
14387         (Attributes.SearchMulti): Update.
14388         (Attributes.GetClsCompliantAttribute): Remove.
14389         (Attributes.GetIndexerNameAttribute): Remove.
14390         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14391         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14392         * class.cs (Indexer.Define): Likewise.
14393
14394 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
14395
14396         Fix bug #68790
14397         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14398         MarshallByReference members access.
14399
14400         * expression.cs: Use CheckMarshallByRefAccess;
14401         Better error CS0197 message.
14402
14403         * report.cs: Print whole related error message.
14404
14405 2004-11-30  Raja R Harinath  <rharinath@novell.com>
14406
14407         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14408         the current directory to help debugging.
14409
14410 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14411
14412         * class (GetClassBases): Better error 60 report.
14413         (EventProperty): Disabled warning 67 detection.
14414
14415 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14416
14417         Fix bug #60324
14418         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14419
14420         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14421         precise values.
14422
14423 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14424
14425         Fix bug #49488
14426         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14427
14428         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14429
14430 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * attribute.cs (Attribute.Resolve): Refine error reporting and
14433         report a cs0117 if the identifier does not exist, to distinguish
14434         from 0617 which is a miss-use of the actual identifier.
14435
14436         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14437         between cs0070 and cs0079.
14438
14439         * class.cs (MemberBase.DoDefine): When reporting a wrong
14440         accessibility level, we use MethodCore to compare instead of
14441         Method (this was a regression in some refactoring effort).
14442
14443         So now we correctly report cs0056 again.
14444
14445         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14446         testing the target_type (which was known to be object_type) and
14447         not the source type (which is anonymous_method).
14448
14449         Fixed reporting of error cs1660.
14450
14451         * expression.cs (UserCast.Source): Expose the underlying cast.
14452
14453         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14454         allowed types to find a match to int32 first (most common).
14455
14456         In addition, it ignores any ImplicitUserConversions that did an
14457         internal implicit conversion (as the switch statement allows only
14458         one integral conversion to exist).
14459
14460         * class.cs (PartialContainer.Create): rename `name' to
14461         `member_name' for clarity.  Then replace the string calls with a
14462         call to MemberName.GetPartialName, as now using
14463         MemberName.ToString is an error (this is due to the side effects
14464         it had, that were fixed in the past).
14465
14466         This will restore the error reporting on a number of partial class
14467         errors that were missusing this (and getting an exception as a
14468         results, which is now just a plain textual warning, because
14469         yyparse debug output would crash otherwise).
14470
14471 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14472
14473         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14474
14475 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14476
14477         * rootcontext.cs (LookupType): Make sure to cache lookups that
14478         don't give us a negative result. This saves about 5% of corlib
14479         compilation time.
14480
14481 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * report.cs (AbstractMessage.Print): messages are sent to stderr
14484
14485         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14486         non-interface in the list of interfaces (at this point, either
14487         parent was properly set, or a base class is being listed in the
14488         interfaces section).
14489
14490         This flags error 1722, and resolves the crash from bug 69259.
14491
14492 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14493
14494         * statement.cs (Using.EmitExpressionFinally): make this work right
14495         for valuetypes. Fixes 69926.
14496
14497 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14498
14499         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14500         converted to an enum" here, before we try to change the underlying
14501         type.  This code exists, but it is a different code path than the
14502         one used while encoding constants.
14503
14504         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14505         old bug: when converting from the null literal to a pointer,
14506         return an EmptyCast, not the NullLiteral.
14507
14508         This fixes #69921, the recent null_type changes probably made this
14509         bug more prominent.
14510
14511         (ImplicitReferenceConversionExists): In addition, resynchronized
14512         the code here, so it matches the same code in
14513         ImplicitReferenceConversionExists for the `from any class-type S
14514         to any interface-type T'.
14515         
14516
14517 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14518
14519         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14520
14521 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * cs-parser.jay: Use verbosity accordingly. 
14524
14525 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14526
14527         * expression.cs (Unary.ResolveOperator): Do not report warning;
14528         AddressOf reads from variable.
14529         
14530         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14531
14532 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14533
14534         Fix bug #69462
14535
14536         * attribute.cs (Attributable): Removed CheckTargets.
14537         (Attributes.Emit): Explicit attribute targets are tested here.
14538
14539         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14540         not enabled for interfaces.
14541
14542         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14543         (GetAssemblyName): Ouch next bug there.
14544
14545 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14546
14547         * expression.cs: Error 275 added.
14548         
14549 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14550
14551         Fix bug #69177 (Implemented decimal constant support)
14552
14553         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14554         (BinaryFold): Add DecimalConstant.
14555
14556         * const.cs (Define): Decimal constant 
14557         (is not constant.
14558         (ChangeType): Add decimal type handling.
14559         (LookupConstantValue): Don't set value for decimal type but
14560         emit DecimalConstantAttribute. Needed for constant optimization.
14561
14562         * constant.cs (ToDecimal): New method.
14563         (ConvertToDecimal): New method.
14564         (IntConstant): Implemented ConvertToDecimal.
14565         (DecimalConstant.Emit): Emit optimized version for decimals in
14566         int range.
14567
14568         * expression.cs (ResolveOperator): Changed order of constant
14569         reduction to work correctly with native types which have
14570         overloaded operators.
14571         (ResolveMemberAccess): Extract constant value from attribute
14572         for decimal type.
14573
14574         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14575
14576         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14577         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14578         (ChangeType): Decimal is special.
14579         (TypeToCoreType): Add decimal type.
14580
14581 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14582
14583         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14584         decimal types.
14585
14586 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14587
14588         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14589         test cs1667-5.cs.
14590
14591 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14592
14593         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14594
14595         * pending.cs (PendingImplementation): Grab only interfaces.
14596
14597 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14598
14599         * statement.cs (ForeachHelperMethods): Add location member and
14600         error 202 detection.
14601
14602 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14603
14604         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14605         automatically handled by executable.make.
14606         (PROGRAM): Make profile-specific.
14607
14608 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14609
14610         * expression.cs (DoResolveBase): Fixed wrong warning for out
14611         variables.
14612
14613 2004-11-18  Martin Baulig  <martin@ximian.com>
14614
14615         Merged latest changes into gmcs.  Please keep this comment in
14616         here, it makes it easier for me to see what changed in MCS since
14617         the last time I merged.
14618
14619 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14620
14621         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14622         (TypeHandle.GetMemberCache): New.
14623         (TypeHandle.TypeHandle): Update.
14624         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14625         (TypeManager.LookupParentInterfacesCache):
14626         Rename from LookupInterfaceCache.  Optimize slightly.
14627         (TypeManager.MemberLookup_FindMembers): Update.
14628         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14629         multi-type variant.
14630         (AddCacheContents): Rename from AddHashtable.
14631         * class.cs (TypeContainer.parent_container): Remove.
14632         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14633         (TypeContainer.DoDefineMembers): Don't initialize it.
14634         Update to name changes.
14635         
14636 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14639         that factors the code to check access modifiers on override.  
14640
14641         (PropertyBase): Use the code here.
14642
14643         Patch from Lluis S'anchez, fixes bug #69361.
14644
14645 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14648         routine that is used to report the use of a captured variable
14649         whose address has been taken.
14650
14651         There are two checks: one when variables are being captured and
14652         the other check is when the address of a variable is taken. 
14653         
14654         (because an anonymous methods might be resolved before *or* after
14655         the address has been taken) and 
14656
14657         * expression.cs (Conditional.DoResolve): Remove the special
14658         casing that Martin added to trueExpr and falseExpr being both
14659         NullLiteral.  We get the right behavior now just by introducing
14660         the null_type into the compiler. 
14661
14662         * convert.cs (ExplicitConversion): Change the code to use
14663         null_type instead of testing `expr is NullLiteral'.
14664         (ImplicitConversionStandard): use null_type too.
14665         (ImplicitReferenceConversionExists): use null_type too.
14666         (ImplicitReferenceConversion): use null_type too.
14667
14668         * literal.cs: The type of `NullLiteral' is now null_type instead
14669         of object_type. 
14670         (Resolve): Set the type here.
14671
14672         * typemanager.cs: Introduce null_type.
14673
14674 2004-11-17  Martin Baulig  <martin@ximian.com>
14675
14676         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14677         direction, like FindMembers() does.  Fixes #69546, testcase is in
14678         test-315.cs.    
14679
14680 2004-11-16  Martin Baulig  <martin@ximian.com>
14681
14682         This is based on a patch from Marek Safar, see bug #69082.
14683         Fixes bugs #63705 and #67130.
14684
14685         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14686         method; create a MemberCache for an interface type and cache the
14687         result.
14688
14689         * decl.cs (IMemberContainer.ParentContainer): Removed.
14690         (IMemberContainer.ParentCache): New property.
14691         (MemberCache.SetupCacheForInterface): Removed.
14692         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14693         to create a cache for an interface's "parent".
14694
14695         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14696         interfaces too.
14697
14698 2004-11-16  Martin Baulig  <martin@ximian.com>
14699
14700         Merged back from gmcs; these changes already went into gmcs a
14701         couple of weeks ago.
14702
14703         * typemanager.cs
14704         (TypeManager.AddUserType): Removed the `ifaces' argument.
14705         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14706         `TypeExpr []'.
14707         (TypeManager.AddUserInterface): Removed.
14708         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14709         `TypeExpr []'.
14710         (TypeManager.GetInterfaces): Likewise.
14711         (TypeManager.GetExplicitInterfaces): Likewise.
14712
14713         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14714
14715         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14716         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14717
14718 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14719
14720         * statement.cs: Avoid adding bools to a hashtable.
14721
14722 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14725         calling an unsafe method from a safe location.
14726
14727 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14728
14729         Fix #69167
14730         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14731
14732 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14733
14734         * namespace.cs (VerifyUsing): use GetPartialName instead of
14735         ToString. 
14736
14737 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14738
14739         * statement.cs (Return.Resolve): Fix regression in typo: if
14740         `in_exc', we have to request a NeedReturnLabel, this was a typo
14741         introduced in the anonymous method check-in.  Fixes #69131.
14742
14743         * Indexers were using the ShortName when defining themselves,
14744         causing a regression in the compiler bootstrap when applying the
14745         patch from 2004-11-02 (first part), now they use their full name
14746         and the bug is gone.
14747
14748 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14749
14750         * driver.cs: Strip the path from the names of embedded resources. Fixes
14751         #68519.
14752
14753 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14754
14755         Fix error message regression: cs0104-2.cs.
14756         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14757         (AliasEntry.Resolve): Update.
14758         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14759         'silent' flag.
14760         (RootContext.LookupType): Update.
14761
14762 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14763
14764         * cs-parser.jay: Add support for handling accessor modifiers
14765         * class: Add support port accessor modifiers and error checking,
14766         define PropertyMethod.Define as virtual (not abstract anymore)
14767         * ecore.cs: Add checking for proeprties access with access modifiers
14768         * iterators.cs: Modify Accessor constructor call based in the modified
14769         constructor
14770 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14771
14772         * expression.cs (StringConcat): Handle being called twice,
14773         as when we have a concat in a field init with more than two
14774         ctors in the class
14775
14776 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14779         special case explicit implementations, we should always produce
14780         the .property or .event declaration.
14781         
14782         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14783         since it will not return correct data if people use this
14784         unresolved in the presence of using statements (see test-313).
14785
14786         * class.cs (MethodData.Define): If we are an explicit interface
14787         implementation, set the method name to the full name of the
14788         interface plus the name of the method.  
14789
14790         Notice that using the method.MethodName.GetFullName() does not
14791         work, as it will only contain the name as declared on the source
14792         file (it can be a shorthand in the presence of using statements)
14793         and not the fully qualifed type name, for example:
14794
14795         using System;
14796
14797         class D : ICloneable {
14798                 object ICloneable.Clone ()  {
14799                 }
14800         }
14801
14802         Would produce a method called `ICloneable.Clone' instead of
14803         `System.ICloneable.Clone'.
14804
14805         * namespace.cs (Alias.Resolve): Use GetPartialName.
14806         
14807 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14808
14809         * cs-parser.jay: Add error 1055 report.
14810
14811 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14812
14813         * assign.cs (Assign.DoResolve): Only do the transform of
14814         assignment into a New if the types are compatible, if not, fall
14815         through and let the implicit code deal with the errors and with
14816         the necessary conversions. 
14817
14818 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14819
14820         * cs-parser.jay: Add error 1031 report.
14821
14822         * cs-tokenizer.cs: Add location for error 1038.
14823
14824 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14825
14826         * cs-parser.jay: Add error 1016 report.
14827
14828 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14829
14830         * cs-parser.jay: Add errors 1575,1611 report.
14831
14832 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14833
14834         * cs-parser.jay: Add error 1001 report.
14835
14836 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14837
14838         Fix #68850
14839         * attribute.cs (GetMarshal): Add method argument for
14840         caller identification.
14841
14842         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14843         agument for GetMarshal and RuntimeMissingSupport.
14844
14845 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14846
14847         * attribute.cs (ExtractSecurityPermissionSet): Removed
14848         TypeManager.code_access_permission_type.
14849
14850         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14851
14852 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14855         for obsolete use of a variable here.   Fixes regression on errors
14856         cs0619-25 and cs0619-26.
14857
14858 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14859
14860         Fix #62358, implemented security attribute encoding.
14861
14862         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14863         Tests permitted SecurityAction for assembly or other types.
14864         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14865         data from SecurityPermissionAttribute to PermisionSet class.
14866
14867         * class.cs (ApplyAttributeBuilder): Added special handling
14868         for System.Security.Permissions.SecurityAttribute based types.
14869
14870         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14871         special handling for System.Security.Permissions.SecurityAttribute
14872         based types.
14873
14874         * enum.cs (ApplyAttributeBuilder): Added special handling
14875         for System.Security.Permissions.SecurityAttribute based types.
14876
14877         * parameter.cs (ApplyAttributeBuilder): Added special handling
14878         for System.Security.Permissions.SecurityAttribute based types.
14879
14880         * rootcontext.cs: Next 2 core types.
14881
14882         * typemanager.cs (TypeManager.security_permission_attr_type):
14883         Built in type for the SecurityPermission Attribute.
14884         (code_access_permission_type): Build in type.
14885
14886 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14889         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14890         all of this information into
14891         EmitContext.EmitCapturedVariableInstance.
14892         
14893         * codegen.cs (EmitCapturedVariableInstance): move here the
14894         funcionality of emitting an ldarg.0 in the presence of a
14895         remapping.   This centralizes the instance emit code.
14896
14897         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14898         then emit a load of this: it means that we have reached the
14899         topmost ScopeInfo: the one that contains the pointer to the
14900         instance of the class hosting the anonymous method.
14901
14902         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14903         captures to the topmost CaptureContext.
14904
14905 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * expression.cs (LocalVariableReference): Move the knowledge about
14908         the iterators into codegen's EmitCapturedVariableInstance.
14909
14910 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14911
14912         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14913         all code paths return a value from an anonymous method (it is the
14914         same as the 161 error, but for anonymous methods).
14915
14916 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14917
14918         The introduction of anonymous methods in the compiler changed
14919         various ways of doing things in the compiler.  The most
14920         significant one is the hard split between the resolution phase
14921         and the emission phases of the compiler.
14922
14923         For instance, routines that referenced local variables no
14924         longer can safely create temporary variables during the
14925         resolution phase: they must do so from the emission phase,
14926         since the variable might have been "captured", hence access to
14927         it can not be done with the local-variable operations from the runtime.
14928         
14929         * statement.cs 
14930
14931         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14932         is a toplevel block.
14933
14934         (ToplevelBlock): A new kind of Block, these are the blocks that
14935         are created by the parser for all toplevel method bodies.  These
14936         include methods, accessors and anonymous methods.
14937
14938         These contain some extra information not found in regular blocks:
14939         A pointer to an optional CaptureContext (for tracking captured
14940         local variables and parameters).  A pointer to the parent
14941         ToplevelBlock.
14942         
14943         (Return.Resolve): Catch missmatches when returning a value from an
14944         anonymous method (error 1662).
14945         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14946         phase.
14947
14948         (Break.Resolve): ditto.
14949
14950         (SwitchLabel): instead of defining the labels during the
14951         resolution phase, we now turned the public ILLabel and ILLabelCode
14952         labels into methods called GetILLabelCode() and GetILLabel() that
14953         only define the label during the Emit phase.
14954
14955         (GotoCase): Track the SwitchLabel instead of the computed label
14956         (its contained therein).  Emit the code by using
14957         SwitchLabel.GetILLabelCode ().
14958
14959         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14960         whether the Local has been captured or not.
14961
14962         (LocalInfo.IsCaptured): New property, used to tell whether the
14963         local has been captured.
14964         
14965         * anonymous.cs: Vastly updated to contain the anonymous method
14966         support.
14967
14968         The main classes here are: CaptureContext which tracks any
14969         captured information for a toplevel block and ScopeInfo used to
14970         track the activation frames for various local variables.   
14971
14972         Each toplevel block has an optional capture context associated
14973         with it.  When a method contains an anonymous method both the
14974         toplevel method and the anonymous method will create a capture
14975         context.   When variables or parameters are captured, they are
14976         recorded on the CaptureContext that owns them, for example:
14977
14978         void Demo () {
14979              int a;
14980              MyDelegate d = delegate {
14981                  a = 1;
14982              }
14983         }
14984
14985         Here `a' will be recorded as captured on the toplevel
14986         CapturedContext, the inner captured context will not have anything
14987         (it will only have data if local variables or parameters from it
14988         are captured in a nested anonymous method.
14989
14990         The ScopeInfo is used to track the activation frames for local
14991         variables, for example:
14992
14993         for (int i = 0; i < 10; i++)
14994                 for (int j = 0; j < 10; j++){
14995                    MyDelegate d = delegate {
14996                         call (i, j);
14997                    }
14998                 }
14999
15000         At runtime this captures a single captured variable `i', but it
15001         captures 10 different versions of the variable `j'.  The variable
15002         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15003         recorded on a child.  
15004
15005         The toplevel ScopeInfo will also track information like the `this'
15006         pointer if instance variables were referenced (this is necessary
15007         as the anonymous method lives inside a nested class in the host
15008         type of the method). 
15009
15010         (AnonymousMethod): Expanded to track the Toplevel, implement
15011         `AnonymousMethod.Compatible' to tell whether an anonymous method
15012         can be converted to a target delegate type. 
15013
15014         The routine now also produces the anonymous method content
15015
15016         (AnonymousDelegate): A helper class that derives from
15017         DelegateCreation, this is used to generate the code necessary to
15018         produce the delegate for the anonymous method that was created. 
15019
15020         * assign.cs: API adjustments for new changes in
15021         Convert.ImplicitStandardConversionExists.
15022
15023         * class.cs: Adjustments to cope with the fact that now toplevel
15024         blocks are of type `ToplevelBlock'. 
15025
15026         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15027         insteda of standard blocks.
15028
15029         Flag errors if params arguments are passed to anonymous methods.
15030
15031         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15032         `CurrentAnonymousMethod' which points to the current Anonymous
15033         Method.  The variable points to the AnonymousMethod class that
15034         holds the code being compiled.  It is set in the new EmitContext
15035         created for the anonymous method.
15036
15037         (EmitContext.Phase): Introduce a variable and an enumeration to
15038         assist in enforcing some rules about when and where we are allowed
15039         to invoke certain methods (EmitContext.NeedsReturnLabel is the
15040         only one that enfonces this right now).
15041
15042         (EmitContext.HaveCaptureInfo): new helper method that returns
15043         whether we have a CapturedContext initialized.
15044
15045         (EmitContext.CaptureVariable): New method used to register that a
15046         LocalInfo must be flagged for capturing. 
15047
15048         (EmitContext.CapturedParameter): New method used to register that a
15049         parameters must be flagged for capturing. 
15050         
15051         (EmitContext.CapturedField): New method used to register that a
15052         field must be flagged for capturing. 
15053
15054         (EmitContext.HaveCapturedVariables,
15055         EmitContext.HaveCapturedFields): Return whether there are captured
15056         variables or fields. 
15057
15058         (EmitContext.EmitMethodHostInstance): This is used to emit the
15059         instance for the anonymous method.  The instance might be null
15060         (static methods), this (for anonymous methods that capture nothing
15061         and happen to live side-by-side with the current method body) or a
15062         more complicated expression if the method has a CaptureContext.
15063
15064         (EmitContext.EmitTopBlock): Routine that drives the emission of
15065         code: it will first resolve the top block, then emit any metadata
15066         and then emit the code.  The split is done so that we can extract
15067         any anonymous methods and flag any captured variables/parameters.
15068         
15069         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
15070         during this phase, the ILGenerator should not be used as labels
15071         and local variables declared here might not be accessible to any
15072         code that is part of an anonymous method.  
15073
15074         Exceptions to this include the temporary variables that are
15075         created by some statements internally for holding temporary
15076         variables. 
15077         
15078         (EmitContext.EmitMeta): New routine, in charge of emitting all the
15079         metadata for a cb
15080
15081         (EmitContext.TemporaryReturn): This method is typically called
15082         from the Emit phase, and its the only place where we allow the
15083         ReturnLabel to be defined other than the EmitMeta.  The reason is
15084         that otherwise we would have to duplicate a lot of logic in the
15085         Resolve phases of various methods that today is on the Emit
15086         phase. 
15087
15088         (EmitContext.NeedReturnLabel): This no longer creates the label,
15089         as the ILGenerator is not valid during the resolve phase.
15090
15091         (EmitContext.EmitThis): Extended the knowledge in this class to
15092         work in anonymous methods in addition to iterators. 
15093
15094         (EmitContext.EmitCapturedVariableInstance): This emits whatever
15095         code is necessary on the stack to access the instance to a local
15096         variable (the variable will be accessed as a field).
15097
15098         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
15099         EmitContext.EmitAddressOfParameter): Routines to support
15100         parameters (not completed at this point). 
15101         
15102         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
15103         will also remove the parameters.
15104
15105         * convert.cs (Convert): Define a `ConstantEC' which points to a
15106         null.  This is just to prefity some code that uses
15107         ImplicitStandardConversion code and do not have an EmitContext
15108         handy.
15109
15110         The idea is to flag explicitly that at that point in time, it is
15111         known that the conversion will not trigger the delegate checking
15112         code in implicit conversions (which requires a valid
15113         EmitContext). 
15114
15115         Everywhere: pass new EmitContext parameter since
15116         ImplicitStandardConversionExists now requires it to check for
15117         anonymous method conversions. 
15118
15119         (Convert.ImplicitStandardConversionExists): If the type of an
15120         expression is the anonymous_method_type, and the type is a
15121         delegate, we invoke the AnonymousMethod.Compatible method to check
15122         whether an implicit conversion is possible. 
15123
15124         (Convert.ImplicitConversionStandard): Only do implicit method
15125         group conversions if the language level is not ISO_1.
15126
15127         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
15128         MethodInfo for the Invoke method.  used by Delegate and
15129         AnonymousDelegate.
15130
15131         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
15132         method conversions if the target type is a delegate.
15133
15134         Removed extra debugging nops.
15135
15136         (LocalVariableReference): Turn the `local_info' into a public
15137         field. 
15138
15139         Add `prepared' field, the same hack used for FieldExprs to cope
15140         with composed assignments, as Local variables do not necessarily
15141         operate purely on the stack as they used to: they can be captured
15142         fields. 
15143
15144         Add `temp' for a temporary result, like fields.
15145
15146         Refactor DoResolve and DoResolveLValue into DoResolveBase.
15147
15148         It now copes with Local variables that are captured and emits the
15149         proper instance variable to load it from a field in the captured
15150         case. 
15151
15152         (ParameterReference.DoResolveBase): During the resolve phase,
15153         capture parameters if we are in an anonymous method.
15154
15155         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
15156         anonymous method, use the EmitContext helper routines to emit the
15157         parameter reference.
15158
15159         * iterators.cs: Set RemapToProxy to true/false during the
15160         EmitDispose class.
15161
15162         * parameters.cs (GetParameterByName): New helper method. 
15163
15164         * typemanager.cs (anonymous_method_type) a new type that
15165         represents an anonyous method.  This is always an internal type,
15166         used as a fencepost to test against the anonymous-methodness of an
15167         expression. 
15168         
15169 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
15170
15171         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
15172         561 report.
15173         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
15174
15175 2004-10-18  Martin Baulig  <martin@ximian.com>
15176
15177         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
15178         `Type' directly, but call ResolveType() on it.
15179         (Catch.Resolve): Likewise.
15180         (Foreach.Resolve): Likewise.
15181
15182 2004-10-18  Martin Baulig  <martin@ximian.com>
15183
15184         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
15185         `Type' directly, but call ResolveType() on it.
15186         (Probe.DoResolve): Likewise.
15187         (ArrayCreation.LookupType): Likewise.
15188         (TypeOf.DoResolve): Likewise.
15189         (SizeOf.DoResolve): Likewise.
15190
15191 2004-10-18  Martin Baulig  <martin@ximian.com>
15192
15193         * expression.cs (Invocation.BetterFunction): Put back
15194         TypeManager.TypeToCoreType().
15195
15196 2004-10-18  Raja R Harinath  <rharinath@novell.com>
15197
15198         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
15199         the ResolveType.
15200
15201 2004-10-18  Martin Baulig  <martin@ximian.com>
15202
15203         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
15204         `Type' directly, but call ResolveType() on it.
15205
15206 2004-10-18  Martin Baulig  <martin@ximian.com>
15207
15208         * class.cs (FieldMember.Define): Don't access the TypeExpr's
15209         `Type' directly, but call ResolveType() on it.
15210         (MemberBase.DoDefine): Likewise.
15211
15212         * expression.cs (New.DoResolve): Don't access the TypeExpr's
15213         `Type' directly, but call ResolveType() on it.
15214         (ComposedCast.DoResolveAsTypeStep): Likewise.
15215
15216         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
15217         `Type' directly, but call ResolveType() on it.
15218
15219 2004-10-17  John Luke  <john.luke@gmail.com>
15220
15221         * class.cs (Operator.GetSignatureForError): use CSharpName
15222
15223         * parameter.cs (Parameter.GetSignatureForError): Returns
15224         correct name even if was not defined.
15225
15226 2004-10-13  Raja R Harinath  <rharinath@novell.com>
15227
15228         Fix #65816.
15229         * class.cs (TypeContainer.EmitContext): New property.
15230         (DefineNestedTypes): Create an emitcontext for each part.
15231         (MethodCore.DoDefineParameters): Use container's emitcontext.
15232         Pass type array to InternalParameters.
15233         (MemberBase.DoDefine): Use container's emitcontext.
15234         (FieldMember.Define): Likewise.
15235         (Event.Define): Likewise.
15236         (SetMethod.GetParameterInfo): Change argument to EmitContext.
15237         Pass type array to InternalParameters.
15238         (SetIndexerMethod.GetParameterInfo): Likewise.
15239         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
15240         * delegate.cs (Define): Pass emitcontext to
15241         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
15242         array to InternalParameters.
15243         * expression.cs (ParameterReference.DoResolveBase): Pass
15244         emitcontext to GetParameterInfo.
15245         (ComposedCast.DoResolveAsTypeStep): Remove check on
15246         ec.ResolvingTypeTree.
15247         * parameter.cs (Parameter.Resolve): Change argument to
15248         EmitContext.  Use ResolveAsTypeTerminal.
15249         (Parameter.GetSignature): Change argument to EmitContext.
15250         (Parameters.ComputeSignature): Likewise.
15251         (Parameters.ComputeParameterTypes): Likewise.
15252         (Parameters.GetParameterInfo): Likewise.
15253         (Parameters.ComputeAndDefineParameterTypes): Likewise.
15254         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
15255         * support.cs (InternalParameters..ctor): Remove variant that takes
15256         a DeclSpace.
15257         * typemanager.cs (system_intptr_expr): New.
15258         (InitExpressionTypes): Initialize it.
15259
15260 2004-10-12  Chris Toshok  <toshok@ximian.com>
15261
15262         * cs-parser.jay: fix location for try_statement and catch_clause.
15263
15264 2004-10-11  Martin Baulig  <martin@ximian.com>
15265
15266         * report.cs: Don't make --fatal abort on warnings, we have
15267         -warnaserror for that.
15268
15269 2004-10-07  Raja R Harinath  <rharinath@novell.com>
15270
15271         More DeclSpace.ResolveType avoidance.
15272         * decl.cs (MemberCore.InUnsafe): New property.
15273         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
15274         with newly created EmitContext.
15275         (FieldMember.Define): Likewise.
15276         * delegate.cs (Delegate.Define): Likewise.
15277         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
15278         only if normal name-lookup fails.
15279         (TypeExpr.DoResolve): Enable error-checking.
15280         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
15281         (SizeOf.DoResolve): Likewise.
15282         (ComposedCast.DoResolveAsTypeStep): Likewise.
15283         (StackAlloc.DoResolve): Likewise.
15284         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
15285         (Block.Unsafe): New property.
15286         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
15287         (Unsafe): Set 'unsafe' flag of contained block.
15288         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
15289         (Fixed.Resolve): Likewise.
15290         (Catch.Resolve): Likewise.
15291         (Using.ResolveLocalVariableDecls): Likewise.
15292         (Foreach.Resolve): Likewise.
15293
15294 2004-10-05  John Luke <john.luke@gmail.com>
15295
15296         * cs-parser.jay: add location to error CS0175
15297
15298 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * ecore.cs (Expression.Constantity): Add support for turning null
15301         into a constant.
15302
15303         * const.cs (Const.Define): Allow constants to be reference types
15304         as long as the value is Null.
15305
15306 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
15307
15308         * namespace.cs (NamespaceEntry.Using): No matter which warning
15309         level is set, check if this namespace name has already been added.
15310
15311 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
15312
15313         * expression.cs: reftype [!=]= null should always use br[true,false].
15314         # 67410
15315
15316 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
15317
15318         Fix #67108
15319         * attribute.cs: Enum conversion moved to 
15320         GetAttributeArgumentExpression to be applied to the all
15321         expressions.
15322
15323 2004-10-01  Raja R Harinath  <rharinath@novell.com>
15324
15325         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15326         * class.c (TypeContainer.DefineType): Flag error if
15327         base types aren't accessible due to access permissions.
15328         * decl.cs (DeclSpace.ResolveType): Move logic to
15329         Expression.ResolveAsTypeTerminal.
15330         (DeclSpace.ResolveTypeExpr): Thin layer over
15331         Expression.ResolveAsTypeTerminal.
15332         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15333         Refactor code into NestedAccess.  Use it.
15334         (DeclSpace.NestedAccess): New.
15335         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15336         argument to silence errors.  Check access permissions.
15337         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15338         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15339         (Cast.DoResolve): Likewise.
15340         (New.DoResolve): Likewise.
15341         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15342         (TypeOf.DoResolve): Likewise.
15343
15344         * expression.cs (Invocation.BetterConversion): Return the Type of
15345         the better conversion.  Implement section 14.4.2.3 more faithfully.
15346         (Invocation.BetterFunction): Make boolean.  Make correspondence to
15347         section 14.4.2.2 explicit.
15348         (Invocation.OverloadResolve): Update.
15349         (Invocation): Remove is_base field.
15350         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
15351         (Invocation.Emit): Likewise.
15352
15353 2004-09-27  Raja R Harinath  <rharinath@novell.com>
15354
15355         * README: Update to changes.
15356
15357 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
15358
15359         * cs-parser.jay: Reverted 642 warning fix.
15360
15361 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15362
15363         Fix bug #66615
15364         * decl.cs (FindMemberWithSameName): Indexer can have more than
15365         1 argument.
15366
15367 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15368
15369         * expression.cs (LocalVariableReference.DoResolveLValue):
15370         Do not report warning 219 for out values.
15371         (EmptyExpression.Null): New member to avoid extra allocations.
15372
15373 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15374
15375         * cs-parser.jay: Fix wrong warning 642 report.
15376
15377         * cs-tokenizer.cs (CheckNextToken): New helper;
15378         Inspect next character if is same as expected.
15379
15380 2004-09-23  Martin Baulig  <martin@ximian.com>
15381
15382         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15383         (Convert.ImplicitReferenceConversionExists): Likewise.
15384
15385 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15386
15387         * class.cs (Operator.Define): Add error 448 and 559 report.
15388
15389 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15390
15391         * class.cs (MemberBase.IsTypePermitted): New protected
15392         method for checking error CS0610.
15393
15394 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15395
15396         * class.cs (TypeContainer.HasExplicitLayout): New property
15397         Returns whether container has StructLayout attribute set Explicit.
15398         (FieldMember): New abstract class for consts and fields.
15399         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15400         (Field): Reuse FieldMember.
15401
15402         * const.cs (Const): Reuse FieldMember.
15403
15404         * rootcontext.cs: EmitConstants call moved to class.
15405
15406 2004-09-22  Martin Baulig  <martin@ximian.com>
15407
15408         Thanks to Peter Sestoft for this bug report.
15409
15410         * expression.cs (Conditional): If both the `trueExpr' and the
15411         `falseExpr' is a NullLiteral, return a NullLiteral.
15412
15413 2004-09-22  Martin Baulig  <martin@ximian.com>
15414
15415         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15416         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15417         for the "get_Current" call.
15418
15419 2004-09-22  Martin Baulig  <martin@ximian.com>
15420
15421         Marek and me just fixed one of our oldest bugs: #28562 :-)
15422
15423         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15424
15425         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15426         we're an EnumConstant, just return that.
15427         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15428         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15429         to get the value which'll actually be written into the attribute.
15430         However, we have to use GetValue() to access the attribute's value
15431         in the compiler.        
15432
15433 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15434
15435         * constant.cs (Constant.IsNegative): New abstract property
15436         IsNegative.
15437
15438         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15439         (StackAlloc.DoResolve): Reused IsNegative.
15440
15441 2004-09-21  Martin Baulig  <martin@ximian.com>
15442
15443         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15444         if we're used in an iterator, we may be called from different
15445         methods.
15446
15447         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15448         we actually have an exception block.
15449
15450 2004-09-20  John Luke <jluke@cfl.rr.com>
15451
15452         * class.cs, cs-parser.jay: Improve the error report for 1520:
15453         report the actual line where the error happens, not where the
15454         class was declared.
15455
15456         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15457         Pass location information that was available elsewhere.
15458
15459 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15460
15461         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15462         runtime to delay sign assemblies.
15463
15464 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * cs-parser.jay: Do not report the stack trace, this is barely
15467         used nowadays.
15468
15469 2004-08-22  John Luke  <john.luke@gmail.com>
15470  
15471         * driver.cs : check that a resource id is not already used
15472         before adding it, report CS1508 if it is, bug #63637
15473
15474 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15475
15476         * ecore.cs: Removed dead code.
15477
15478 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15479
15480         * class.cs: Do not report warning CS0067 on the interfaces.
15481
15482 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15483
15484         * cs-parser.jay: Add error 504 report.
15485
15486 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15487
15488         * rootcontext.cs: WarningLevel is 4 by default now.
15489
15490         * statement.cs (Fixed.Resolve): Do not null
15491         VariableInfo.
15492
15493 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15494
15495         Fixed bug #55780
15496         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15497         deep search when property is not virtual.
15498         (PropertyExpr.ResolveAccessors): Make one call for both
15499         accessors.
15500
15501 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15502
15503         Fixed bug #65766
15504         * statement.cs: Error 152 report constains also location.
15505
15506 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15507
15508         Fixed bug #65766
15509         * const.cs: Explicitly set constant as static.
15510
15511 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15512
15513         Fixed bug #64226
15514         * cs-parser.jay: Add error 1017 report.
15515
15516 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15517
15518         Fixed bug #59980, #64224
15519         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15520
15521         * typemanager.cs (IsSpecialMethod): Simplified
15522
15523 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15524
15525         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15526         condition with better params.
15527
15528 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15529
15530         Fixed bug #65238
15531         * attribute.cs (Resolve): Property has to have both
15532         accessors.
15533
15534 2004-09-14  Martin Baulig  <martin@ximian.com>
15535
15536         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15537
15538 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15539
15540         Fixed bug #61902
15541         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15542         called and is obsolete then this member suppress message
15543         when call is inside next [Obsolete] method or type.
15544
15545         * expression.cs: Use TestObsoleteMethodUsage member.
15546
15547 2004-09-14  Martin Baulig  <martin@ximian.com>
15548
15549         * cs-parser.jay: Sync a bit with the GMCS version.
15550
15551 2004-09-14  Martin Baulig  <martin@ximian.com>
15552
15553         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15554         (CSharpParser.yacc_verbose_flag): New public field.
15555
15556         * genericparser.cs: Removed.
15557
15558 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15559
15560         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15561
15562 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15563
15564         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15565
15566 2004-09-10  Martin Baulig  <martin@ximian.com>
15567
15568         Backported my MemberName changes from GMCS into MCS.
15569
15570         - we are now using a special `MemberName' class instead of using
15571         strings; in GMCS, the `MemberName' also contains the type
15572         arguments.
15573
15574         - changed the grammar rules a bit:
15575           * the old `member_name' is now a `namespace_or_type_name':
15576             The rule is that we use `namespace_or_type_name' everywhere
15577             where we expect either a "member name" (GetEnumerator) or a
15578             "member name" with an explicit interface name
15579             (IEnumerable.GetEnumerator).
15580             In GMCS, the explicit interface name may include type arguments
15581             (IEnumerable<T>.GetEnumerator).
15582           * we use `member_name' instead of just `IDENTIFIER' for
15583             "member names":
15584             The rule is that we use `member_name' wherever a member may
15585             have type parameters in GMCS.       
15586
15587         * decl.cs (MemberName): New public class.
15588         (MemberCore.MemberName): New public readonly field.
15589         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15590         (DeclSpace): Likewise.
15591
15592         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15593         * enum.cs (Enum.ctor): Likewise.
15594
15595         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15596         MemberName.     
15597         (AliasEntry.ctor): Take a MemberName, not an Expression.
15598         (AliasEntry.UsingAlias): Likewise.
15599
15600         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15601         (IMethodData.MemberName): Changed type from string to MemberName.
15602         (MemberBase.ExplicitInterfaceName): Likewise.
15603         (AbstractPropertyEventMethod.SetupName): Make this private.
15604         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15605         argument; compute the member name here.
15606         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15607         on the `member.MemberName' and the `prefix'.
15608
15609         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15610         not `type_name'.
15611         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15612         thus, we get a `MemberName' instead of a `string'.  These
15613         declarations may have type parameters in GMCS.
15614         (interface_method_declaration, delegate_declaration): Likewise.
15615         (class_declaration, interface_declaration): Likewise.
15616         (method_header): Use `namespace_or_type_name' instead of
15617         `member_name'.  We may be an explicit interface implementation.
15618         (property_declaration, event_declaration): Likewise.
15619         (member_name): This is now just an `IDENTIFIER', not a
15620         `namespace_or_type_name'.
15621         (type_name, interface_type): Removed.
15622         (namespace_or_type_name): Return a MemberName, not an Expression.
15623         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15624         call GetTypeExpression() on the MemberName to get an expression.
15625         (IndexerDeclaration.interface_type): Changed type from string to
15626         MemberName.
15627         (MakeName): Operate on MemberName's instead of string's.
15628
15629 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15630
15631         Fix bug #55770.
15632         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15633         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15634         lookup to avoid symbols introduced by 'using'.
15635         * rootcontext.cs (NamespaceLookup): Update.
15636
15637 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15638
15639         * class.cs (TypeContainer.DoDefineMembers): Do not call
15640         DefineDefaultConstructor for static classes.
15641
15642 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15643
15644         * attribute.cs (Attribute.Resolve): Add error 653 report.
15645
15646         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15647         report.
15648         (Method.ApplyAttributeBuilder): Add error 685 report.
15649         (Operator.Define): Add error 564 report.
15650
15651         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15652
15653         * expression.cs (Invocation.DoResolve): Add error
15654         245 and 250 report.
15655
15656         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15657         error 674 report.
15658
15659 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15660
15661         * class.cs (ConstructorInitializer.Resolve):
15662         Wrong error number (515->516).
15663
15664 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15665
15666         * class.cs (Indexer.Define): Add error 631 report.
15667
15668 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15669
15670         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15671
15672 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15673
15674         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15675
15676 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15677
15678         * cs-parser.jay: Added error CS0241 report.
15679
15680 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15681
15682         * cs-parser.jay (fixed_statement): Introduce a scope for the
15683         declaration in the 'fixed' statement.
15684
15685 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15686
15687         * cs-parser.jay: Added CS0230 error report.
15688
15689 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15690
15691         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15692
15693 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15694
15695         * expression.cs (Argument.Resolve): Added error CS0192 and
15696         CS0199 report.
15697
15698 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15699
15700         C# 2.0 #pragma warning feature
15701
15702         * cs-tokenizer.cs (PreProcessPragma): New method; 
15703         Handles #pragma directive.
15704
15705         * report.cs (WarningRegions): New class; Support
15706         class for #pragma warning directive. It tests whether
15707         warning is enabled for a given line.
15708
15709 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15710
15711         * const.cs: Add more descriptive error report, tahnks to
15712         Sebastien. 
15713
15714 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15715
15716         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15717
15718 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * expression.cs: Apply patch from Ben: Remove dead code from
15721         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15722         as that code just threw an exception anwyays.
15723
15724         * const.cs: Remove the call to the turnintoconstant, for details
15725         see bug: #63144
15726         
15727         * literal.cs: The type of the null-literal is the null type;  So
15728         we use a placeholder type (literal.cs:System.Null, defined here)
15729         for it.
15730
15731         * expression.cs (Conditional.DoResolve): Remove some old code that
15732         is no longer needed, conversions have been fixed.
15733
15734         (ArrayCreationExpression.DoResolve): Return false if we fail to
15735         resolve the inner expression.
15736
15737 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15738
15739         Fix test-290.cs.
15740         * cs-parser.jay (delegate_declaration): Record a delegate
15741         declaration as a type declaration.
15742         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15743
15744 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15745
15746         * parameter.cs: Do not crash if the type can not be resolved. 
15747
15748         * expression.cs: Report errors with unsafe pointers, fixes #64896
15749
15750 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15751
15752         * expression.cs: Pointer arith always needs to do a conv.i
15753         if the operand is a long. fix 65320
15754
15755 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15756
15757         Fixed cs0619-37.cs, cs0619-38.cs
15758
15759         * enum.cs (GetObsoleteAttribute): Removed.
15760
15761         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15762         on Enum member is double staged. The first is tested member
15763         and then enum.
15764
15765 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15766
15767         Fixed #56986, #63631, #65231
15768
15769         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15770         adds member to name container.
15771         (TypeContainer.AddToTypeContainer): New method, adds type to
15772         name container.
15773         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15774         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15775         AddOperator): Simplified by reusing AddToMemberContainer.
15776         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15777         instead of field.
15778         (Method.CheckForDuplications): Fixed implementation to test all
15779         possibilities.
15780         (MemberBase): Detection whether member is explicit interface
15781         implementation is now in constructor.
15782         (MemberBase.UpdateMemberName): Handles IndexerName.
15783         (Accessor): Changed to keep also location information.
15784         (AbstractPropertyEventMethod): Is derived from MemberCore.
15785         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15786         will be emited or not.
15787         (PropertyBase.AreAccessorsDuplicateImplementation):
15788         Tests whether accessors are not in collision with some method.
15789         (Operator): Is derived from MethodCore to simplify common
15790         operations.
15791
15792         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15793         must be performed.
15794         (DeclSpace.AddToContainer): Adds the member to defined_names
15795         table. It tests for duplications and enclosing name conflicts.
15796
15797         * enum.cs (EnumMember): Clean up to reuse the base structures
15798
15799 2004-09-03  Martin Baulig  <martin@ximian.com>
15800
15801         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15802         into TypeContainer, to make partial classes work again.
15803
15804 2004-09-03  Martin Baulig  <martin@ximian.com>
15805
15806         * rootcontext.cs (RootContext.V2): Removed.
15807
15808 2004-03-23  Martin Baulig  <martin@ximian.com>
15809
15810         * expression.cs (Invocation.OverloadResolve): Added `bool
15811         may_fail' argument and use it instead of the Location.IsNull() hack.
15812
15813 2004-09-03  Martin Baulig  <martin@ximian.com>
15814
15815         Merged latest changes into gmcs.  Please keep this comment in
15816         here, it makes it easier for me to see what changed in MCS since
15817         the last time I merged.
15818
15819 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15820
15821         Fix #61128.
15822         * expression.cs (BetterConversion): Don't allow either conversion 
15823         to be null.  Remove redundant implicit conversion test when 'q ==
15824         null' -- when this function is invoked, we already know that the
15825         implicit conversion exists.
15826         (BetterFunction): Assume that 'best' is non-null.  Remove
15827         redundant reimplementation of IsApplicable when 'best' is null.
15828         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15829         number of arguments.
15830         (IsAncestralType): Extract from OverloadResolve.
15831         (OverloadResolve): Make robust to the MethodGroupExpr being
15832         unsorted.  Implement all the logic of Section 14.5.5.1, and
15833         support overloading of methods from multiple applicable types.
15834         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15835
15836         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15837         (RealError, Warning): Append type of report to related symbol.
15838
15839 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15840
15841         * enum.cs: Fixed CLS-Compliance checks for enum members.
15842         Error tests cs3008-8.cs, cs3014-8.cs
15843
15844 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15845
15846         Fixed bug #62342, #63102
15847         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15848         like ImplementMethod.
15849
15850 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15851
15852         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15853         Fixed bug #65170.
15854
15855 2004-09-02  Martin Baulig  <martin@ximian.com>
15856
15857         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15858         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15859         on the MethodBase.
15860
15861 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15862
15863         C# 2.0 Static classes implemented
15864
15865         * class.cs (TypeContainer): instance_constructors,
15866         initialized_fields, initialized_static_fields,
15867         default_constructor, base_inteface_types are protected to be
15868         accessible from StaticClass.
15869         (TypeContainer.DefineDefaultConstructor): New virtual method
15870         for custom default constructor generating
15871         (StaticClass): New class to handle "Static classes" feature.
15872
15873         * cs-parser.jay: Handle static keyword on class like instance
15874         of StaticClass.
15875
15876         * driver.cs: Added "/langversion" command line switch with two
15877         options (iso-1, default).
15878
15879 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15880
15881         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15882
15883 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15884
15885         * delegate.cs: Style.
15886
15887 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15888
15889         * delegate.cs: Add seperate instance expr field for miguel.
15890
15891 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15892
15893         * PointerArithmetic (Resolve): make sure we are not doing
15894         pointer arith on void*. Also, make sure we are resolved
15895         by not setting eclass until resolve.
15896
15897         All callers: Make sure that PointerArithmetic gets resolved.
15898
15899 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15900
15901         * ArrayCreation (LookupType): If the type does not resolve 
15902         to an array, give an error.
15903
15904 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15905
15906         * statement.cs (Try.Resolve): Fixed bug #64222
15907
15908 2004-08-27  Martin Baulig  <martin@ximian.com>
15909
15910         * class.cs
15911         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15912         crash here.     
15913
15914 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15915
15916         * ecore.cs (Constantify): Get underlying type via
15917         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15918         Windows in special cases.
15919
15920 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15921
15922         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15923         for obtaining also private methods.
15924         (GetRemoveMethod): Used GetRemoveMethod (true)
15925         for obtaining also private methods.
15926
15927 2004-08-24  Martin Baulig  <martin@ximian.com>
15928
15929         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15930         MethodAttributes.HideBySig for operators.
15931
15932 2004-08-23  Martin Baulig  <martin@ximian.com>
15933
15934         Back to the old error reporting system :-)
15935
15936         * report.cs (Message): Removed.
15937         (Report.MessageData, ErrorData, WarningData): Removed.
15938         (Report.Error, Warning): Back to the old system.
15939
15940 2004-08-23  Martin Baulig  <martin@ximian.com>
15941
15942         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15943
15944         * class.cs (TypeContainer.ParentContainer): New public virtual
15945         method; replaces the explicit interface implementation.
15946         (ClassPart.ParentContainer): Override.
15947
15948 2004-08-23  Martin Baulig  <martin@ximian.com>
15949
15950         * statement.cs (Switch): Added support for constant switches; see
15951         #59428 or test-285.cs.
15952
15953 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15954
15955         Fixed bug #62740.
15956         * statement.cs (GetEnumeratorFilter): Removed useless
15957         logic because C# specs is strict. GetEnumerator must be
15958         public.
15959
15960 2004-08-22  Martin Baulig  <martin@ximian.com>
15961
15962         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15963         a switch and may break, reset the barrier.  Fixes #59867.
15964
15965 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15966
15967         CLS-Compliance speed up (~5% for corlib)
15968
15969         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15970         New method. Tests container for CLS-Compliant names
15971
15972         * class.cs (TypeContainer.VerifyClsName): New method.
15973         Checks whether container name is CLS Compliant.
15974         (Constructor): Implements IMethodData.
15975
15976         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15977         low-case table for CLS Compliance test.
15978         (MemberCache.VerifyClsParameterConflict): New method.
15979         Checks method parameters for CS3006 error.
15980
15981         * enum.cs (EnumMember): Is derived from MemberCore.
15982         (Enum.VerifyClsName): Optimized for better performance.
15983
15984 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15985
15986         * report.cs: Renamed Error_T to Error and changed all
15987         references.
15988
15989 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15990
15991         * class.cs (TypeContainer.IndexerArrayList): New inner class
15992         container for indexers.
15993         (TypeContainer.DefaultIndexerName): New constant for default
15994         indexer name. Replaced all "Item" with this constant.
15995         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15996
15997         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15998         DefaultMemberAttribute constructor.
15999
16000 2004-08-05  Martin Baulig  <martin@ximian.com>
16001
16002         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16003         Fix bug #59429.
16004
16005 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
16006
16007         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16008         multi platforms problem.
16009
16010         * compiler.csproj: Included shared files.
16011
16012 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16013
16014         Fix bug 60333, 55971 in the more general way
16015         * attribute.cs (Attribute.GetAttributeArgumentExpression):
16016         Added arg_type argument for constant conversion.
16017         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16018
16019 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16020
16021         Fix bug #59760
16022         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
16023         OperatorArrayList, MethodCoreArrayList for typecontainer
16024         containers. Changed class member types to these new types.
16025         (MethodArrayList.DefineMembers): Added test for CS0659.
16026
16027 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * cfold.cs: Synchronize the folding with the code in expression.cs
16030         Binary.DoNumericPromotions for uint operands.
16031
16032         * attribute.cs: Revert patch from Raja, it introduced a regression
16033         while building Blam-1.2.1 (hard to isolate a test case).
16034
16035 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
16036
16037         Fix for #55382
16038         * class.cs:
16039         (TypeContainer.Define): Renamed to DefineContainerMembers because of
16040         name collision.
16041         (MethodCore.parent_method): New member. The method we're overriding
16042         if this is an override method.
16043         (MethodCore.CheckBase): Moved from Method class and made common.
16044         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
16045         private.
16046         (MethodCore.CheckForDuplications): New abstract method. For custom
16047         member duplication search in a container
16048         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
16049         method and its return type.
16050         (Event.conflict_symbol): New member. Symbol with same name in the
16051         parent class.
16052
16053         * decl.cs:
16054         (MemberCache.FindMemberWithSameName): New method. The method
16055         is looking for conflict with inherited symbols.
16056
16057 2004-08-04  Martin Baulig  <martin@ximian.com>
16058
16059         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
16060
16061         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
16062
16063 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16064
16065         * report.cs (Message): New enum for better error, warning reference in
16066         the code.
16067         (MessageData): New inner abstract class. It generally handles printing of
16068         error and warning messages.
16069         Removed unused Error, Warning, Message methods.
16070
16071 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16072
16073         Fix for cs0592-8.cs test
16074         * attribute.cs
16075         (Attributable.ValidAttributeTargets): Made public.
16076         (Attribute.ExplicitTarget): New member for explicit target value.
16077         (Attribute.CheckTargets): Now we translate explicit attribute
16078         target to Target here.
16079
16080 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
16081
16082         * ecore.cs (MethodGroupExpr): new IsBase property.
16083
16084         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
16085
16086         * delegate.cs (DelegateCreation): store a MethodGroupExpr
16087         rather than an instance expr.
16088
16089         (DelegateCreation.Emit): Use the method group rather than
16090         the instance expression. Also, if you have base.Foo as the
16091         method for a delegate, make sure to emit ldftn, not ldftnvirt.
16092
16093         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
16094
16095         (NewDelegate.DoResolve): Only check for the existance of Invoke
16096         if the method is going to be needed. Use MethodGroupExpr.
16097
16098         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
16099
16100         * expression.cs: For pointer arith., make sure to use
16101         the size of the type, not the size of the pointer to
16102         the type.
16103
16104 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
16105
16106         Fix for #60722
16107         * class.cs (Class): Added error CS0502 test.
16108
16109 2004-08-03  John Luke  <jluke@cfl.rr.com>
16110             Raja R Harinath  <rharinath@novell.com>
16111
16112         Fix for #60997.
16113         * attribute.cs (Attribute.complained_before): New flag.
16114         (Attribute.ResolveType, Attribute.Resolve),
16115         (Attribute.DefinePInvokeMethod): Set it.
16116         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
16117         
16118 2004-08-03  Martin Baulig  <martin@ximian.com>
16119
16120         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
16121         use a user-defined operator; we still need to do numeric
16122         promotions in case one argument is a builtin type and the other
16123         one has an implicit conversion to that type.  Fixes #62322.
16124
16125 2004-08-02  Martin Baulig  <martin@ximian.com>
16126
16127         * statement.cs (LocalInfo.Flags): Added `IsThis'.
16128         (LocalInfo.IsThis): New public property.
16129         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
16130
16131 2004-08-01  Martin Baulig  <martin@ximian.com>
16132
16133         * class.cs (TypeContainer.GetClassBases): Don't set the default
16134         here since we may get called from GetPartialBases().
16135         (TypeContainer.DefineType): If GetClassBases() didn't return a
16136         parent, use the default one.
16137
16138 2004-07-30  Duncan Mak  <duncan@ximian.com>
16139
16140         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
16141
16142 2004-07-30  Martin Baulig  <martin@ximian.com>
16143
16144         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
16145
16146         * class.cs (SourceMethod): New public class, derive from the
16147         symbol writer's ISourceMethod.
16148         (Method): Use the new symbol writer API.
16149
16150         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
16151         as argument and use the new symbol writer.
16152
16153         * location.cs
16154         (SourceFile): Implement the symbol writer's ISourceFile.
16155         (Location.SymbolDocument): Removed.
16156         (Location.SourceFile): New public property.
16157
16158         * symbolwriter.cs: Use the new symbol writer API.
16159
16160 2004-07-30  Raja R Harinath  <rharinath@novell.com>
16161
16162         * Makefile (install-local): Remove.  Functionality moved to
16163         executable.make.
16164
16165 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
16166
16167         * Makefile: Install mcs.exe.config file together with mcs.exe.
16168         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
16169         correct runtime version.
16170         
16171 2004-07-25  Martin Baulig  <martin@ximian.com>
16172
16173         * class.cs
16174         (TypeContainer.RegisterOrder): Removed, this was unused.
16175         (TypeContainer, interface_order): Removed.
16176         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
16177         TypeContainer as argument since we can also be called with a
16178         `PartialContainer' for a partial class/struct/interface.
16179         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
16180         of checking whether we're an `Interface' - we could be a
16181         `PartialContainer'.
16182         (PartialContainer.Register): Override; call
16183         AddClass()/AddStruct()/AddInterface() on our parent.
16184
16185         * cs-parser.jay (interface_member_declaration): Add things to the
16186         `current_container', not the `current_class'.
16187
16188         * rootcontext.cs (RegisterOrder): The overloaded version which
16189         takes an `Interface' was unused, removed.
16190
16191         * typemanager.cs (TypeManager.LookupInterface): Return a
16192         `TypeContainer', not an `Interface'.
16193         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
16194         contain a `PartialContainer' for an interface, so check it's
16195         `Kind' to figure out what it is.
16196
16197 2004-07-25  Martin Baulig  <martin@ximian.com>
16198
16199         * class.cs (Class.DefaultTypeAttributes): New public constant.
16200         (Struct.DefaultTypeAttributes): Likewise.
16201         (Interface.DefaultTypeAttributes): Likewise.
16202         (PartialContainer.TypeAttr): Override this and add the
16203         DefaultTypeAttributes.
16204
16205 2004-07-25  Martin Baulig  <martin@ximian.com>
16206
16207         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
16208         we can just use the `Parent' field instead.
16209
16210 2004-07-25  Martin Baulig  <martin@ximian.com>
16211
16212         * class.cs (TypeContainer.Emit): Renamed to EmitType().
16213
16214 2004-07-25  Martin Baulig  <martin@ximian.com>
16215
16216         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
16217         our parts before defining any methods.
16218         (TypeContainer.VerifyImplements): Make this virtual.
16219         (ClassPart.VerifyImplements): Override and call VerifyImplements()
16220         on our PartialContainer.
16221
16222 2004-07-25  Martin Baulig  <martin@ximian.com>
16223
16224         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
16225
16226         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
16227         argument, we can just use the `Parent' field instead.
16228
16229         * class.cs
16230         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
16231         (MemberBase.DoDefine): Likewise.
16232
16233 2004-07-24  Martin Baulig  <martin@ximian.com>
16234
16235         * decl.cs (MemberCore.Parent): New public field.
16236         (DeclSpace.Parent): Moved to MemberCore.
16237
16238         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
16239         (MemberBase.ctor): Added TypeContainer argument, pass it to our
16240         parent's .ctor.
16241         (FieldBase, Field, Operator): Likewise.
16242         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
16243         (EventField, Event): Likewise.
16244
16245 2004-07-23  Martin Baulig  <martin@ximian.com>
16246
16247         * class.cs (PartialContainer): New public class.
16248         (ClassPart): New public class.
16249         (TypeContainer): Added support for partial classes.
16250         (TypeContainer.GetClassBases): Splitted some of the functionality
16251         out into GetNormalBases() and GetPartialBases().
16252
16253         * cs-tokenizer.cs (Token.PARTIAL): New token.
16254         (Tokenizer.consume_identifier): Added some hacks to recognize
16255         `partial', but only if it's immediately followed by `class',
16256         `struct' or `interface'.
16257
16258         * cs-parser.jay: Added support for partial clases.
16259
16260 2004-07-23  Martin Baulig  <martin@ximian.com>
16261
16262         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
16263         a `DeclSpace' and also made it readonly.
16264         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
16265         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
16266         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
16267
16268         * cs-parser.jay: Pass the `current_class', not the
16269         `current_container' (at the moment, this is still the same thing)
16270         to a new Method, Property, Event, Indexer or Constructor.
16271
16272 2004-07-23  Martin Baulig  <martin@ximian.com>
16273
16274         * cs-parser.jay (CSharpParser): Added a new `current_class' field
16275         and removed the `current_interface' one.
16276         (struct_declaration, class_declaration, interface_declaration):
16277         Set `current_class' to the newly created class/struct/interface;
16278         set their `Bases' and call Register() before parsing their body.
16279
16280 2004-07-23  Martin Baulig  <martin@ximian.com>
16281
16282         * class.cs (Kind): New public enum.
16283         (TypeContainer): Made this class abstract.
16284         (TypeContainer.Kind): New public readonly field.
16285         (TypeContainer.CheckDef): New public method; moved here from
16286         cs-parser.jay.
16287         (TypeContainer.Register): New public abstract method.
16288         (TypeContainer.GetPendingImplementations): New public abstract
16289         method.
16290         (TypeContainer.GetClassBases): Removed the `is_class' and
16291         `is_iface' parameters.
16292         (TypeContainer.DefineNestedTypes): Formerly known as
16293         DoDefineType().
16294         (ClassOrStruct): Made this class abstract.
16295
16296         * tree.cs (RootTypes): New public type. 
16297
16298 2004-07-20  Martin Baulig  <martin@ximian.com>
16299
16300         * tree.cs (Tree.RecordNamespace): Removed.
16301         (Tree.Namespaces): Removed.
16302
16303         * rootcontext.cs (RootContext.IsNamespace): Removed.
16304
16305         * cs-parser.jay (namespace_declaration): Just create a new
16306         NamespaceEntry here.
16307
16308 2004-07-20  Martin Baulig  <martin@ximian.com>
16309
16310         * statement.cs (ExceptionStatement): New abstract class.  This is
16311         now used as a base class for everyone who's using `finally'.
16312         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16313         our local variables before using them.
16314
16315         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16316         virtual method.  This is used by Yield.Resolve() to "steal" an
16317         outer block's `finally' clauses.
16318         (FlowBranchingException): The .ctor now takes an ExceptionStatement
16319         argument.
16320
16321         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16322         version which takes an ExceptionStatement.  This version must be
16323         used to create exception branchings.
16324
16325         * iterator.cs
16326         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16327         (Iterator.EmitMoveNext): Added exception support; protect the
16328         block with a `fault' clause, properly handle 'finally' clauses.
16329         (Iterator.EmitDispose): Run all the `finally' clauses here.
16330
16331 2004-07-20  Martin Baulig  <martin@ximian.com>
16332
16333         * iterator.cs: This is the first of a set of changes in the
16334         iterator code.  Match the spec more closely: if we're an
16335         IEnumerable, then GetEnumerator() must be called.  The first time
16336         GetEnumerator() is called, it returns the current instance; all
16337         subsequent invocations (if any) must create a copy.
16338
16339 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
16340
16341         * expression.cs: Resolve the constant expression before returning
16342         it. 
16343
16344 2004-07-19  Martin Baulig  <martin@ximian.com>
16345
16346         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16347         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16348         the return type of the new EmitContext.
16349
16350 2004-07-18  Martin Baulig  <martin@ximian.com>
16351
16352         * class.cs (Property.Define): Fix iterators.
16353
16354         * iterators.cs (Iterator.Define): Moved the
16355         `container.AddInterator (this)' call here from the .ctor; only do
16356         it if we resolved successfully.
16357
16358 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
16359
16360         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16361         `true' for preprocessing directives that we parse.  The return
16362         value indicates whether we should return to regular tokenizing or
16363         not, not whether it was parsed successfully.
16364
16365         In the past if we were in: #if false ... #line #endif, we would
16366         resume parsing after `#line'.  See bug 61604.
16367
16368         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16369         building: IsEnumType should return true only for enums, not for
16370         enums or System.Enum itself.  This fixes #61593.
16371
16372         Likely what happened is that corlib was wrong: mcs depended on
16373         this bug in some places.  The bug got fixed, we had to add the
16374         hack, which caused bug 61593.
16375
16376         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16377         that was a workaround for the older conditions.
16378
16379 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
16380
16381         * assign.cs: IAssignMethod has a new interface, as documented
16382         inline. All assignment code now uses this new api.
16383
16384         * ecore.cs, expression.cs: All classes which implement
16385         IAssignMethod now use the new interface.
16386
16387         * expression.cs (Invocation): add a hack to EmitCall so that
16388         IndexerAccess can be the target of a compound assignment without
16389         evaluating its arguments twice.
16390
16391         * statement.cs: Handle changes in Invocation api.
16392
16393 2004-07-16  Martin Baulig  <martin@ximian.com>
16394
16395         * iterators.cs: Rewrote this.  We're now using one single Proxy
16396         class for both the IEnumerable and the IEnumerator interface and
16397         `Iterator' derives from Class so we can use the high-level API.
16398
16399         * class.cs (TypeContainer.AddIterator): New method.
16400         (TypeContainer.DoDefineType): New protected virtual method, which
16401         is called from DefineType().
16402         (TypeContainer.DoDefineMembers): Call DefineType() and
16403         DefineMembers() on all our iterators.
16404         (TypeContainer.Emit): Call Emit() on all our iterators.
16405         (TypeContainer.CloseType): Call CloseType() on all our iterators.
16406
16407         * codegen.cs (EmitContext.CurrentIterator): New public field.
16408
16409 2004-07-15  Martin Baulig  <martin@ximian.com>
16410
16411         * typemanager.cs
16412         (TypeManager.not_supported_exception_type): New type.   
16413
16414 2004-07-14  Martin Baulig  <martin@ximian.com>
16415
16416         * iterators.cs: Use real error numbers.
16417
16418 2004-07-14  Martin Baulig  <martin@ximian.com>
16419
16420         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16421         requires this to be a System.Collection.IEnumerable and not a
16422         class implementing that interface.
16423         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16424
16425 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16426
16427         * class.cs: Fixed previous fix, it broke some error tests.
16428
16429 2004-07-12  Martin Baulig  <martin@ximian.com>
16430
16431         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16432         Fixes #61293.
16433
16434 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * assign.cs (LocalTemporary): Add new argument: is_address,If
16437         `is_address' is true, then the value that we store is the address
16438         to the real value, and not the value itself.
16439         
16440         * ecore.cs (PropertyExpr): use the new local temporary
16441         stuff to allow us to handle X.Y += z (where X is a struct)
16442
16443 2004-07-08  Martin Baulig  <martin@ximian.com>
16444
16445         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16446         not always return, just like we're doing in Using.Resolve().
16447
16448 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * cs-parser.jay (fixed_statement): flag this as Pinned.
16451
16452 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16453
16454         * typemanager.cs (TypeManager): Removed MakePinned method, this
16455         mechanism is replaced with the .NET 2.x compatible mechanism of
16456         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16457
16458         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16459         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16460         `IsFixed' property which has a different meaning.
16461
16462 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16463
16464         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16465         visible from inside a nested class, not just the names of the
16466         immediately enclosing class.
16467         Fix for bug #60730.
16468
16469 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16470
16471         * expression.cs (BetterConversion): Remove buggy special-case
16472         handling of "implicit constant expression conversions".  At this
16473         point, we already know that the conversion is possible -- we're
16474         only checking to see which is better.
16475
16476 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16477
16478         * cs-parser.jay: Added error CS0210 test.
16479
16480 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16481
16482         * cs-parser.jay: Added error CS0134 test.
16483
16484 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16485
16486         Fix bug #52507
16487         * cs-parser.jay: Added error CS0145 test.
16488
16489 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16490
16491         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16492
16493 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16494         
16495         * expression.cs (StackAlloc.Resolve): The argument may not
16496         be a constant; deal with this case.
16497         
16498 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16499
16500         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16501         GetIndexerAttributeValue.
16502         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16503
16504         * class.cs (Indexer.Define): Added error tests for CS0415,
16505         CS0609.
16506
16507 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16508
16509         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16510         property code.
16511
16512 2004-06-23  Martin Baulig  <martin@ximian.com>
16513
16514         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16515         neither return nor throw, reset the barrier as well.  Fixes #60457.
16516
16517 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16518
16519         * class.cs : EventAttributes is now set to None by default.
16520           This fixes bug #60459.
16521
16522 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16523
16524         Fix bug #60219
16525         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16526         Don't throw exception but return null (it's sufficient now).
16527
16528 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16529
16530         * typemanager.cs (GetArgumentTypes): Faster implementation.
16531
16532 2004-06-18  Martin Baulig  <martin@ximian.com>
16533
16534         * attribute.cs (Attribute.Resolve): Check whether we're an
16535         EmptyCast which a Constant child.  Fixes #60333.
16536
16537 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16538
16539         * statement.cs (EmitCollectionForeach): Account for the fact that
16540         not all valuetypes are in areas which we can take the address of.
16541         For these variables, we store to a temporary variable. Also, make
16542         sure that we dont emit a `callvirt' on a valuetype method.
16543
16544 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16545
16546         * expression.cs (StackAlloc.DoReSolve): Added test for
16547         negative parameter (CS0247).
16548
16549 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16550
16551         Fix bug #59792
16552         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16553
16554 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16555
16556         Fix bug #59781
16557         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16558         ulong.
16559
16560 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16561
16562         Fix bug #58254 & cs1555.cs, cs1556.cs
16563         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16564
16565 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16566
16567         * cs-parser.jay: Added error CS1669 test for indexers.
16568
16569 2004-06-11  Martin Baulig  <martin@ximian.com>
16570
16571         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16572         call this twice: for params and varargs methods.
16573
16574 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16575
16576         * class.cs:
16577         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16578
16579 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16580
16581         * attribute.cs (Attribute.GetValidTargets): Made public.
16582
16583         * class.cs: 
16584         (AbstractPropertyEventMethod): New class for better code sharing.
16585         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16586         CS1667 report.
16587         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16588
16589 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16590
16591         Fix bug #59477.
16592         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16593         that the call to Resolve is part of a MemberAccess.
16594         (Expression.Resolve): Use it for SimpleName resolution.
16595         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16596         Add 'intermediate' boolean argument.
16597         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16598         error message when the SimpleName can be resolved ambiguously
16599         between an expression and a type.
16600         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16601         public.
16602         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16603         call on the left-side.
16604
16605 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16606
16607         * class.cs:
16608         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16609
16610 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16611
16612         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16613
16614 2004-06-11  Martin Baulig  <martin@ximian.com>
16615
16616         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16617         varargs methods if applicable.
16618
16619 2004-06-11  Martin Baulig  <martin@ximian.com>
16620
16621         * expression.cs (Invocation.EmitCall): Don't use
16622         `method.CallingConvention == CallingConventions.VarArgs' since the
16623         method could also have `CallingConventions.HasThis'.
16624
16625 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16626
16627         * class.cs (Event.GetSignatureForError): Implemented.
16628         Fixed crash in error test cs3010.cs
16629
16630 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * cs-tokenizer.cs: Change the way we track __arglist to be
16633         consistent with the other keywords.
16634
16635 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16636
16637         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16638         tomorrow.
16639
16640 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16641
16642         * codegen.cs: Check that all referenced assemblies have a strongname
16643         before strongnaming the compiled assembly. If not report error CS1577.
16644         Fix bug #56563. Patch by Jackson Harper.
16645         * typemanager.cs: Added a method to return all referenced assemblies.
16646         Fix bug #56563. Patch by Jackson Harper.
16647
16648 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16649
16650         * class.cs:
16651         (Method.ApplyAttributeBuilder): Moved and added conditional
16652         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16653
16654         * delegate.cs:
16655         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16656
16657 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16658
16659         Fixed #59640
16660         * class.cs: (EventField.attribute_targets): Changed default target.
16661
16662 2004-06-08  Martin Baulig  <martin@ximian.com>
16663
16664         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16665
16666 2004-06-08  Martin Baulig  <martin@ximian.com>
16667
16668         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16669
16670 2004-06-07  Martin Baulig  <martin@ximian.com>
16671
16672         Added support for varargs methods.
16673
16674         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16675         keyword.
16676
16677         * cs-parser.jay: Added support for `__arglist'.
16678
16679         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16680
16681         * expression.cs (Argument.AType): Added `ArgList'.
16682         (Invocation): Added support for varargs methods.
16683         (ArglistAccess): New public class.
16684         (Arglist): New public class.
16685
16686         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16687
16688         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16689         a method's top-level block if the method has varargs.
16690
16691         * support.cs (ReflectionParameters, InternalParameters): Added
16692         support for varargs methods.    
16693
16694 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * class.cs: Provide location in indexer error report.
16697
16698         * driver.cs: Use standard names.
16699
16700         * namespace.cs: Catch the use of using after a namespace has been
16701         declared also on using aliases.
16702
16703 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16704
16705         Bug #50820.
16706         * typemanager.cs (closure_private_ok, closure_invocation_type)
16707         (closure_qualifier_type, closure_invocation_assembly)
16708         (FilterWithClosure): Move to ...
16709         (Closure): New internal nested class.
16710         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16711         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16712         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16713         (MemberLookup, MemberLookupFailed): Use it.
16714         * expression.cs (New.DoResolve): Treat the lookup for the
16715         constructor as being qualified by the 'new'ed type.
16716         (Indexers.GetIndexersForTypeOrInterface): Update.
16717
16718 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16719
16720         * attribute.cs
16721         (GetConditionalAttributeValue): New method. Returns
16722         condition of ConditionalAttribute.
16723         (SearchMulti): New method.  Returns all attributes of type 't'.
16724         Use it when attribute is AllowMultiple = true.
16725         (IsConditionalMethodExcluded): New method.
16726
16727         * class.cs
16728         (Method.IsExcluded): Implemented. Returns true if method has conditional
16729         attribute and the conditions is not defined (method is excluded).
16730         (IMethodData): Extended interface for ConditionalAttribute support.
16731         (PropertyMethod.IsExcluded): Implemented.
16732
16733         * decl.cs
16734         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16735
16736         * expression.cs
16737         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16738         on the method.
16739
16740 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16741
16742         * expression.cs (ArrayCreationExpression): Make this just an
16743         `expression'. It can't be a statement, so the code here was
16744         dead.
16745
16746 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16747
16748         Fixed #59072
16749         * typemanager.cs (GetFullNameSignature): New method for
16750         MethodBase types.
16751
16752 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16753
16754         Fixed #56452
16755         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16756         Use this method when MethodBuilder is null.
16757         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16758         Added test for error CS0626 (MONO reports error for this situation).
16759         (IMethodData.GetSignatureForError): Extended interface.
16760
16761 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16762
16763         * attribute.cs
16764         (AttributeTester.GetObsoleteAttribute): Returns instance of
16765         ObsoleteAttribute when type is obsolete.
16766
16767         * class.cs
16768         (TypeContainer.VerifyObsoleteAttribute): Override.
16769         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16770         (MethodCode.VerifyObsoleteAttribute): Override.
16771         (MemberBase.VerifyObsoleteAttribute): Override.
16772
16773         * decl.cs
16774         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16775         and report proper error.
16776
16777         *delegate.cs
16778         Delegate.VerifyObsoleteAttribute): Override.
16779
16780         * ecore.cs
16781         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16782         and report proper error.
16783         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16784
16785         * enum.cs
16786         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16787         and enum member.
16788
16789         * expression.cs
16790         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16791         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16792         Added test for ObsoleteAttribute.
16793
16794         * statement.cs
16795         (Catch): Derived from Statement.
16796
16797 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16798  
16799         Fixed bug #59071 & cs0160.cs
16800  
16801         * statement.cs (Try.Resolve): Check here whether order of catch
16802         clauses matches their dependencies.
16803
16804 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16805
16806         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16807         caused a regression: #59343.  Referencing nested classes from an
16808         assembly stopped working.
16809
16810 2004-05-31  Martin Baulig  <martin@ximian.com>
16811
16812         MCS is now frozen for beta 2.
16813
16814 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16815
16816         * convert.cs: add a trivial cache for overload operator resolution.
16817
16818 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16819
16820         * decl.cs: If possible, use lookuptypedirect here. We can only do
16821         this if there is no `.' after the namespace. Avoids using
16822         LookupType, which does lots of slow processing.
16823         (FindNestedType) New method, does what it says :-).
16824         * namespace.cs: use LookupTypeDirect.
16825         * rootcontext.cs: use membercache, if possible.
16826         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16827
16828 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16829
16830         * expression.cs:
16831         According to the spec, 
16832
16833         In a member access of the form E.I, if E is a single identifier,
16834         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16835         field, property, localvariable, or parameter with the same type as
16836         the meaning of E as a type-name (§3.8), then both possible
16837         meanings of E are permitted.
16838
16839         We did not check that E as a simple-name had the same type as E as
16840         a type name.
16841
16842         This trivial check gives us 5-7% on bootstrap time.
16843
16844 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16845
16846         * expression.cs (Invocation.OverloadResolve): Avoid the
16847         use of hashtables and boxing here by allocating on demand.
16848
16849 2004-05-30  Martin Baulig  <martin@ximian.com>
16850
16851         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16852         we're doing a silent lookup.  Don't try to lookup nested types in
16853         TypeManager.object_type (thanks to Ben Maurer).
16854
16855 2004-05-30  Martin Baulig  <martin@ximian.com>
16856
16857         Committing a patch from Ben Maurer.
16858
16859         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16860
16861 2004-05-29  Martin Baulig  <martin@ximian.com>
16862
16863         * class.cs (IMethodData.ShouldIgnore): New method.
16864
16865         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16866         `Location' argument, we don't need it anywhere.  Use
16867         `IMethodData.ShouldIgnore ()' instead of
16868         `MethodData.GetMethodFlags ()'.
16869         (TypeManager.AddMethod): Removed.
16870         (TypeManager.AddMethod2): Renamed to AddMethod.
16871
16872 2004-05-29  Martin Baulig  <martin@ximian.com>
16873
16874         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16875
16876         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16877         converting from a class type S to an interface type and we already
16878         have an object on the stack, don't box it again.  Fixes #52578.
16879
16880 2004-05-29  Martin Baulig  <martin@ximian.com>
16881
16882         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16883         Added support for `params' parameters.  Fixes #59267.
16884
16885 2004-05-29  Martin Baulig  <martin@ximian.com>
16886
16887         * literal.cs (NullPointer): Provide a private .ctor which sets
16888         `type' to TypeManager.object_type.  Fixes #59048.
16889
16890 2004-05-29  Martin Baulig  <martin@ximian.com>
16891
16892         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16893         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16894
16895         * ecore.cs (EventExpr.instance_expr): Make the field private.
16896
16897 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16898
16899         Fixed bug #50080 & cs0214-2.cs
16900         * expression.cs (Cast.DoResolve): Check unsafe context here.
16901         
16902         * statement.cs (Resolve.DoResolve): Likewise.
16903
16904 2004-05-26  Martin Baulig  <martin@ximian.com>
16905
16906         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16907
16908         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16909         (RootContext.LookupType): Pass down the `silent' flag.
16910
16911 2004-05-25  Martin Baulig  <martin@ximian.com>
16912
16913         * expression.cs
16914         (MethodGroupExpr.IdenticalTypeName): New public property.
16915         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16916         expression actually refers to a type.
16917
16918 2004-05-25  Martin Baulig  <martin@ximian.com>
16919
16920         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16921         for #56176 and made it actually work.
16922
16923 2004-05-25  Martin Baulig  <martin@ximian.com>
16924
16925         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16926         (FieldExpr, PropertyExpr): Override and implement
16927         CacheTemporaries.  Fixes #52279.
16928
16929 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16930
16931         * location.cs: In the new compiler listing a file twice is a
16932         warning, not an error.
16933
16934 2004-05-24  Martin Baulig  <martin@ximian.com>
16935
16936         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16937         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16938
16939 2004-05-24  Martin Baulig  <martin@ximian.com>
16940
16941         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16942         walking the `using' list.  Fixes #53921.
16943
16944 2004-05-24  Martin Baulig  <martin@ximian.com>
16945
16946         * const.cs (Const.LookupConstantValue): Added support for
16947         EmptyCast's; fixes #55251.
16948
16949 2004-05-24  Martin Baulig  <martin@ximian.com>
16950
16951         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16952         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16953         which does the CS0135 check.  The reason is that we first need to
16954         check whether the variable actually exists.
16955
16956 2004-05-24  Martin Baulig  <martin@ximian.com>
16957
16958         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16959         than RootContext.LookupType() to find the explicit interface
16960         type.  Fixes #58584.
16961
16962 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16963
16964         * Makefile: Simplify.  Use executable.make.
16965         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16966
16967 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16968
16969         * decl.cs:
16970         * enum.cs:
16971         Use the invariant culture when doing String.Compare for CLS case
16972         sensitivity.
16973         
16974 2004-05-23  Martin Baulig  <martin@ximian.com>
16975
16976         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16977         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16978
16979         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16980         
16981 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16982
16983         * class.cs (MemberBase.Define): Reuse MemberType member for 
16984         resolved type. Other methods can use it too.
16985
16986 2004-05-23  Martin Baulig  <martin@ximian.com>
16987
16988         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16989         the variable also exists in the current block (otherwise, we need
16990         to report a CS0103).  Fixes #58670.
16991
16992 2004-05-23  Martin Baulig  <martin@ximian.com>
16993
16994         * flowanalysis.cs (Reachability.Reachable): Compute this
16995         on-the-fly rather than storing it as a field.
16996
16997 2004-05-23  Martin Baulig  <martin@ximian.com>
16998
16999         * flowanalysis.cs (Reachability.And): Manually compute the
17000         resulting `barrier' from the reachability.      
17001        
17002 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
17003
17004         Fix bug #57835
17005         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17006         instance of ObsoleteAttribute when symbol is obsolete.
17007
17008         * class.cs
17009         (IMethodData): Extended interface for ObsoleteAttribute support.
17010
17011 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17012
17013         * attribute.cs: Fix bug #55970
17014
17015 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
17016
17017         Fix bug #52705
17018         * attribute.cs
17019         (GetObsoleteAttribute): New method. Creates the instance of
17020         ObsoleteAttribute.
17021         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17022         ObsoleteAttribute when member is obsolete.
17023         (AttributeTester.Report_ObsoleteMessage): Common method for
17024         Obsolete error/warning reporting.
17025
17026         * class.cs
17027         (TypeContainer.base_classs_type): New member for storing parent type.
17028
17029         * decl.cs
17030         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17031         for this MemberCore.
17032
17033 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17034
17035         * attribute.cs, const.cs: Fix bug #58590
17036
17037 2004-05-21  Martin Baulig  <martin@ximian.com>
17038
17039         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
17040         out parameters if the end of the method is unreachable.  Fixes
17041         #58098. 
17042
17043 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17044
17045         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
17046         Hari was right, why extra method.
17047
17048 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
17049
17050         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
17051
17052 2004-05-20  Martin Baulig  <martin@ximian.com>
17053
17054         Merged this back from gmcs to keep the differences to a minumum.
17055
17056         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
17057         instead of a Declspace.
17058         (Attribute.ResolveType): Likewise.
17059         (Attributes.Search): Likewise.
17060         (Attributes.Contains): Likewise.
17061         (Attributes.GetClsCompliantAttribute): Likewise.
17062
17063         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
17064         argument.
17065         (MethodData.ApplyAttributes): Take an EmitContext instead of a
17066         DeclSpace.
17067
17068 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
17069
17070         Fix bug #58688 (MCS does not report error when the same attribute
17071         is assigned twice)
17072
17073         * attribute.cs (Attribute.Emit): Distinction between null and default.
17074
17075 2004-05-19  Raja R Harinath  <rharinath@novell.com>
17076
17077         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
17078         of a top-level attribute without an attribute target.
17079         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
17080         Make non-static.
17081         (Attribute.Conditional_GetConditionName), 
17082         (Attribute.Obsolete_GetObsoleteMessage): Update.
17083         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
17084         part of ScanForIndexerName.
17085         (Attribute.CanIgnoreInvalidAttribute): New function.
17086         (Attribute.ScanForIndexerName): Move to ...
17087         (Attributes.ScanForIndexerName): ... here.
17088         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
17089         (Attributes.Search): New internal variant that can choose not to
17090         complain if types aren't resolved.  The original signature now
17091         complains.
17092         (Attributes.GetClsCompliantAttribute): Use internal variant, with
17093         complaints suppressed.
17094         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
17095         only if it not useful.
17096         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
17097         top-level for attributes that are shared between the assembly
17098         and a top-level class.
17099         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
17100         * class.cs: Update to reflect changes.
17101         (DefineIndexers): Fuse loops.
17102         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
17103         a couple more variants of attribute names.
17104
17105 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
17106
17107         Fix bug #52585 (Implemented explicit attribute declaration)
17108
17109         * attribute.cs:
17110         (Attributable.ValidAttributeTargets): New abstract method. It gets
17111         list of valid attribute targets for explicit target declaration.
17112         (Attribute.Target): It holds target itself.
17113         (AttributeSection): Removed.
17114         (Attribute.CheckTargets): New method. It checks whether attribute
17115         target is valid for the current element.
17116
17117         * class.cs:
17118         (EventProperty): New class. For events that are declared like
17119         property (with add and remove accessors).
17120         (EventField): New class. For events that are declared like field.
17121         class.cs
17122
17123         * cs-parser.jay: Implemented explicit attribute target declaration.
17124
17125         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
17126         Override ValidAttributeTargets.
17127
17128         * parameter.cs:
17129         (ReturnParameter): Class for applying custom attributes on 
17130         the return type.
17131         (ParameterAtribute): New class. Class for applying custom
17132         attributes on the parameter type.
17133
17134 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
17135
17136         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
17137         definitions. 
17138
17139         (Method): Allow UNSAFE here.
17140
17141         * modifiers.cs: Support unsafe reporting.
17142
17143 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
17144
17145         * decl.cs: Fix bug #58478.
17146
17147 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17148
17149         * statement.cs: When checking for unreachable code on an EmptyStatement,
17150         set the location. Fixes bug #58488.
17151
17152 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
17153
17154         * driver.cs: Add -pkg handling.
17155
17156         From Gonzalo: UseShelLExecute=false
17157
17158 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
17159
17160         * attribute.cs:
17161         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
17162         for attribute.
17163         (Attribute.IsClsCompliaceRequired): Moved to base for better
17164         accesibility.
17165         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
17166         when attribute is AttributeUsageAttribute.
17167         (Attribute.GetValidTargets): Simplified.
17168         (Attribute.GetAttributeUsage): New method returns AttributeUsage
17169         attribute for this type.
17170         (Attribute.ApplyAttributes): Method renamed to Emit and make
17171         non-static.
17172         (GlobalAttributeSection): New class for special handling of global
17173         attributes (assembly, module).
17174         (AttributeSection.Emit): New method.
17175
17176         * class.cs: Implemented Attributable abstract methods.
17177         (MethodCore.LabelParameters): Moved to Parameter class.
17178         (Accessor): Is back simple class.
17179         (PropertyMethod): Implemented Attributable abstract class.
17180         (DelegateMethod): Implemented Attributable abstract class.
17181         (Event): New constructor for disctintion between normal Event
17182         and Event with accessors.
17183
17184         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
17185
17186         * codegen.cs, const.cs, decl.cs, delegate.cs:
17187         (CommonAssemblyModulClass): Implemented Attributable abstract class
17188         and simplified.
17189
17190         * enum.cs: Implement IAttributeSupport interface.
17191         (EnumMember): New class for emum members. Implemented Attributable
17192         abstract class
17193
17194         * parameter.cs:
17195         (ParameterBase): Is abstract.
17196         (ReturnParameter): New class for easier [return:] attribute handling.
17197
17198         * typemanager.cs: Removed builder_to_attr.
17199
17200 2004-05-11  Raja R Harinath  <rharinath@novell.com>
17201
17202         Fix bug #57151.
17203         * attribute.cs (Attribute.GetPositionalValue): New function.
17204         * class.cs (TypeContainer.VerifyMembers): New function.
17205         (TypeContainer.Emit): Use it.
17206         (ClassOrStruct): New base class for Class and Struct.
17207         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
17208         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
17209         class.
17210         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
17211         then each non-static field should have a FieldOffset attribute.
17212         Otherwise, none of the fields should have a FieldOffset attribute.
17213         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
17214         and FieldOffset attributes.
17215         * typemanager.cs (TypeManager.struct_layout_attribute_type)
17216         (TypeManager.field_offset_attribute_type): New core types.
17217         (TypeManager.InitCoreTypes): Initialize them.
17218
17219 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
17220
17221         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
17222         Return correct type.
17223         From bug #58270.
17224
17225 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
17226
17227         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
17228         be implicitly converted to ulong.
17229         
17230         * expression.cs: The logic for allowing operator &, | and ^ worked
17231         was wrong, it worked before because we did not report an error in
17232         an else branch.  Fixes 57895.
17233
17234         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
17235         allow volatile fields to be reference types.
17236
17237 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * driver.cs: Add support for /debug-
17240
17241 2004-05-07  Raja R Harinath  <rharinath@novell.com>
17242
17243         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
17244         Add a 'complain' parameter to silence errors.
17245         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
17246         silently overlooked type-resolutions.
17247         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
17248         to reflect changes.
17249         (Attributes.Search): New function.
17250         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
17251         (Attributes.GetAttributeFullName): Remove hack.
17252         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
17253         Update to reflect changes.
17254         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
17255         Use Attributes.Search instead of nested loops.
17256
17257 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
17258
17259         * decl.cs:
17260         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
17261         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
17262         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
17263
17264         * report.cs: (Report.Warning): Renamed to Warning_T because of
17265         parameter collision.
17266
17267 2004-05-05  Raja R Harinath  <rharinath@novell.com>
17268
17269         * expression.cs (MemberAccess.ResolveMemberAccess):
17270         Exit with non-zero status after Report.Error.
17271         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
17272         Likewise.
17273         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
17274
17275 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17276
17277         * support.cs: Don't hang when the file is empty.
17278
17279 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
17280
17281         * support.cs: In SeekableStreamReader, compute the preamble size of the
17282           underlying stream. Position changes should take into account that initial
17283           count of bytes.
17284
17285 2004-05-03  Todd Berman  <tberman@sevenl.net>
17286
17287         * driver.cs: remove unused GetSysVersion function.
17288
17289 2004-05-03  Todd Berman  <tberman@sevenl.net>
17290
17291         * driver.cs: Remove the hack from saturday, as well as the hack
17292         from jackson (LoadAssemblyFromGac), also adds the CWD to the
17293         link_paths to get that bit proper.
17294
17295 2004-05-01  Todd Berman  <tberman@sevenl.net>
17296
17297         * driver.cs: Try a LoadFrom before a Load, this checks the current
17298         path. This is currently a bug in mono that is be fixed, however, this
17299         provides a workaround for now. This will be removed when the bug
17300         is fixed.
17301
17302 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
17303
17304         * CryptoConvert.cs: Updated to latest version. Fix issue with 
17305         incomplete key pairs (#57941).
17306
17307 2004-05-01  Todd Berman  <tberman@sevenl.net>
17308
17309         * driver.cs: Remove '.' from path_chars, now System.* loads properly
17310         from the GAC
17311
17312 2004-04-30  Jackson Harper  <jackson@ximian.com>
17313
17314         * codegen.cs: Open keys readonly.
17315         
17316 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17317
17318         * typemanager.cs: don't report cyclic struct layout when a struct
17319         contains 2 or more fields of the same type. Failed for Pango.AttrShape
17320         which has 2 Pango.Rectangle fields.
17321
17322 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17323
17324         * expression.cs: Handle IntPtr comparisons with IL code
17325         rather than a method call.
17326
17327 2004-04-29  Martin Baulig  <martin@ximian.com>
17328
17329         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
17330         the list of PropertyInfo's in class hierarchy and find the
17331         accessor.  Fixes #56013.
17332
17333 2004-04-29  Martin Baulig  <martin@ximian.com>
17334
17335         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17336
17337 2004-04-29  Martin Baulig  <martin@ximian.com>
17338
17339         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17340
17341         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17342
17343 2004-04-29  Martin Baulig  <martin@ximian.com>
17344
17345         * class.cs (ConstructorInitializer.Resolve): Check whether the
17346         parent .ctor is accessible.  Fixes #52146.
17347
17348 2004-04-29  Martin Baulig  <martin@ximian.com>
17349
17350         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17351
17352         * statement.cs (Using.EmitLocalVariableDecls): Use
17353         TypeManager.idisposable_type, not typeof (IDisposable).
17354         (Foreach.EmitCollectionForeach): Added support for valuetypes.
17355
17356 2004-04-29  Martin Baulig  <martin@ximian.com>
17357
17358         * class.cs (Event.Define): Don't emit the field and don't set
17359         RTSpecialName and SpecialName for events on interfaces.  Fixes
17360         #57703. 
17361
17362 2004-04-29  Raja R Harinath  <rharinath@novell.com>
17363
17364         Refactor Attribute.ApplyAttributes.
17365         * attribute.cs (Attributable): New base class for objects that can
17366         have Attributes applied on them.
17367         (Attribute): Make AttributeUsage fields public.
17368         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17369         (Attribute.IsInternalCall): New property.
17370         (Attribute.UsageAttr): Convert to a public read-only property.
17371         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17372         (Attribute.ResolveType, Attribute.Resolve)
17373         (Attribute.ScanForIndexerName): Update to reflect changes.
17374         (Attribute.CheckAttributeTarget): Re-format.
17375         (Attribute.ApplyAttributes): Refactor, to various
17376         Attributable.ApplyAttributeBuilder methods.
17377         * decl.cs (MemberCore): Make Attributable.
17378         * class.cs (Accessor): Make Attributable.
17379         (MethodData.ApplyAttributes): Use proper attribute types, not
17380         attribute names.
17381         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17382         (TypeContainer.ApplyAttributeBuilder)
17383         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17384         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
17385         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17386         (Operator.ApplyAttributeBuilder): New factored-out methods.
17387         * const.cs (Const.ApplyAttributeBuilder): Likewise.
17388         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17389         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17390         * parameter.cs (ParameterBase): New Attributable base class
17391         that can also represent Return types.
17392         (Parameter): Update to the changes.
17393
17394 2004-04-29  Jackson Harper  <jackson@ximian.com>
17395
17396         * driver.cs: Prefer the corlib system version when looking for
17397         assemblies in the GAC. This is still a hack, but its a better hack
17398         now.
17399         
17400 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
17401
17402         * decl.cs, enum.cs: Improved error 3005 reporting.
17403   
17404         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17405         (related_symbols): New private member for list of symbols
17406         related to reported error/warning.
17407         
17408         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17409
17410 2004-04-29  Martin Baulig  <martin@ximian.com>
17411
17412         * ecore.cs (Expression.Constantify): If we're an enum and
17413         TypeManager.TypeToCoreType() doesn't give us another type, use
17414         t.UnderlyingSystemType.  Fixes #56178.  
17415
17416 2004-04-29  Martin Baulig  <martin@ximian.com>
17417
17418         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17419         interfaces and for each interface, only add members directly
17420         declared in that interface.  Fixes #53255.
17421
17422 2004-04-28  Martin Baulig  <martin@ximian.com>
17423
17424         * expression.cs (ConditionalLogicalOperator): Use a temporary
17425         variable for `left' to avoid that we evaluate it more than once;
17426         bug #52588.
17427
17428 2004-04-28  Martin Baulig  <martin@ximian.com>
17429
17430         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17431         `void[]' (CS1547).
17432
17433 2004-04-28  Martin Baulig  <martin@ximian.com>
17434
17435         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17436         void (CS1547).
17437
17438         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17439         whether the type is not void (CS1547).
17440
17441 2004-04-28  Martin Baulig  <martin@ximian.com>
17442
17443         * expression.cs (Unary.DoResolveLValue): Override this and report
17444         CS0131 for anything but Operator.Indirection.
17445
17446 2004-04-28  Martin Baulig  <martin@ximian.com>
17447
17448         Committing a patch from Ben Maurer; see bug #50820.
17449
17450         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17451         check for classes.
17452
17453         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17454         classes.        
17455
17456 2004-04-28  Martin Baulig  <martin@ximian.com>
17457
17458         Committing a patch from Ben Maurer; see bug #50820.
17459
17460         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17461         check for classes.
17462
17463         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17464         classes.        
17465
17466 2004-04-28  Martin Baulig  <martin@ximian.com>
17467
17468         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17469         (Block.AddLabel): Call DoLookupLabel() to only search in the
17470         current block.
17471
17472 2004-04-28  Martin Baulig  <martin@ximian.com>
17473
17474         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17475         comparing StringConstants and NullLiterals in Equality and Inequality.
17476
17477 2004-04-28  Jackson Harper  <jackson@ximian.com>
17478
17479         * driver.cs: Attempt to load referenced assemblies from the
17480         GAC. This is the quick and dirty version of this method that
17481         doesnt take into account versions and just takes the first
17482         canidate found. Will be good enough for now as we will not have more
17483         then one version installed into the GAC until I update this method.
17484
17485 2004-04-28  Martin Baulig  <martin@ximian.com>
17486
17487         * typemanager.cs (TypeManager.CheckStructCycles): New public
17488         static method to check for cycles in the struct layout.
17489
17490         * rootcontext.cs (RootContext.PopulateTypes): Call
17491         TypeManager.CheckStructCycles() for each TypeContainer.
17492         [Note: We only need to visit each type once.]
17493
17494 2004-04-28  Martin Baulig  <martin@ximian.com>
17495
17496         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17497
17498         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17499         success and added `out object value'.  Use a `bool resolved' field
17500         to check whether we've already been called rather than
17501         `ConstantValue != null' since this breaks for NullLiterals.
17502
17503 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17504
17505         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17506         setting of this flag, since the 'set' method may be non-public.
17507
17508 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17509
17510         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17511         check on current_vector.Block.
17512
17513 2004-04-27  Martin Baulig  <martin@ximian.com>
17514
17515         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17516         a field initializer.  Fixes #56459.
17517
17518 2004-04-27  Martin Baulig  <martin@ximian.com>
17519
17520         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17521         we're not attempting to use an indexer.  Fixes #52154.
17522
17523 2004-04-27  Martin Baulig  <martin@ximian.com>
17524
17525         * statement.cs (Return): Don't create a return label if we don't
17526         need it; reverts my change from January 20th.  Thanks to Ben
17527         Maurer for this.
17528
17529 2004-04-27  Martin Baulig  <martin@ximian.com>
17530
17531         According to the spec, `goto' can only leave a nested scope, but
17532         never enter it.
17533
17534         * statement.cs (Block.LookupLabel): Only lookup in the current
17535         block, don't recurse into parent or child blocks.
17536         (Block.AddLabel): Check in parent and child blocks, report
17537         CS0140/CS0158 if we find a duplicate.
17538         (Block): Removed this indexer for label lookups.
17539         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17540         this already does the error reporting for us.
17541
17542         * flowanalysis.cs
17543         (FlowBranching.UsageVector.Block): New public variable; may be null.
17544         (FlowBranching.CreateSibling): Added `Block' argument.
17545         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17546         label for the target of a `goto' and check whether we're not
17547         leaving a `finally'.
17548
17549 2004-04-27  Martin Baulig  <martin@ximian.com>
17550
17551         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17552         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17553         just for returns).
17554
17555 2004-04-27  Martin Baulig  <martin@ximian.com>
17556
17557         * statement.cs (Block.AddLabel): Also check for implicit blocks
17558         and added a CS0158 check.
17559
17560 2004-04-27  Martin Baulig  <martin@ximian.com>
17561
17562         * flowanalysis.cs (FlowBranchingLoop): New class.
17563         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17564         UsageVector's instead of an ArrayList.
17565         (FlowBranching.Label): Likewise.
17566         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17567         (FlowBranching.AddBreakVector): New method.
17568
17569 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17570
17571         * attribute.cs: Small regression fix: only convert the type if we
17572         the type is different, fixes System.Drawing build.
17573
17574 2004-04-27  Martin Baulig  <martin@ximian.com>
17575
17576         * attribute.cs (Attribute.Resolve): If we have a constant value
17577         for a named field or property, implicity convert it to the correct
17578         type.
17579
17580 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17581
17582         * statement.cs (Block.Block): Implicit blocks share
17583         'child_variable_names' fields with parent blocks.
17584         (Block.AddChildVariableNames): Remove.
17585         (Block.AddVariable): Mark variable as "used by a child block" in
17586         every surrounding block.
17587         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17588         been used in a child block, complain about violation of "Invariant
17589         meaning in blocks" rule.
17590         * cs-parser.jay (declare_local_variables): Don't use
17591         AddChildVariableNames.
17592         (foreach_statement): Don't create an implicit block: 'foreach'
17593         introduces a scope.
17594
17595 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17596
17597         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17598         converting from 0L to ulong.  Fixes 57522.
17599
17600 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17601
17602         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17603         derived class hides via 'new' keyword field from base class (test-242.cs).
17604         TODO: Handle this in the more general way.
17605         
17606         * class.cs (CheckBase): Ditto.
17607
17608 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17609
17610         * decl.cs (caching_flags): New member for storing cached values
17611         as bit flags.
17612         (MemberCore.Flags): New enum where bit flags for caching_flags
17613         are defined.
17614         (MemberCore.cls_compliance): Moved to caching_flags.
17615         (DeclSpace.Created): Moved to caching_flags.
17616
17617         * class.cs: Use caching_flags instead of DeclSpace.Created
17618         
17619 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17622         if we are only a derived class, not a nested class.
17623
17624         * typemanager.cs: Same as above, but do this at the MemberLookup
17625         level (used by field and methods, properties are handled in
17626         PropertyExpr).   Allow for the qualified access if we are a nested
17627         method. 
17628
17629 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17630
17631         * class.cs: Refactoring.
17632         (IMethodData): New inteface; Holds links to parent members
17633         to avoid member duplication (reduced memory allocation).
17634         (Method): Implemented IMethodData interface.
17635         (PropertyBase): New inner classes for get/set methods.
17636         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17637         (Event): New inner classes for add/remove methods.
17638         (Event.DelegateMethod): Implemented IMethodData interface.
17639
17640         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17641         EmitContext (related to class.cs refactoring).
17642
17643 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17644
17645         * delegate.cs (Delegate.VerifyApplicability): If the number of
17646         arguments are the same as the number of parameters, first try to
17647         verify applicability ignoring  any 'params' modifier on the last
17648         parameter.
17649         Fixes #56442.
17650
17651 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17652
17653         * class.cs (TypeContainer.AddIndexer): Use
17654         'ExplicitInterfaceName' to determine if interface name was
17655         explicitly specified.  'InterfaceType' is not initialized at this time.
17656         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17657         Indexers array is already in the required order.  Initialize
17658         'IndexerName' only if there are normal indexers.
17659         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17660         (TypeContainer.Emit): Emit DefaultMember attribute only if
17661         IndexerName is initialized.
17662         Fixes #56300.
17663
17664 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17665
17666         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17667         Fixes #57007
17668
17669 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17670
17671         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17672         attributes.
17673         Fix for #56456.
17674
17675         * attribute.cs (Attribute.Resolve): Check for duplicate named
17676         attributes.
17677         Fix for #56463.
17678
17679 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17680
17681         * iterators.cs (MarkYield): track whether we are in an exception,
17682         and generate code accordingly.  Use a temporary value to store the
17683         result for our state.
17684
17685         I had ignored a bit the interaction of try/catch with iterators
17686         since their behavior was not entirely obvious, but now it is
17687         possible to verify that our behavior is the same as MS .NET 2.0
17688
17689         Fixes 54814
17690
17691 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * iterators.cs: Avoid creating temporaries if there is no work to
17694         do. 
17695
17696         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17697         Enumerations, use TypeManager.EnumToUnderlying and call
17698         recursively. 
17699
17700         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17701         bug #57013
17702
17703         (This.Emit): Use EmitContext.EmitThis to emit our
17704         instance variable.
17705
17706         (This.EmitAssign): Ditto.
17707
17708         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17709         codepaths, we will move all the functionality into
17710         Mono.CSharp.This 
17711
17712         (FieldExpr.EmitAssign): Ditto.
17713
17714         This fixes several hidden bugs that I uncovered while doing a code
17715         review of this today.
17716
17717         * codegen.cs (EmitThis): reworked so the semantics are more clear
17718         and also support value types "this" instances.
17719
17720         * iterators.cs: Changed so that for iterators in value types, we
17721         do not pass the value type as a parameter.  
17722
17723         Initialization of the enumerator helpers is now done in the caller
17724         instead of passing the parameters to the constructors and having
17725         the constructor set the fields.
17726
17727         The fields have now `assembly' visibility instead of private.
17728
17729 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * expression.cs (Argument.Resolve): Check if fields passed as ref
17732         or out are contained in a MarshalByRefObject.
17733
17734         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17735         another compiler type.
17736
17737 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17738
17739         * class.cs (Indexer.Define): use the new name checking method.
17740         Also, return false on an error.
17741         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17742         (is_identifier_[start/part]_character): make static.
17743
17744 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17745
17746         * expression.cs (Binary.ResolveOperator): Do no append strings
17747         twice: since we can be invoked more than once (array evaluation)
17748         on the same concatenation, take care of this here.  Based on a fix
17749         from Ben (bug #56454)
17750
17751 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17752
17753         * codegen.cs: Fix another case where CS1548 must be reported (when 
17754         delay-sign isn't specified and no private is available #56564). Fix
17755         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17756         error when MCS is used on the MS runtime and we need to delay-sign 
17757         (which seems unsupported by AssemblyBuilder - see #56621).
17758
17759 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17760
17761         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17762         (TypeManager.ComputeNamespaces): Faster implementation for
17763         Microsoft runtime.
17764
17765         * compiler.csproj: Updated AssemblyName to mcs.
17766
17767 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * rootcontext.cs: Add new types to the boot resolution.
17770
17771         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17772         MulticastDelegate is not allowed.
17773
17774         * typemanager.cs: Add new types to lookup: System.TypedReference
17775         and ArgIterator.
17776
17777         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17778         check for TypedReference or ArgIterator, they are not allowed. 
17779
17780         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17781         makes us properly catch 1510 in some conditions (see bug 56016 for
17782         details). 
17783
17784 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17785
17786         * CryptoConvert.cs: update from corlib version
17787         with endian fixes.
17788
17789 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17790
17791         * class.cs (Indexer.Define): Check indexername declaration
17792
17793 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17794
17795         * attribute.cs (IsClsCompliant): Fixed problem with handling
17796         all three states (compliant, not-compliant, undetected).
17797
17798 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17799
17800         * attribute.cs (Attribute): Location is now public.
17801         (Resolve): Store resolved arguments (pos_values) in attribute class.
17802         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17803         (GetClsCompliantAttributeValue): New method that gets
17804         CLSCompliantAttribute value.
17805         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17806         if exists else null.
17807         (AttributeTester): New class for CLS-Compliant verification routines.
17808
17809         * class.cs (Emit): Add CLS-Compliant verification.
17810         (Method.GetSignatureForError): Implemented.
17811         (Constructor.GetSignatureForError): Implemented
17812         (Constructor.HasCompliantArgs): Returns if constructor has
17813         CLS-Compliant arguments.
17814         (Constructor.Emit): Override.
17815         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17816         is needed to test only parameters.
17817         (FieldBase.GetSignatureForError): Implemented.
17818         (TypeContainer): New member for storing base interfaces.
17819         (TypeContainer.FindMembers): Search in base interfaces too.
17820
17821         * codegen.cs (GetClsComplianceAttribute): New method that gets
17822         assembly or module CLSCompliantAttribute value.
17823         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17824         for assembly.
17825         (ModuleClass.Emit): Add error 3012 test.
17826
17827         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17828
17829         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17830         state for all decl types.
17831         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17832         if CLS-Compliant tests are required.
17833         (IsClsCompliaceRequired): New method. Analyze whether code
17834         must be CLS-Compliant.
17835         (IsExposedFromAssembly): New method. Returns true when MemberCore
17836         is exposed from assembly.
17837         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17838         value or gets cached value.
17839         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17840         is explicitly marked with CLSCompliantAttribute.
17841         (IsIdentifierClsCompliant): New abstract method. This method is
17842         used to testing error 3005.
17843         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17844         for identifier and parameters CLS-Compliant testing.
17845         (VerifyClsCompliance): New method. The main virtual method for
17846         CLS-Compliant verifications.
17847         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17848         null. I don't know why is null (too many public members !).
17849         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17850         and get value of first CLSCompliantAttribute that found.
17851
17852         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17853         (VerifyClsCompliance): Override and add extra tests.
17854
17855         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17856         clscheck- disable CLS-Compliant verification event if assembly is has
17857         CLSCompliantAttribute(true).
17858
17859         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17860         ApllyAttribute is now called in emit section as in the other cases.
17861         Possible future Emit integration.
17862         (IsIdentifierClsCompliant): New override.
17863         (VerifyClsCompliance): New override.
17864         (GetEnumeratorName): Returns full enum name.
17865
17866         * parameter.cs (GetSignatureForError): Implemented.
17867
17868         * report.cs (WarningData): New struct for Warning message information.
17869         (LocationOfPreviousError): New method.
17870         (Warning): New method. Reports warning based on the warning table.
17871         (Error_T): New method. Reports error based on the error table.
17872
17873         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17874         verifications are done here.
17875
17876         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17877
17878         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17879         CLSCompliantAttribute.
17880         (all_imported_types): New member holds all imported types from other
17881         assemblies.
17882         (LoadAllImportedTypes): New method fills static table with exported types
17883         from all referenced assemblies.
17884         (Modules): New property returns all assembly modules.
17885
17886 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17889         throwing a parser error.
17890
17891         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17892         which removes the hardcoded get_/set_ prefixes for properties, as
17893         IL allows for the properties to be named something else.  
17894
17895         Bug #56013
17896
17897         * expression.cs: Do not override operand before we know if it is
17898         non-null.  Fix 56207
17899
17900 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17901
17902         * typemanager.cs: support for pinned variables.
17903
17904 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17905
17906         * decl.cs, typemanager.cs: Avoid using an arraylist
17907         as a buffer if there is only one result set.
17908
17909 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17910
17911         * expression.cs: Make sure you cant call a static method
17912         with an instance expression, bug #56174.
17913
17914 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * class.cs (IsDuplicateImplementation): Improve error reporting to
17917         flag 663 (method only differs in parameter modifier).
17918
17919         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17920         in preprocessor directives.
17921
17922         * location.cs (LookupFile): Allow for the empty path.
17923
17924         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17925         better approach for some of that patch, but its failing with the
17926         CharSet enumeration.  For now try/catch will do.
17927
17928         * typemanager.cs: Do not crash if a struct does not have fields.
17929         Fixes 56150.
17930
17931 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17932
17933         * expression.cs: cs0213, cant fix a fixed expression.
17934         fixes 50231.
17935
17936 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17937
17938         * cs-parser.jay: detect invalid embeded statements gracefully.
17939         bug #51113.
17940
17941 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17942
17943         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17944         As a regex:
17945         s/
17946         the invocation type may not be a subclass of the tye of the item/
17947         The type of the item must be a subclass of the invocation item.
17948         /g
17949
17950         Fixes bug #50820.
17951
17952 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17953
17954         * attribute.cs: Added methods to get a string and a bool from an
17955         attribute. Required to information from AssemblyKeyFileAttribute,
17956         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17957         * codegen.cs: Modified AssemblyName creation to include support for
17958         strongnames. Catch additional exceptions to report them as CS1548.
17959         * compiler.csproj: Updated include CryptoConvert.cs.
17960         * compiler.csproj.user: Removed file - user specific configuration.
17961         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17962         Mono.Security assembly. The original class is maintained and tested in
17963         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17964         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17965         like CSC 8.0 (C# v2) supports.
17966         * Makefile: Added CryptoConvert.cs to mcs sources.
17967         * rootcontext.cs: Added new options for strongnames.
17968
17969 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17970
17971         * driver.cs: For --expect-error, report error code `2'
17972         if the program compiled with no errors, error code `1' if
17973         it compiled with an error other than the one expected.
17974
17975 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17976
17977         * compiler.csproj: Updated for Visual Studio .NET 2003.
17978         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17979         * compiler.sln: Updated for Visual Studio .NET 2003.
17980
17981 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17982
17983         * expression.cs: Fix bug #47234. We basically need to apply the
17984         rule that we prefer the conversion of null to a reference type
17985         when faced with a conversion to 'object' (csc behaviour).
17986
17987 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17988
17989         * statement.cs: Shorter form for foreach, eliminates
17990         a local variable. r=Martin.
17991
17992 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17993
17994         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17995         checks if we can use brtrue/brfalse to test for 0.
17996         * expression.cs: use the above in the test for using brtrue/brfalse.
17997         cleanup code a bit.
17998
17999 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18000
18001         * expression.cs: Rewrite string concat stuff. Benefits:
18002
18003         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18004         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18005         rather than a concat chain.
18006
18007         * typemanager.cs: Add lookups for more concat overloads.
18008
18009 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18010
18011         * expression.cs: Emit shorter il code for array init.
18012
18013         newarr
18014         dup
18015         // set 1
18016
18017         // set 2
18018
18019         newarr
18020         stloc.x
18021
18022         ldloc.x
18023         // set 1
18024
18025         ldloc.x
18026         // set 2
18027
18028 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
18029
18030         * statement.cs: Before, two switch blocks would be merged if the
18031         total size of the blocks (end_item - begin_item + 1) was less than
18032         two times the combined sizes of the blocks.
18033
18034         Now, it will only merge if after the merge at least half of the
18035         slots are filled.
18036
18037         fixes 55885.
18038
18039 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
18040
18041         * class.cs : csc build fix for GetMethods(). See bug #52503.
18042
18043 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
18044
18045         * expression.cs: Make sure fp comparisons work with NaN.
18046         This fixes bug #54303. Mig approved this patch a long
18047         time ago, but we were not able to test b/c the runtime
18048         had a related bug.
18049
18050 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
18053
18054 2004-03-19  Martin Baulig  <martin@ximian.com>
18055
18056         * class.cs (MemberCore.IsDuplicateImplementation): Report the
18057         error here and not in our caller.
18058
18059 2004-03-19  Martin Baulig  <martin@ximian.com>
18060
18061         * interface.cs: Completely killed this file.
18062         (Interface): We're now a TypeContainer and live in class.cs.
18063
18064         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
18065         argument; we're now also called for interfaces.
18066         (TypeContainer.DefineMembers): Allow this method being called
18067         multiple times.
18068         (TypeContainer.GetMethods): New public method; formerly known as
18069         Interface.GetMethod().  This is used by PendingImplementation.
18070         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
18071         it's now private and non-static.
18072         (Interface): Moved this here; it's now implemented similar to
18073         Class and Struct.
18074         (Method, Property, Event, Indexer): Added `bool is_interface'
18075         argument to their .ctor's.
18076         (MemberBase.IsInterface): New public field.
18077
18078         * cs-parser.jay: Create normal Method, Property, Event, Indexer
18079         instances instead of InterfaceMethod, InterfaceProperty, etc.
18080         (opt_interface_base): Removed; we now use `opt_class_base' instead.
18081         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
18082
18083 2004-03-19  Martin Baulig  <martin@ximian.com>
18084
18085         * class.cs (MethodCore.IsDuplicateImplementation): New private
18086         method which does the CS0111 checking.
18087         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
18088         Use IsDuplicateImplementation().
18089
18090 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
18091
18092         * decl.cs (FindMemberToOverride): New method to find the correct
18093         method or property to override in the base class.
18094         * class.cs
18095             - Make Method/Property use the above method to find the
18096               version in the base class.
18097             - Remove the InheritableMemberSignatureCompare as it is now
18098               dead code.
18099
18100         This patch makes large code bases much faster to compile, as it is
18101         O(n) rather than O(n^2) to do this validation.
18102
18103         Also, it fixes bug 52458 which is that nested classes are not
18104         taken into account when finding the base class member.
18105
18106         Reviewed/Approved by Martin.
18107
18108 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
18109
18110         * interface.cs: In all interface classes removed redundant
18111         member initialization.
18112
18113 2004-03-16  Martin Baulig  <martin@ximian.com>
18114
18115         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
18116
18117 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
18118
18119         * decl.cs (DefineTypeAndParents): New helper method to define a
18120         type's containers before the type itself is defined;  This is a
18121         bug exposed by the recent changes to Windows.Forms when an
18122         implemented interface was defined inside a class that had not been
18123         built yet.   
18124
18125         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
18126
18127         (Check): Loop correctly to report errors modifiers
18128         (UNSAFE was not in the loop, since it was the same as TOP).
18129
18130         * interface.cs: Every interface member now takes a ModFlags,
18131         instead of a "is_new" bool, which we set on the base MemberCore. 
18132
18133         Every place where we called "UnsafeOk" in the interface, now we
18134         call the proper member (InterfaceMethod.UnsafeOK) instead to get
18135         the unsafe settings from the member declaration instead of the
18136         container interface. 
18137
18138         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
18139
18140         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
18141         `set_indexer_name' to the pending bits (one per type).
18142
18143         We fixed a bug today that was picking the wrong method to
18144         override, since for properties the existing InterfaceMethod code
18145         basically ignored the method name.  Now we make sure that the
18146         method name is one of the valid indexer names.
18147
18148 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
18149  
18150         * support.cs (SeekableStreamReader): Keep track of stream byte
18151         positions and don't mix them with character offsets to the buffer.
18152
18153         Patch from Gustavo Giráldez
18154
18155 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
18156
18157         * interface.cs (InterfaceSetGetBase): Removed double member
18158         initialization, base class does it as well.
18159
18160 2004-03-13  Martin Baulig  <martin@ximian.com>
18161
18162         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
18163         when compiling corlib.
18164
18165 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * convert.cs (ExplicitConversion): We were reporting an error on
18168         certain conversions (object_type source to a value type, when the
18169         expression was `null') before we had a chance to pass it through
18170         the user defined conversions.
18171
18172         * driver.cs: Replace / and \ in resource specifications to dots.
18173         Fixes 50752
18174
18175         * class.cs: Add check for duplicate operators.  Fixes 52477
18176
18177 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
18178
18179         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
18180         that are in the middle of the statements, not only at the end.
18181         Fixes #54987
18182
18183         * class.cs (TypeContainer.AddField): No longer set the
18184         `HaveStaticConstructor' flag, now we call it
18185         `UserDefineStaticConstructor' to diferentiate the slightly
18186         semantic difference.
18187
18188         The situation is that we were not adding BeforeFieldInit (from
18189         Modifiers.TypeAttr) to classes that could have it.
18190         BeforeFieldInit should be set to classes that have no static
18191         constructor. 
18192
18193         See:
18194
18195         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
18196
18197         And most importantly Zoltan's comment:
18198
18199         http://bugzilla.ximian.com/show_bug.cgi?id=44229
18200
18201         "I think beforefieldinit means 'it's ok to initialize the type sometime 
18202          before its static fields are used', i.e. initialization does not need
18203          to be triggered by the first access to the type. Setting this flag
18204          helps the JIT to compile better code, since it can run the static
18205          constructor at JIT time, and does not need to generate code to call it
18206          (possibly lots of times) at runtime. Unfortunately, mcs does not set
18207          this flag for lots of classes like String. 
18208          
18209          csc sets this flag if the type does not have an explicit static 
18210          constructor. The reasoning seems to be that if there are only static
18211          initalizers for a type, and no static constructor, then the programmer
18212          does not care when this initialization happens, so beforefieldinit
18213          can be used.
18214          
18215          This bug prevents the AOT compiler from being usable, since it 
18216          generates so many calls to mono_runtime_class_init that the AOT code
18217          is much slower than the JITted code. The JITted code is faster, 
18218          because it does not generate these calls if the vtable is type is
18219          already initialized, which is true in the majority of cases. But the
18220          AOT compiler can't do this."
18221
18222 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
18223
18224         * class.cs (MethodData.Emit): Refactor the code so symbolic
18225         information is generated for destructors;  For some reasons we
18226         were taking a code path that did not generate symbolic information
18227         before. 
18228
18229 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18230
18231         * class.cs: Create a Constructor.CheckBase method that
18232         takes care of all validation type code. The method
18233         contains some code that was moved from Define.
18234
18235         It also includes new code that checks for duplicate ctors.
18236         This fixes bug #55148.
18237
18238 2004-03-09  Joshua Tauberer <tauberer@for.net>
18239
18240         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
18241         a { ... }-style array creation invokes EmitStaticInitializers
18242         which is not good for reference-type arrays.  String, decimal
18243         and now null constants (NullCast) are not counted toward
18244         static initializers.
18245
18246 2004-03-05  Martin Baulig  <martin@ximian.com>
18247
18248         * location.cs (SourceFile.HasLineDirective): New public field;
18249         specifies whether the file contains or is referenced by a "#line"
18250         directive.
18251         (Location.DefineSymbolDocuments): Ignore source files which
18252         either contain or are referenced by a "#line" directive.        
18253
18254 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
18255
18256         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
18257         direct access to our parent, so check the method inline there.
18258
18259 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18260
18261         * expression.cs (Invocation.EmitCall): Miguel's last commit
18262         caused a regression. If you had:
18263
18264             T t = null;
18265             t.Foo ();
18266
18267         In Foo the implict this would be null.
18268
18269 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * expression.cs (Invocation.EmitCall): If the method is not
18272         virtual, do not emit a CallVirt to it, use Call.
18273
18274         * typemanager.cs (GetFullNameSignature): Improve the method to
18275         cope with ".ctor" and replace it with the type name.
18276
18277         * class.cs (ConstructorInitializer.Resolve): Now the method takes
18278         as an argument the ConstructorBuilder where it is being defined,
18279         to catch the recursive constructor invocations.
18280
18281 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
18282
18283         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
18284         routines to check if a type is an enumerable/enumerator allow
18285         classes that implement the IEnumerable or IEnumerator interfaces.
18286
18287         * class.cs (Property, Operator): Implement IIteratorContainer, and
18288         implement SetYields.
18289
18290         (Property.Define): Do the block swapping for get_methods in the
18291         context of iterators.   We need to check if Properties also
18292         include indexers or not.
18293
18294         (Operator): Assign the Block before invoking the
18295         OperatorMethod.Define, so we can trigger the Iterator code
18296         replacement. 
18297
18298         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
18299         Property and Operator classes are not created when we parse the
18300         declarator but until we have the block completed, so we use a
18301         singleton SimpleIteratorContainer.Simple to flag whether the
18302         SetYields has been invoked.
18303
18304         We propagate this setting then to the Property or the Operator to
18305         allow the `yield' to function.
18306
18307 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
18308
18309         * codegen.cs: Implemented attribute support for modules.
18310         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18311         Assembly/Module functionality.
18312
18313         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18314         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18315         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18316
18317 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
18318
18319         * interface.cs (FindMembers): The operation is performed on all base
18320         interfaces and not only on the first. It is required for future CLS Compliance patch.
18321
18322 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18323
18324         * statement.cs, codegen.cs:
18325         This patch deals with patterns such as:
18326
18327         public class List : IEnumerable {
18328
18329                 public MyEnumerator GetEnumerator () {
18330                         return new MyEnumerator(this);
18331                 }
18332
18333                 IEnumerator IEnumerable.GetEnumerator () {
18334                         ...
18335                 }
18336                 
18337                 public struct MyEnumerator : IEnumerator {
18338                         ...
18339                 }
18340         }
18341
18342         Before, there were a few things we did wrong:
18343         1) we would emit callvirt on a struct, which is illegal
18344         2) we emited ldarg when we needed to emit ldarga
18345         3) we would mistakenly call the interface methods on an enumerator
18346         type that derived from IEnumerator and was in another assembly. For example:
18347
18348         public class MyEnumerator : IEnumerator
18349
18350         Would have the interface methods called, even if there were public impls of the
18351         method. In a struct, this lead to invalid IL code.
18352
18353 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
18354
18355         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18356           renamed to Emit.
18357
18358         * delegate.cs (Define): Fixed crash when delegate type is undefined.
18359
18360 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * cs-parser.jay: Fix small regression: we were not testing V2
18363         compiler features correctly.
18364
18365         * interface.cs: If the emit context is null, then create one
18366
18367 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
18368
18369         * decl.cs (GetSignatureForError): New virtual method to get full name
18370           for error messages.
18371
18372         * attribute.cs (IAttributeSupport): New interface for attribute setting.
18373           Now it is possible to rewrite ApplyAttributes method to be less if/else.
18374
18375         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18376           Duplicated members and code in these classes has been removed.
18377           Better encapsulation in these classes.
18378
18379 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
18380
18381         * assign.cs (Assign.DoResolve): When dealing with compound
18382         assignments, there is a new rule in ECMA C# 2.4 (might have been
18383         there before, but it is documented here) that states that in:
18384
18385         a op= b;
18386
18387         If b is of type int, and the `op' is a shift-operator, then the
18388         above is evaluated as:
18389
18390         a = (int) a op b 
18391
18392         * expression.cs (Binary.ResolveOperator): Instead of testing for
18393         int/uint/long/ulong, try to implicitly convert to any of those
18394         types and use that in pointer arithmetic.
18395
18396         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18397         method to print information for from the type, not from the
18398         null-method we were given.
18399
18400 2004-02-01  Duncan Mak  <duncan@ximian.com>
18401
18402         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18403         parsing for cmd, fixes bug #53694.
18404
18405 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
18406
18407         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18408         in the member name duplication tests. Property and operator name duplication
18409         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18410
18411 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18412
18413         * interface.cs (PopulateMethod): Fixed crash when interface method
18414         returns not existing type (error test cs0246-3.cs).
18415
18416 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18417
18418         * cs-parser.jay (interface_accessors): Re-write actions to also
18419         store attributes attached to get and set methods. Fix spelling
18420         while at it.
18421
18422         (inteface_property_declaration): Modify accordingly.
18423
18424         (InterfaceAccessorInfo): New helper class to store information to pass
18425         around between rules that use interface_accessors.
18426
18427         * interface.cs (Emit): Apply attributes on the get and set
18428         accessors of properties and indexers too.
18429
18430         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18431         right MethodBuilder when applying attributes to the get and set accessors.
18432
18433 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18434
18435         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18436
18437 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18440
18441 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18442
18443         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18444         changes that treat `yield' specially when present before `break'
18445         or `return' tokens.
18446
18447         * cs-tokenizer.cs: yield is no longer a keyword.
18448
18449 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18450
18451         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18452         setting for default constructors.
18453         For default constructors are almost every time set wrong Modifier. The
18454         generated IL code has been alright. But inside mcs this values was
18455         wrong and this was reason why several of my CLS Compliance tests
18456         failed.
18457
18458 2004-01-22  Martin Baulig  <martin@ximian.com>
18459
18460         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18461         not a QualifiedIdentifier.  This is what `type_name_expression'
18462         was previously doing.
18463         (type_name_expression): Removed; the code is now in
18464         `namespace_or_type_name'.
18465         (qualified_identifier): Removed, use `namespace_or_type_name'
18466         instead.
18467         (QualifiedIdentifier): Removed this class.      
18468
18469 2004-01-22  Martin Baulig  <martin@ximian.com>
18470
18471         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18472         not a string as alias name.
18473
18474 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18475
18476         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18477         #52730 bug, and instead compute correctly the need to use a
18478         temporary variable when requesting an address based on the
18479         static/instace modified of the field and the constructor.
18480  
18481 2004-01-21  Martin Baulig  <martin@ximian.com>
18482
18483         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18484         class and namespace before looking up aliases.  Fixes #52517.
18485
18486 2004-01-21  Martin Baulig  <martin@ximian.com>
18487
18488         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18489         assinged in a 'try'; fixes exception4.cs.
18490
18491 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18492         * class.cs : Implemented parameter-less constructor for TypeContainer
18493
18494         * decl.cs: Attributes are now stored here. New property OptAttributes
18495
18496         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18497
18498         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18499
18500 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18501
18502         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18503           (CSharpSignature): New method for indexer and property signature.
18504
18505 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18506
18507         * pending.cs (IsVirtualFilter): Faster implementation.
18508
18509 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18510
18511         * typemanager.cs: Avoid inclusion of same assembly more than once.
18512
18513 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18514
18515         * cs-parser.jay: Fixed problem where the last assembly attribute
18516           has been applied also to following declaration (class, struct, etc.)
18517           
18518 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18519
18520         * class.cs: Added error CS0538, CS0539 reporting.
18521         Fixed crash on Microsoft runtime when field type is void.
18522
18523         * cs-parser.jay: Added error CS0537 reporting.
18524
18525         * pending.cs: Added error CS0535 reporting.
18526         Improved error report for errors CS0536, CS0534.
18527
18528 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18529
18530         Merge a few bits from the Anonymous Method MCS tree.
18531
18532         * statement.cs (ToplevelBlock): New class for toplevel methods,
18533         will hold anonymous methods, lifted variables.
18534
18535         * cs-parser.jay: Create toplevel blocks for delegates and for
18536         regular blocks of code. 
18537
18538 2004-01-20  Martin Baulig  <martin@ximian.com>
18539
18540         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18541         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18542         and `NeedExplicitReturn'; added `IsLastStatement'.
18543         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18544         have a `ReturnLabel' or we're not unreachable.
18545
18546         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18547         child's reachability; don't just override ours with it.  Fixes
18548         #58058 (lluis's example).
18549         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18550         InFinally(), InLoop(), InSwitch() and
18551         BreakCrossesTryCatchBoundary() methods.
18552
18553         * statement.cs (Return): Do all error checking in Resolve().
18554         Unless we are the last statement in a top-level block, always
18555         create a return label and jump to it.
18556         (Break, Continue): Do all error checking in Resolve(); also make
18557         sure we aren't leaving a `finally'.
18558         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18559         statement in a top-level block.
18560         (Block.Flags): Added `IsDestructor'.
18561         (Block.IsDestructor): New public property.
18562
18563 2004-01-20  Martin Baulig  <martin@ximian.com>
18564
18565         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18566
18567 2004-01-20  Martin Baulig  <martin@ximian.com>
18568
18569         * statement.cs (Statement.ResolveUnreachable): New public method.
18570         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18571         (Block.Resolve): Resolve unreachable statements.
18572
18573 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18574
18575         * expression.cs: We need to fix the case where we do
18576         not have a temp variable here.
18577
18578         * assign.cs: Only expression compound assignments need
18579         temporary variables.
18580
18581 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18582
18583         * flowanalysis.cs: Reduce memory allocation in a few ways:
18584           - A block with no variables should not allocate a bit
18585             vector for itself.
18586           - A method with no out parameters does not need any tracking
18587             for assignment of the parameters, so we need not allocate
18588             any data for it.
18589           - The arrays:
18590                 public readonly Type[] VariableTypes;
18591                 public readonly string[] VariableNames;
18592             Are redundant. The data is already stored in the variable
18593             map, so we need not allocate another array for it.
18594           - We need to add alot of checks for if (params | locals) == null
18595             due to the first two changes.
18596
18597 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18598
18599         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18600         implement IMemoryLocation, we store a copy on a local variable and
18601         take the address of it.  Patch from Benjamin Jemlich
18602
18603         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18604         to use a special "type_name_expression" rule which reduces the
18605         number of "QualifiedIdentifier" classes created, and instead
18606         directly creates MemberAccess expressions.
18607
18608 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18609
18610         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18611         that fixes #52853.  Null literal assignment to ValueType
18612
18613         * class.cs (MethodData.Emit): Instead of checking the name of the
18614         method to determine if its a destructor, create a new derived
18615         class from Method called Destructor, and test for that.  
18616
18617         * cs-parser.jay: Create a Destructor object instead of a Method.  
18618
18619         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18620
18621         Fixes: 52933
18622
18623 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * expression.cs (Binary.ResolveOperator): Perform an implicit
18626         conversion from MethodGroups to their delegate types on the
18627         Addition operation.
18628
18629         * delegate.cs: Introduce a new class DelegateCreation that is the
18630         base class for `NewDelegate' and `ImplicitDelegateCreation',
18631         factor some code in here.
18632
18633         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18634         conversion from MethodGroups to compatible delegate types. 
18635
18636         * ecore.cs (Expression.Resolve): Do not flag error 654
18637         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18638         we allow conversions from MethodGroups to delegate types now.
18639
18640         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18641         assignments in v2 either.
18642
18643 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18646         static read-only fields in ctors.
18647
18648         Applied patch from Benjamin Jemlich 
18649
18650         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18651
18652 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18655         here to return true, as they can be used like this:
18656
18657                 (XXX) int.MEMBER ()
18658
18659         Fixed 49836 and all the other dups
18660
18661 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18662
18663         * driver.cs: Implement /win32res and /win32icon.
18664
18665 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18666
18667         * cs-parser.jay: Add a rule to improve error handling for the
18668         common mistake of placing modifiers after the type.
18669
18670 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18671
18672         * cs-parser.jay (interface_event_declaration): Catch
18673         initialization of events on interfaces, and report cs0068
18674
18675         * cs-parser.jay (interface_event_declaration): Catch
18676         initialization of events. 
18677
18678         * ecore.cs: Better report missing constructors.
18679
18680         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18681         the error reporting done in the wrong place.  Fix.
18682
18683         * expression.cs (Binary.ResolveOperator): Catch the 
18684         operator + (E x, E y) error earlier, and later allow for implicit
18685         conversions in operator +/- (E e, U x) from U to the underlying
18686         type of E.
18687
18688         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18689         52596, if the container class is abstract, the default constructor
18690         is protected otherwise its public (before, we were always public).
18691
18692         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18693         fixed statement.
18694
18695         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18696         Jemlich that fixes bug #52597, MCS was generating invalid code for
18697         idisposable structs.   Thanks to Ben for following up with this
18698         bug as well.
18699
18700 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18701
18702         * driver.cs: Allow assemblies without code to be generated, fixes
18703         52230.
18704
18705 2004-01-07  Nick Drochak <ndrochak@gol.com>
18706
18707         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18708
18709 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * cs-parser.jay: Add rules to improve error reporting if fields or
18712         methods are declared at the namespace level (error 116)
18713
18714         * Add rules to catch event add/remove
18715
18716 2004-01-04  David Sheldon <dave-mono@earth.li>
18717
18718   * expression.cs: Added matching ")" to error message for 
18719   CS0077
18720
18721 2004-01-03 Todd Berman <tberman@gentoo.org>
18722
18723         * ecore.cs, attribute.cs:
18724         Applying fix from #52429.
18725
18726 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18727
18728         * ecore.cs, expression.cs, statement.cs:
18729         Total rewrite of how we handle branching. We
18730         now handle complex boolean expressions with fewer
18731         jumps. As well if (x == 0) no longer emits a ceq.
18732
18733         if (x is Foo) is much faster now, because we generate
18734         better code.
18735
18736         Overall, we get a pretty big improvement on our benchmark
18737         tests. The code we generate is smaller and more readable.
18738
18739         I did a full two-stage bootstrap. The patch was reviewed
18740         by Martin and Miguel.
18741
18742 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18743
18744         * cs-parser.jay: Make primary_expression not take a QI.
18745         we dont need this because the member_access rule covers
18746         us here. So we replace the rule with just IDENTIFIER.
18747
18748         This has two good effects. First, we remove a s/r conflict.
18749         Second, we allocate many fewer QualifiedIdentifier objects.
18750
18751 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18752
18753         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18754         set the correct information via SRE. This prevents
18755         hanging on the MS runtime. Fixes #29374.
18756
18757 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18758
18759         * convert.cs: correctly handle conversions to value types
18760         from Enum and ValueType as unboxing conversions.
18761
18762         Fixes bug #52569. Patch by Benjamin Jemlich.
18763
18764 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18765
18766         * expression.cs (BetterConversion): Prefer int -> uint
18767         over int -> ulong (csc's behaviour). This fixed bug #52046.
18768
18769 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18770
18771         * decl.cs (MemberCache.FindMembers): now returns a
18772         MemberInfo [].
18773
18774         * typemanager.cs: In general, go with with ^^.
18775         (CopyNewMethods): take an IList.
18776         (RealMemberLookup): Only allocate an arraylist
18777         if we copy from two sets of methods.
18778
18779         This change basically does two things:
18780         1) Fewer array lists allocated due to CopyNewMethods.
18781         2) the explicit cast in MemberList costed ALOT.
18782
18783 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18784
18785         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18786         a hashtable to avoid needless string allocations when an identifier is
18787         used more than once (the common case).
18788
18789 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18790
18791         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18792         is broken, it will not return anything. So, we
18793         have to use the information we have in mcs to
18794         do the task.
18795
18796         * typemanager.cs: Add a cache for GetInterfaces,
18797         since this will now be used more often (due to ^^)
18798
18799         (GetExplicitInterfaces) New method that gets the
18800         declared, not effective, interfaces on a type
18801         builder (eg, if you have interface IFoo, interface
18802         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18803         { IBar }.
18804
18805         This patch makes MCS able to bootstrap itself on
18806         Windows again.
18807
18808 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18809
18810         * expression.cs: Remove the Nop's that Miguel put
18811         in by mistake.
18812
18813 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18814
18815         * report.cs, codegen.cs: Give the real stack trace to
18816         the error when an exception is thrown.
18817
18818 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18819
18820         * decl.cs: only allocate hashtables for ifaces if 
18821         it is an iface!
18822
18823 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18824
18825         * expression.cs: fix the error from cs0121-2.cs
18826         (a parent interface has two child interfaces that
18827         have a function with the same name and 0 params
18828         and the function is called through the parent).
18829
18830 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18831
18832         * class.cs, rootcontext.cs, typmanager.cs: do not
18833         leak pointers.
18834
18835 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18836
18837         * codegen.cs: remove stack for the ec flow branching.
18838         It is already a linked list, so no need.
18839
18840 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18841
18842         * Makefile: Allow custom profiler here.
18843
18844 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18845
18846         * typemanager.cs (LookupType):
18847           - Use a static char [], because split takes
18848             a param array for args, so it was allocating
18849             every time.
18850           - Do not store true in a hashtable, it boxes.
18851
18852 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18853
18854         * flowanalysis.cs: bytify common enums.
18855
18856 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18857
18858         * modifiers.cs: Add a new set of flags for the
18859         flags allowed on explicit interface impls.
18860         * cs-parser.jay: catch the use of modifiers in
18861         interfaces correctly.
18862         * class.cs: catch private void IFoo.Blah ().
18863
18864         All related to bug #50572.
18865
18866 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18867
18868         * decl.cs: Rewrite the consistant accessability checking.
18869         Accessability is not linear, it must be implemented in
18870         a tableish way. Fixes #49704.
18871
18872 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18873
18874         * expression.cs: Handle negation in a checked context.
18875         We must use subtraction from zero. Fixes #38674.
18876
18877 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18878
18879         * class.cs: Ignore static void main in DLLs.
18880         * rootcontext.cs: Handle the target type here,
18881         since we are have to access it from class.cs
18882         * driver.cs: account for the above.
18883
18884 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18885
18886         * report.cs: Give line numbers and files if available.
18887
18888 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18889
18890         * driver.cs: Implement /addmodule.
18891
18892         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18893         ModuleBuilders.
18894
18895 2003-12-20  Martin Baulig  <martin@ximian.com>
18896
18897         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18898         (FieldBase.IsAssigned): Removed this field.
18899         (FieldBase.SetAssigned): New public method.
18900         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18901
18902 2003-12-20  Martin Baulig  <martin@ximian.com>
18903
18904         * expression.cs (LocalVariableReference.DoResolve): Don't set
18905         `vi.Used' if we're called from DoResolveLValue().
18906
18907         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18908         returns the usage vector it just merged into the current one -
18909         pass this one to UsageWarning().
18910         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18911         of the `EmitContext', don't call this recursively on our children.
18912
18913 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18914
18915         * driver.cs: Implement /target:module.
18916
18917 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18918
18919         * support.cs (CharArrayHashtable): New helper class.
18920
18921         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18922         char arrays, not strings, so we can avoid creating a string in
18923         consume_identifier if the identifier is a keyword.
18924
18925 2003-12-16  Martin Baulig  <martin@ximian.com>
18926
18927         * statement.cs (LocalInfo.Assigned): Removed this property.
18928         (LocalInfo.Flags): Removed `Assigned'.
18929         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18930         and uses flow analysis.
18931         (Block.UsageWarning): Made this method private.
18932         (Block.Resolve): Call UsageWarning() if appropriate.
18933
18934         * expression.cs (LocalVariableReference.DoResolve): Always set
18935         LocalInfo.Used here.
18936
18937 2003-12-13  Martin Baulig  <martin@ximian.com>
18938
18939         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18940         any value here; we're now using flow analysis to figure out
18941         whether a statement/block returns a value.
18942
18943 2003-12-13  Martin Baulig  <martin@ximian.com>
18944
18945         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18946         working again.
18947         (FlowBranching.MergeFinally): Don't call
18948         `branching.CheckOutParameters()' here, this is called in
18949         MergeTopBlock().
18950         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18951         when adding the `finally' vector.       
18952
18953 2003-12-13  Martin Baulig  <martin@ximian.com>
18954
18955         * flowanalysis.cs
18956         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18957         actually work and also fix #48962.
18958
18959 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18960
18961         * decl.cs: Do not check System.Object for nested types,
18962         since we know it does not have any. Big bang for buck:
18963
18964         BEFORE:
18965            Run 1:   8.35 seconds
18966            Run 2:   8.32 seconds
18967            corlib:  17.99 seconds
18968         AFTER:
18969            Run 1:   8.17 seconds
18970            Run 2:   8.17 seconds
18971            corlib:  17.39 seconds
18972
18973 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18974
18975         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18976         time we are returning 0 members, so we save alot here.
18977
18978 2003-12-11  Martin Baulig  <martin@ximian.com>
18979
18980         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18981         `MergeChild()', also just take the `FlowBranching' as argument;
18982         call Merge() on it and return the result.
18983         (FlowBranching.Merge): We don't need to do anything if we just
18984         have one sibling.
18985
18986 2003-12-11  Martin Baulig  <martin@ximian.com>
18987
18988         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18989         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18990         Maurer for this idea.
18991
18992 2003-12-11  Martin Baulig  <martin@ximian.com>
18993
18994         * flowanalysis.cs (MergeResult): This class is now gone; we now
18995         use the `UsageVector' for this.  The reason for this is that if a
18996         branching just has one sibling, we don't need to "merge" them at
18997         all - that's the next step to do.
18998         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18999         `MergeResult'.
19000
19001 2003-12-11  Martin Baulig  <martin@ximian.com>
19002
19003         Reworked flow analyis and made it more precise and bug-free.  The
19004         most important change is that we're now using a special `Reachability'
19005         class instead of having "magic" meanings of `FlowReturns'.  I'll
19006         do some more cleanups and optimizations and also add some more
19007         documentation this week.
19008
19009         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19010         largely reworked this class.
19011         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19012         the new `Reachability' class instead of having "magic" values here.
19013         (FlowBranching): We're now using an instance of `Reachability'
19014         instead of having separate `Returns', `Breaks' etc. fields.
19015
19016         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19017         based on flow analysis; ignore the return value of block.Emit ().
19018
19019 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
19020
19021         * driver.cs typemanager.cs: Find the mono extensions to corlib even
19022         if they are private.
19023
19024 2003-12-09  Martin Baulig  <martin@ximian.com>
19025
19026         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19027         call them directly on the UsageVector.
19028
19029 2003-12-09  Martin Baulig  <martin@ximian.com>
19030
19031         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19032         Changed return type from `FlowReturns' to `Reachability'.
19033
19034 2003-12-09  Martin Baulig  <martin@ximian.com>
19035
19036         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
19037         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
19038         `Reachable' fields with a single `Reachability' one.
19039
19040 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19041
19042         * class.cs (FindMembers): Remove foreach's.
19043
19044         Bootstrap times:
19045
19046         BEFORE
19047                 Run 1:   8.74 seconds
19048                 Run 2:   8.71 seconds
19049
19050         AFTER
19051                 Run 1:   8.64 seconds
19052                 Run 2:   8.58 seconds
19053
19054
19055 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19056
19057         * cs-parser.jay:
19058         * gen-treedump.cs:
19059         * statement.cs:
19060         This patch does a few things:
19061                 1. EmptyStatement is now a singleton, so it is never reallocated.
19062                 2. All blah is EmptyStatement constructs have been changed to
19063                    blah == EmptyStatement.Value, which is much faster and valid
19064                    now that EmptyStatement is a singleton.
19065                 3. When resolving a block, rather than allocating a new array for
19066                    the non-empty statements, empty statements are replaced with
19067                    EmptyStatement.Value
19068                 4. Some recursive functions have been made non-recursive.
19069         Mainly the performance impact is from (3), however (1) and (2) are needed for
19070         this to work. (4) does not make a big difference in normal situations, however
19071         it makes the profile look saner.
19072
19073         Bootstrap times:
19074
19075         BEFORE
19076         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19077         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
19078         Total memory allocated: 56397 KB
19079
19080         AFTER
19081         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
19082         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
19083         Total memory allocated: 55666 KB
19084
19085 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19086
19087         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
19088         than the hashtable in a hashtable version
19089
19090         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
19091         we always end up concating a string. This results in a huge perf
19092         loss, because many strings have to be tracked by the GC. In this
19093         patch, we first use a hashtable that works with two keys, so that
19094         the strings do not need to be concat'ed.
19095
19096         Bootstrap times:
19097         BEFORE
19098                 Run 1:   8.74 seconds
19099                 Run 2:   8.71 seconds
19100
19101         AFTER
19102                 Run 1:   8.65 seconds
19103                 Run 2:   8.56 seconds
19104
19105 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
19106
19107         * Makefile: Add a new target `do-time' that does a quick and simple
19108         profile, leaving easy to parse output.
19109
19110 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
19111
19112         * codegen.cs (Init): Create the dynamic assembly with 
19113         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
19114
19115 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
19116
19117         * support.cs: Make the PtrHashtable use only one
19118         instance of its comparer.
19119
19120 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
19121
19122         * typemanager.cs: Fix lookup of GetNamespaces.
19123
19124 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
19125
19126         * expression.cs: Removed redundant line.
19127
19128         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
19129         ArrayLists, use for loops with bounds.  
19130
19131         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
19132         arraylist.
19133
19134         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
19135         arraylists, use for loop with bounds.
19136
19137         The above three changes give us a 0.071 second performance
19138         improvement out of 3.294 seconds down to 3.223.  On my machine
19139         the above changes reduced the memory usage by 1,387 KB during
19140         compiler bootstrap.
19141
19142         * cs-parser.jay (QualifiedIdentifier): New class used to represent
19143         QualifiedIdentifiers.  Before we created a new string through
19144         concatenation, and mostly later on, the result would be
19145         manipulated by DecomposeQI through string manipulation.
19146
19147         This reduced the compiler memory usage for bootstrapping from
19148         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
19149         compile times in 0.05 seconds.
19150
19151 2003-11-28  Dick Porter  <dick@ximian.com>
19152
19153         * support.cs: Do string compares with the Invariant culture.
19154
19155         * rootcontext.cs: 
19156         * gen-treedump.cs: 
19157         * expression.cs: 
19158         * driver.cs: 
19159         * decl.cs: 
19160         * codegen.cs: 
19161         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
19162         the comparison is done with the Invariant culture.
19163
19164 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
19167         GetEnumerator method.
19168
19169         (ProbeCollectionType): Iterate starting at the most specific type
19170         upwards looking for a GetEnumerator
19171
19172         * expression.cs: Shift count can be up to 31 for int/uint and 63
19173         for long/ulong.
19174
19175 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * statement.cs (Block.LookupLabel): Also look for the label on the
19178         children blocks.  Use a hash table to keep track of visited
19179         nodes. 
19180
19181         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
19182         we actually did transform the other operand, otherwise fall back
19183         to the common codepath that casts to long.
19184
19185         * cs-tokenizer.cs: Use the same code pattern as the int case.
19186         Maybe I should do the parsing myself, and avoid depending on the
19187         Parse routines to get this done.
19188
19189 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
19190
19191         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19192         which fixes bug 51347.  This time test it.
19193
19194         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
19195         attributes for example can not tell the difference between these.
19196         The difference was only a syntax feature of the language. 
19197
19198         * attribute.cs: Apply attributes to delegates.
19199
19200         * delegate.cs: Call the apply attributes method.
19201
19202 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
19203
19204         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
19205         comparing 0 vs Byte.MinValue, not the value
19206
19207         (ImplicitConversionRequired): When reporting a conversion error,
19208         use error 31 to print out the constant error instead of the
19209         simpler 29.
19210
19211         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
19212         which fixes bug 51347.
19213
19214 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
19217         which fixes the -warnaserror command line option.
19218
19219 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * cfold.cs (DoNumericPromotions): During constant folding of
19222         additions on UIntConstant, special case intconstants with
19223         IntConstants like we do on the expression binary operator. 
19224
19225 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * convert.cs (ImplicitReferenceConversion): We were missing a case
19228         (System.Enum are not value types or class types, so we need to
19229         classify them separatedly).
19230
19231         * driver.cs: We do not support error 2007.
19232
19233 2003-11-12 Jackson Harper <jackson@ximian.com>
19234
19235         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
19236         system directory. Also use the full file name so users can
19237         libraries names mscorlib-o-tron.dll in a non system dir.
19238
19239 2003-11-10  Martin Baulig  <martin@ximian.com>
19240
19241         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
19242         (TypeManager.InitCoreTypes): Initialize them here, but instead of
19243         calling `ResolveType()' on them, directly assign their `Type'.
19244
19245 2003-11-08  Martin Baulig  <martin@ximian.com>
19246
19247         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
19248         return value and the `out parent' parameter.
19249         (TypeContainer.DefineType): Moved the CS0644 check into
19250         GetClassBases().  Don't pass the interface types to the
19251         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
19252         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
19253
19254         * ecore.cs (TypeExpr.IsAttribute): New property.
19255         (TypeExpr.GetInterfaces): New method.
19256
19257         * interface.cs (Interface.GetInterfaceTypeByName): Return a
19258         TypeExpr instead of a Type.
19259         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
19260         (Interface.DefineType): Don't pass the interface types to the
19261         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
19262         them later and then call `TypeBulider.AddInterfaceImplementation()'.
19263
19264         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
19265         instead of a `Type[]'.
19266         (TypeManager.RegisterBuilder): Likewise.
19267         (TypeManager.AddUserInterface): Likewise.
19268         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
19269         `Type[]' and also return a `TypeExpr[]'.
19270         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
19271
19272 2003-11-08  Martin Baulig  <martin@ximian.com>
19273
19274         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
19275         Expression.     
19276
19277 2003-11-08  Martin Baulig  <martin@ximian.com>
19278
19279         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
19280         TypeManager.ResolveExpressionTypes().
19281
19282         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
19283         instead of an Expression.
19284         (TypeExpr): This is now an abstract base class for `TypeExpression'.
19285         (TypeExpression): New public class; formerly known as `TypeExpr'.
19286
19287         * expression.cs (ComposedCast): Derive from TypeExpr.
19288
19289         * typemanager.cs (TypeManager.system_*_expr): These are now
19290         TypExpr's instead of Expression's.
19291         (TypeManager.ResolveExpressionTypes): New public static function;
19292         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
19293         of them.        
19294
19295 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
19296
19297         * expression.cs (New.DoResolve): Do not dereference value that
19298         might be a null return.
19299
19300         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19301         sure that the constant value has the right type.  Fixes an
19302         unreported bug, similar to 50425.
19303
19304         * const.cs (Const.LookupConstantValue): Call
19305         ImplicitStandardConversionExists before doing a conversion to
19306         avoid havng the TypeManager.ChangeType do conversions.
19307
19308         Reduced the number of casts used
19309
19310         (Const.ChangeType): New routine to enable reuse of the constant
19311         type changing code from statement.
19312
19313         * typemanager.cs (ChangeType): Move common initialization to
19314         static global variables.
19315
19316         Fixes #50425.
19317
19318         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19319         every value type to go through, even if it was void.  Fix that. 
19320
19321         * cs-tokenizer.cs: Use is_identifier_start_character on the start
19322         character of the define, and the is_identifier_part_character for
19323         the rest of the string.
19324
19325 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * expression.cs (UnaryMutator.EmitCode): When I updated
19328         LocalVariableReference.DoResolve, I overdid it, and dropped an
19329         optimization done on local variable references.
19330
19331 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * ecore.cs: Convert the return from Ldlen into an int.
19334
19335 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19338         the accessibility, this is a special case for toplevel non-public
19339         classes (internal for instance).
19340
19341 2003-10-20  Nick Drochak <ndrochak@gol.com>
19342
19343         * ecore.cs: Fix typo and build.  Needed another right paren.
19344
19345 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
19348         `internal' case regular and protected, but not allowing protected
19349         to be evaluated later.  Bug 49840
19350
19351 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19354         to kb.Nlast, and not the kb.nFirst to isolate the switch
19355         statement.
19356
19357         Extract the underlying type, so enumerations of long/ulong are
19358         treated like long/ulong.
19359
19360 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * expression.cs (New): Overload the meaning of RequestedType to
19363         track the possible creation of the NewDelegate type, since
19364         DoResolve is invoked more than once for new constructors on field
19365         initialization.
19366
19367         See bugs: #48800 and #37014
19368
19369         * cs-parser.jay (declare_local_constants): Take an arraylist
19370         instead of a single constant.
19371
19372         (local_constant_declaration): It should take a
19373         constant_declarators, not a constant_declarator.  Fixes 49487
19374
19375         * convert.cs: Fix error report.
19376
19377 2003-10-13 Jackson Harper <jackson@ximian.com>
19378
19379         * typemanager.cs (TypeToCoreType): Add float and double this fixes
19380         bug #49611
19381
19382 2003-10-09  Martin Baulig  <martin@ximian.com>
19383
19384         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19385         to the .ctor.
19386         (MethodCore.DoDefineParameters): Removed the TypeContainer
19387         argument; use the DeclSpace which was passed to the .ctor instead.
19388         (MethodCore.CheckParameter): Take a DeclSpace instead of a
19389         TypeContainer; we only need a DeclSpace here.
19390
19391 2003-10-09  Martin Baulig  <martin@ximian.com>
19392
19393         * class.cs (MethodData): Added additional `DeclSpace ds' argument
19394         to the .ctor.
19395         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19396         EmitContext's .ctor.    
19397
19398 2003-10-09  Martin Baulig  <martin@ximian.com>
19399
19400         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19401         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19402         AsAccessible(), moved them as well.
19403
19404         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19405
19406 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19407
19408         * cs-parser.jay : Renamed yyName to yyNames related to jay.
19409
19410 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19411
19412         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19413         generation for >=, as spotted by Paolo, bug 48679.  
19414         Patch from David Waite.
19415
19416         * cs-tokenizer.cs: Add handling for #pragma.
19417
19418         * cs-parser.jay: Allow for both yield and yield return in the
19419         syntax.  The anti-cobolization of C# fight will go on!
19420
19421         * class.cs (TypeBuilder.DefineType): Catch error condition here
19422         (Parent.DefineType erroring out and returning null).
19423
19424         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19425         coping with enumerations variables, we were mistakenly processing
19426         them as a regular value type instead of built-in types.  Fixes the
19427         bug #48063
19428
19429         * typemanager.cs (IsBuiltinOrEnum): New method.
19430
19431 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19432
19433         * cs-parser.jay: Upgrade: yield now needs the return clause.
19434
19435 2003-09-19  Martin Baulig  <martin@ximian.com>
19436
19437         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19438         `MemberCache parent' argument.  Normally, an interface doesn't
19439         have a parent type except System.Object, but we use this in gmcs
19440         for generic type parameters.
19441
19442 2003-09-18  Martin Baulig  <martin@ximian.com>
19443
19444         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19445         on `type.IsInterface'; don't check whether the type has a parent
19446         to determine whether it's an interface.
19447
19448 2003-09-15  Martin Baulig  <martin@ximian.com>
19449
19450         * class.cs (TypeContainer.DefineType): Added an error flag to
19451         avoid reporting duplicate CS0146's ("class definition is
19452         circular.").
19453
19454         * driver.cs (Driver.MainDriver): Abort if
19455         RootContext.ResolveTree() reported any errors.
19456
19457 2003-09-07  Martin Baulig  <martin@ximian.com>
19458
19459         * report.cs (Error, Warning): Added overloaded versions which take
19460         a `params object[] args' and call String.Format().
19461
19462 2003-09-07  Martin Baulig  <martin@ximian.com>
19463
19464         * decl.cs (DeclSpace..ctor): Don't call
19465         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19466         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19467         (DeclSpace.RecordDecl): New method.
19468
19469         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19470
19471 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19472
19473         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19474         value attributes to be applied to ParameterBuilders.
19475
19476         * class.cs (MethodCore.LabelParameters): Make static and more
19477         generic so that it can be used from other places - like interface
19478         methods, for instance.
19479
19480         * interface.cs (Interface.Emit): Call LabelParameters before
19481         emitting attributes on the InterfaceMethod.
19482
19483 2003-08-26  Martin Baulig  <martin@ximian.com>
19484
19485         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19486         resolving aliases; fixes #47927.
19487
19488 2003-08-26  Martin Baulig  <martin@ximian.com>
19489
19490         * statement.cs (Using.DoResolve): This is internally emitting a
19491         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19492         do not always return.  Fixes #47681.
19493
19494 2003-08-26  Martin Baulig  <martin@ximian.com>
19495
19496         * decl.cs (MemberCore): Moved WarningNotHiding(),
19497         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19498         into MemberBase.
19499         (AdditionResult): Make this nested in DeclSpace.
19500         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19501         argument; call NamespaceEntry.Define() unless we're nested in a
19502         class or struct.
19503
19504         * namespace.cs (Namespace.DefineName): New public function.  This
19505         is called from DeclSpace's .ctor to add 
19506         (Namespace.Lookup): Include DeclSpaces in the lookup.
19507
19508         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19509
19510         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19511
19512 2003-08-25  Martin Baulig  <martin@ximian.com>
19513
19514         * convert.cs (Convert.ExplicitReferenceConversion): When
19515         converting from an interface type to a class, unbox if the target
19516         type is a struct type.  Fixes #47822.
19517
19518 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19519
19520         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19521         #47854.
19522
19523 2003-08-22  Martin Baulig  <martin@ximian.com>
19524
19525         * class.cs (TypeManager.DefineType): When defining a nested type,
19526         call DefineType() on our parent; fixes #47801.
19527
19528 2003-08-22  Martin Baulig  <martin@ximian.com>
19529
19530         * class.cs (MethodData.Define): While checking if a method is an
19531         interface implementation, improve the test a bit more to fix #47654.
19532
19533 2003-08-22  Martin Baulig  <martin@ximian.com>
19534
19535         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19536         correctly; fixes #47722.
19537
19538 2003-08-22  Martin Baulig  <martin@ximian.com>
19539
19540         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19541         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19542
19543         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19544
19545 2003-08-22  Martin Baulig  <martin@ximian.com>
19546
19547         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19548         can only be assigned in static constructors.  Fixes #47161.
19549
19550 2003-08-22  Martin Baulig  <martin@ximian.com>
19551
19552         Rewrote and improved the flow analysis code.
19553
19554         * flowbranching.cs (FlowBranching): Make this class abstract.
19555         (FlowBranching.CreateBranching): New static function to create a
19556         new flow branching.
19557         (FlowBranchingBlock, FlowBranchingException): New classes.
19558         (FlowBranching.UsageVector.Type): New public readonly field.
19559         (FlowBranching.UsageVector.Breaks): Removed the setter.
19560         (FlowBranching.UsageVector.Returns): Removed the setter.
19561         (FlowBranching.UsageVector): Added Break(), Return(),
19562         NeverReachable() and Throw() methods to modify the reachability.
19563         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19564         done by FlowBranching.Merge().
19565         (FlowBranching.UsageVector.MergeChild): New method; merges the
19566         merge result into the current vector.
19567         (FlowBranching.Merge): New abstract method to merge a branching.
19568
19569 2003-08-12  Martin Baulig  <martin@ximian.com>
19570
19571         * expression.cs (Indirection.CacheTemporaries): Create the
19572         LocalTemporary with the pointer type, not its element type.
19573
19574 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19575
19576         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19577         token was a keyword or not.
19578
19579         Add `error' options where an IDENTIFIER was expected;  Provide
19580         CheckToken and CheckIdentifierToken convenience error reporting
19581         functions. 
19582
19583         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19584
19585         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19586         NameSpaceEntry NameSpaceEntry.
19587
19588         (LookupInterfaceOrClass): Avoid creating a full qualified name
19589         from namespace and name: avoid doing lookups when we know the
19590         namespace is non-existant.   Use new Tree.LookupByNamespace which
19591         looks up DeclSpaces based on their namespace, name pair.
19592
19593         * driver.cs: Provide a new `parser verbose' to display the
19594         exception thrown during parsing.  This is turned off by default
19595         now, so the output of a failure from mcs is more graceful.
19596
19597         * namespace.cs: Track all the namespaces defined in a hashtable
19598         for quick lookup.
19599
19600         (IsNamespace): New method
19601
19602 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19605         we know that we need to concatenate (full typename can never be
19606         null). 
19607
19608         * class.cs: ditto.
19609
19610         * statement.cs: Use a bitfield;  Do not initialize to null things
19611         which are done by the constructor by default.
19612
19613         * cs-parser.jay: bug fix, parameter was 4, not 3.
19614
19615         * expression.cs: Just use the property;
19616
19617         * statement.cs: No need for GetVariableInfo method.
19618
19619 2003-08-08  Martin Baulig  <martin@ximian.com>
19620
19621         * flowanalysis.cs (FlowReturns): This is now nested in the
19622         `FlowBranching' class.
19623         (MyBitVector): Moved this here from statement.cs.
19624         (FlowBranching.SiblingType): New enum type.
19625         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19626
19627 2003-08-07  Martin Baulig  <martin@ximian.com>
19628
19629         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19630         `FlowBranching' class and called `BranchingType'.
19631
19632 2003-08-07  Martin Baulig  <martin@ximian.com>
19633
19634         * flowanalysis.cs: Moved all the control flow analysis code into
19635         its own file.
19636
19637 2003-08-07  Martin Baulig  <martin@ximian.com>
19638
19639         * assign.cs (Assign.DoResolve): `target' must either be an
19640         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19641         #37319.
19642
19643 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * expression.cs (BinaryMethod): This kind of expression is created by the
19646         Binary class if it determines that the operator has to be handled
19647         by a method.
19648
19649         (BinaryDelegate): This kind of expression is created if we are
19650         dealing with a + or - operator on delegates.
19651
19652         (Binary): remove method, argumetns, and DelegateOperator: when
19653         dealing with methods, 
19654
19655         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19656
19657         * statement.cs (Block): use bitfields for the three extra booleans
19658         we had in use.   Remove unused topblock parameter.
19659
19660         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19661
19662         * assign.cs: Drop extra unneeded tests.
19663
19664 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19665
19666         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19667
19668         * statement.cs (Foreach): Use VariableStorage instead of
19669         LocalBuilders.   
19670
19671         * codegen.cs (VariableStorage): New class used by clients that
19672         require a variable stored: locals or fields for variables that
19673         need to live across yield.
19674
19675         Maybe provide a convenience api for EmitThis+EmitLoad?
19676
19677         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19678         these bad boys.
19679
19680 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19683         RemapParameterLValue): New methods that are used to turn a
19684         precomputed FieldInfo into an expression like this:
19685
19686                 instance.FieldInfo
19687
19688         The idea is to use this instead of making LocalVariableReference
19689         have more than one meaning.
19690
19691         * cs-parser.jay: Add error production to BASE.
19692
19693         * ecore.cs: Deal with TypeManager.GetField returning null, which
19694         is now a valid return value.
19695
19696         (FieldExprNoAddress): New expression for Fields whose address can
19697         not be taken.
19698
19699         * expression.cs (LocalVariableReference): During the resolve
19700         phases, create new expressions if we are in a remapping context.
19701         Remove code that dealt with remapping here.
19702
19703         (ParameterReference): same.
19704
19705         (ProxyInstance): New expression, like the `This' expression, but
19706         it is born fully resolved.  We know what we are doing, so remove
19707         the errors that are targeted to user-provided uses of `this'.
19708
19709         * statement.cs (Foreach): our variable is now stored as an
19710         Expression;  During resolution, follow the protocol, dont just
19711         assume it will return this.
19712
19713 2003-08-06  Martin Baulig  <martin@ximian.com>
19714
19715         * support.cs (SeekableStreamReader.cs): New public class.
19716
19717         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19718         SeekableStreamReader instead of the normal StreamReader.
19719
19720 2003-08-04  Martin Baulig  <martin@ximian.com>
19721
19722         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19723         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19724         deambiguate casts and delegate invocations.
19725         (parenthesized_expression): Use the new tokens to ensure this is
19726         not a cast of method invocation.
19727
19728         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19729         when reading a `)' and Deambiguate_CloseParens () was previously
19730         called.
19731
19732         * expression.cs (ParenthesizedExpression): New class.  This is
19733         just used for the CS0075 test.
19734         (Binary.DoResolve): Check for CS0075.   
19735
19736 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19737
19738         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19739         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19740         reference comparison.
19741
19742         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19743         examine the ReturnType for equality - this is necessary in the
19744         cases of implicit and explicit operators whose signature also
19745         includes the return type.
19746
19747 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19748
19749         * namespace.cs: Cache the result of the namespace computation,
19750         instead of computing it every time.
19751
19752 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * decl.cs: Use a global arraylist that we reuse over invocations
19755         to avoid excesive memory consumption.  Reduces memory usage on an
19756         mcs compile by one meg (45 average).
19757
19758         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19759         private, work around that.
19760
19761 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * literal.cs (IntLiteral): Define Zero and One static literals. 
19764
19765         * cs-parser.jay (integer_literal): use static literals to reduce
19766         memory usage for the most used literals (0, 1 and -1).  211kb
19767         reduced in memory usage.
19768
19769         Replace all calls to `new ArrayList' with `new
19770         ArrayList(4)' which is a good average number for most allocations,
19771         and also requires only 16 bytes of memory for its buffer by
19772         default. 
19773
19774         This reduced MCS memory usage in seven megabytes for the RSS after
19775         bootstrapping.
19776
19777 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19778
19779         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19780         handle params methods the correct way by forming only one
19781         applicable set with params and normal methods in them. Earlier we
19782         were looking at params methods only if we found no normal methods
19783         which was not the correct thing to do.
19784
19785         (Invocation.BetterFunction): Take separate arguments indicating
19786         when candidate and the best method are params methods in their
19787         expanded form.
19788
19789         This fixes bugs #43367 and #46199.
19790
19791         * attribute.cs: Documentation updates.
19792
19793         (CheckAttribute): Rename to CheckAttributeTarget.
19794         (GetValidPlaces): Rename to GetValidTargets.
19795
19796         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19797         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19798
19799         Fixes bug #44468.
19800
19801 2003-07-28  Martin Baulig  <martin@ximian.com>
19802
19803         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19804         name when looking up the base class of a nested class.  Fixes #46977.
19805
19806 2003-07-26  Martin Baulig  <martin@ximian.com>
19807
19808         * expression.cs (Indexers.Indexer): New nested struct; contains
19809         getter, setter and the indexer's type.
19810         (Indexers.Properties): This is now an ArrayList of
19811         Indexers.Indexer's.
19812         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19813         indexer doesn't have any getters.
19814
19815         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19816         for embedded property and indexer assignments.
19817
19818 2003-07-26  Martin Baulig  <martin@ximian.com>
19819
19820         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19821         preprocessor directive is not the first non-whitespace character
19822         on a line.
19823
19824 2003-07-26  Martin Baulig  <martin@ximian.com>
19825
19826         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19827         namespace parsing, follow the spec more closely.
19828
19829         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19830         NamespaceEntry.Lookup().
19831
19832 2003-07-25  Martin Baulig  <martin@ximian.com>
19833
19834         * MethodCore.cs (OverridesSomething): New public field; it's set
19835         from TypeContainer.DefineMembers if this method overrides
19836         something (which doesn't need to be a method).  Fix #39462.
19837
19838 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19839
19840         * typemanager.cs (GetMembers): Ensure that the list of members is
19841         reversed. This keeps things in sync.
19842
19843         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19844         find an AttributeUsage attribute.
19845
19846         * expression.cs (Invocation.OverloadResolve): Perform the check
19847         which disallows Invoke to be directly called on a Delegate.
19848
19849         (Error_InvokeOnDelegate): Report error cs1533.
19850
19851 2003-07-25  Martin Baulig  <martin@ximian.com>
19852
19853         * expression.cs (Indexers.GetIndexersForType): Only look in the
19854         interface hierarchy if the requested type is already an
19855         interface.  Fixes #46788 while keeping #46502 fixed.
19856
19857 2003-07-25  Martin Baulig  <martin@ximian.com>
19858
19859         * class.cs (TypeContainer.DefineMembers): Check whether all
19860         readonly fields have been assigned and report warning CS0649 if
19861         not.
19862
19863         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19864         a valuetype.
19865
19866 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19867
19868         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19869         returned from GetMethods to make things consistent with the
19870         assumptions MCS makes about ordering of methods.
19871
19872         This should comprehensively fix bug #45127 and it does :-)
19873
19874         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19875         ordering is actually reverse.
19876
19877         * Clean up some debug messages I left lying around.
19878
19879         * interface.cs (Populate*): Get rid of code which emits attributes
19880         since the stage in which we emit attributes is the 'Emit' stage,
19881         not the define stage.
19882
19883         (Emit): Move attribute emission for interface members here.
19884
19885 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19886
19887         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19888         closely: we eliminate methods in base types when we have an
19889         applicable method in a top-level type.
19890
19891         Please see section 14.5.5.1 for an exact description of what goes
19892         on. 
19893
19894         This fixes bug #45127 and a host of other related to corlib compilation.
19895
19896         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19897         array is the method corresponding to the top-level type (this is
19898         because of the changes made to icall.c) so we change this
19899         accordingly.
19900
19901         (MethodGroupExpr.Name): This too.
19902
19903         * typemanager.cs (GetElementType): New method which does the right
19904         thing when compiling corlib. 
19905
19906         * everywhere: Make use of the above in the relevant places.
19907
19908 2003-07-22  Martin Baulig  <martin@ximian.com>
19909
19910         * cs-parser.jay (invocation_expression): Moved
19911         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19912         `cast_expression', but create a InvocationOrCast which later
19913         resolves to either an Invocation or a Cast.
19914
19915         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19916         method; call this before EmitStatement() to make sure that this
19917         expression can be used as a statement.
19918
19919         * expression.cs (InvocationOrCast): New class; resolves to either
19920         an Invocation or a Cast.
19921
19922         * statement.cs (StatementExpression): Call ResolveStatement() on
19923         the ExpressionStatement before emitting it.
19924
19925 2003-07-21  Martin Baulig  <martin@ximian.com>
19926
19927         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19928         `ref' and `out' attributes match; fixes #46220.
19929         (MemberAccess.ResolveMemberAccess): You can't reference a type
19930         through an expression; fixes #33180.
19931         (Indexers.GetIndexersForType): Don't return the indexers from
19932         interfaces the class implements; fixes #46502.
19933
19934 2003-07-21  Martin Baulig  <martin@ximian.com>
19935
19936         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19937         CS0661 checks; fixes bug #30442.
19938
19939 2003-07-21  Martin Baulig  <martin@ximian.com>
19940
19941         * decl.cs (AdditionResult): Added `Error'.
19942
19943         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19944
19945         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19946         makes cs0031.cs actually work.
19947
19948 2003-07-20  Martin Baulig  <martin@ximian.com>
19949
19950         * namespace.cs: Fixed that bug which caused a crash when compiling
19951         the debugger's GUI.
19952
19953 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * typemanager.cs (LookupTypeReflection): Never expose types which
19956         are NotPublic, NestedPrivate, NestedAssembly, or
19957         NestedFamANDAssem.  We used to return these, and later do a check
19958         that would report a meaningful error, but the problem is that we
19959         would not get the real match, if there was a name override.
19960
19961 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * namespace.cs (Namespace, Name): Do not compute the namespace
19964         name dynamically, compute it in the constructor.  This reduced
19965         memory usage by 1697 KB.
19966
19967         * driver.cs: Use --pause to pause at the end.
19968
19969 2003-07-17  Peter Williams  <peter@newton.cx>
19970
19971         * Makefile: Change the name of the test target so that it doesn't
19972         conflict with the recursive test target.
19973
19974 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19975
19976         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19977         AddressOf): Do not use EmitThis, that was wrong, use the actual
19978         this pointer.
19979
19980 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19981
19982         * class.cs (MethodData.Define): While checking if a method is an
19983         interface implementation, improve the test: If we are not public
19984         (use new test here: use the computed MethodAttributes directly,
19985         instead of the parsed modifier flags) check if the `implementing'
19986         method comes from an interface or not.
19987
19988         * pending.cs (VerifyPendingMethods): Slightly better error
19989         message.
19990
19991         * makefile: add test target that does the mcs bootstrap.
19992
19993 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19994
19995         * interface.cs (Define): Do nothing here since there are no
19996         members to populate etc. Move the attribute emission out of here
19997         since this was just totally the wrong place to put it. Attribute
19998         application happens during the 'Emit' phase, not in the 'Define'
19999         phase.
20000
20001         (Emit): Add this method and move the attribute emission here
20002
20003         * rootcontext.cs (EmitCode): Call the Emit method on interface
20004         types too.
20005
20006 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20007
20008         * expression.cs (OverloadResolve): Report error only if Location
20009         is not 'Null' which means that there was a probe going on.
20010
20011 2003-07-14  Martin Baulig  <martin@ximian.com>
20012
20013         * expression.cs (ConditionalLogicalOperator): New public class to
20014         implement user defined conditional logical operators.
20015         This is section 14.11.2 in the spec and bug #40505.
20016
20017 2003-07-14  Martin Baulig  <martin@ximian.com>
20018
20019         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20020
20021 2003-07-14  Martin Baulig  <martin@ximian.com>
20022
20023         * codegen.cs (EmitContext.InFixedInitializer): New public field.
20024
20025         * ecore.cs (IVariable.VerifyFixed): New interface method.
20026
20027         * expression.cs (Unary.ResolveOperator): When resolving the `&'
20028         operator, check whether the variable is actually fixed.  Fixes bug
20029         #36055.  Set a variable definitely assigned when taking its
20030         address as required by the spec.
20031
20032         * statement.cs (LocalInfo.IsFixed): New field.
20033         (LocalInfo.MakePinned): Set `IsFixed' to true.
20034
20035 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
20036
20037         * attribute.cs (Attribute.Resolve): While doing a Member lookup
20038         for .ctors, ensure that we only ask for members declared in the
20039         attribute type (BindingFlags.DeclaredOnly).
20040
20041         Fixes bug #43632.
20042
20043         * expression.cs (Error_WrongNumArguments): Report error 1501
20044         correctly the way CSC does.
20045
20046 2003-07-13  Martin Baulig  <martin@ximian.com>
20047
20048         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
20049         lookup on the fully qualified name, to make things like "X.X" work
20050         where "X.X" is a fully qualified type name, but we also have a
20051         namespace "X" in the using list.  Fixes #41975.
20052
20053 2003-07-13  Martin Baulig  <martin@ximian.com>
20054
20055         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
20056         function. If we're a CompoundAssign, we need to create an embedded
20057         CompoundAssign, not an embedded Assign.
20058         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
20059         Fixes #45854.
20060
20061 2003-07-13  Martin Baulig  <martin@ximian.com>
20062
20063         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
20064         work to fix bug #46088.
20065
20066 2003-07-13  Ravi Pratap <ravi@ximian.com>
20067
20068         * class.cs (Operator.Emit): Do not emit attributes here - it is
20069         taken care of by the Method class that we delegate too. This takes
20070         care of bug #45876.
20071
20072 2003-07-10  Martin Baulig  <martin@ximian.com>
20073
20074         * expression.cs (TypeOfVoid): New class.
20075         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
20076
20077 2003-07-10  Martin Baulig  <martin@ximian.com>
20078
20079         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
20080         bug #35957.
20081
20082 2003-07-10  Martin Baulig  <martin@ximian.com>
20083
20084         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
20085         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
20086
20087         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
20088
20089         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
20090
20091 2003-07-10  Martin Baulig  <martin@ximian.com>
20092
20093         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
20094         of decimal.  Fixes #42850.
20095
20096         NOTE: I also fixed the created byte blob, but this doesn't work on
20097         the MS runtime and csc never produces any byte blobs for decimal
20098         arrays.
20099
20100 2003-07-10  Martin Baulig  <martin@ximian.com>
20101
20102         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
20103         structs; fixes #32068.
20104         (Block.AddChildVariableNames): Fixed #44302.
20105
20106 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20107
20108         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
20109
20110 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20111
20112         * attribute.cs: And this test is onger needed.
20113
20114 2003-07-08  Martin Baulig  <martin@ximian.com>
20115
20116         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
20117         inaccessible types.  Fixes #36313.
20118
20119         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
20120
20121         * namespace.cs (NamespaceEntry): Create implicit entries for all
20122         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
20123         implicit entries for N1.N2 and N1.
20124
20125 2003-07-08  Martin Baulig  <martin@ximian.com>
20126
20127         Rewrote the handling of namespaces to fix a lot of the issues
20128         wrt. `using' aliases etc.
20129
20130         * namespace.cs (Namespace): Splitted this class into a
20131         per-assembly `Namespace' and a per-file `NamespaceEntry'.
20132
20133         * typemanager.cs (TypeManager.IsNamespace): Removed.
20134         (TypeManager.ComputeNamespaces): Only compute namespaces from
20135         loaded assemblies here, not the namespaces from the assembly we're
20136         currently compiling.
20137
20138 2003-07-08  Martin Baulig  <martin@ximian.com>
20139
20140         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
20141
20142 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20143
20144         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
20145         already fixed it.  
20146
20147         I thought about the memory savings here, but LookupTypeReflection
20148         is used under already very constrained scenarios.  Compiling
20149         corlib or mcs only exposes one hit, so it would not really reduce
20150         any memory consumption.
20151
20152 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20153
20154         * typemanager.cs: fixes bug #45889 by only adding public types from
20155         other assemblies to the list of known types.
20156
20157 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
20160         on the type we resolved.
20161
20162 2003-07-05  Martin Baulig  <martin@ximian.com>
20163
20164         * pending.cs (PendingImplementation.ParentImplements): Don't
20165         create the proxy if the parent is abstract.
20166
20167         * class.cs (TypeContainer.DefineIndexers): Process explicit
20168         interface implementations first.  Fixes #37714.
20169
20170 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
20171
20172         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
20173         defined recursively;  but since we modify the input parameters
20174         (left is set to `this' temporarily), we reset this value if the
20175         left_is_explicit is false, which gives the original semantics to
20176         the code.  
20177
20178         * literal.cs (NullPointer): new class used to represent a null
20179         literal in a pointer context.
20180
20181         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
20182         type is a pointer, use a NullPointer object instead of a
20183         NullLiteral.   Closes 43687
20184
20185         (ExplicitConversion): Convert pointer values using
20186         the conv opcode to the proper type.
20187
20188         * ecore.cs (New): change ValueTypeVariable property into a method,
20189         that returns whether the valuetype is suitable for being used.
20190
20191         * expression.cs (Binary.DoNumericPromotions): Only return if we
20192         the int constant was a valid uint, and we can return both left and
20193         right as uints.  If not, we continue processing, to trigger the
20194         type conversion.  This fixes 39018.
20195
20196         * statement.cs (Block.EmitMeta): During constant resolution, set
20197         the CurrentBlock property on the emitcontext, so that we resolve
20198         constants propertly.
20199
20200 2003-07-02  Martin Baulig  <martin@ximian.com>
20201
20202         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
20203         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
20204
20205         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
20206         than emitting it here.
20207
20208         * statement.cs: Fixed some more flow analysis bugs.
20209
20210 2003-07-02  Martin Baulig  <martin@ximian.com>
20211
20212         * class.cs (MethodData.Define): When implementing interface
20213         methods, set Final unless we're Virtual.
20214
20215         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
20216         check work for interface methods.
20217
20218 2003-07-01  Martin Baulig  <martin@ximian.com>
20219
20220         * ecore.cs (EmitContext.This): Replaced this property with a
20221         GetThis() method which takes a Location argument.  This ensures
20222         that we get the correct error location for a CS0188.
20223
20224 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
20227         ImplicitStandardConversion.
20228
20229         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
20230
20231 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
20232
20233         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
20234         optimization.
20235
20236 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
20237
20238         * class.cs (Constructor.Define): Turn off initlocals for unsafe
20239         constructors.
20240
20241         (MethodData.Define): Turn off initlocals for unsafe methods.
20242
20243 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
20246         complete;  Fixes #37521.
20247
20248         * delegate.cs: Use Modifiers.TypeAttr to compute the
20249         TypeAttributes, instead of rolling our own.  This makes the flags
20250         correct for the delegates.
20251
20252 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
20253
20254         * class.cs (Constructor.Define): Set the private flag for static
20255         constructors as well.
20256
20257         * cs-parser.jay (statement_expression): Set the return value to
20258         null, to avoid a crash when we catch an error.
20259
20260 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * cs-parser.jay: Applied patch from Jackson that adds support for
20263         extern and unsafe modifiers to destructor declarations.
20264
20265         * expression.cs: Report error 21 if the user is trying to index a
20266         System.Array.
20267
20268         * driver.cs: Add an error message, suggested by the bug report.
20269
20270         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
20271         if we do not have a ": this ()" constructor initializer.  Fixes 45149
20272
20273 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * namespace.cs: Add some information to reduce FAQs.
20276
20277 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
20278
20279         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
20280         underlying enumeration types.  Fixes #43915.
20281
20282         * expression.cs: Treat ushort/short as legal values to be used in
20283         bitwise operations.
20284
20285 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
20286
20287         * delegate.cs: transfer custom attributes for paramenters from
20288         the delegate declaration to Invoke and BeginInvoke.
20289
20290 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
20291
20292         * attribute.cs: handle custom marshalers and emit marshal info
20293         for fields, too.
20294
20295 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
20296
20297         * makefile.gnu: Added anonymous.cs to the compiler sources.
20298
20299 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
20300
20301         * iterators.cs: Change the name of the proxy class to include two
20302         underscores.
20303
20304         * cs-parser.jay: Update grammar to include anonymous methods.
20305
20306         * anonymous.cs: new file.
20307
20308 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
20309
20310         * class.cs (Field.Define): Add missing test for pointers and
20311         safety. 
20312
20313 2003-05-27  Ravi Pratap  <ravi@ximian.com>
20314
20315         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20316         we use the stobj opcode.
20317
20318         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20319         since it wasn't the correct fix. 
20320
20321         It still is puzzling that we are required to use stobj for IntPtr
20322         which seems to be a ValueType.
20323
20324 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20327         during regular simple name resolution.   Now, the trick is that
20328         instead of returning for processing the simplename, we do a
20329         TypeManager.LookupType (ie, a rooted lookup as opposed to a
20330         contextual lookup type).   If a match is found, return that, if
20331         not, return for further composition.
20332
20333         This fixes long-standing 30485.
20334
20335         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20336         using the address to initialize an object, do an Stobj instead of
20337         using the regular Stelem.
20338
20339         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20340         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20341         Because if we are a BaseIndexerAccess that value will be true.
20342         Fixes 43643.
20343
20344         * statement.cs (GotoCase.Resolve): Return after reporting an
20345         error, do not attempt to continue. 
20346
20347         * expression.cs (PointerArithmetic.Emit): If our operand is a
20348         long, convert our constants to match the operand before
20349         multiplying.  Convert to I type before adding.   Fixes 43670.
20350
20351 2003-05-14  Ravi Pratap  <ravi@ximian.com>
20352
20353         * enum.cs (ImplicitConversionExists) : Rename to
20354         ImplicitEnumConversionExists to remove ambiguity. 
20355
20356         * ecore.cs (NullCast): New type of cast expression class which
20357         basically is very similar to EmptyCast with the difference being
20358         it still is a constant since it is used only to cast a null to
20359         something else
20360         (eg. (string) null)
20361
20362         * convert.cs (ImplicitReferenceConversion): When casting a null
20363         literal, we return a NullCast.
20364
20365         * literal.cs (NullLiteralTyped): Remove - I don't see why this
20366         should be around anymore.
20367
20368         The renaming (reported was slightly wrong). Corrections:
20369
20370         ConvertImplicitStandard -> ImplicitConversionStandard
20371         ConvertExplicitStandard -> ExplicitConversionStandard
20372
20373         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20374         before passing them in !
20375
20376         * convert.cs (ImplicitConversionStandard): When comparing for
20377         equal expr and target types, ensure that expr is not a
20378         NullLiteral.
20379
20380         In general, we must not be checking (expr_type ==
20381         target_type) in the top level conversion methods
20382         (ImplicitConversion, ExplicitConversion etc). This checking is
20383         done in the methods that they delegate to.
20384
20385 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
20386
20387         * convert.cs: Move Error_CannotConvertType,
20388         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20389         ImplicitNumericConversion, ImplicitConversionExists,
20390         ImplicitUserConversionExists, StandardConversionExists,
20391         FindMostEncompassedType, FindMostSpecificSource,
20392         FindMostSpecificTarget, ImplicitUserConversion,
20393         ExplicitUserConversion, GetConversionOperators,
20394         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20395         TryImplicitIntConversion, Error_CannotConvertImplicit,
20396         ConvertImplicitRequired, ConvertNumericExplicit,
20397         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20398         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20399         its own file.
20400
20401         Perform the following renames:
20402
20403         StandardConversionExists -> ImplicitStandardConversionExists
20404         ConvertImplicit -> ImplicitConversion
20405         ConvertImplicitStandard -> ImplicitStandardConversion
20406         TryImplicitIntConversion -> ImplicitIntConversion
20407         ConvertImplicitRequired -> ImplicitConversionRequired
20408         ConvertNumericExplicit -> ExplicitNumericConversion
20409         ConvertReferenceExplicit -> ExplicitReferenceConversion
20410         ConvertExplicit -> ExplicitConversion
20411         ConvertExplicitStandard -> ExplicitStandardConversion
20412
20413 2003-05-19  Martin Baulig  <martin@ximian.com>
20414
20415         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20416         (TypeInfo): Added support for structs having structs as fields.
20417
20418         * ecore.cs (FieldExpr): Implement IVariable.
20419         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20420         VariableInfo for the field.
20421
20422 2003-05-18  Martin Baulig  <martin@ximian.com>
20423
20424         * expression.cs (This.DoResolve): Report a CS0027 if we're
20425         emitting a field initializer.
20426
20427 2003-05-18  Martin Baulig  <martin@ximian.com>
20428
20429         * expression.cs (This.ResolveBase): New public function.
20430         (This.DoResolve): Check for CS0188.
20431
20432         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20433         This.Resolve().
20434
20435         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20436         `instance_expression' to null if we don't have any non-static
20437         methods.
20438
20439 2003-05-18  Martin Baulig  <martin@ximian.com>
20440
20441         Reworked the way how local variables and parameters are handled by
20442         the flow analysis code.
20443
20444         * statement.cs (TypeInfo, VariableMap): New public classes.
20445         (VariableInfo): New public class.  This is now responsible for
20446         checking whether a variable has been assigned.  It is used for
20447         parameters and local variables.
20448         (Block.EmitMeta): Take the InternalParameters as argument; compute
20449         the layout of the flow vectors here.
20450         (Block.LocalMap, Block.ParameterMap): New public properties.
20451         (FlowBranching): The .ctor doesn't get the InternalParameters
20452         anymore since Block.EmitMeta() now computes the layout of the flow
20453         vector.
20454         (MyStructInfo): This class is now known as `StructInfo' and nested
20455         in `TypeInfo'; we don't access this directly anymore.
20456
20457         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20458         property and removed IsAssigned(), IsFieldAssigned(),
20459         SetAssigned() and SetFieldAssigned(); we now call them on the
20460         VariableInfo so we don't need to duplicate this code everywhere.
20461
20462         * expression.cs (ParameterReference): Added `Block block' argument
20463         to the .ctor.
20464         (LocalVariableReference, ParameterReference, This): The new
20465         VariableInfo class is now responsible for all the definite
20466         assignment stuff.
20467
20468         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20469         IsParameterAssigned, SetParameterAssigned): Removed.
20470
20471 2003-05-18  Martin Baulig  <martin@ximian.com>
20472
20473         * typemanager.cs (InitCoreTypes): Try calling
20474         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20475         the 3-args-version.  Corlib now also needs our `void_type'.
20476         (GetMethod): Added overloaded version which takes an optional
20477         `bool report_errors' to allow lookups of optional methods.
20478
20479 2003-05-12  Martin Baulig  <martin@ximian.com>
20480
20481         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20482         only used for locals and not for parameters.
20483
20484 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * support.cs (InternalParameters.ParameterType): Return the
20487         ExternalType of the parameter.
20488
20489         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20490         they were unused.
20491
20492 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20493
20494         * class.cs (MethodData.Define): Do not set the `newslot' on
20495         interface members, if they are also flagged as "override".
20496
20497         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20498         better code for ++i and i++.  This only works for static fields
20499         and local variables.
20500
20501         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20502         want to pull the DeclSpace out of the builder_to_declspace instead
20503         of the TypeBuilder (like in TypeContainer.FindMembers).
20504
20505         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20506         instead of LookupTypeContainer.  Fixes the crash on .NET for
20507         looking up interface members.
20508
20509         * const.cs: Create our own emit context during the Definition
20510         stage, so that constants are evaluated in the proper context, when
20511         a recursive definition happens.
20512
20513 2003-05-11  Martin Baulig  <martin@ximian.com>
20514
20515         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20516         new block for a switch section.
20517         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20518         the adding/lookup in the switch block.  Fixes #39828.
20519
20520 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20523         functionality: I needed to convert the data after I had performed
20524         the add/sub operation into the operands type size.
20525
20526         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20527         pass the type for the box operation, otherwise the resulting
20528         object would have been of type object.
20529
20530         (BoxedCast): Add constructor to specify the type to box as.
20531
20532 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * iterators.cs: I was reusing the `count' variable inadvertently,
20535         take steps to not allow this to happen.
20536
20537 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20538
20539         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20540         by creating an array at the point where the params starts and
20541         putting all those arguments there, then adjusting the size of the
20542         array.
20543
20544 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * expression.cs (New.AddressOf): Implement interface
20547         IMemoryLocation.  This is used when the `new' operator is used in
20548         the context of an invocation to a method on a value type.
20549
20550         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20551         example. 
20552
20553         * namespace.cs: Also check the using aliases here.
20554
20555         * driver.cs: Move the test for using validity after the types have
20556         been entered, so we do a single pass that also includes the using
20557         aliases. 
20558
20559         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20560         in the regular case.   CreateSiblingForFinally is doing extra
20561         error checking.
20562
20563         * attribute.cs (GetAttributeArgumentExpression): Store the result
20564         on an out value, and use the return value to indicate failure
20565         instead of using null (which is a valid return for Constant.GetValue).
20566
20567         * statement.cs: Perform the analysis flow for the increment
20568         portion after the statement, because this will be the real flow of
20569         execution.  Fixes #42385
20570
20571         * codegen.cs (EmitContext.EmitArgument,
20572         EmitContext.EmitStoreArgument): New helper functions when the
20573         RemapToProxy flag is set.
20574
20575         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20576         function.
20577
20578         Add support for remapping parameters. 
20579
20580         * iterators.cs: Propagate parameter values;  Store parameter
20581         values in the proxy classes.
20582
20583 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20584
20585         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20586         need a proxy reference;  I do not know what I was thinking
20587
20588         * cs-parser.jay (constructor_initializer): catch another error,
20589         and display nice message.
20590
20591         (field_declaration): catch void field declaration
20592         to flag a better error. 
20593
20594         * class.cs (MemberBase.CheckBase): Report an error instead of a
20595         warning if a new protected member is declared in a struct. 
20596         (Field.Define): catch the error of readonly/volatile.
20597
20598         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20599
20600         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20601         volatile variable is taken
20602
20603 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * statement.cs (Fixed.Resolve): Report an error if we are not in
20606         an unsafe context.
20607
20608 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20609
20610         * typemanager.cs: reuse the code that handles type clashes for
20611         delegates and enumerations.
20612
20613         * class.cs (Report28): Always report.
20614
20615         * expression.cs (EncodeAsAttribute): Allow nulls here.
20616
20617 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20618
20619         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20620         the functionality for testing whether an expression is valid for
20621         an attribute here.  Also handle the case of arrays of elements
20622         being stored. 
20623
20624         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20625         encoding a linear array into an array of objects that are suitable
20626         to be passed to an CustomAttributeBuilder.
20627
20628         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20629
20630         * ecore.cs: (FieldExpr): Handle field remapping here.
20631
20632         * iteratators.cs: Pass the instance variable (if the method is an
20633         instance method) to the constructors, so we can access the field
20634         variables on the class.
20635
20636         TODO: Test this with structs.  I think the THIS variable on
20637         structs might have to be a pointer, and not a refenrece
20638
20639 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20642         local variables to fields in a proxy class.
20643
20644         * iterators.cs (PopulateProxy): Rename our internal fields to
20645         <XXX>.  
20646         Create a <THIS> field if we are an instance method, so we can
20647         reference our parent container variables.
20648         (MapVariable): Called back from the EmitContext code to enter a
20649         new variable to field mapping into the proxy class (we just create
20650         a FieldBuilder).
20651
20652         * expression.cs
20653         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20654         for using the remapped locals to fields.
20655
20656         I placed the code here, because that gives the same semantics to
20657         local variables, and only changes the Emit code.
20658
20659         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20660         statements inside iterators.
20661         (VariableInfo): Add a FieldBuilder for the cases when we are
20662         remapping local variables to fields in a proxy class
20663
20664         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20665         current_block != null.
20666
20667         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20668         not cope with strings, as it has been moved to the
20669         TableSwitchEmit.  Fixed bug in switch generation.
20670
20671         * expression.cs (New.DoResolve): Provide more context for the user
20672         when reporting an error.
20673
20674         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20675         pointers. 
20676
20677         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20678         check the permissions for it.  Note than in a type-resolution
20679         context the check was already present in DeclSpace.ResolveType,
20680         but was missing from the MemberAccess.
20681
20682         (ArrayCreation.CheckIndices): warn if the user has
20683         more nested levels of expressions, but there are no more
20684         dimensions specified.  Avoids crash on bug 41906.
20685
20686 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * statement.cs (Block): replace Implicit bool, for a generic
20689         flags.   
20690         New flag: `Unchecked'.  This is used during the EmitMeta phase
20691         (which is out-of-line with the regular Resolve/Emit process for a
20692         statement, as this is done ahead of time, but still gets a chance
20693         to call constant resolve).
20694
20695         (Block.Flags): new enum for adding a new flag.
20696
20697         (Block.EmitMeta): track the state of unchecked.
20698
20699         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20700         to enable constant resolution to work there as well.
20701
20702 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * typemanager.cs (ienumerable_type): Also look up
20705         System.Collections.IEnumerable. 
20706
20707 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20708
20709         TODO: Test more than one conditional per method.
20710
20711         * class.cs (Indexer.Define): Report the location where the user is
20712         referencing the unsupported feature.
20713
20714         (MethodData): Overload the use of `conditionals' to
20715         minimize the creation of needless ArrayLists.   This saves roughly
20716         212kb on my machine.
20717
20718         (Method): Implement the new IIteratorContainer interface.
20719         (Method.SetYields): Implement the method by setting the ModFlags
20720         to contain METHOD_YIELDS.
20721
20722         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20723         which just got set to null.
20724
20725         * iterators.cs: New file.
20726
20727         (Yield, YieldBreak): New statements.
20728
20729         * statement.cs (Return.Resolve): Flag an error if we are used in
20730         an iterator method.
20731
20732         * codegen.cs (InIterator): New flag set if the code is being
20733         compiled in an iterator method.
20734
20735         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20736         internal modifier, and we just use it to avoid adding extra
20737         fields, as this is seldom used.  
20738
20739         * cs-parser.jay: Add yield_statement (yield and yield break).
20740
20741         * driver.cs: New flag -v2 to turn on version 2 features. 
20742
20743         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20744         hashtable when v2 is enabled.
20745
20746 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20747
20748         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20749         there is already a namespace defined with this name.
20750
20751         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20752         people upgraded their corlibs.
20753
20754         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20755         always use fully qualified types, no need to use the compiler
20756         front end.
20757
20758         (TypeManager.IsNamespace): Use binarysearch.
20759
20760         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20761         AddDelegate): I did not quite use the new IsValid API properly: I
20762         have to pass the short-name and the fullname.  I was passing only
20763         the basename instead of the fullname sometimes. 
20764
20765         (TypeContainer.DefineType): call NamespaceClash.
20766
20767         * interface.cs (Interface.DefineType): use NamespaceClash before
20768         defining the type.
20769
20770         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20771         defining the type.
20772
20773         * enum.cs: (Enum.DefineType): use NamespaceClash before
20774         defining the type.
20775
20776         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20777         speed increase.  First, use the negative_hits cache when we get a
20778         negative.  Second, add the type with its full original name
20779         instead of the new . and + encoded name (reflection uses + to
20780         separate type from a nested type).  Use LookupTypeReflection
20781         directly which bypasses the type->name hashtable (that we already
20782         know does not contain the type.
20783
20784         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20785         location/container type. 
20786
20787         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20788
20789 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20790
20791         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20792
20793         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20794         method is being referenced in the method group from a static
20795         context, and report error 120 if so.
20796
20797         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20798         Error118. 
20799
20800         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20801         is created, we create the A namespace).
20802
20803         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20804         Fixes #41591
20805
20806 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20807
20808         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20809         invocation to ModuleBuilder.GetType with the same values will
20810         return a new type instance, so we need to cache its return
20811         values. 
20812
20813         * expression.cs (Binary.ResolveOperator): Only allow the compare
20814         operators on enums if they are of the same type.
20815
20816         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20817         types of ValueType on their own case.  Before we were giving them
20818         the same treatment as objects.
20819
20820         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20821         fullname.  Short name is used to compare against container name.
20822         Fullname is used to check against defined namespace names.
20823
20824         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20825         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20826
20827         (Method.CheckBase): Call parent.
20828         (MemberBase.CheckBase): Check for protected members on sealed
20829         classes.
20830         (PropertyBase.CheckBase): Call parent.
20831         (Field.Define): Call parent.
20832
20833         * report.cs: Negative error codes are now mapped to 8000 - code,
20834         so that the display is render more nicely.
20835
20836         * typemanager.cs: Do not use try/catch, instead report a regular
20837         error. 
20838
20839         (GetPointerType, GetReferenceType): These methods provide
20840         mechanisms to obtain the T* and T& from a T.  We had the code
20841         previously scattered around the code base, and it also used
20842         TypeManager.LookupType that would go through plenty of caches.
20843         This one goes directly to the type source.
20844
20845         In some places we did the Type.GetType followed by
20846         ModuleBuilder.GetType, but not in others, so this unifies the
20847         processing as well.
20848
20849         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20850         statements now that we have namespace information.
20851
20852         * typemanager.cs (IsNamespace): New method, returns whether the
20853         string presented is a namespace or not.
20854
20855         (ComputeNamespaces): New public entry point, computes the list of
20856         available namespaces, using the GetNamespaces API call in Mono, or
20857         the slower version in MS.NET.   
20858
20859         Now before we start the semantic analysis phase, we have a
20860         complete list of namespaces including everything that the user has
20861         provided.
20862
20863         Deleted old code to cache namespaces in .nsc files.
20864
20865 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20866
20867         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20868         class/struct location definition Location for the implicit
20869         constructor location.
20870
20871         (Operator.Define): Use the location of the operator for the
20872         implicit Method definition.
20873
20874         (Constructor.Emit): use the constructor location for the implicit
20875         base initializer constructor.
20876
20877         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20878         and the Expression class now contains two new methods:
20879
20880         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20881         isolate type lookup from the rest of the resolution process.
20882
20883         Since we use Expressions to hold type definitions due to the way
20884         we parse the input we have historically overloaded Resolve to
20885         perform the Type lookups if a special flag is passed.  Now this is
20886         eliminated and two methods take their place. 
20887
20888         The differences in the two methods between xStep and xTerminal is
20889         that xStep is involved in our current lookup system that uses
20890         SimpleNames to compose a name, while xTerminal is used just to
20891         catch the case where the simplename lookup failed.
20892
20893 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20894
20895         * expression.cs (ResolveMemberAccess): Remove redundant code.
20896         TypeExpr expressions are always born fully resolved.
20897
20898         * interface.cs (PopulateMethod): Do not lookup the types twice.
20899         We were doing it once during SemanticAnalysis and once during
20900         PopulateMethod.
20901
20902         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20903         in local variable type definitions, were being returned as a
20904         SimpleName (we decomposed everything into a string), that is
20905         because primary_expression was being used instead of a type in the
20906         grammar (reduce/reduce conflicts).
20907
20908         The part that was wrong is that we converted the expression into a
20909         string (an oversimplification in one hand, compounded with primary
20910         expressions doing string concatenation).
20911
20912         So things like:
20913
20914         A.B.C [] x;
20915
20916         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20917         using clauses from working on this particular context.  And a type
20918         was being matched directly against "A.B.C[]".
20919
20920         We now use the correct approach, and allow for ComposedCast to be
20921         part of the unary expression.  So the "A.B.C []" become a composed
20922         cast of "A.B.C" (as a nested group of MemberAccess with a
20923         SimpleName at the end) plus the rank composition "[]". 
20924
20925         Also fixes 35567
20926
20927 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20930         for the access level checking.
20931
20932         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20933         `TypeContainer container', because I kept getting confused when I
20934         was debugging this code.
20935
20936         * expression.cs (Indexers): Instead of tracking getters/setters,
20937         we now track them in parallel.  We create one arraylist less, but
20938         most importantly it is possible now for the LValue code to find a
20939         matching get for a set.
20940
20941         (IndexerAccess.DoResolveLValue): Update the code.
20942         GetIndexersForType has been modified already to extract all the
20943         indexers from a type.  The code assumed it did not.
20944
20945         Also make the code set the correct return type for the indexer.
20946         This was fixed a long time ago for properties, but was missing for
20947         indexers.  It used to be void_type.
20948
20949         (Binary.Emit): Test first for doubles instead of
20950         floats, as they are more common.
20951
20952         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20953         when dealing with floats and the <=, >= operators.  This fixes bug
20954         #39314 
20955
20956         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20957         to load the array value by emitting a load on the foreach variable
20958         type.  This was incorrect.  
20959
20960         We now emit the code to load an element using the the array
20961         variable type, and then we emit the conversion operator.
20962
20963         Fixed #40176
20964
20965 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20966
20967         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20968
20969 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20972         test for protection before we test for signatures. 
20973
20974         (MethodSignature.ToString): implement.
20975
20976         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20977         to the case where we reduced into a LongConstant.
20978
20979         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20980         depend on whether the information is acurrate, because the
20981         Microsoft runtime will always claim that the array type is public,
20982         regardless of the real state.
20983
20984         If the type is a pointer, another problem happens: the type is
20985         reported as non-public in Microsoft.  
20986
20987         In both cases we have to call CheckAccessLevel recursively with
20988         the underlying type as the argument to be tested.
20989
20990 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20991
20992         * assign.cs (Assign.Emit): If we are dealing with a compound
20993         assignment expression, we should use the code path that stores the
20994         intermediate result in a temporary value.  This fixes #40903.
20995
20996         *expression.cs (Indirection.ToString): Provide ToString method for
20997         debugging. 
20998
20999 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
21000
21001         * class.cs: Null out fields holding references to Block objects so
21002         they can be garbage collected.
21003
21004         * expression.cs (OverloadResolve): Remove unused local.
21005
21006 2003-04-07  Martin Baulig  <martin@ximian.com>
21007
21008         * codegen.cs (EmitContext.CurrentFile): New public field.
21009         (EmitContext.Mark): Use the CurrentFile to check whether the
21010         location is in the correct file.
21011         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21012
21013 2003-04-07  Martin Baulig  <martin@ximian.com>
21014
21015         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21016
21017         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21018         location.  [FIXME: The location argument which gets passed to this
21019         method is sometimes wrong!]
21020
21021 2003-04-07  Nick Drochak <ndrochak@gol.com>
21022
21023         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21024
21025 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
21026
21027         * expression.cs (Indirection.EmitAssign): We were using the
21028         temporary, but returning immediately instead of continuing the
21029         EmitAssing flow.
21030
21031 2003-04-06  Martin Baulig  <martin@ximian.com>
21032
21033         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
21034         if it's a nested child, but also deriving from the outer class.
21035         See test 190.cs.
21036
21037         * typemanager.cs (IsNestedChildOf): Make this work if it's a
21038         nested child, but also deriving from the outer class.  See
21039         test-190.cs.
21040         (FilterWithClosure): We may access private members of the outer
21041         class if we're a nested child and deriving from the outer class.
21042         (RealMemberLookup): Only set `closure_private_ok' if the
21043         `original_bf' contained BindingFlags.NonPublic.
21044
21045 2003-04-05  Martin Baulig  <martin@ximian.com>
21046
21047         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
21048
21049 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * class.cs (Event.Define): Do not allow abstract events to have
21052         initializers. 
21053
21054 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
21055
21056         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
21057         block in event declarations.
21058
21059         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
21060         value type, get its address.
21061
21062         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
21063         leaving a class on the stack instead of a boolean value (int
21064         0/1).  Change the code so we compare against null, and then the
21065         result against zero.
21066
21067         * class.cs (TypeContainer.GetClassBases): We were checking for the
21068         parent class being sealed too late.
21069
21070         * expression.cs (Binary.Emit): For <= and >= when dealing with
21071         floating point values, use cgt.un and clt.un instead of cgt and
21072         clt alone.
21073
21074 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
21075
21076         * statement.cs: Apply the same optimization as MS: skip the 
21077         GetEnumerator returning an IEnumerator, and use the one returning a 
21078         CharEnumerator instead. This allows us to avoid the try-finally block 
21079         and the boxing.
21080
21081 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
21082
21083         * cs-parser.jay: Attributes cannot be applied to
21084                          namespaces. Fixes #40473
21085
21086 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21087
21088         * class.cs:
21089         (Add*): check if the name is valid using the full name for constants,
21090         fields, properties and events.
21091
21092 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
21093
21094         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
21095         char constants to be part of the enumeration.
21096
21097         * expression.cs (Conditional.DoResolve): Add support for operator
21098         true. Implements the missing functionality from 14.12
21099
21100         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
21101         operator true/false as required by the spec.
21102
21103         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
21104         implicit conversion to boolean.
21105
21106         * statement.cs (Statement.ResolveBoolean): A boolean expression is
21107         also one where the type implements `operator true'. 
21108
21109         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
21110         get an expression that will invoke operator true based on an
21111         expression.  
21112
21113         (GetConversionOperators): Removed the hack that called op_True
21114         here.  
21115
21116         (Expression.ResolveBoolean): Move this from Statement.
21117
21118 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
21119
21120         * ecore.cs (FieldExpr): do not allow initialization of initonly
21121         fields on derived classes
21122
21123 2003-03-13  Martin Baulig  <martin@ximian.com>
21124
21125         * statement.cs (Block.Emit): Call ig.BeginScope() and
21126         ig.EndScope() when compiling with debugging info; call
21127         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
21128
21129 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * expression.cs (Indexers): Do not construct immediately, allow
21132         for new members to be appended as we go.  Fixes 38143
21133
21134 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21135
21136         * expression.cs: save/restore context when resolving an unchecked
21137         expression.
21138
21139 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
21140
21141         * cfold.cs: Catch division by zero in modulus operator during
21142         constant folding.
21143
21144 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
21145
21146         * interface.cs (Interface.DefineMembers): Avoid defining members
21147         twice. 
21148
21149 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
21150
21151         * driver.cs: handle the +/- options for -noconfig
21152
21153         * statement.cs (Unckeched.Resolve): Also track the state of
21154         unchecked in the Resolve phase.
21155
21156 2003-02-27  Martin Baulig  <martin@ximian.com>
21157
21158         * ecore.cs (Expression.MemberLookup): Don't create a
21159         MethodGroupExpr for something which is not a method.  Fixes #38291.
21160
21161 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
21162
21163         * class.cs (MemberBase.CheckParameters): Also check that the type
21164         is unmanaged if it is a pointer.
21165
21166         * expression.cs (SizeOf.Resolve): Add location information.
21167
21168         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
21169         a managed type is declared.
21170
21171         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
21172         parameter modifiers as well.  Fixes bug 38606
21173
21174         * class.cs: Very sad.  Am backing out the speed up changes
21175         introduced by the ArrayList -> Array in the TypeContainer, as they
21176         were not actually that much faster, and introduced a bug (no error
21177         reports on duplicated methods).
21178
21179         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
21180         source first, this will guarantee that we have a valid expression
21181         before calling in lower levels functions that will require a
21182         resolved object.  Then use this original_source in the
21183         target.ResolveLValue instead of the original source that was
21184         passed to us.
21185
21186         Another change.  Use target.Resolve instead of LValueResolve.
21187         Although we are resolving for LValues, we will let the Assign code
21188         take care of that (it will be called again from Resolve).  This
21189         basically allows code like this:
21190
21191         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
21192         class Y { void A (X x) { x [0] += o; }
21193
21194         The problem was that the indexer was trying to resolve for
21195         set_Item (idx, object o) and never finding one.  The real set_Item
21196         was set_Item (idx, X).  By delaying the process we get the right
21197         semantics. 
21198
21199         Fixes bug 36505
21200
21201 2003-02-23  Martin Baulig  <martin@ximian.com>
21202
21203         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
21204         while calling DoEmit ().
21205
21206         * codegen.cs (EmitContext.Mark): Don't mark locations in other
21207         source files; if you use the #line directive inside a method, the
21208         compiler stops emitting line numbers for the debugger until it
21209         reaches the end of the method or another #line directive which
21210         restores the original file.
21211
21212 2003-02-23  Martin Baulig  <martin@ximian.com>
21213
21214         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
21215
21216 2003-02-23  Martin Baulig  <martin@ximian.com>
21217
21218         * statement.cs (Block.AddChildVariableNames): We need to call this
21219         recursively, not just for our immediate children.
21220
21221 2003-02-23  Martin Baulig  <martin@ximian.com>
21222
21223         * class.cs (Event.Define): Always make the field private, like csc does.
21224
21225         * typemanager.cs (TypeManager.RealMemberLookup): Make events
21226         actually work, fixes bug #37521.
21227
21228 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
21229
21230         * delegate.cs: When creating the various temporary "Parameters"
21231         classes, make sure that we call the ComputeAndDefineParameterTypes
21232         on those new parameters (just like we do with the formal ones), to
21233         allow them to be resolved in the context of the DeclSpace.
21234
21235         This fixes the bug that Dick observed in Bugzilla #38530.
21236
21237 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
21238
21239         * expression.cs (ResolveMemberAccess): When resolving a constant,
21240         do not attempt to pull a constant if the value was not able to
21241         generate a valid constant.
21242
21243         * const.cs (LookupConstantValue): Do not report more errors than required.
21244
21245 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21246
21247         * expression.cs: fixes bug #38328.
21248
21249 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21250
21251         * class.cs: Changed all the various members that can be part of a
21252         class from being an ArrayList to be an Array of the right type.
21253         During the DefineType type_list, interface_list, delegate_list and
21254         enum_list are turned into types, interfaces, delegates and enums
21255         arrays.  
21256
21257         And during the member population, indexer_list, event_list,
21258         constant_list, field_list, instance_constructor_list, method_list,
21259         operator_list and property_list are turned into their real arrays.
21260
21261         Although we could probably perform this operation earlier, for
21262         good error reporting we need to keep the lists and remove the
21263         lists for longer than required.
21264
21265         This optimization was triggered by Paolo profiling the compiler
21266         speed on the output of `gen-sample-program.pl' perl script. 
21267
21268         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
21269         not crash in methods like MemberLookupFailed that use this field.  
21270
21271         This problem arises when the compiler fails to resolve a type
21272         during interface type definition for example.
21273
21274 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
21275
21276         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
21277         inherit from System.Object, so we have to stop at null, not only
21278         when reaching System.Object.
21279
21280 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
21281
21282         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
21283         DeclaredOnly because the parent indexer might have had a different
21284         name, but did not loop until the top of the hierarchy was reached.
21285
21286         The problem this one fixes is 35492: when a class implemented an
21287         indexer from an interface, we were getting the interface method
21288         (which was abstract) and we were flagging an error (can not invoke
21289         abstract method).
21290
21291         This also keeps bug 33089 functioning, and test-148 functioning.
21292
21293         * typemanager.cs (IsSpecialMethod): The correct way of figuring
21294         out if a method is special is to see if it is declared in a
21295         property or event, or whether it is one of the predefined operator
21296         names.   This should fix correctly #36804.
21297
21298 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
21299
21300         The goal here is to remove the dependency on EmptyCast.Peel ().
21301         Killing it completely.
21302
21303         The problem is that currently in a number of places where
21304         constants are expected, we have to "probe" for an EmptyCast, and
21305         Peel, which is not the correct thing to do, as this will be
21306         repetitive and will likely lead to errors. 
21307
21308         The idea is to remove any EmptyCasts that are used in casts that
21309         can be reduced to constants, so we only have to cope with
21310         constants. 
21311
21312         This bug hunt was triggered by Bug 37363 and the desire to remove
21313         the duplicate pattern where we were "peeling" emptycasts to check
21314         whether they were constants.  Now constants will always be
21315         constants.
21316
21317         * ecore.cs: Use an enumconstant here instead of wrapping with
21318         EmptyCast.  
21319
21320         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21321         throwing me off.  By handling this we can get rid of a few hacks.
21322
21323         * statement.cs (Switch): Removed Peel() code.
21324
21325 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
21326
21327         * class.cs: Location information for error 508
21328
21329         * expression.cs (New.DoResolve): Add a guard against double
21330         resolution of an expression.  
21331
21332         The New DoResolve might be called twice when initializing field
21333         expressions (see EmitFieldInitializers, the call to
21334         GetInitializerExpression will perform a resolve on the expression,
21335         and later the assign will trigger another resolution
21336
21337         This leads to bugs (#37014)
21338
21339         * delegate.cs: The signature for EndInvoke should contain any ref
21340         or out parameters as well.  We were not doing this in the past. 
21341
21342         * class.cs (Field.Define): Do not overwrite the type definition
21343         inside the `volatile' group.  Turns out that volatile enumerations
21344         were changing the type here to perform a validity test, which
21345         broke conversions. 
21346
21347 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21350         and structs, we do not want to load the instance variable
21351
21352         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21353         enum_type has to be handled like an object reference (implicit
21354         conversions exists from this to object), but the regular IsClass
21355         and IsValueType tests will never return true for this one.
21356
21357         Also we use TypeManager.IsValueType instead of type.IsValueType,
21358         just for consistency with the rest of the code (this is only
21359         needed if we ever use the construct exposed by test-180.cs inside
21360         corlib, which we dont today).
21361
21362 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
21363
21364         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21365         just InternalCall.
21366
21367 2003-02-09  Martin Baulig  <martin@ximian.com>
21368
21369         * namespace.cs (Namespace..ctor): Added SourceFile argument.
21370         (Namespace.DefineNamespaces): New static public method; this is
21371         called when we're compiling with debugging to add all namespaces
21372         to the symbol file.
21373
21374         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21375         pass it to the Namespace's .ctor.
21376
21377         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21378         and MethodBase arguments; pass the namespace ID to the symwriter;
21379         pass the MethodBase instead of the token to the symwriter.
21380         (SymbolWriter.DefineNamespace): New method to add a namespace to
21381         the symbol file.
21382
21383 2003-02-09  Martin Baulig  <martin@ximian.com>
21384
21385         * symbolwriter.cs: New file.  This is a wrapper around
21386         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
21387         methods here in near future.
21388
21389 2003-02-09  Martin Baulig  <martin@ximian.com>
21390
21391         * codegen.cs (EmitContext.Mark): Just pass the arguments to
21392         ILGenerator.MarkSequencePoint() which are actually used by the
21393         symbol writer.
21394
21395 2003-02-09  Martin Baulig  <martin@ximian.com>
21396
21397         * location.cs (SourceFile): New public sealed class.  This
21398         contains the name and an index which is used in the location's token.
21399         (Location): Reserve an appropriate number of bits in the token for
21400         the source file instead of walking over that list, this gives us a
21401         really huge performance improvement when compiling with debugging.
21402
21403         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21404         `SourceFile' argument instead of a string.
21405         (Driver.ProcessFile): Add all the files via Location.AddFile(),
21406         but don't parse/tokenize here, we need to generate the list of all
21407         source files before we do that.
21408         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
21409         the files.
21410
21411         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21412         instead of a string.
21413
21414         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21415         of a string.
21416
21417 2003-02-09  Martin Baulig  <martin@ximian.com>
21418
21419         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21420         filename on `#line default'.
21421
21422 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21423
21424         * statement.cs: don't clear the pinned var when the fixed statement
21425         returns from the method (fixes bug#37752).
21426
21427 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21428
21429         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21430         to IsValueType.
21431
21432 2003-02-07  Martin Baulig  <martin@ximian.com>
21433
21434         * driver.cs: Removed the `--debug-args' command line argument.
21435
21436         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21437         automatically by the AsssemblyBuilder.
21438         (CodeGen.InitializeSymbolWriter): We don't need to call any
21439         initialization function on the symbol writer anymore.  This method
21440         doesn't take any arguments.
21441
21442 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21443
21444         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21445         from referenced assemblies as well.
21446
21447 2003-02-02  Martin Baulig  <martin@ximian.com>
21448
21449         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21450
21451 2003-02-02  Martin Baulig  <martin@ximian.com>
21452
21453         * class.cs (Constructor.Emit): Open the symbol writer before
21454         emitting the constructor initializer.
21455         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21456         single-stepping through constructor initializers.
21457
21458 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21459
21460         * class.cs: Handle error 549: do not allow virtual methods in
21461         sealed classes. 
21462
21463 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21464
21465         * decl.cs: Check access levels when resolving types
21466
21467 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21468
21469         * statement.cs: Add parameters and locals set in catch blocks that might 
21470         return to set vector
21471
21472 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * class.cs (Operator): Set the SpecialName flags for operators.
21475
21476         * expression.cs (Invocation.DoResolve): Only block calls to
21477         accessors and operators on SpecialName methods.
21478
21479         (Cast.TryReduce): Handle conversions from char constants.
21480
21481
21482 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21483
21484         * statement.cs: small memory and time optimization in FlowBranching.
21485
21486 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21487
21488         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21489         problem that the last fix but in the other sid (Set).
21490
21491         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21492         access when there is no indexer in the hierarchy.
21493
21494 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21495
21496         * class.cs: Combine some if statements.
21497
21498 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21499
21500         * driver.cs: fixed bug #37187.
21501
21502 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21503
21504         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21505         any indexer, it's needed to build a list with all the indexers in the
21506         hierarchy (AllGetters), else we have problems. Fixes #35653.
21507
21508 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21509
21510         * class.cs (MethodData.Define): It is wrong for an interface
21511         implementation to be static in both cases: explicit and implicit.
21512         We were only handling this in one case.
21513
21514         Improve the if situation there to not have negations.
21515
21516         * class.cs (Field.Define): Turns out that we do not need to check
21517         the unsafe bit on field definition, only on usage.  Remove the test.
21518
21519 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21520
21521         * driver.cs: use assembly.Location instead of Codebase (the latest
21522         patch made mcs fail when using MS assemblies).
21523
21524 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21525
21526         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21527         get the path to *corlib.dll.
21528
21529 2003-01-21  Nick Drochak <ndrochak@gol.com>
21530
21531         * cs-tokenizer.cs:
21532         * pending.cs:
21533         * typemanager.cs: Remove compiler warnings
21534
21535 2003-01-20  Duncan Mak  <duncan@ximian.com>
21536
21537         * AssemblyInfo.cs: Bump the version number to 0.19.
21538
21539 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21540
21541         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21542
21543 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21544
21545         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21546
21547 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21548
21549         * cs-parser.jay: Small fix: we were not comparing the constructor
21550         name correctly.   Thanks to Zoltan for the initial pointer.
21551
21552 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21553
21554         * cs-tokenizer.cs: Set file name when specified with #line
21555
21556 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21557
21558         * cs-parser.jay: Only perform the constructor checks here if we
21559         are named like the class;  This will help provider a better
21560         error.  The constructor path is taken when a type definition is
21561         not found, but most likely the user forgot to add the type, so
21562         report that rather than the constructor error.
21563
21564 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21565
21566         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21567         allocations.
21568
21569 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21570
21571         * cs-parser.jay: Add cleanup call.
21572
21573 2003-01-13  Duncan Mak  <duncan@ximian.com>
21574
21575         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21576         consistent with other methods.
21577
21578 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21579
21580         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21581
21582 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21583
21584         * attribute.cs: only set GuidAttr to true when we have a
21585         GuidAttribute.
21586
21587 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21588
21589         * ecore.cs:
21590         * expression.cs:
21591         * typemanager.cs: fixes to allow mcs compile corlib with the new
21592         Type.IsSubclassOf fix.
21593
21594 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21595
21596         * expression.cs (LocalVariableReference.DoResolve): Classify a
21597         constant as a value, not as a variable.   Also, set the type for
21598         the variable.
21599
21600         * cs-parser.jay (fixed_statement): take a type instead of a
21601         pointer_type, so we can produce a better error message later.
21602
21603         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21604         as an error.  
21605
21606         (For.DoEmit): Make inifinite loops have a
21607         non-conditional branch back.
21608
21609         (Fixed.DoEmit): First populate the pinned variables, then emit the
21610         statement, then clear the variables.  Before I was emitting the
21611         code once for each fixed piece.
21612
21613
21614 2003-01-08  Martin Baulig  <martin@ximian.com>
21615
21616         * statement.cs (FlowBranching.MergeChild): A break in a
21617         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21618
21619 2003-01-08  Martin Baulig  <martin@ximian.com>
21620
21621         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21622         lives in the same number space than `param_map'.  Fixes #36154.
21623
21624 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21625
21626         * cs-parser.jay (constructor_declaration): Set the
21627         Constructor.ModFlags before probing for it.  This makes the
21628         compiler report 514, 515 and 132 (the code was there, but got
21629         broken). 
21630
21631         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21632         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21633         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21634
21635 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21636
21637         * enum.cs: create the enum static fields using the enum type.
21638
21639 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21640
21641         * class.cs: don't try to create the ParamBuilder for the return
21642         type if it's not needed (and handle it breaking for the ms runtime
21643         anyway).
21644
21645 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21646
21647         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21648
21649 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21650
21651         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21652         the command.   This showed up while compiling the JANET source
21653         code, which used \r as its only newline separator.
21654
21655 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21656
21657         * class.cs (Method.Define): If we are an operator (because it
21658         reuses our code), then set the SpecialName and HideBySig.  #36128
21659
21660 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21661
21662         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21663         exception, report error 120 `object reference required'.
21664
21665         * driver.cs: Add --pause option, used during to measure the size
21666         of the process as it goes with --timestamp.
21667
21668         * expression.cs (Invocation.DoResolve): Do not allow methods with
21669         SpecialName to be invoked.
21670
21671 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21674         number before adding it.
21675
21676 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21677
21678         * ecore.cs (StandardImplicitConversion): When in an unsafe
21679         context, we allow conversion between void * to any other pointer
21680         type. This fixes bug #35973.
21681
21682 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21683
21684         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21685         is not thrown when extensionless outputs are used 
21686
21687 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21688
21689         * rootcontext.cs: fixed compilation of corlib.
21690
21691 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21692
21693         * attribute.cs (Attributes.Contains): Add new method.
21694
21695         * class.cs (MethodCore.LabelParameters): if the parameter is an
21696         `out' parameter, check that no attribute `[In]' has been passed.
21697
21698         * enum.cs: Handle the `value__' name in an enumeration.
21699
21700 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21701
21702         * decl.cs: Added special case to allow overrides on "protected
21703         internal" methods
21704
21705 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21706
21707         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21708         since it makes much more sense.
21709
21710         (Attributes.ctor): Don't require a Location parameter.
21711
21712         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21713
21714         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21715         since we already have that information per attribute.
21716
21717         * everywhere : make appropriate changes.
21718
21719         * class.cs (LabelParameters): Write the code which actually
21720         applies attributes to the return type. We can't do this on the MS
21721         .NET runtime so we flag a warning in the case an exception is
21722         thrown.
21723
21724 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21725
21726         * const.cs: Handle implicit null conversions here too.
21727
21728 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21729
21730         * class.cs (MethodCore.LabelParameters): Remove the extra
21731         Type [] parameter since it is completely unnecessary. Instead
21732         pass in the method's attributes so that we can extract
21733         the "return" attribute.
21734
21735 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21736
21737         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21738         of ignoring it and letting the compile continue.
21739
21740         * typemanager.cs (ChangeType): use an extra argument to return an
21741         error condition instead of throwing an exception.
21742
21743 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21744
21745         * expression.cs (Unary.TryReduce): mimic the code for the regular
21746         code path.  Perform an implicit cast in the cases where we can
21747         implicitly convert to one of the integral types, and then reduce
21748         based on that constant.   This fixes bug #35483.
21749
21750 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21751
21752         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21753
21754 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21755
21756         * namespace.cs: fixed bug #35489.
21757
21758 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21759
21760         * class.cs: Remove some dead code.
21761
21762         * cs-parser.jay: Estimate the number of methods needed
21763         (RootContext.MethodCount);
21764
21765         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21766         numbers instead of StringBuilders.
21767
21768         * support.cs (PtrHashtable): Add constructor with initial size;
21769         We can now reduce reallocations of the method table.
21770
21771 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21772
21773         * attribute.cs (ApplyAttributes): Keep track of the emitted
21774         attributes on a per-target basis. This fixes bug #35413.
21775
21776 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21777
21778         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21779         default to the Windows 1252 encoding.
21780
21781         (UnixParseOption): Support version, thanks to Alp for the missing
21782         pointer. 
21783
21784         * AssemblyInfo.cs: Add nice assembly information.
21785
21786         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21787         (bug 35169).
21788
21789         * cs-parser.jay: Allow a trailing comma before the close bracked
21790         in the attribute_section production.
21791
21792         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21793         address of the instance was being taken, I will take this out,
21794         because we take the address of the object immediately here.
21795
21796 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21797
21798         * typemanager.cs (AreMultipleAllowed): Take care of the most
21799         obvious case where attribute type is not in the current assembly -
21800         stupid me ;-)
21801
21802 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21805         definitions, instead of doing that afterwards.  
21806
21807         Also we use a nice little hack, depending on the constructor, we
21808         know if we are a "composed" name or a simple name.  Hence, we
21809         avoid the IndexOf test, and we avoid 
21810
21811         * codegen.cs: Add code to assist in a bug reporter to track down
21812         the source of a compiler crash. 
21813
21814 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21815
21816         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21817         types have been emitted for a given element and flag an error
21818         if something which does not have AllowMultiple set is used more
21819         than once.
21820
21821         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21822         attribute types and their corresponding AllowMultiple properties
21823
21824         (AreMultipleAllowed): Check the property for a given type.
21825
21826         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21827         property in the case we have a TypeContainer.
21828
21829         (Attributes.AddAttribute): Detect duplicates and just skip on
21830         adding them. This trivial fix catches a pretty gross error in our
21831         attribute emission - global attributes were being emitted twice!
21832
21833         Bugzilla bug #33187 is now fixed.
21834
21835 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21836
21837         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21838         instead of pp_and).
21839
21840         * expression.cs (Binary.ResolveOperator): I can only use the
21841         Concat (string, string, string) and Concat (string, string,
21842         string, string) if the child is actually a concatenation of
21843         strings. 
21844
21845 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21848         context where we need a 2-character lookahead.
21849
21850         * pending.cs (PendingImplementation): Rework so we can keep track
21851         of interface types all the time, and flag those which were
21852         implemented by parents as optional.
21853
21854 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21855
21856         * expression.cs (Binary.ResolveOperator): Use
21857         String.Concat(string,string,string) or
21858         String.Concat(string,string,string,string) when possible. 
21859
21860         * typemanager: More helper methods.
21861
21862
21863 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21864
21865         * pending.cs: remove the bogus return from GetMissingInterfaces()
21866         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21867
21868 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21869
21870         * namespace.cs: avoid duplicated 'using xxx' being added to
21871         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21872         when we get more than one 'using' statement for the same namespace.
21873         Report a CS0105 warning for it.
21874
21875 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21876
21877         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21878         of calling getChar/putback, uses internal knowledge of it.    
21879
21880         (xtoken): Reorder tokenizer so most common patterns are checked
21881         first.  This reduces the compilation time in another 5% (from 8.11s
21882         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21883
21884         The parsing time is 22% of the compilation in mcs, and from that
21885         64% is spent on the tokenization process.  
21886
21887         I tried using a binary search for keywords, but this is slower
21888         than the hashtable.  Another option would be to do a couple of
21889         things:
21890
21891                 * Not use a StringBuilder, instead use an array of chars,
21892                   with a set value.  Notice that this way we could catch
21893                   the 645 error without having to do it *afterwards*.
21894
21895                 * We could write a hand-parser to avoid the hashtable
21896                   compares altogether.
21897
21898         The identifier consumption process takes 37% of the tokenization
21899         time.  Another 15% is spent on is_number.  56% of the time spent
21900         on is_number is spent on Int64.Parse:
21901
21902                 * We could probably choose based on the string length to
21903                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21904                   computations. 
21905
21906         Another 3% is spend on wrapping `xtoken' in the `token' function.
21907
21908         Handle 0xa0 as whitespace (#34752)
21909
21910 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21911
21912         * typemanager.cs (IsCLRType): New routine to tell whether a type
21913         is one of the builtin types.  
21914
21915         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21916         typecode in more places instead of doing pointer comparissions.
21917         We could leverage some knowledge about the way the typecodes are
21918         laid out.
21919
21920         New code to cache namespaces in assemblies, it is currently not
21921         invoked, to be used soon.
21922
21923         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21924
21925         * expression.cs (Binary.ResolveOperator): specially handle
21926         strings, and do not perform user-defined operator overloading for
21927         built-in types.
21928
21929 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21930
21931         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21932         internalcall as it is a pretty simple operation;  Avoid whenever
21933         possible to call Char.IsLetter.
21934
21935         (consume_identifier): Cut by half the number of
21936         hashtable calls by merging the is_keyword and GetKeyword behavior.
21937
21938         Do not short-circuit, because if we do, we
21939         report errors (ie, #if false && true would produce an invalid
21940         directive error);
21941
21942
21943 2002-11-24  Martin Baulig  <martin@ximian.com>
21944
21945         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21946         check constant ranges and report a CS0221.  Fixes #33186.
21947
21948 2002-11-24  Martin Baulig  <martin@ximian.com>
21949
21950         * cs-parser.jay: Make this work for uninitialized variable
21951         declarations in the `for' initializer.  Fixes #32416.
21952
21953 2002-11-24  Martin Baulig  <martin@ximian.com>
21954
21955         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21956         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21957
21958 2002-11-24  Martin Baulig  <martin@ximian.com>
21959
21960         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21961         argument; if true, we also check for user-defined conversions.
21962         This is only needed if both arguments are of a user-defined type.
21963         Fixes #30443, added test-175.cs.
21964         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21965
21966         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21967
21968 2002-11-24  Martin Baulig  <martin@ximian.com>
21969
21970         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21971         function to get the store opcode.
21972         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21973         only emit the Ldelema if the store opcode is Stobj.  You must run
21974         both test-34 and test-167 to test this.  Fixes #34529.
21975
21976 2002-11-23  Martin Baulig  <martin@ximian.com>
21977
21978         * ecore.cs (Expression.MemberLookup): Added additional
21979         `qualifier_type' argument which is used when we're being called
21980         from MemberAccess.DoResolve() and null if we're called from a
21981         SimpleName lookup.
21982         (Expression.MemberLookupFailed): New method to report errors; this
21983         does the CS1540 check and reports the correct error message.
21984
21985         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21986         argument for the CS1540 check and redone the way how we're dealing
21987         with private members.  See the comment in the source code for details.
21988         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21989         `closure_start_type' to `closure_qualifier_type' and check whether
21990         it's not null.  It was not this filter being broken, it was just
21991         being called with the wrong arguments.
21992
21993         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21994         and pass it the correct `qualifier_type'; this also does the error
21995         handling for us.
21996
21997 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21998
21999         * expression.cs (Invocation.EmitParams): If the we are dealing
22000         with a non-built-in value type, load its address as well.
22001
22002         (ArrayCreation): Use a a pretty constant instead
22003         of the hardcoded value 2.   Use 6 instead of 2 for the number of
22004         static initializers.  
22005
22006         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22007         because they are not really value types, just glorified integers. 
22008
22009         * driver.cs: Do not append .exe, the CSC compiler does not do it.
22010
22011         * ecore.cs: Remove redundant code for enumerations, make them use
22012         the same code path as everything else, fixes the casting issue
22013         with enumerations in Windows.Forms.
22014
22015         * attribute.cs: Do only cast to string if it is a string, the
22016         validation happens later.
22017
22018         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22019         people upgrade their corlibs.
22020
22021         * ecore.cs: Oops, enumerations were not following the entire code path
22022
22023 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
22024
22025         * typemanager.cs (FilterWithClosure): Commented out the test for
22026         1540 in typemanager.cs, as it has problems when accessing
22027         protected methods from a parent class (see test-174.cs). 
22028
22029         * attribute.cs (Attribute.ValidateGuid): new method.
22030         (Attribute.Resolve): Use above.
22031
22032 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
22035
22036         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
22037         handling for enumerations, as we only needed the TypeContainer
22038         functionality to begin with (this is required for the fix below to
22039         work for enums that reference constants in a container class for
22040         example). 
22041
22042         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
22043
22044         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
22045         a valid TypeBuilder to perform lookups on.o
22046
22047         * class.cs (InheritableMemberSignatureCompare): Use true in the
22048         call to GetGetMethod and GetSetMethod, because we are comparing
22049         the signature, and we need to get the methods *even* if they are
22050         private. 
22051
22052         (PropertyBase.CheckBase): ditto.
22053
22054         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
22055         GotoCase.Resolve): Use Peel on EmpytCasts.
22056
22057         * ecore.cs (EmptyCast): drop child, add Peel method.
22058
22059 2002-11-17  Martin Baulig  <martin@ximian.com>
22060
22061         * ecore.cs (EmptyCast.Child): New public property.
22062
22063         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
22064         label resolved to an EmptyCast.  Fixes #34162.
22065         (GotoCase.Resolve): Likewise.
22066         (Block.EmitMeta): Likewise.
22067
22068 2002-11-17  Martin Baulig  <martin@ximian.com>
22069
22070         * expression.cs (Invocation.BetterConversion): Prefer int over
22071         uint; short over ushort; long over ulong for integer literals.
22072         Use ImplicitConversionExists instead of StandardConversionExists
22073         since we also need to check for user-defined implicit conversions.
22074         Fixes #34165.  Added test-173.cs.
22075
22076 2002-11-16  Martin Baulig  <martin@ximian.com>
22077
22078         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
22079         with the `true' and `false' literals.  Fixes #33151.
22080
22081 2002-11-16  Martin Baulig  <martin@ximian.com>
22082
22083         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
22084         October 22nd; don't do the cs1540 check for static members.
22085
22086         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
22087         now using our own filter here and doing the cs1540 check again.
22088
22089 2002-11-16  Martin Baulig  <martin@ximian.com>
22090
22091         * support.cs (InternalParameters): Don't crash if we don't have
22092         any fixed parameters.  Fixes #33532.
22093
22094 2002-11-16  Martin Baulig  <martin@ximian.com>
22095
22096         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
22097         when looking up static methods to make this work on Windows.
22098         Fixes #33773.
22099
22100 2002-11-16  Martin Baulig  <martin@ximian.com>
22101
22102         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
22103         a setter rather than using PropertyInfo.CanWrite.
22104
22105 2002-11-15  Nick Drochak  <ndrochak@gol.com>
22106
22107         * class.cs: Allow acces to block member by subclasses. Fixes build
22108         breaker.
22109
22110 2002-11-14  Martin Baulig  <martin@ximian.com>
22111
22112         * class.cs (Constructor.Emit): Added the extern/block check.
22113         Fixes bug #33678.
22114
22115 2002-11-14  Martin Baulig  <martin@ximian.com>
22116
22117         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
22118         iteration while looking for indexers, this is needed because the
22119         indexer may have a different name in our base classes.  Fixed the
22120         error reporting (no indexers at all, not get accessor, no
22121         overloaded match).  Fixes bug #33089.
22122         (IndexerAccess.DoResolveLValue): Likewise.
22123
22124 2002-11-14  Martin Baulig  <martin@ximian.com>
22125
22126         * class.cs (PropertyBase.CheckBase): Make this work for multiple
22127         indexers.  Fixes the first part of bug #33089.
22128         (MethodSignature.InheritableMemberSignatureCompare): Added support
22129         for properties.
22130
22131 2002-11-13  Ravi Pratap  <ravi@ximian.com>
22132
22133         * attribute.cs (Attribute.Resolve): Catch the
22134         NullReferenceException and report it since it isn't supposed to
22135         happen. 
22136
22137 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
22138
22139         * expression.cs (Binary.EmitBranchable): Also handle the cases for
22140         LogicalOr and LogicalAnd that can benefit from recursively
22141         handling EmitBranchable.  The code now should be nice for Paolo.
22142
22143 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
22144
22145         * typemanager.cs (LookupType): Added a negative-hit hashtable for
22146         the Type lookups, as we perform quite a number of lookups on
22147         non-Types.  This can be removed once we can deterministically tell
22148         whether we have a type or a namespace in advance.
22149
22150         But this might require special hacks from our corlib.
22151
22152         * TODO: updated.
22153
22154         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
22155         and double which avoids a conversion from an integer to a double.
22156
22157         * expression.cs: tiny optimization, avoid calling IsConstant,
22158         because it effectively performs the lookup twice.
22159
22160 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
22161
22162         But a bogus return here to keep the semantics of the old code
22163         until the Mono runtime is fixed.
22164
22165         * pending.cs (GetMissingInterfaces): New method used to remove all
22166         the interfaces that are already implemented by our parent
22167         classes from the list of pending methods. 
22168
22169         * interface.cs: Add checks for calls after ResolveTypeExpr.
22170
22171 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
22172
22173         * class.cs (Class.Emit): Report warning 67: event not used if the
22174         warning level is beyond 3.
22175
22176         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
22177         being a NullLiteral.
22178
22179         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
22180         specifiers. 
22181
22182         * class.cs (TypeContainer.GetClassBases): Cover a missing code
22183         path that might fail if a type can not be resolved.
22184
22185         * expression.cs (Binary.Emit): Emit unsigned versions of the
22186         operators. 
22187
22188         * driver.cs: use error 5.
22189
22190 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
22191
22192         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
22193
22194 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
22195
22196         * cs-parser.jay (switch_section): A beautiful patch from Martin
22197         Baulig that fixed 33094.
22198
22199 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
22200
22201         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
22202         Check whether the base is abstract and report an error if so.
22203
22204         * expression.cs (IndexerAccess.DoResolveLValue,
22205         IndexerAccess.DoResolve): ditto. 
22206
22207         (Invocation.DoResolve): ditto.
22208
22209         (Invocation.FullMethodDesc): Improve the report string.
22210
22211         * statement.cs (Block): Eliminate IsVariableDefined as it is
22212         basically just a wrapper for GetVariableInfo.
22213
22214         * ecore.cs (SimpleName): Use new 
22215
22216         * support.cs (ReflectionParamter.ParameterType): We unwrap the
22217         type, as we return the actual parameter ref/unref state on a
22218         different call.
22219
22220 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
22221
22222         * support.cs: Return proper flags REF/OUT fixing the previous
22223         commit.  
22224
22225         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
22226         not used to mean `ref' but `ref or out' in ParameterReference
22227
22228         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
22229         full type signature instead of calling TypeManger.CSharpName
22230         ourselves. 
22231
22232         * support.cs (InternalParameters.ParameterDesc): Do not compare
22233         directly to the modflags, because REF/OUT will actually be bitsets
22234         if set. 
22235
22236         * delegate.cs (VerifyMethod): Check also the modifiers.
22237
22238         * cs-tokenizer.cs: Fix bug where floating point values with an
22239         exponent where a sign was missing was ignored.
22240
22241         * driver.cs: Allow multiple assemblies to be specified in a single
22242         /r: argument
22243
22244 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
22245
22246         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
22247         because identifiers after a parenthesis would end up in this kind
22248         of production, and we needed to desamiguate it for having casts
22249         like:
22250
22251                 (UserDefinedType *) xxx
22252
22253 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
22254
22255         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
22256         we should set on the Bindingflags.NonPublic, but not turn on
22257         private_ok.  private_ok controls whether a Private member is
22258         returned (this is chekced on the filter routine), while the
22259         BindingFlags.NonPublic just controls whether private/protected
22260         will be allowed.   This fixes the problem part of the problem of
22261         private properties being allowed to be used in derived classes.
22262
22263         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
22264         so we can call the children DoResolveLValue method (this will
22265         properly signal errors on lvalue assignments to base properties)
22266
22267         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
22268         getter are null, and we have a property info, we know that this
22269         happened because the lookup failed, so we report an error 122 for
22270         protection level violation.
22271
22272         We also silently return if setter and getter are null in the
22273         resolve functions, this condition only happens if we have flagged
22274         the error before.  This is the other half of the problem. 
22275
22276         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
22277         not have accessibility information, that is why we were returning
22278         true in the filter function in typemanager.cs.
22279
22280         To properly report 122 (property is inaccessible because of its
22281         protection level) correctly, we report this error in ResolveAccess
22282         by failing if both the setter and the getter are lacking (ie, the
22283         lookup failed). 
22284
22285         DoResolve and DoLResolve have been modified to check for both
22286         setter/getter being null and returning silently, the reason being
22287         that I did not want to put the knowledge about this error in upper
22288         layers, like:
22289
22290         int old = Report.Errors;
22291         x = new PropertyExpr (...);
22292         if (old != Report.Errors)
22293                 return null;
22294         else
22295                 return x;
22296
22297         So the property expr is returned, but it is invalid, so the error
22298         will be flagged during the resolve process. 
22299
22300         * class.cs: Remove InheritablePropertySignatureCompare from the
22301         class, as we no longer depend on the property signature to compute
22302         whether it is possible to implement a method or not.
22303
22304         The reason is that calling PropertyInfo.GetGetMethod will return
22305         null (in .NET, in Mono it works, and we should change this), in
22306         cases where the Get Method does not exist in that particular
22307         class.
22308
22309         So this code:
22310
22311         class X { public virtual int A { get { return 1; } } }
22312         class Y : X { }
22313         class Z : Y { public override int A { get { return 2; } } }
22314
22315         Would fail in Z because the parent (Y) would not have the property
22316         defined.  So we avoid this completely now (because the alternative
22317         fix was ugly and slow), and we now depend exclusively on the
22318         method names.
22319
22320         (PropertyBase.CheckBase): Use a method-base mechanism to find our
22321         reference method, instead of using the property.
22322
22323         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22324         routines are gone now.
22325
22326         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22327         names, they were incorrectly named.
22328
22329         * cs-tokenizer.cs: Return are more gentle token on failure. 
22330
22331         * pending.cs (PendingImplementation.InterfaceMethod): This routine
22332         had an out-of-sync index variable, which caused it to remove from
22333         the list of pending methods the wrong method sometimes.
22334
22335 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
22336
22337         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22338         CanWrite, because those refer to this particular instance of the
22339         property, and do not take into account the fact that we can
22340         override single members of a property.
22341
22342         Constructor requires an EmitContext.  The resolution process does
22343         not happen here, but we need to compute the accessors before,
22344         because the resolution does not always happen for properties.
22345
22346         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22347         subclass, before we did not update this flag, but we did update
22348         bindingflags. 
22349
22350         (GetAccessors): Drop this routine, as it did not work in the
22351         presence of partially overwritten set/get methods. 
22352
22353         Notice that this broke the cs1540 detection, but that will require
22354         more thinking. 
22355
22356 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22357
22358         * class.cs:
22359         * codegen.cs:
22360         * driver.cs: issue a warning instead of an error if we don't support
22361         debugging for the platform. Also ignore a couple of errors that may
22362         arise when trying to write the symbols. Undo my previous patch.
22363
22364 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22365
22366         * driver.cs: ignore /debug switch except for Unix platforms.
22367
22368 2002-10-23  Nick Drochak  <ndrochak@gol.com>
22369
22370         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22371
22372 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
22373
22374         * driver.cs: Do not make mcs-debug conditional, so we do not break
22375         builds that use it.
22376
22377         * statement.cs (UsageVector.MergeChildren): I would like Martin to
22378         review this patch.  But basically after all the children variables
22379         have been merged, the value of "Breaks" was not being set to
22380         new_breaks for Switch blocks.  I think that it should be set after
22381         it has executed.  Currently I set this to the value of new_breaks,
22382         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22383         conservative, but I do not understand this code very well.
22384
22385         I did not break anything in the build, so that is good ;-)
22386
22387         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22388
22389 2002-10-20  Mark Crichton  <crichton@gimp.org>
22390
22391         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
22392
22393 2002-10-20  Nick Drochak  <ndrochak@gol.com>
22394
22395         * cfold.cs: Fixed compile blocker.
22396
22397 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
22398
22399         * driver.cs: I was chekcing the key, not the file.
22400
22401 2002-10-19  Ravi Pratap  <ravi@ximian.com>
22402
22403         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22404         message that we were generating - we just need to silently return
22405         a null.
22406
22407 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
22408
22409         * class.cs (Event.Define): Change my previous commit, as this
22410         breaks the debugger.  This is a temporary hack, as it seems like
22411         the compiler is generating events incorrectly to begin with.
22412
22413         * expression.cs (Binary.ResolveOperator): Added support for 
22414         "U operator - (E x, E y)"
22415
22416         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22417         y)".
22418
22419         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22420         init-only variables, but this path did not take into account that
22421         there might be also instance readonly variables.  Correct this
22422         problem. 
22423
22424         This fixes bug 32253
22425
22426         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22427         delegates as well.
22428
22429         * driver.cs: Change the extension for modules to `netmodule'
22430
22431         * cs-parser.jay: Improved slightly the location tracking for
22432         the debugger symbols.
22433
22434         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22435         modifiers that were specified instead of the hardcoded value
22436         (FamAndAssem).  This was basically ignoring the static modifier,
22437         and others.  Fixes 32429.
22438
22439         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22440         fixed a bug in the process (32476)
22441
22442         * expression.cs (ArrayAccess.EmitAssign): Patch from
22443         hwang_rob@yahoo.ca that fixes bug 31834.3
22444
22445 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22446
22447         * driver.cs: Make the module extension .netmodule.
22448
22449 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * driver.cs: Report an error if the resource file is not found
22452         instead of crashing.
22453
22454         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22455         false, like Emit does.
22456
22457 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22458
22459         * typemanager.cs: Remove unused private member.  Also reported mcs
22460         bug to report this as a warning like csc.
22461
22462 2002-10-15  Martin Baulig  <martin@gnome.org>
22463
22464         * statement.cs (Statement.Emit): Made this a virtual method; emits
22465         the line number info and calls DoEmit().
22466         (Statement.DoEmit): New protected abstract method, formerly knows
22467         as Statement.Emit().
22468
22469         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22470
22471 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22472
22473         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22474         have fixed a remaining problem: not every AddXXXX was adding a
22475         fully qualified name.  
22476
22477         Now everyone registers a fully qualified name in the DeclSpace as
22478         being defined instead of the partial name.  
22479
22480         Downsides: we are slower than we need to be due to the excess
22481         copies and the names being registered this way.  
22482
22483         The reason for this is that we currently depend (on the corlib
22484         bootstrap for instance) that types are fully qualified, because
22485         we dump all the types in the namespace, and we should really have
22486         types inserted into the proper namespace, so we can only store the
22487         basenames in the defined_names array.
22488
22489 2002-10-10  Martin Baulig  <martin@gnome.org>
22490
22491         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22492         from bug #31834, see the bug report for a testcase which is
22493         miscompiled.
22494
22495 2002-10-10  Martin Baulig  <martin@gnome.org>
22496
22497         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22498         flow analysis code for this.
22499
22500         * statement.cs (Do, While, For): Tell the flow analysis code about
22501         infinite loops.
22502         (FlowBranching.UsageVector): Added support for infinite loops.
22503         (Block.Resolve): Moved the dead code elimination here and use flow
22504         analysis to do it.
22505
22506 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22507
22508         * class.cs (Field.Define): Catch cycles on struct type
22509         definitions. 
22510
22511         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22512         fields if the fields are static.  We only need to check instance
22513         fields. 
22514
22515         * expression.cs (As.DoResolve): Test for reference type.
22516
22517         * statement.cs (Using.ResolveExpression): Use
22518         ConvertImplicitRequired, not ConvertImplicit which reports an
22519         error on failture
22520         (Using.ResolveLocalVariableDecls): ditto.
22521
22522         * expression.cs (Binary.ResolveOperator): Report errors in a few
22523         places where we had to.
22524
22525         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22526
22527 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * expression.cs: Use StoreFromPtr instead of extracting the type
22530         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22531
22532         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22533         an enumeration value to a System.Enum, but System.Enum is not a
22534         value type, but an class type, so we need to box.
22535
22536         (Expression.ConvertExplicit): One codepath could return
22537         errors but not flag them.  Fix this.  Fixes #31853
22538
22539         * parameter.cs (Resolve): Do not allow void as a parameter type.
22540
22541 2002-10-06  Martin Baulig  <martin@gnome.org>
22542
22543         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22544         if it's a class type and not a struct.  Fixes #31815.
22545
22546 2002-10-06  Martin Baulig  <martin@gnome.org>
22547
22548         * statement.cs: Reworked the flow analysis code a bit to make it
22549         usable for dead code elimination.
22550
22551 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22552
22553         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22554
22555 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22556
22557         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22558         to fix the test 165, will investigate deeper.
22559
22560 2002-10-04  Martin Baulig  <martin@gnome.org>
22561
22562         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22563         finally blocks actually work.
22564         (Try.Resolve): We don't need to create a sibling for `finally' if
22565         there is no finally block.
22566
22567 2002-10-04  Martin Baulig  <martin@gnome.org>
22568
22569         * class.cs (Constructor.Define): The default accessibility for a
22570         non-default constructor is private, not public.
22571
22572 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22573
22574         * class.cs (Constructor): Make AllowedModifiers public, add
22575         EXTERN.
22576
22577         * cs-parser.jay: Perform the modifiers test here, as the
22578         constructor for the Constructor class usually receives a zero
22579         because of the way we create it (first we create, later we
22580         customize, and we were never checking the modifiers).
22581
22582         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22583         is a version of LookupTypeReflection that includes the type-name
22584         cache.  This can be used as a fast path for functions that know
22585         the fully qualified name and are only calling into *.GetType() to
22586         obtain a composed type.
22587
22588         This is also used by TypeManager.LookupType during its type
22589         composition.
22590
22591         (LookupType): We now also track the real type name, as sometimes
22592         we can get a quey for the real type name from things like
22593         ComposedCast.  This fixes bug 31422.
22594
22595         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22596         complete type fullname, it does not have to go through the type
22597         resolution system to obtain the composed version of the type (for
22598         obtaining arrays or pointers).
22599
22600         (Conditional.Emit): Use the EmitBoolExpression to
22601         generate nicer code, as requested by Paolo.
22602
22603         (ArrayCreation.CheckIndices): Use the patch from
22604         hwang_rob@yahoo.ca to validate the array initializers. 
22605
22606 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22607
22608         * class.cs (ConstructorInitializer.Emit): simplify code by using
22609         Invocation.EmitCall, and at the same time, fix the bugs in calling
22610         parent constructors that took variable arguments. 
22611
22612         * ecore.cs (Expression.ConvertNumericExplicit,
22613         Expression.ImplicitNumericConversion): Remove the code that
22614         manually wrapped decimal (InternalTypeConstructor call is now gone
22615         as well).
22616
22617         * expression.cs (Cast.TryReduce): Also handle decimal types when
22618         trying to perform a constant fold on the type.
22619
22620         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22621
22622         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22623         that only turned off an error report, and did nothing else. 
22624
22625 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22626
22627         * driver.cs: Handle and ignore /fullpaths
22628
22629 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22630
22631         * expression.cs (Binary.ResolveOperator): Catch the case where
22632         DoNumericPromotions returns true, 
22633
22634         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22635
22636 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22637
22638         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22639         report error 70.
22640
22641 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22642
22643         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22644         conversion exists, but it is also required that the conversion be
22645         performed.  This manifested in "(Type64Enum) 2".  
22646
22647         * class.cs (TypeManager.AddMethod): The fix is not to change
22648         AddEnum, because that one was using a fully qualified name (every
22649         DeclSpace derivative does), but to change the AddMethod routine
22650         that was using an un-namespaced name.  This now correctly reports
22651         the duplicated name.
22652
22653         Revert patch until I can properly fix it.  The issue
22654         is that we have a shared Type space across all namespaces
22655         currently, which is wrong.
22656
22657         Options include making the Namespace a DeclSpace, and merge
22658         current_namespace/current_container in the parser.
22659
22660 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22661
22662         * cs-parser.jay: Improve error reporting when we get a different
22663         kind of expression in local_variable_type and
22664         local_variable_pointer_type. 
22665
22666         Propagate this to avoid missleading errors being reported.
22667
22668         * ecore.cs (ImplicitReferenceConversion): treat
22669         TypeManager.value_type as a target just like object_type.   As
22670         code like this:
22671
22672         ValueType v = 1;
22673
22674         Is valid, and needs to result in the int 1 being boxed before it
22675         is assigned to the value type v.
22676
22677         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22678         to validate the enumeration name.
22679
22680         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22681         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22682         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22683
22684         * ecore.cs (TryImplicitIntConversion): When doing an
22685         implicit-enumeration-conversion, check if the type is 64-bits and
22686         perform a conversion before passing to EnumConstant.
22687
22688 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22689
22690         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22691         report ambiguous type references.  Unlike the MS version, we
22692         report what the ambiguity is.   Innovation at work ;-)
22693
22694         (DeclSpace.FindType): Require a location argument to
22695         display when we display an ambiguous error.
22696
22697         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22698
22699         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22700
22701         * expression.cs (EmitDynamicInitializers): Apply patch from
22702         hwang_rob@yahoo.ca that fixes the order in which we emit our
22703         initializers. 
22704
22705 2002-09-21  Martin Baulig  <martin@gnome.org>
22706
22707         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22708         delegate takes no arguments.
22709
22710 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22711
22712         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22713         from integers.
22714
22715         * expression.cs: Extract the underlying type.
22716
22717         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22718
22719         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22720
22721 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22722
22723         * class.cs (TypeContainer.DefineType): We can not use the nice
22724         PackingSize with the size set to 1 DefineType method, because it
22725         will not allow us to define the interfaces that the struct
22726         implements.
22727
22728         This completes the fixing of bug 27287
22729
22730         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22731         means also structs.  This fixes part of the problem. 
22732         (Expresion.ImplicitReferenceConversionExists): ditto.
22733
22734         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22735         error if there were no errors reported during the type lookup
22736         process, to avoid duplicates or redundant errors.  Without this
22737         you would get an ambiguous errors plus a type not found.  We have
22738         beaten the user enough with the first error.  
22739
22740         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22741         reference. 
22742
22743         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22744         during the resolution process, stop the lookup, this avoids
22745         repeated error reports (same error twice).
22746
22747         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22748
22749         * typemanager.cs (LookupType): Redo the type lookup code to match
22750         the needs of System.Reflection.  
22751
22752         The issue is that System.Reflection requires references to nested
22753         types to begin with a "+" sign instead of a dot.  So toplevel
22754         types look like: "NameSpace.TopLevelClass", and nested ones look
22755         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22756         levels. 
22757
22758 2002-09-19  Martin Baulig  <martin@gnome.org>
22759
22760         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22761         says that a method always returns or always throws an exception,
22762         don't report the CS0161.
22763
22764         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22765         set `Returns = new_returns'.
22766
22767 2002-09-19  Martin Baulig  <martin@gnome.org>
22768
22769         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22770         to an enum constant, check for a CS0176.
22771
22772 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22773
22774         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22775         for operators that must be in pairs and report errors.
22776
22777         * ecore.cs (SimpleName.DoResolveType): During the initial type
22778         resolution process, when we define types recursively, we must
22779         check first for types in our current scope before we perform
22780         lookups in the enclosing scopes.
22781
22782         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22783
22784         (Invocation.VerifyArgumentsCompat): Call
22785         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22786         I thought we were supposed to always call this, but there are a
22787         few places in the code where we dont do it.
22788
22789 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22790
22791         * driver.cs: Add support in -linkres and -resource to specify the
22792         name of the identifier.
22793
22794 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22795
22796         * ecore.cs (StandardConversionExists): Sync with the conversion
22797         code: allow anything-* to void* conversions.
22798
22799         (FindMostSpecificSource): Use an Expression argument
22800         instead of a Type, because we might be handed over a Literal which
22801         gets a few more implicit conversions that plain types do not.  So
22802         this information was being lost.
22803
22804         Also, we drop the temporary type-holder expression when not
22805         required.
22806
22807 2002-09-17  Martin Baulig  <martin@gnome.org>
22808
22809         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22810         this is an explicit interface implementation.
22811
22812 2002-09-17  Martin Baulig  <martin@gnome.org>
22813
22814         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22815         different `IndexerName' attributes.
22816
22817         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22818         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22819         virtual CommonResolve().
22820
22821 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22822
22823         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22824         and convert that to the UnderlyingType.
22825
22826         * statement.cs (Foreach.Resolve): Indexers are just like variables
22827         or PropertyAccesses.
22828
22829         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22830         inside quoted strings, we were not doing this before.
22831
22832 2002-09-16  Martin Baulig  <martin@gnome.org>
22833
22834         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22835         resolve it.  This is needed for the definite assignment check of the
22836         instance expression, fixes bug #29846.
22837         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22838
22839 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22840
22841         * parameter.cs: Fix compile error.  Cannot reference static member
22842         from an instance object.  Is this an mcs bug?
22843
22844 2002-09-14  Martin Baulig  <martin@gnome.org>
22845
22846         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22847         multiple times.  Fixes bug #30295, added test-166.cs.
22848
22849 2002-09-14  Martin Baulig  <martin@gnome.org>
22850
22851         * statement.cs (Block.Emit): Don't emit unreachable code.
22852         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22853         `break' statements.
22854         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22855
22856 2002-09-14  Martin Baulig  <martin@gnome.org>
22857
22858         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22859         is set.
22860
22861 2002-09-14  Martin Baulig  <martin@gnome.org>
22862
22863         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22864         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22865         be false on the ms runtime.
22866
22867 2002-09-13  Martin Baulig  <martin@gnome.org>
22868
22869         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22870         the CS0038 error message.
22871
22872 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22873
22874         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22875         constant inside, return it.
22876
22877 2002-09-12  Martin Baulig  <martin@gnome.org>
22878
22879         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22880         implicit conversion can be done between enum types.
22881
22882         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22883         check whether an implicit conversion to the current enum's UnderlyingType
22884         exists and report an error if not.
22885
22886         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22887         without debugging support.
22888
22889         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22890         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22891
22892 2002-09-12  Martin Baulig  <martin@gnome.org>
22893
22894         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22895
22896         * ecore.cs (IMemberExpr.DeclaringType): New property.
22897         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22898         nonstatic member of an outer type (CS0038).
22899
22900 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22901
22902         * driver.cs: Activate the using-error detector at warning level
22903         4 (at least for MS-compatible APIs).
22904
22905         * namespace.cs (VerifyUsing): Small buglett fix.
22906
22907         * pending.cs (PendingImplementation): pass the container pointer. 
22908
22909         * interface.cs (GetMethods): Allow for recursive definition.  Long
22910         term, I would like to move every type to support recursive
22911         definitions, not the current ordering mechanism that we have right
22912         now.
22913
22914         The situation is this: Attributes are handled before interfaces,
22915         so we can apply attributes to interfaces.  But some attributes
22916         implement interfaces, we will now handle the simple cases
22917         (recursive definitions will just get an error).  
22918
22919         * parameter.cs: Only invalidate types at the end if we fail to
22920         lookup all types.  
22921
22922 2002-09-09  Martin Baulig  <martin@gnome.org>
22923
22924         * ecore.cs (PropertyExpr.Emit): Also check for
22925         TypeManager.system_int_array_get_length so this'll also work when
22926         compiling corlib.  Fixes #30003.
22927
22928 2002-09-09  Martin Baulig  <martin@gnome.org>
22929
22930         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22931         and throw an exception if we can't get the type's size.  Fixed #30040,
22932         added test-165.cs.
22933
22934 2002-09-09  Martin Baulig  <martin@gnome.org>
22935
22936         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22937
22938         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22939         context.  Fixes bug #30027.
22940
22941         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22942         virtual functions.  Fixes bug #30043, added test-164.cs.
22943
22944 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22945
22946         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22947
22948 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22949
22950         * driver.cs: Use an object to get the windows codepage since it's not a
22951         static property.
22952
22953 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * statement.cs (For.Emit): for infinite loops (test == null)
22956         return whether there is a break inside, not always "true".
22957
22958         * namespace.cs (UsingEntry): New struct to hold the name of the
22959         using definition, the location where it is defined, and whether it
22960         has been used in a successful type lookup.
22961
22962         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22963         strings.
22964
22965         * decl.cs: ditto.
22966
22967 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22968
22969         * attribute.cs : Fix incorrect code which relied on catching
22970         a NullReferenceException to detect a null being passed in
22971         where an object was expected.
22972
22973 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * statement.cs (Try): flag the catch variable as assigned
22976
22977         * expression.cs (Cast): Simplified by using ResolveType instead of
22978         manually resolving.
22979
22980         * statement.cs (Catch): Fix bug by using ResolveType.
22981
22982 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22983
22984         * expression.cs (BetterConversion): Special case for when we have
22985         a NullLiteral as the argument and we have to choose between string
22986         and object types - we choose string the way csc does.
22987
22988         * attribute.cs (Attribute.Resolve): Catch the
22989         NullReferenceException and report error #182 since the Mono
22990         runtime no more has the bug and having this exception raised means
22991         we tried to select a constructor which takes an object and is
22992         passed a null.
22993
22994 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22995
22996         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22997         message (1502, 1503) when we can't locate a method after overload
22998         resolution. This is much more informative and closes the bug
22999         Miguel reported.
23000
23001         * interface.cs (PopulateMethod): Return if there are no argument
23002         types. Fixes a NullReferenceException bug.
23003
23004         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23005         expressions too. Previously we were checking only in one place for
23006         positional arguments leaving out named arguments.
23007
23008         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23009         type to the enum type is not allowed. Remove code corresponding to
23010         that.
23011
23012         (ConvertNumericExplicit): Allow explicit conversions from
23013         the underlying type to enum type. This precisely follows the spec
23014         and closes a bug filed by Gonzalo.
23015
23016 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23017
23018         * compiler.csproj:
23019         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23020
23021 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
23022
23023         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23024         it was important that we stored the right value after the
23025         reduction in `converted'.
23026
23027 2002-09-04  Martin Baulig  <martin@gnome.org>
23028
23029         * location.cs (Location.SymbolDocument): Use full pathnames for the
23030         source files.
23031
23032 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
23033
23034         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
23035         of the expression resolve mechanism, because that will catch the
23036         SimpleName error failures.
23037
23038         (Conditional): If we can not resolve the
23039         expression, return, do not crash.
23040
23041 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23042
23043         * cs-tokenizer.cs:
23044         (location): display token name instead of its number.
23045
23046 2002-08-28  Martin Baulig  <martin@gnome.org>
23047
23048         * expression.cs (Binary.ResolveOperator): Don't silently return
23049         but return an error if an operator cannot be applied between two
23050         enum types.
23051
23052 2002-08-28  Martin Baulig  <martin@gnome.org>
23053
23054         * class.cs (Constructor.Define): Set the permission attributes
23055         correctly instead of making all constructors public.
23056
23057 2002-08-28  Martin Baulig  <martin@gnome.org>
23058
23059         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
23060         for private members before reporting a CS0103; if we find anything,
23061         it's a CS0122.
23062
23063 2002-08-28  Martin Baulig  <martin@gnome.org>
23064
23065         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
23066         to check whether `closure_start_type == closure_invocation_type',
23067         we also need to check whether `m.DeclaringType == closure_invocation_type'
23068         before bypassing the permission checks.  We might be accessing
23069         protected/private members from the base class.
23070         (TypeManager.RealMemberLookup): Only set private_ok if private
23071         members were requested via BindingFlags.NonPublic.
23072
23073         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
23074
23075         * expression.cs (MemberAccess.ResolveMemberAccess): Set
23076         MethodGroupExpr.IsExplicitImpl if appropriate.
23077         (Invocation.DoResolve): Don't report the CS0120 for explicit
23078         interface implementations.
23079
23080 2002-08-27  Martin Baulig  <martin@gnome.org>
23081
23082         * expression.cs (Invocation.DoResolve): If this is a static
23083         method and we don't have an InstanceExpression, we must report
23084         a CS0120.
23085
23086 2002-08-25  Martin Baulig  <martin@gnome.org>
23087
23088         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
23089         `==' between a valuetype and an object.
23090
23091 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
23092
23093         * ecore.cs (TypeExpr): Provide a ToString method.
23094
23095 2002-08-24  Martin Baulig  <martin@gnome.org>
23096
23097         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
23098         now called proggie.dbg and it's a binary file.
23099
23100 2002-08-23  Martin Baulig  <martin@gnome.org>
23101
23102         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
23103
23104 2002-08-23  Martin Baulig  <martin@gnome.org>
23105
23106         * struct.cs (MyStructInfo.ctor): Make this work with empty
23107         structs; it's not allowed to use foreach() on null.
23108
23109 2002-08-23  Martin Baulig  <martin@gnome.org>
23110
23111         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
23112         writer the full pathname of the generated assembly.
23113
23114 2002-08-23  Martin Baulig  <martin@gnome.org>
23115
23116         * statements.cs (FlowBranching.UsageVector.MergeChildren):
23117         A `finally' block never returns or breaks; improved handling of
23118         unreachable code.
23119
23120 2002-08-23  Martin Baulig  <martin@gnome.org>
23121
23122         * statement.cs (Throw.Resolve): Allow `throw null'.
23123
23124 2002-08-23  Martin Baulig  <martin@gnome.org>
23125
23126         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
23127         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
23128         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
23129         MemberLookup would return a wrong event if this is an explicit
23130         interface implementation and the class has an event with the same
23131         name.
23132
23133 2002-08-23  Martin Baulig  <martin@gnome.org>
23134
23135         * statement.cs (Block.AddChildVariableNames): New public method.
23136         (Block.AddChildVariableName): Likewise.
23137         (Block.IsVariableNameUsedInChildBlock): Likewise.
23138         (Block.AddVariable): Check whether a variable name has already
23139         been used in a child block.
23140
23141         * cs-parser.jay (declare_local_variables): Mark all variable names
23142         from the current block as being used in a child block in the
23143         implicit block.
23144
23145 2002-08-23  Martin Baulig  <martin@gnome.org>
23146
23147         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
23148         find the symbol writer.
23149
23150         * driver.cs: csc also allows the arguments to /define being
23151         separated by commas, not only by semicolons.
23152
23153 2002-08-23  Martin Baulig  <martin@gnome.org>
23154
23155         * interface.cs (Interface.GetMembers): Added static check for events.
23156
23157 2002-08-15  Martin Baulig  <martin@gnome.org>
23158
23159         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
23160         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
23161
23162         * ecore.cs (Expression.MemberLookup): Added documentation and explained
23163         why the MethodData.EmitDestructor() change was necessary.
23164
23165 2002-08-20  Martin Baulig  <martin@gnome.org>
23166
23167         * class.cs (TypeContainer.FindMembers): Added static check for events.
23168
23169         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
23170
23171         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
23172         use Type.GetEvents(), not Type.FindMembers().
23173
23174 2002-08-20  Martin Baulig  <martin@gnome.org>
23175
23176         * decl.cs (MemberCache): Added a special method cache which will
23177         be used for method-only searched.  This ensures that a method
23178         search will return a MethodInfo with the correct ReflectedType for
23179         inherited methods.      
23180
23181 2002-08-20  Martin Baulig  <martin@gnome.org>
23182
23183         * decl.cs (DeclSpace.FindMembers): Made this public.
23184
23185 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23186
23187         * delegate.cs: fixed build on windows.
23188         [FIXME:  Filed as bug #29150: MCS must report these errors.]
23189
23190 2002-08-19  Ravi Pratap  <ravi@ximian.com>
23191
23192         * ecore.cs (StandardConversionExists): Return a false
23193         if we are trying to convert the void type to anything else
23194         since that is not allowed.
23195
23196         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
23197         we flag error 70 in the event an event is trying to be accessed
23198         directly from outside the declaring type.
23199
23200 2002-08-20  Martin Baulig  <martin@gnome.org>
23201
23202         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
23203         MemberCache from typemanager.cs to decl.cs.
23204
23205 2002-08-19  Martin Baulig  <martin@gnome.org>
23206
23207         * class.cs (TypeContainer): Implement IMemberContainer.
23208         (TypeContainer.DefineMembers): Create the MemberCache.
23209         (TypeContainer.FindMembers): Do better BindingFlags checking; only
23210         return public members if BindingFlags.Public was given, check
23211         whether members are static.
23212
23213 2002-08-16  Martin Baulig  <martin@gnome.org>
23214
23215         * decl.cs (DeclSpace.Define): Splitted this in Define and
23216         DefineMembers.  DefineMembers is called first and initializes the
23217         MemberCache.
23218
23219         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
23220         DefineMembers() on all our DeclSpaces.
23221
23222         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
23223         but call DefineMembers() on all nested interfaces.  We call their
23224         Define() in our new Define() function.
23225
23226         * interface.cs (Interface): Implement IMemberContainer.
23227         (Interface.Define): Moved all code except the attribute stuf to
23228         DefineMembers().
23229         (Interface.DefineMembers): Initialize the member cache.
23230
23231         * typemanager.cs (IMemberFinder): Removed this interface, we don't
23232         need this anymore since we can use MemberCache.FindMembers directly.
23233
23234 2002-08-19  Martin Baulig  <martin@gnome.org>
23235
23236         * typemanager.cs (MemberCache): When creating the cache for an
23237         interface type, add all inherited members.
23238         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
23239         to `out bool used_cache' and documented it.
23240         (TypeManager.MemberLookup): If we already used the cache in the first
23241         iteration, we don't need to do the interfaces check.
23242
23243 2002-08-19  Martin Baulig  <martin@gnome.org>
23244
23245         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
23246         here from IMemberFinder and don't implement this interface anymore.
23247         (DeclSpace.MemberCache): Moved here from IMemberFinder.
23248
23249         * typemanager.cs (IMemberFinder): This interface is now only used by
23250         classes which actually support the member cache.
23251         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
23252         since we only put DeclSpaces into this Hashtable.
23253         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
23254         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
23255
23256 2002-08-16  Martin Baulig  <martin@gnome.org>
23257
23258         * typemanager.cs (ICachingMemberFinder): Removed.
23259         (IMemberFinder.MemberCache): New property.
23260         (TypeManager.FindMembers): Merged this with RealFindMembers().
23261         This function will never be called from TypeManager.MemberLookup()
23262         so we can't use the cache here, just the IMemberFinder.
23263         (TypeManager.MemberLookup_FindMembers): Check whether the
23264         IMemberFinder has a MemberCache and call the cache's FindMembers
23265         function.
23266         (MemberCache): Rewrote larger parts of this yet another time and
23267         cleaned it up a bit.
23268
23269 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
23270
23271         * driver.cs (LoadArgs): Support quoting.
23272
23273         (Usage): Show the CSC-like command line arguments.
23274
23275         Improved a few error messages.
23276
23277 2002-08-15  Martin Baulig  <martin@gnome.org>
23278
23279         * typemanager.cs (IMemberContainer.Type): New property.
23280         (IMemberContainer.IsInterface): New property.
23281
23282         The following changes are conditional to BROKEN_RUNTIME, which is
23283         defined at the top of the file.
23284
23285         * typemanager.cs (MemberCache.MemberCache): Don't add the base
23286         class'es members, but add all members from TypeHandle.ObjectType
23287         if we're an interface.
23288         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
23289         is the current type.
23290         (MemberCache.CacheEntry.Container): Removed this field.
23291         (TypeHandle.GetMembers): Include inherited members.
23292
23293 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23294
23295         * typemanager.cs: fixed compilation and added a comment on a field that
23296         is never used.
23297
23298 2002-08-15  Martin Baulig  <martin@gnome.org>
23299
23300         * class.cs (ConstructorInitializer.Resolve): In the
23301         Expression.MemberLookup call, use the queried_type as
23302         invocation_type.
23303
23304         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23305         declared' attribute, it's always true.
23306         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23307         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23308         temporary wrapper for FindMembers which tells MemberLookup whether
23309         members from the base classes are included in the return value.
23310         This will go away soon.
23311         (TypeManager.MemberLookup): Use this temporary hack here; once the
23312         new MemberCache is completed, we don't need to do the DeclaredOnly
23313         looping here anymore since the MemberCache will take care of this.
23314         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23315         (MemberCache): When creating the MemberCache for a class, get
23316         members from the current class and all its base classes.
23317         (MemberCache.CacheEntry.Container): New field.  This is a
23318         temporary hack until the Mono runtime is fixed to distinguish
23319         between ReflectedType and DeclaringType.  It allows us to use MCS
23320         with both the MS runtime and the unfixed Mono runtime without
23321         problems and without accecting performance.
23322         (MemberCache.SearchMembers): The DeclaredOnly looping from
23323         TypeManager.MemberLookup is now done here.      
23324
23325 2002-08-14  Martin Baulig  <martin@gnome.org>
23326
23327         * statement.cs (MyStructInfo.MyStructInfo): Don't call
23328         Type.GetFields on dynamic types but get the fields from the
23329         corresponding TypeContainer.
23330         (MyStructInfo.GetStructInfo): Added check for enum types.
23331
23332         * typemanager.cs (MemberList.IsSynchronized): Implemented.
23333         (MemberList.SyncRoot): Implemented.
23334         (TypeManager.FilterWithClosure): No need to check permissions if
23335         closure_start_type == closure_invocation_type, don't crash if
23336         closure_invocation_type is null.
23337
23338 2002-08-13  Martin Baulig  <martin@gnome.org>
23339
23340         Rewrote TypeContainer.FindMembers to use a member cache.  This
23341         gives us a speed increase of about 35% for the self-hosting MCS
23342         build and of about 15-20% for the class libs (both on GNU/Linux).
23343
23344         * report.cs (Timer): New class to get enhanced profiling.  This
23345         whole class is "TIMER" conditional since it remarkably slows down
23346         compilation speed.
23347
23348         * class.cs (MemberList): New class.  This is an IList wrapper
23349         which we're now using instead of passing MemberInfo[]'s around to
23350         avoid copying this array unnecessarily.
23351         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23352         (ICachingMemberFinder, IMemberContainer): New interface.
23353         (TypeManager.FilterWithClosure): If `criteria' is null, the name
23354         has already been checked, otherwise use it for the name comparision.
23355         (TypeManager.FindMembers): Renamed to RealMemberFinder and
23356         provided wrapper which tries to use ICachingMemberFinder.FindMembers
23357         if possible.  Returns a MemberList, not a MemberInfo [].
23358         (TypeHandle): New class, implements IMemberContainer.  We create
23359         one instance of this class per type, it contains a MemberCache
23360         which is used to do the member lookups.
23361         (MemberCache): New class.  Each instance of this class contains
23362         all members of a type and a name-based hash table.
23363         (MemberCache.FindMembers): This is our new member lookup
23364         function.  First, it looks up all members of the requested name in
23365         the hash table.  Then, it walks this list and sorts out all
23366         applicable members and returns them.
23367
23368 2002-08-13  Martin Baulig  <martin@gnome.org>
23369
23370         In addition to a nice code cleanup, this gives us a performance
23371         increase of about 1.4% on GNU/Linux - not much, but it's already
23372         half a second for the self-hosting MCS compilation.
23373
23374         * typemanager.cs (IMemberFinder): New interface.  It is used by
23375         TypeManager.FindMembers to call FindMembers on a TypeContainer,
23376         Enum, Delegate or Interface.
23377         (TypeManager.finder_to_member_finder): New PtrHashtable.
23378         (TypeManager.finder_to_container): Removed.
23379         (TypeManager.finder_to_delegate): Removed.
23380         (TypeManager.finder_to_interface): Removed.
23381         (TypeManager.finder_to_enum): Removed.
23382
23383         * interface.cs (Interface): Implement IMemberFinder.
23384
23385         * delegate.cs (Delegate): Implement IMemberFinder.
23386
23387         * enum.cs (Enum): Implement IMemberFinder.
23388
23389         * class.cs (TypeContainer): Implement IMemberFinder.
23390
23391 2002-08-12  Martin Baulig  <martin@gnome.org>
23392
23393         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23394
23395 2002-08-12  Martin Baulig  <martin@gnome.org>
23396
23397         * ecore.cs (ITypeExpression): New interface for expressions which
23398         resolve to a type.
23399         (TypeExpression): Renamed to TypeLookupExpression.
23400         (Expression.DoResolve): If we're doing a types-only lookup, the
23401         expression must implement the ITypeExpression interface and we
23402         call DoResolveType() on it.
23403         (SimpleName): Implement the new ITypeExpression interface.
23404         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23405         hack, the situation that we're only looking up types can't happen
23406         anymore when this method is called.  Moved the type lookup code to
23407         DoResolveType() and call it.
23408         (SimpleName.DoResolveType): This ITypeExpression interface method
23409         is now doing the types-only lookup.
23410         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23411         (ResolveFlags): Added MaskExprClass.
23412
23413         * expression.cs (MemberAccess): Implement the ITypeExpression
23414         interface.
23415         (MemberAccess.DoResolve): Added support for a types-only lookup
23416         when we're called via ITypeExpression.DoResolveType().
23417         (ComposedCast): Implement the ITypeExpression interface.
23418
23419         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23420         Expression.Resolve() with ResolveFlags.Type instead.
23421
23422 2002-08-12  Martin Baulig  <martin@gnome.org>
23423
23424         * interface.cs (Interface.Define): Apply attributes.
23425
23426         * attribute.cs (Attribute.ApplyAttributes): Added support for
23427         interface attributes.
23428
23429 2002-08-11  Martin Baulig  <martin@gnome.org>
23430
23431         * statement.cs (Block.Emit): Only check the "this" variable if we
23432         do not always throw an exception.
23433
23434         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23435         whether the property has a set accessor.
23436
23437 2002-08-11  Martin Baulig  <martin@gnome.org>
23438
23439         Added control flow analysis support for structs.
23440
23441         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23442         with control flow analysis turned off.
23443         (IVariable): New interface.
23444         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23445         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23446         (FieldExpr.DoResolve): Resolve the instance expression with flow
23447         analysis turned off and do the definite assignment check after the
23448         resolving when we know what the expression will resolve to.
23449
23450         * expression.cs (LocalVariableReference, ParameterReference):
23451         Implement the new IVariable interface, only call the flow analysis
23452         code if ec.DoFlowAnalysis is true.
23453         (This): Added constructor which takes a Block argument.  Implement
23454         the new IVariable interface.
23455         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23456         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23457         This does the definite assignment checks for struct members.
23458
23459         * class.cs (Constructor.Emit): If this is a non-static `struct'
23460         constructor which doesn't have any initializer, call
23461         Block.AddThisVariable() to tell the flow analysis code that all
23462         struct elements must be initialized before control returns from
23463         the constructor.
23464
23465         * statement.cs (MyStructInfo): New public class.
23466         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23467         argument to this indexer.  If non-zero, check an individual struct
23468         member, not the whole struct.
23469         (FlowBranching.CheckOutParameters): Check struct members.
23470         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23471         overloaded versions of these methods which take an additional
23472         `int field_idx' argument to check struct members.
23473         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23474         overloaded versions of these methods which take an additional
23475         `string field_name' argument to check struct member.s
23476         (VariableInfo): Implement the IVariable interface.
23477         (VariableInfo.StructInfo): New public property.  Returns the
23478         MyStructInfo instance of the variable if it's a struct or null.
23479         (Block.AddThisVariable): New public method.  This is called from
23480         Constructor.Emit() for non-static `struct' constructor which do
23481         not have any initializer.  It creates a special variable for the
23482         "this" instance variable which will be checked by the flow
23483         analysis code to ensure that all of the struct's fields are
23484         initialized before control returns from the constructor.
23485         (UsageVector): Added support for struct members.  If a
23486         variable/parameter is a struct with N members, we reserve a slot
23487         in the usage vector for each member.  A struct is considered fully
23488         initialized if either the struct itself (slot 0) or all its
23489         members are initialized.
23490
23491 2002-08-08  Martin Baulig  <martin@gnome.org>
23492
23493         * driver.cs (Driver.MainDriver): Only report an error CS5001
23494         if there were no compilation errors.
23495
23496         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23497         `UnsafeContext' property to determine whether the parent is in
23498         unsafe context rather than checking the parent's ModFlags:
23499         classes nested in an unsafe class are unsafe as well.
23500
23501 2002-08-08  Martin Baulig  <martin@gnome.org>
23502
23503         * statement.cs (UsageVector.MergeChildren): Distinguish between
23504         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23505         we return.  Added test17() and test18() to test-154.cs.
23506
23507 2002-08-08  Martin Baulig  <martin@gnome.org>
23508
23509         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23510         Family access, make sure the invoking type isn't a subclass of the
23511         queried type (that'd be a CS1540).
23512
23513         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23514         this method which takes an additional `Type invocation_type'.
23515
23516         * expression.cs (BaseAccess.DoResolve): Use the base type as
23517         invocation and query type.
23518         (MemberAccess.DoResolve): If the lookup failed and we're about to
23519         report a CS0122, try a lookup with the ec.ContainerType - if this
23520         succeeds, we must report a CS1540.
23521
23522 2002-08-08  Martin Baulig  <martin@gnome.org>
23523
23524         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23525         (MethodGroupExpr): Implement the IMemberExpr interface.
23526
23527         * expression (MemberAccess.ResolveMemberAccess): No need to have
23528         any special code for MethodGroupExprs anymore, they're now
23529         IMemberExprs.   
23530
23531 2002-08-08  Martin Baulig  <martin@gnome.org>
23532
23533         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23534         Family, FamANDAssem and FamORAssem permissions.
23535         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23536
23537 2002-08-08  Martin Baulig  <martin@gnome.org>
23538
23539         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23540         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23541         or loop block.
23542
23543 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23544
23545         * driver.cs: implemented /resource option to embed managed resources.
23546
23547 2002-08-07  Martin Baulig  <martin@gnome.org>
23548
23549         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23550         (FieldBase.HasFieldInitializer): New public property.
23551         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23552         returns the field initializer and makes sure it is only resolved once.
23553         (TypeContainer.EmitFieldInitializers): Call
23554         FieldBase.GetInitializerExpression to get the initializer, this ensures
23555         that it isn't resolved multiple times.
23556
23557         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23558         the resolving process (SimpleName/MemberLookup) that we're currently
23559         emitting a field initializer (which must not access any instance members,
23560         this is an error CS0236).
23561
23562         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23563         argument, if the `IsFieldInitializer' flag is set, we must report and
23564         error CS0236 and not an error CS0120.   
23565
23566 2002-08-07  Martin Baulig  <martin@gnome.org>
23567
23568         * ecore.cs (IMemberExpr): New public interface.
23569         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23570         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23571         if the expression is an IMemberExpr.
23572
23573         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23574         to be null, implicitly default to `this' if we're non-static in
23575         this case.  Simplified the code a lot by using the new IMemberExpr
23576         interface.  Also fixed bug #28176 here.
23577
23578 2002-08-06  Martin Baulig  <martin@gnome.org>
23579
23580         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23581         ParameterReferences during semantic analysis so that we can do a
23582         type-only search when resolving Cast, TypeOf and SizeOf.
23583         (block): Pass the `current_local_parameters' to the Block's
23584         constructor.
23585
23586         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23587         argument to the constructor.
23588         (ConstructorInitializer.Resolve): Create a temporary implicit
23589         block with the parameters.
23590
23591         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23592         references here if we aren't doing a type-only search.
23593
23594         * statement.cs (Block): Added constructor which takes a
23595         `Parameters parameters' argument.
23596         (Block.Parameters): New public property.
23597
23598         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23599         to `Parameters' and made it public readonly.
23600
23601 2002-08-06  Martin Baulig  <martin@gnome.org>
23602
23603         * ecore.cs (Expression.Warning): Made this public as well.
23604
23605         * report.cs (Report.Debug): Print the contents of collections.
23606
23607 2002-08-06  Martin Baulig  <martin@gnome.org>
23608
23609         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23610         used to tell Resolve() which kinds of expressions it may return.
23611         (Expression.Resolve): Added overloaded version of this method which
23612         takes a `ResolveFlags flags' argument.  This can be used to tell
23613         Resolve() which kinds of expressions it may return.  Reports a
23614         CS0118 on error.
23615         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23616         ResolveFlags.SimpleName.
23617         (Expression.Error118): Added overloaded version of this method which
23618         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23619         which kinds of expressions are allowed.
23620
23621         * expression.cs (Argument.ResolveMethodGroup): New public method.
23622         Resolves an argument, but allows a MethodGroup to be returned.
23623         This is used when invoking a delegate.
23624
23625         * TODO: Updated a bit.
23626
23627 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23628
23629         Fixed compilation with csc.
23630
23631         * ecore.cs: Expression.Error made public. Is this correct? Should
23632         Warning be made public too?
23633
23634         * expression.cs: use ea.Location instead of ea.loc.
23635         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23636
23637 2002-08-06  Martin Baulig  <martin@gnome.org>
23638
23639         * ecore.cs (Expression.loc): Moved the location here instead of
23640         duplicating it in all derived classes.
23641         (Expression.Location): New public property.
23642         (Expression.Error, Expression.Warning): Made them non-static and
23643         removed the location argument.
23644         (Expression.Warning): Added overloaded version which takes an
23645         `int level' argument.
23646         (Expression.Error118): Make this non-static and removed the
23647         expression and location arguments.
23648         (TypeExpr): Added location argument to the constructor.
23649
23650         * expression.cs (StaticCallExpr): Added location argument to
23651         the constructor.
23652         (Indirection, PointerArithmetic): Likewise.
23653         (CheckedExpr, UnCheckedExpr): Likewise.
23654         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23655         (StringPtr): Likewise.
23656
23657
23658 2002-08-05  Martin Baulig  <martin@gnome.org>
23659
23660         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23661
23662         * assign.cs (Assign.DoResolve): Check whether the source
23663         expression is a value or variable.
23664
23665         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23666         while resolving the corresponding blocks.
23667
23668         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23669         an error, don't silently return null.
23670
23671         * statement.cs (Block.AddVariable): Do the error reporting here
23672         and distinguish between CS0128 and CS0136.
23673         (Block.DoResolve): Report all unused labels (warning CS0164).
23674         (LabeledStatement): Pass the location to the constructor.
23675         (LabeledStatement.HasBeenReferenced): New property.
23676         (LabeledStatement.Resolve): Set it to true here.
23677
23678         * statement.cs (Return.Emit): Return success even after reporting
23679         a type mismatch error (CS0126 or CS0127), this is what csc does and
23680         it avoids confusing the users with any consecutive errors.
23681
23682 2002-08-05  Martin Baulig  <martin@gnome.org>
23683
23684         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23685
23686         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23687
23688         * expression.cs (MemberAccess.DoResolve): Silently return if an
23689         error has already been reported.
23690
23691         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23692         error has already been reported.
23693
23694 2002-08-05  Martin Baulig  <martin@gnome.org>
23695
23696         * statement.cs (UsageVector): Only initialize the `parameters'
23697         vector if we actually have any "out" parameters.
23698
23699 2002-08-05  Martin Baulig  <martin@gnome.org>
23700
23701         * expression.cs (Binary.ResolveOperator): When combining delegates,
23702         they must have the same type.
23703
23704 2002-08-05  Martin Baulig  <martin@gnome.org>
23705
23706         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23707         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23708         work with the ms runtime and we also don't need it: if we're a
23709         PropertyBuilder and not in the `indexer_arguments' hash, then we
23710         are a property and not an indexer.
23711
23712         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23713         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23714         since the latter one doesn't work with the ms runtime.
23715
23716 2002-08-03  Martin Baulig  <martin@gnome.org>
23717
23718         Fixed bugs #27998 and #22735.
23719
23720         * class.cs (Method.IsOperator): New public field.
23721         (Method.CheckBase): Report CS0111 if there's already a method
23722         with the same parameters in the current class.  Report CS0508 when
23723         attempting to change the return type of an inherited method.
23724         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23725         and it's not marked abstract or extern.
23726         (PropertyBase): New abstract base class for Property and Indexer.
23727         (PropertyBase.CheckBase): Moved here from Property and made it work
23728         for indexers.
23729         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23730         the same so we can reuse it there.
23731         (Property, Indexer): Derive from PropertyBase.
23732         (MethodSignature.inheritable_property_signature_filter): New delegate
23733         to find properties and indexers.
23734
23735         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23736         argument and improved error reporting.
23737
23738         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23739         EmptyReadOnlyParameters and made it a property.
23740
23741         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23742         version of this method which takes a `PropertyInfo indexer'.
23743         (TypeManager.RegisterIndexer): New method.
23744
23745         * class.cs: Added myself as author of this file :-)
23746
23747 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23748
23749         * class.cs: fixed compilation on windoze.
23750
23751 2002-08-03  Martin Baulig  <martin@gnome.org>
23752
23753         * interface.cs (Interface.GetInterfaceBases): Check whether all
23754         base interfaces are at least as accessible than the current one.
23755
23756         * class.cs (TypeContainer.GetClassBases): Check whether base types
23757         are at least as accessible than the current type.
23758         (TypeContainer.AsAccessible): Implemented and made non-static.
23759         (MemberBase.CheckParameters): Report errors if the accessibility
23760         checks fail.
23761
23762         * delegate.cs (Delegate.Delegate): The default visibility is
23763         internal for top-level types and private for nested types.
23764         (Delegate.Define): Report errors if the accessibility checks fail.
23765
23766         * enum.cs (Enum.Enum): The default visibility is internal for
23767         top-level types and private for nested types.
23768         (Enum.DefineType): Compute the correct visibility.
23769
23770         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23771         function which takes a `bool is_toplevel' instead of a TypeContainer.
23772
23773         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23774         builtin type.
23775
23776 2002-08-02  Martin Baulig  <martin@gnome.org>
23777
23778         * expression.cs (LocalVariableReferenc): Added constructor which
23779         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23780         (LocalVariableReference.IsReadOnly): New property.
23781         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23782         variable is readonly, use our own readonly flag to do this; you can
23783         use the new constructor to get a writable reference to a read-only
23784         variable.
23785
23786         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23787         reference to the local variable.
23788
23789 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23790
23791         * rootcontext.cs (ResolveCore): Also include System.Exception
23792
23793         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23794         we reach an EmptyStatement.
23795
23796         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23797         is also fine.
23798
23799         * expression.cs (Binary.ResolveOperator): Check error result in
23800         two places.
23801
23802         use brtrue/brfalse directly and avoid compares to null.
23803
23804 2002-08-02  Martin Baulig  <martin@gnome.org>
23805
23806         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23807         Fixes bug #28407, added test-155.cs.
23808
23809 2002-08-01  Martin Baulig  <martin@gnome.org>
23810
23811         * class.cs (Event.EmitDefaultMethod): Make this work with static
23812         events.  Fixes #28311, added verify-3.cs.
23813
23814 2002-08-01  Martin Baulig  <martin@gnome.org>
23815
23816         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23817         `is_disposable' fields.
23818         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23819         `hm.is_disposable' if we're using the collection pattern.
23820         (Foreach.EmitCollectionForeach): Use the correct type for the
23821         enumerator's local variable, only emit the try/finally block if
23822         necessary (fixes #27713).
23823
23824 2002-08-01  Martin Baulig  <martin@gnome.org>
23825
23826         * ecore.cs (Expression.report118): Renamed to Error118 and made
23827         it public static.
23828
23829         * statement.cs (Throw.Resolve): Check whether the expression is of
23830         the correct type (CS0118) and whether the type derives from
23831         System.Exception (CS0155).
23832         (Catch.Resolve): New method.  Do the type lookup here and check
23833         whether it derives from System.Exception (CS0155).
23834         (Catch.CatchType, Catch.IsGeneral): New public properties.
23835
23836         * typemanager.cs (TypeManager.exception_type): Added.
23837
23838 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23839
23840         * driver.cs: Updated About function.
23841
23842 2002-07-31  Martin Baulig  <martin@gnome.org>
23843
23844         Implemented Control Flow Analysis.
23845
23846         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23847         (EmitContext.CurrentBranching): Added.
23848         (EmitContext.StartFlowBranching): Added.
23849         (EmitContext.EndFlowBranching): Added.
23850         (EmitContext.KillFlowBranching): Added.
23851         (EmitContext.IsVariableAssigned): Added.
23852         (EmitContext.SetVariableAssigned): Added.
23853         (EmitContext.IsParameterAssigned): Added.
23854         (EmitContext.SetParameterAssigned): Added.
23855         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23856         Added control flow analysis stuff here.
23857
23858         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23859         resolve the expression as lvalue.
23860         (LocalVariableReference.DoResolve): Check whether the variable has
23861         already been assigned.
23862         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23863         the parameter as assigned here.
23864         (ParameterReference.DoResolve): Check whether the parameter has already
23865         been assigned.
23866         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23867         expression as lvalue.
23868
23869         * statement.cs (FlowBranching): New class for the flow analysis code.
23870         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23871         (LabeledStatement.IsDefined): New public property.
23872         (LabeledStatement.AddUsageVector): New public method to tell flow
23873         analyis that the label may be reached via a forward jump.
23874         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23875         flow analysis.
23876         (VariableInfo.Number): New public field.  This is used by flow analysis
23877         to number all locals of a block.
23878         (Block.CountVariables): New public property.  This is the number of
23879         local variables in this block (including the locals from all parent
23880         blocks).
23881         (Block.EmitMeta): Number all the variables.
23882
23883         * statement.cs: Added flow analysis support to all classes.
23884
23885 2002-07-31  Martin Baulig  <martin@gnome.org>
23886
23887         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23888         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23889         then use this argument.
23890
23891         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23892
23893         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23894         use this to specify /define options.
23895
23896 2002-07-29  Martin Baulig  <martin@gnome.org>
23897
23898         * statement.cs (Fixed): Moved all code that does variable lookups
23899         and resolvings from Emit to Resolve.
23900
23901         * statement.cs (For): Moved all code that does variable lookups
23902         and resolvings from Emit to Resolve.
23903
23904         * statement.cs (Using): Moved all code that does variable lookups
23905         and resolvings from Emit to Resolve.
23906
23907 2002-07-29  Martin Baulig  <martin@gnome.org>
23908
23909         * attribute.cs (Attribute.Resolve): Explicitly catch a
23910         System.NullReferenceException when creating the
23911         CustromAttributeBuilder and report a different warning message.
23912
23913 2002-07-29  Martin Baulig  <martin@gnome.org>
23914
23915         * support.cs (ParameterData.ParameterName): Added method to
23916         get the name of a parameter.
23917
23918         * typemanager.cs (TypeManager.IsValueType): New public method.
23919
23920 2002-07-29  Martin Baulig  <martin@gnome.org>
23921
23922         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23923         is a flag which specifies that it's either ref or out.
23924         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23925         the out parameter to `out Parameter.Modifier mod', also set the
23926         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23927
23928         * support.cs (InternalParameters.ParameterModifier): Distinguish
23929         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23930         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23931
23932         * expression.cs (Argument.GetParameterModifier): Distinguish
23933         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23934         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23935
23936 2002-07-29  Martin Baulig  <martin@gnome.org>
23937
23938         * expression.cs (ParameterReference.ParameterReference): Added
23939         `Location loc' argument to the constructor.
23940
23941         * cs-parser.jay: Pass location to ParameterReference.
23942
23943 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23944
23945         * statement.cs (Try): Initialize the location.
23946
23947         * cs-parser.jay: pass location to Try.
23948
23949         * expression.cs (Unary.Reduce): Change the prototype to return
23950         whether a constant fold could be performed or not.  The result is
23951         returned in an out parameters.  In the case of Indirection and
23952         AddressOf, we want to perform the full tests.
23953
23954 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23955
23956         * statement.cs (Statement.Emit): Flag dead code.
23957
23958 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23959
23960         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23961
23962 2002-07-27  Martin Baulig  <martin@gnome.org>
23963
23964         * class.cs (MethodData.Define): Put back call to
23965         TypeManager.AddMethod(), accidentally commented this out.
23966
23967         * report.cs (Debug): New public method to print debugging information,
23968         this is `[Conditional ("DEBUG")]'.
23969
23970 2002-07-26  Martin Baulig  <martin@gnome.org>
23971
23972         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23973         (switch_statement): Push the current_block to the switch_stack and
23974         pop it again when we're done with the switch.
23975         (switch_section): The new block is a child of the current_block.
23976         Fixes bug #24007, added test-152.cs.
23977
23978 2002-07-27  Martin Baulig  <martin@gnome.org>
23979
23980         * expression.cs (Invocation.EmitArguments): When calling a varargs
23981         function with only its fixed arguments, we need to pass an empty
23982         array.
23983
23984 2002-07-27  Martin Baulig  <martin@gnome.org>
23985
23986         Mono 0.13 has been released.
23987
23988 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23989
23990         * driver.cs: Rename --resource to --linkres, because that is what
23991         we do currently, we dont support --resource yet.
23992
23993         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23994
23995 2002-07-25  Martin Baulig  <martin@gnome.org>
23996
23997         * class.cs (MethodData): New public class.  This is a `method builder'
23998         class for a method or one accessor of a Property/Indexer/Event.
23999         (MethodData.GetMethodFlags): Moved here from MemberBase.
24000         (MethodData.ApplyAttributes): Likewise.
24001         (MethodData.ApplyObsoleteAttribute): Likewise.
24002         (MethodData.ApplyConditionalAttribute): Likewise.
24003         (MethodData.ApplyDllImportAttribute): Likewise.
24004         (MethodData.CheckAbstractAndExternal): Likewise.
24005         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24006         (MethodData.Emit): Formerly known as Method.Emit().
24007         (MemberBase): Moved everything which was specific to a single
24008         accessor/method to MethodData.
24009         (Method): Create a new MethodData and call Define() and Emit() on it.
24010         (Property, Indexer, Event): Create a new MethodData objects for each
24011         accessor and call Define() and Emit() on them.
24012
24013 2002-07-25  Martin Baulig  <martin@gnome.org>
24014
24015         Made MethodCore derive from MemberBase to reuse the code from there.
24016         MemberBase now also checks for attributes.
24017
24018         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24019         (MemberBase.GetMethodFlags): Moved here from class Method and marked
24020         as virtual.
24021         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24022         `CallingConventions cc' and `Attributes opt_attrs' arguments.
24023         (MemberBase.ApplyAttributes): New virtual method; applies the
24024         attributes to a method or accessor.
24025         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24026         (MemberBase.ApplyConditionalAttribute): Likewise.
24027         (MemberBase.ApplyDllImportAttribute): Likewise.
24028         (MemberBase.CheckAbstractAndExternal): Likewise.
24029         (MethodCore.ParameterTypes): This is now a property instead of a
24030         method, it's initialized from DoDefineParameters().
24031         (MethodCore.ParameterInfo): Removed the set accessor.
24032         (MethodCore.DoDefineParameters): New protected virtual method to
24033         initialize ParameterTypes and ParameterInfo.
24034         (Method.GetReturnType): We can now simply return the MemberType.
24035         (Method.GetMethodFlags): Override the MemberBase version and add
24036         the conditional flags.
24037         (Method.CheckBase): Moved some code from Define() here, call
24038         DoDefineParameters() here.
24039         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
24040         here to avoid some larger code duplication.
24041         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
24042         ensure that abstract and external accessors don't declare a body.
24043
24044         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
24045         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
24046         lookup in the attribute's parent classes, so we need to abort as soon
24047         as we found the first match.
24048         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
24049         the attribute has no arguments.
24050
24051         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
24052         of a Method.
24053
24054 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24055
24056         * cs-parser.jay: reverted previous patch.
24057
24058 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24059
24060         * cs-parser.jay: fixed bug #22119.
24061
24062 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24063
24064         * attribute.cs: fixed compilation. The error was:
24065         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
24066         be assigned to before control leaves the current method."
24067         [FIXME:  Filed as bug #28186: MCS must report this error.]
24068
24069 2002-07-25  Martin Baulig  <martin@gnome.org>
24070
24071         * attribute.cs (Attribute.Conditional_GetConditionName): New static
24072         method to pull the condition name ouf of a Conditional attribute.
24073         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
24074         the obsolete message and error flag out of an Obsolete attribute.
24075
24076         * class.cs (Method.GetMethodFlags): New public method to get the
24077         TypeManager.MethodFlags for this method.
24078         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
24079         private methods.
24080         (Method.Define): Get and apply the Obsolete and Conditional attributes;
24081         if we're overriding a virtual function, set the new private variable
24082         `parent_method'; call the new TypeManager.AddMethod().
24083
24084         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
24085         the MethodBuilder and the Method in a PtrHashtable.
24086         (TypeManager.builder_to_method): Added for this purpose.
24087         (TypeManager.MethodFlags): Added IsObsoleteError.
24088         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
24089         Obsolete and Conditional arguments in MethodBuilders.  If we discover
24090         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
24091         the message from the attribute.
24092
24093 2002-07-24  Martin Baulig  <martin@gnome.org>
24094
24095         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
24096         preprocessor directives, ensure that the argument to #define/#undef is
24097         exactly one identifier and that it's actually an identifier.
24098
24099         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
24100         did not work ....
24101
24102 2002-07-24  Martin Baulig  <martin@gnome.org>
24103
24104         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
24105         initialize it to TypeManager.object_type in the constructor.
24106         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
24107         of the `hm.get_current' method if we're using the collection pattern.
24108         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
24109         for the explicit conversion to make it work when we're using the collection
24110         pattern and the `Current' property has a different return type than `object'.
24111         Fixes #27713.
24112
24113 2002-07-24  Martin Baulig  <martin@gnome.org>
24114
24115         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
24116         does not match, but don't report any errors.  This method is called in
24117         order for all methods in a MethodGroupExpr until a matching method is
24118         found, so we don't want to bail out if the first method doesn't match.
24119         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
24120         matches, report the 123.  Fixes #28070.
24121
24122 2002-07-24  Martin Baulig  <martin@gnome.org>
24123
24124         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
24125         TypeManager.TypeToCoreType() to the top of the method so the
24126         following equality checks will work.  Fixes #28107.
24127
24128 2002-07-24  Martin Baulig  <martin@gnome.org>
24129
24130         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
24131         operand is of type uint, and the other operand is of type sbyte,
24132         short or int, the operands are converted to type long." -
24133         Actually do what this comment already told us.  Fixes bug #28106,
24134         added test-150.cs.
24135
24136 2002-07-24  Martin Baulig  <martin@gnome.org>
24137
24138         * class.cs (MethodBase): New abstract class.  This is now a base
24139         class for Property, Indexer and Event to avoid some code duplication
24140         in their Define() and DefineMethods() methods.
24141         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
24142         generic methods for Define() and DefineMethods().
24143         (FieldBase): Derive from MemberBase, not MemberCore.
24144         (Property): Derive from MemberBase, not MemberCore.
24145         (Property.DefineMethod): Moved all the code from this method to the
24146         new MethodBase.DefineAccessor(), just call it with appropriate
24147         argumetnts.
24148         (Property.Define): Call the new Property.DoDefine(), this does some
24149         sanity checks and we don't need to duplicate the code everywhere.
24150         (Event): Derive from MemberBase, not MemberCore.
24151         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
24152         accessors, this will also make them work with interface events.
24153         (Indexer): Derive from MemberBase, not MemberCore.
24154         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
24155         (Indexer.Define): Use the new MethodBase functions.
24156
24157         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
24158         argument to the constructor.
24159         (Interface.FindMembers): Added support for interface events.
24160         (Interface.PopluateEvent): Implemented.
24161
24162         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
24163
24164 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
24165
24166         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
24167         but this is required to check for a method name being the same as
24168         the containing class.  
24169
24170         Handle this now.
24171
24172 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24173
24174         * interface.cs: initialize variable.
24175
24176 2002-07-23  Martin Baulig  <martin@gnome.org>
24177
24178         Implemented the IndexerName attribute in interfaces.
24179
24180         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
24181         name if this is an explicit interface implementation.
24182         (Indexer.InterfaceIndexerName): New public variable.  If we're
24183         implementing an interface indexer, this is the IndexerName in that
24184         interface.  Otherwise, it's the IndexerName.
24185         (Indexer.DefineMethod): If we're implementing interface indexer,
24186         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
24187         and Pending.ImplementIndexer methods.
24188         (Indexer.Define): Also define the PropertyBuilder if we're
24189         implementing an interface indexer and this is neither an explicit
24190         interface implementation nor do the IndexerName match the one in
24191         the interface.
24192
24193         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
24194         If a method is defined here, then we always need to create a proxy
24195         for it.  This is used when implementing interface indexers.
24196         (Pending.IsInterfaceIndexer): New public method.
24197         (Pending.ImplementIndexer): New public method.
24198         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
24199         This is used when implementing interface indexers to define a proxy
24200         if necessary.
24201         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
24202         define a proxy if necessary.
24203
24204         * interface.cs (Interface.IndexerName): New public variable.
24205         (Interface.PopulateIndexer): Set the IndexerName.
24206         (Interface.DefineIndexers): New private method.  Populate all the
24207         indexers and make sure their IndexerNames match.
24208
24209         * typemanager.cs (IndexerPropertyName): Added support for interface
24210         indexers.
24211
24212 2002-07-22  Martin Baulig  <martin@gnome.org>
24213
24214         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
24215         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
24216         ret if HasReturnLabel.
24217         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
24218         variables.
24219
24220         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
24221         and set the ec.LoopBeginTryCatchLevel.
24222         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
24223         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
24224         the current ec.TryCatchLevel, the branch goes out of an exception
24225         block.  In this case, we need to use Leave and not Br.
24226
24227 2002-07-22  Martin Baulig  <martin@gnome.org>
24228
24229         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
24230         block unless the block does not always return or it is contained in
24231         another try { ... } catch { ... } block.  Fixes bug #26506.
24232         Added verify-1.cs to the test suite.
24233
24234 2002-07-22  Martin Baulig  <martin@gnome.org>
24235
24236         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
24237         then we do not always return.  Fixes bug #24985.
24238
24239 2002-07-22  Martin Baulig  <martin@gnome.org>
24240
24241         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
24242         lookup on a per-class level; ie. walk up the class hierarchy until we
24243         found at least one applicable method, then choose the best among them.
24244         Fixes bug #24463 and test-29.cs.
24245
24246 2002-07-22  Martin Baulig  <martin@gnome.org>
24247
24248         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
24249         return types of the methods.  The return type is not part of the
24250         signature and we must not check it to make the `new' modifier work.
24251         Fixes bug #27999, also added test-147.cs.
24252         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
24253
24254         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
24255         on the method's return type.
24256
24257 2002-07-21  Martin Baulig  <martin@gnome.org>
24258
24259         * assign.cs: Make this work if the rightmost source is a constant and
24260         we need to do an implicit type conversion.  Also adding a few more tests
24261         to test-38.cs which should have caught this.
24262
24263         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
24264         target in the makefile for this.  The makefile.gnu is primarily intended
24265         for end-users who don't want to debug the compiler.
24266
24267 2002-07-21  Martin Baulig  <martin@gnome.org>
24268
24269         * assign.cs: Improved the Assign class so it can now handle embedded
24270         assignments (X = Y = Z = something).  As a side-effect this'll now also
24271         consume less local variables.  test-38.cs now passes with MCS, added
24272         a few new test cases to that test.
24273
24274 2002-07-20  Martin Baulig  <martin@gnome.org>
24275
24276         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
24277         instructions.  Fixes bug #27977, also added test-146.cs.
24278
24279 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24280
24281         * cs-tokenizer.cs: fixed getHex ().
24282
24283 2002-07-19  Martin Baulig  <martin@gnome.org>
24284
24285         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
24286         not Type.GetType() to lookup the array type.  This is needed when
24287         we're constructing an array of a user-defined type.
24288         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
24289         single-dimensional arrays, but also for single-dimensial arrays of
24290         type decimal.
24291
24292 2002-07-19  Martin Baulig  <martin@gnome.org>
24293
24294         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
24295         this function is called, it's not allowed to share LocalBuilders
24296         among ILGenerators.
24297
24298 2002-07-19  Martin Baulig  <martin@gnome.org>
24299
24300         * expression.cs (Argument.Resolve): Report an error 118 when trying
24301         to pass a type as argument.
24302
24303 2002-07-18  Martin Baulig  <martin@gnome.org>
24304
24305         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24306         Conv_R_Un for the signed `long' type.
24307
24308 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
24309
24310         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24311         `expr' for the temporary result, as that will fail if we do
24312         multiple resolves on the same expression.
24313
24314 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
24315
24316         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24317         ec.TypeContainer for looking up aliases. 
24318
24319         * class.cs (TypeContainer): Remove LookupAlias from here.
24320
24321         * decl.cs (DeclSpace); Move here.
24322
24323 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
24324
24325         * class.cs (FindMembers): Only call filter if the constructor
24326         bulider is not null.
24327
24328         Also handle delegates in `NestedTypes' now.  Now we will perform
24329         type lookups using the standard resolution process.  This also
24330         fixes a bug.
24331
24332         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24333         This uses Expressions (the limited kind that can be parsed by the
24334         tree) instead of strings.
24335
24336         * expression.cs (ComposedCast.ToString): Implement, used to flag
24337         errors since now we have to render expressions.
24338
24339         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
24340         FormArrayType. 
24341
24342         * ecore.cs (SimpleName.ToString): ditto.
24343
24344         * cs-parser.jay: Instead of using strings to assemble types, use
24345         Expressions to assemble the type (using SimpleName, ComposedCast,
24346         MemberAccess).  This should fix the type lookups in declarations,
24347         because we were using a different code path for this.
24348
24349         * statement.cs (Block.Resolve): Continue processing statements
24350         even when there is an error.
24351
24352 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
24353
24354         * class.cs (Event.Define): Also remove the `remove' method from
24355         the list of pending items.
24356
24357         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24358         generate more compact code. 
24359
24360 2002-07-17  Martin Baulig  <martin@gnome.org>
24361
24362         * const.cs (Const.LookupConstantValue): Add support for constant
24363         `unchecked' and `checked' expressions.
24364         Also adding test case test-140.cs for this.
24365
24366 2002-07-17  Martin Baulig  <martin@gnome.org>
24367
24368         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24369         check whether mi.ReturnType implements the IEnumerator interface; the
24370         `==' and the IsAssignableFrom() will fail in this situation.
24371
24372 2002-07-16  Ravi Pratap  <ravi@ximian.com>
24373
24374         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
24375         here too.
24376
24377 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24378
24379         * expression.cs: fixed bug #27811.
24380
24381 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
24382
24383         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24384         Molaro: when we are a ref, the value already contains a pointer
24385         value, do not take the address of it.
24386
24387 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24388         * removed mb-parser.jay and mb-tokenizer.cs
24389
24390 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24391
24392         * expression.cs: check against the building corlib void type.
24393
24394 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24395
24396         * ecore.cs: fix for valuetype static readonly fields: when 
24397         initializing them, we need their address, not the address of a copy.
24398
24399 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24400
24401         * typemanager.cs: register also enum_type in corlib.
24402
24403 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24404
24405         * class.cs: allow calling this (but not base) initializers in structs.
24406
24407 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24408
24409         * ecore.cs: make sure we compare against the building base types
24410         in GetTypeSize ().
24411
24412 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24413
24414         * typemanager.cs: fix TypeToCoreType() to handle void and object
24415         (corlib gets no more typerefs after this change).
24416
24417 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * expression.cs (ArrayCreation.EmitArrayArguments): use
24420         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24421
24422         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24423         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24424         array indexes, the runtime actually forbids them.
24425
24426         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24427         for array arguments here.
24428
24429         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24430         instead of the default for ValueTypes.
24431
24432         (New.DoEmit): Use IsValueType instead of
24433         IsSubclassOf (value_type)
24434         (New.DoResolve): ditto.
24435         (Invocation.EmitCall): ditto.
24436
24437         * assign.cs (Assign): ditto.
24438
24439         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24440         Statements *are* currently doing part of their resolution during
24441         Emit.  
24442
24443         Expressions do always resolve during resolve, but statements are
24444         only required to propagate resolution to their children.
24445
24446 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24447
24448         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24449
24450         (LoadAssembly): Do not add the dll if it is already specified
24451
24452         (MainDriver): Add the System directory to the link path at the end,
24453         after all the other -L arguments. 
24454
24455         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24456         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24457         ldelem.u1) and using the opposite for sbytes.
24458
24459         This fixes Digger, and we can finally run it.
24460
24461         * driver.cs (UnixParseOption): Move the option parsing here.  
24462         (CSCParseOption): Implement CSC-like parsing of options.
24463
24464         We now support both modes of operation, the old Unix way, and the
24465         new CSC-like way.  This should help those who wanted to make cross
24466         platform makefiles.
24467
24468         The only thing broken is that /r:, /reference: and /lib: are not
24469         implemented, because I want to make those have the same semantics
24470         as the CSC compiler has, and kill once and for all the confussion
24471         around this.   Will be doing this tomorrow.
24472
24473         * statement.cs (Unsafe.Resolve): The state is checked during
24474         resolve, not emit, so we have to set the flags for IsUnsfe here.
24475
24476 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24477
24478         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24479         not catch the Error_ObjectRefRequired in SimpleName (as it is
24480         possible to have a class/instance variable name that later gets
24481         deambiguated), we have to check this here.      
24482
24483 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24484
24485         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24486         make static and put into Expression.
24487
24488         (Event.Define): Register the private field of the event with the 
24489         TypeManager so that GetFieldFromEvent can get at it.
24490
24491         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24492         keep track of the private field associated with an event which
24493         has no accessors.
24494
24495         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24496         private field.
24497
24498         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24499
24500 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24501
24502         * expression.cs (Binary.EmitBranchable): this routine emits the
24503         Binary expression in a branchable context.  This basically means:
24504         we need to branch somewhere, not just get the value on the stack.
24505
24506         This works together with Statement.EmitBoolExpression.
24507
24508         * statement.cs (Statement.EmitBoolExpression): Use
24509         EmitBranchable. 
24510
24511 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24512
24513         * statement.cs (For): Reduce the number of jumps in loops.
24514
24515         (For): Implement loop inversion for the For statement.
24516
24517         (Break): We can be breaking out of a Try/Catch controlled section
24518         (foreach might have an implicit try/catch clause), so we need to
24519         use Leave instead of Br.
24520
24521         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24522         now).  If the instace expression supports IMemoryLocation, we use
24523         the AddressOf method from the IMemoryLocation to extract the
24524         address instead of emitting the instance.
24525
24526         This showed up with `This', as we were emitting the instance
24527         always (Emit) instead of the Address of This.  Particularly
24528         interesting when This is a value type, as we dont want the Emit
24529         effect (which was to load the object).
24530
24531 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24532
24533         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24534
24535         * statement.cs (Checked): Set the CheckedState during the resolve
24536         process too, as the ConvCast operations track the checked state on
24537         the resolve process, and not emit.
24538
24539         * cs-parser.jay (namespace_member_declaration): Flag that we have
24540         found a declaration when we do.  This is used to flag error 1529
24541
24542         * driver.cs: Report ok when we display the help only.
24543
24544 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24545
24546         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24547
24548 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * cs-tokenizer.cs (define): We also have to track locally the
24551         defines.  AllDefines is just used for the Conditional Attribute,
24552         but we also need the local defines for the current source code. 
24553
24554 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24555
24556         * statement.cs (While, For, Do): These loops can exit through a
24557         Break statement, use this information to tell whether the
24558         statement is the last piece of code.
24559
24560         (Break): Flag that we break.
24561
24562         * codegen.cs (EmitContexts): New `Breaks' state variable.
24563
24564 2002-07-03  Martin Baulig  <martin@gnome.org>
24565
24566         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24567         modifiers in method declarations in structs.  Otherwise, you won't
24568         be able to override things like Object.Equals().
24569
24570 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24571
24572         * class.cs (Method, Property, Indexer): Do not allow the public
24573         modifier to be used in explicit interface implementations.
24574
24575         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24576         override modifiers in method declarations in structs
24577
24578 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24579
24580         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24581         integer or real overflow, report an error
24582
24583 2002-07-02  Martin Baulig  <martin@gnome.org>
24584
24585         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24586         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24587         to tell the runtime about our newly created System.Object and
24588         System.ValueType types.
24589
24590 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24591
24592         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24593         struct instead of Ldarg/Starg.
24594
24595 2002-07-02  Martin Baulig  <martin@gnome.org>
24596
24597         * expression.cs (Indirection.Indirection): Call
24598         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24599
24600 2002-07-02  Martin Baulig  <martin@gnome.org>
24601
24602         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24603         ValueType, call TypeManager.TypeToCoreType() on it.
24604         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24605         the OpCodes.Newarr argument.
24606
24607 2002-07-02  Martin Baulig  <martin@gnome.org>
24608
24609         * expression.cs (Invocation.EmitCall): When compiling corlib,
24610         replace all calls to the system's System.Array type to calls to
24611         the newly created one.
24612
24613         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24614         System.Array methods.
24615         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24616         from the system's System.Array type which must be replaced.
24617
24618 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24619
24620         * typemanager.cs: load unverifiable_code_ctor so we can build
24621         corlib using the correct type. Avoid using GetTypeCode() with
24622         TypeBuilders.
24623         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24624         TypeManager.object_type to allow building corlib.
24625
24626 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24627
24628         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24629
24630 2002-07-01  Martin Baulig  <martin@gnome.org>
24631
24632         * class.cs: Make the last change actually work, we need to check
24633         whether `ifaces != null' to avoid a crash.
24634
24635 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24636
24637         * class.cs: when we build structs without fields that implement
24638         interfaces, we need to add the interfaces separately, since there is
24639         no API to both set the size and add the interfaces at type creation
24640         time.
24641
24642 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24643
24644         * expression.cs: the dimension arguments to the array constructors
24645         need to be converted if they are a long.
24646
24647 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24648
24649         * class.cs: don't emit ldarg.0 if there is no parent constructor
24650         (fixes showstopper for corlib).
24651
24652 2002-06-29  Martin Baulig  <martin@gnome.org>
24653
24654         MCS now compiles corlib on GNU/Linux :-)
24655
24656         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24657         ie. check for MethodImplOptions.InternalCall.
24658
24659         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24660         and TypeManager.attribute_type are null, so we must explicitly check
24661         whether parent is not null to find out whether it's an attribute type.
24662         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24663         and SetBuilder, not only if the property is neither abstract nor external.
24664         This is necessary to set the MethodImplOptions on the accessor methods.
24665         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24666         SetBuilder, see Property.Emit().
24667
24668         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24669         populate "System.Object", "System.ValueType" and "System.Attribute" since
24670         they've already been populated from BootCorlib_PopulateCoreTypes().
24671
24672 2002-06-29  Martin Baulig  <martin@gnome.org>
24673
24674         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24675         is the NullLiteral, we also need to make sure that target_type is not
24676         an enum type.   
24677
24678 2002-06-29  Martin Baulig  <martin@gnome.org>
24679
24680         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24681         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24682         before calling BootstrapCorlib_ResolveDelegate ().
24683
24684 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24685
24686         * statement.cs: fixed build-breaker. All tests passed ok.
24687
24688 2002-06-27  Martin Baulig  <martin@gnome.org>
24689
24690         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24691         for System.Decimal when compiling corlib.
24692
24693 2002-06-27  Martin Baulig  <martin@gnome.org>
24694
24695         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24696         switch blocks which contain nothing but a default clause.
24697
24698 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24699
24700        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24701
24702 2002-06-27  Martin Baulig  <martin@gnome.org>
24703
24704         * ecore.cs (PropertyExpr.PropertyExpr): Call
24705         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24706
24707         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24708         is already a TypeBuilder.
24709
24710 2002-06-27  Martin Baulig  <martin@gnome.org>
24711
24712         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24713         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24714         the "from an array-type to System.Array" case.  This makes it work
24715         when compiling corlib.
24716
24717 2002-06-27  Martin Baulig  <martin@gnome.org>
24718
24719         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24720         non-static PropertyExpr, set its InstanceExpression.  This makes
24721         the `ICollection.Count' property work in System/Array.cs.
24722
24723 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24724
24725         * driver.cs: Made error handling more consistent.  Errors now
24726         tracked by Report class, so many methods which used to return int
24727         now return void.  Main() now prints success/failure and 
24728         errors/warnings message.
24729
24730         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24731         the magic number return values (123 and 124).  Now, if the
24732         expected error occurs, the compiler exits with success (exit value
24733         0).  If the compilation completes without seeing that particular
24734         error, the compiler exits with failure (exit value 1).  The
24735         makefile in mcs/errors has been changed to handle the new behaviour.
24736
24737         * report.cs: Made 'expected error' number a property and renamed
24738         it from 'Probe' to 'ExpectedError'.
24739
24740         * genericparser.cs: Removed error handling support, since it is
24741         now all done by Report class.
24742
24743         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24744         class, so parse() no longer returns an int.
24745
24746         * namespace.cs: Use Report.Error instead of GenericParser.error
24747
24748 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24749
24750         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24751         TypeContainer.AddOperator): At the front of the list put the
24752         explicit implementations, so they get resolved/defined first. 
24753
24754 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24755
24756         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24757         interface type is implemented by this TypeContainer.  Used during
24758         explicit interface implementation.
24759
24760         (Property.Define, Indexer.Define, Method.Define): Validate that
24761         the given interface in the explicit implementation is one of the
24762         base classes for the containing type.
24763
24764         Also if we are explicitly implementing an interface, but there is
24765         no match in the pending implementation table, report an error.
24766
24767         (Property.Define): Only define the property if we are
24768         not explicitly implementing a property from an interface.  Use the
24769         correct name also for those properties (the same CSC uses,
24770         although that is really not needed).
24771
24772         (Property.Emit): Do not emit attributes for explicitly implemented
24773         properties, as there is no TypeBuilder.
24774
24775         (Indexer.Emit): ditto.
24776
24777         Hiding then means that we do not really *implement* a pending
24778         implementation, which makes code fail.
24779
24780 2002-06-22  Martin Baulig  <martin@gnome.org>
24781
24782         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24783         the return value of Object.GetType().  [FIXME: we need to do this whenever
24784         we get a type back from the reflection library].
24785
24786 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24787
24788         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24789
24790 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24791
24792         * attribute.cs: Return null if we can not look up the type.
24793
24794         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24795         the interface types found.
24796
24797         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24798         interface types found.
24799
24800         * typemanager.cs (GetInterfaces): Make this routine returns alll
24801         the interfaces and work around the lame differences between
24802         System.Type and System.Reflection.Emit.TypeBuilder in the results
24803         result for GetInterfaces.
24804
24805         (ExpandInterfaces): Given an array of interface types, expand and
24806         eliminate repeated ocurrences of an interface.  This expands in
24807         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24808         be IA, IB, IC.
24809
24810 2002-06-21  Martin Baulig  <martin@gnome.org>
24811
24812         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24813         on System.Enum.
24814
24815 2002-06-21  Martin Baulig  <martin@gnome.org>
24816
24817         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24818         and called with one of the core types, return the corresponding typebuilder for
24819         that type.
24820
24821         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24822         element type.
24823
24824 2002-06-21  Martin Baulig  <martin@gnome.org>
24825
24826         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24827         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24828         (Expression.ConvertReferenceExplicit): Likewise.
24829
24830         * expression.cs (ElementAccess.DoResolve): Likewise.
24831         (ElementAccess.DoResolveLValue): Likewise.
24832
24833 2002-06-10  Martin Baulig  <martin@gnome.org>
24834
24835         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24836         add the "value" parameter to the parameter list.
24837
24838         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24839         to our caller.
24840
24841 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24842
24843         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24844         the argument to an int, uint, long or ulong, per the spec.  Also
24845         catch negative constants in array creation.
24846
24847 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24848
24849         * class.cs: do not allow the same interface to appear twice in
24850         the definition list.
24851
24852 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24853
24854         * ecore.cs: don't use ldlen with System.Array.
24855
24856 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24857
24858         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24859
24860 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24861
24862         * modifiers.cs: produce correct field attributes for protected
24863         internal. Easy fix so miguel can work on ther harder stuff:-)
24864
24865 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24866
24867         * pending.cs: New file.  Move the code from class.cs here.
24868         Support clearning the pending flag for all methods (when not doing
24869         explicit interface implementation).
24870
24871 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24872
24873         * rootcontext.cs: added a couple more types needed to bootstrap.
24874
24875 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24876
24877         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24878         constructor in the type, instead of any constructor in the type
24879         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24880         a bug in the Mono runtime when applying the params attribute). 
24881
24882 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24883         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24884
24885 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24886
24887         * expression.cs (Unary.ResolveOperator): Use TypeManager
24888         to resolve the type.
24889
24890 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24891
24892         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24893         attached.
24894
24895         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24896         with each member too.
24897
24898         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24899         field builders too - this takes care of the enum member case.
24900
24901 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24902
24903         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24904         address-of operator on both value types and pointers.
24905
24906 2002-06-10  Martin Baulig  <martin@gnome.org>
24907
24908         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24909         PropertyBuilder to the `property_builders' list.
24910
24911         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24912         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24913         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24914         find any indexers which are inherited from an interface.
24915
24916 2002-06-09  Martin Baulig  <martin@gnome.org>
24917
24918         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24919         the same type as the constant if necessary.  There's also a test-130.cs
24920         for this.
24921
24922         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24923
24924         * typemanager.cs (TypeManager.ChangeType): Previously known as
24925         Enum.ChangeEnumType().
24926
24927 2002-06-09  Martin Baulig  <martin@gnome.org>
24928
24929         * expression.cs (Cast.TryReduce): Added support for consts.
24930
24931 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24932
24933         * class.cs (Accessor): Hold attributes information so we can pass
24934         it along.
24935
24936         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24937         Modify to pass in attributes attached to the methods.
24938
24939         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24940
24941         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24942         to handle the Accessor kind :-)
24943
24944         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24945
24946 2002-06-08  Martin Baulig  <martin@gnome.org>
24947
24948         * expression.cs (Unary.TryReduceNegative): Added support for
24949         ULongConstants.
24950
24951 2002-06-08  Martin Baulig  <martin@gnome.org>
24952
24953         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24954         name can't be found in the `defined_names' - the caller will do a
24955         MemberLookup in this case and thus find methods in System.Enum
24956         such as Enum.IsDefined().
24957
24958 2002-06-08  Martin Baulig  <martin@gnome.org>
24959
24960         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24961         Convert.ChangeType() which works with TypeBuilder created types.
24962         (Enum.LookupEnumValue, Enum.Define): Use it here.
24963
24964         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24965         `TypeBuilder.BaseType != null' check.
24966         (TypeContainer.FindMembers): Only lookup parent members if we
24967         actually have a parent.
24968         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24969         (ConstructorInitializer.Resolve): Likewise.
24970
24971         * interface.cs (Interface.FindMembers): Added
24972         `TypeBuilder.BaseType != null' check.
24973
24974         * rootcontext.cs (RootContext.ResolveCore): Added
24975         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24976         classes_second_stage.
24977
24978         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24979         debug_type and trace_type when compiling with --nostdlib.       
24980
24981 2002-06-07  Martin Baulig  <martin@gnome.org>
24982
24983         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24984         (AddField): Set it to true when adding a non-static field.
24985         (DefineType): Use `have_nonstatic_fields' to find out whether we
24986         have non-static fields, not `Fields != null'.
24987
24988 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24989
24990         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24991         dereferencing a null on the static-field code path)
24992
24993 2002-05-30  Martin Baulig  <martin@gnome.org>
24994
24995         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24996         to take command line arguments.  Use reflection to call the new
24997         custom `Initialize' function on the symbol writer and pass it the
24998         command line arguments.
24999
25000         * driver.cs (--debug-args): New command line argument to pass command
25001         line arguments to the symbol writer.
25002
25003 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
25004
25005         * assign.cs (DoResolve): Forgot to do the implicit conversion to
25006         the target type for indexers and properties.  Thanks to Joe for
25007         catching this.
25008
25009 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
25010
25011         * typemanager.cs (MethodFlags): returns the method flags
25012         (Obsolete/ShouldIgnore) that control warning emission and whether
25013         the invocation should be made, or ignored. 
25014
25015         * expression.cs (Invocation.Emit): Remove previous hack, we should
25016         not do this on matching a base type, we should do this based on an attribute
25017
25018         Only emit calls to System.Diagnostics.Debug and
25019         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25020         on the command line.
25021
25022         * rootcontext.cs: Global settings for tracing and debugging.
25023
25024         * cs-tokenizer.cs (define): New utility function to track
25025         defines.   Set the global settings for TRACE and DEBUG if found.
25026
25027 2002-05-25  Ravi Pratap  <ravi@ximian.com>
25028
25029         * interface.cs (Populate*): Pass in the TypeContainer as well as
25030         the DeclSpace as parameters so that we can create EmitContexts and
25031         then use that to apply attributes etc.
25032
25033         (PopulateMethod, PopulateEvent, PopulateProperty)
25034         (PopulateIndexer): Apply attributes everywhere.
25035
25036         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
25037         etc.
25038
25039         (ApplyAttributes): Update accordingly.
25040
25041         We now apply interface attributes for all members too.
25042
25043 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
25044
25045         * class.cs (Indexer.Define); Correctly check if we are explicit
25046         implementation (instead of checking the Name for a ".", we
25047         directly look up if the InterfaceType was specified).
25048
25049         Delay the creation of the PropertyBuilder.
25050
25051         Only create the PropertyBuilder if we are not an explicit
25052         interface implementation.   This means that explicit interface
25053         implementation members do not participate in regular function
25054         lookups, and hence fixes another major ambiguity problem in
25055         overload resolution (that was the visible effect).
25056
25057         (DefineMethod): Return whether we are doing an interface
25058         implementation. 
25059
25060         * typemanager.cs: Temporary hack until we get attributes in
25061         interfaces (Ravi is working on that) and we get IndexerName
25062         support in interfaces.
25063
25064         * interface.cs: Register the indexers as properties.
25065
25066         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
25067         warning, I have verified that this is a bug in the .NET runtime
25068         (JavaScript suffers of the same problem).
25069
25070         * typemanager.cs (MemberLookup): When looking up members for
25071         interfaces, the parent of an interface is the implicit
25072         System.Object (so we succeed in searches of Object methods in an
25073         interface method invocation.  Example:  IEnumerable x;  x.ToString
25074         ()) 
25075
25076 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
25077
25078         * class.cs (Event): Events should also register if they do
25079         implement the methods that an interface requires.
25080
25081         * typemanager.cs (MemberLookup); use the new GetInterfaces
25082         method. 
25083
25084         (GetInterfaces): The code used to lookup interfaces for a type is
25085         used in more than one place, factor it here. 
25086
25087         * driver.cs: Track the errors at the bottom of the file, we kept
25088         on going.
25089
25090         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
25091         instance if the method we are calling is static!
25092
25093 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
25094
25095         * attribute.cs (ApplyAttributes): Make this function filter out
25096         the IndexerName attribute (as that attribute in reality is never
25097         applied) and return the string constant for the IndexerName
25098         attribute. 
25099
25100         * class.cs (TypeContainer.Emit): Validate that all the indexers
25101         have the same IndexerName attribute, and if so, set the
25102         DefaultName attribute on the class. 
25103
25104         * typemanager.cs: The return value might contain other stuff (not
25105         only methods).  For instance, consider a method with an "Item"
25106         property and an Item method.
25107
25108         * class.cs: If there is a problem with the parameter types,
25109         return. 
25110
25111 2002-05-24  Ravi Pratap  <ravi@ximian.com>
25112
25113         * ecore.cs (ImplicitConversionExists): Wrapper function which also
25114         looks at user defined conversion after making a call to 
25115         StandardConversionExists - we need this for overload resolution.
25116
25117         * expression.cs : Update accordingly the various method calls.
25118
25119         This fixes 2 bugs filed against implicit user defined conversions 
25120
25121 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * statement.cs: Track the result of the assignment.
25124
25125 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
25126
25127         * expression.cs (MemberAccess): Improved error reporting for
25128         inaccessible members.
25129
25130 2002-05-22  Martin Baulig  <martin@gnome.org>
25131
25132         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
25133         itself with debugging support.
25134
25135 2002-05-22  Martin Baulig  <martin@gnome.org>
25136
25137         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
25138         Removed, this isn't needed anymore.
25139
25140 2002-05-20  Martin Baulig  <martin@gnome.org>
25141
25142         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
25143         be underlying type for an enum.
25144
25145 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
25148         that splits out the loading of just the core types.
25149
25150         * rootcontext.cs (ResolveCore): Split the struct resolution in
25151         two, so we can load the enumeration underlying types before any
25152         enums are used.
25153
25154         * expression.cs (Is): Bandaid until we fix properly Switch (see
25155         bug #24985 for details).
25156
25157         * typemanager.cs (ImplementsInterface): The hashtable will contain
25158         a null if there are no interfaces implemented.
25159
25160 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
25161
25162         * cs-parser.jay (indexer_declarator): It is fine to have array
25163         parameters
25164
25165 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25166
25167         * typemanager.cs: (RegisterBuilder): New function used to register
25168         TypeBuilders that implement interfaces.  Since
25169         TypeBuilder.GetInterfaces (as usual) does not work with lame
25170         Reflection.Emit. 
25171         (AddUserType): register interfaces.
25172
25173         (ImplementsInterface): Use the builder_to_ifaces hash if we are
25174         dealing with TypeBuilder.  Also, arrays are showing up as
25175         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
25176         methods can not be invoked on them!
25177
25178         * ecore.cs (ExplicitReferenceConversionExists): Made public.
25179         (ImplicitReferenceConversionExists): Split out from
25180         StandardConversionExists. 
25181
25182         * expression.cs (As): We were only implementing one of the three
25183         cases for the as operator.  We now implement them all.
25184         (Is): Implement the various other cases for Is as well.
25185
25186         * typemanager.cs (CACHE): New define used to control if we want or
25187         not the FindMembers cache.  Seems to have a negative impact on
25188         performance currently
25189
25190         (MemberLookup): Nested types have full acess to
25191         enclosing type members
25192
25193         Remove code that coped with instance/static returns for events, we
25194         now catch this in RealFindMembers.
25195
25196         (RealFindMembers): only perform static lookup if the instance
25197         lookup did not return a type or an event.  
25198
25199 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
25200
25201         * assign.cs (CompoundAssign): We pass more semantic information
25202         now to Compound Assignments than we did before: now we have all
25203         the information at hand, and now we resolve the target *before* we
25204         do the expression expansion, which allows the "CacheValue" method
25205         to have the effect we intended (before, a [x] += 1 would generate
25206         two differen ArrayAccess expressions from the ElementAccess,
25207         during the resolution process).
25208
25209         (CompoundAssign.DoResolve): Resolve target and original_source here.
25210
25211 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
25212
25213         * expression.cs (ArrayAccess): dropped debugging information. 
25214
25215         * typemanager.cs: Small bug fix: I was always returning i_members,
25216         instead of one of i_members or s_members (depending on which had
25217         the content).
25218
25219         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
25220         method is invoked before any code generation takes place, and it
25221         is a mechanism to inform that the expression will be invoked more
25222         than once, and that the method should use temporary values to
25223         avoid having side effects
25224
25225         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
25226
25227         * ecore.cs (Expression.CacheTemporaries): Provide empty default
25228         implementation.
25229
25230         * expression.cs (Indirection, ArrayAccess): Add support for
25231         CacheTemporaries in these two bad boys. 
25232
25233         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
25234         ldobj or ldind_ref.  
25235         (StoreFromPtr): Handle stobj as well.
25236
25237         * expression.cs (UnaryMutator): Share more code.
25238
25239         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
25240         down: I was not tracking the Filter function as well, which
25241         was affecting the results of the cache.
25242
25243 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
25244
25245         * attribute.cs: Remove the hack to handle the CharSet property on
25246         StructLayouts. 
25247
25248 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
25249
25250         * attribute.cs (DoResolve): More uglyness, we now only try to
25251         resolve the attribute partially, to extract the CharSet
25252         information (only if we are a StructLayout attribute).  Otherwise 
25253
25254         (GetExtraTypeInfo): Add some code to conditionally kill in the
25255         future this.   I am more and more convinced that the .NET
25256         framework has special code to handle the attribute setting on
25257         certain elements.
25258
25259         * expression.cs (IsParamsMethodApplicable): Revert my previous
25260         foreach change here, it was wrong.
25261
25262 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
25263
25264         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
25265         (pp_expr): do not abort on unknown input, just return.
25266         (eval): abort if there are pending chars.
25267
25268         * attribute.cs (Attribute.Resolve): Positional parameters are
25269         optional.  Deal with that case.
25270
25271         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
25272         the Ansi/Unicode/Auto information for the type.
25273
25274         (TypeContainer.DefineType): instantiate the EmitContext here, as
25275         we will be using it during the type definition (to resolve
25276         attributes) and during the emit phase.
25277
25278         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
25279         to pull type information out of the attributes
25280
25281         (Attribute.Resolve): track the constructor builder, and allow for
25282         multiple invocations (structs and classes will use this).
25283
25284         * ecore.cs (MemberLookupFinal): new version with all the
25285         parameters customizable.
25286
25287         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
25288         constructors.  Return if the result value is null (as the error
25289         would have been flagged already by MemberLookupFinal)
25290
25291         Do not allow instances of abstract classes or interfaces to be
25292         created.
25293
25294         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
25295         We have to compare the assembly property here when dealing with
25296         FamANDAssem and Assembly access modifiers, because we might be
25297         creating an assembly from *modules* (that means that we are not
25298         getting TypeBuilders for types defined in other modules that are
25299         part of this assembly).
25300
25301         (Method.Emit): If the method is marked abstract and has a body,
25302         emit an error. 
25303
25304         (TypeContainer.DefineMembers): If both the defined member and the
25305         parent name match are methods, then do not emit any warnings: let
25306         the Method.Define routine take care of flagging warnings.  But if
25307         there is a mismatch (method overrides something else, or method is
25308         overriwritten by something, then emit warning).
25309
25310         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25311         set to null, this means `do not check for the return type on the
25312         signature'. 
25313
25314         (Method.Define): set the return type for the method signature to
25315         null, so that we get methods with the same name and parameters and
25316         different return types.  This is used to flag warning 114 (you are
25317         hiding a method, and you probably want to use the new/override
25318         keywords instead).
25319
25320         * typemanager.cs (MemberLookup): Implemented proper access
25321         control, closing a long standing set of bug reports.  The problem
25322         was that the Framework only has two bits: Public and NonPublic,
25323         and NonPublic includes private and protected methods, but we need
25324         to enforce the FamANDAssem, FamOrAssem and Family. 
25325
25326 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
25327
25328         * statement.cs (GotoCase): Return true: Ammounts to giving up
25329         knowledge on whether we return or not, and letting the other case
25330         be responsible for it.
25331
25332 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
25333
25334         * driver.cs: Do not load directories for each file processed, only
25335         do it if there is a pattern.
25336
25337         * ecore.cs: Report readonly assigns here as well, as we might have
25338         been resolved only by MemberAccess.
25339
25340         (SimpleName.SimpleNameResolve): Also be useful for LValue
25341         resolution.   We need this to propagate assign to local readonly variables
25342
25343         * typemanager.cs: Use a ptrhashtable for the criteria, because we
25344         do not want to reuse potential criteria memory.
25345
25346         * class.cs (MyEventBuilder): Set reflected_type;
25347
25348         * ecore.cs (Constantify): Added support for constifying bools.
25349
25350         (RootContext.LookupType): Added a cache for values looked up in
25351         the declaration space.
25352
25353         * typemanager.cs (FindMembers): Now is a front-end to
25354         RealFindMembers, and provides a two-level hashtable-based cache to
25355         the request.  
25356
25357         15% performance improvement: from 22.5 to 19.2 seconds.
25358
25359         * expression.cs (IsParamsMethodApplicable): use foreach.
25360         (Invocation.DoResolve): ditto.
25361         (New.DoResolve): ditto.
25362         (ArrayCreation.DoResolve): ditto.
25363
25364         * ecore.cs (FindMostEncompassingType): use foreach.
25365
25366         * delegate.cs (NewDelegate.DoResolve): Use foreach
25367
25368         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25369         (RemoveMethods): use foreach.
25370
25371         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25372         nested foreach statements instead of for, and also break out of
25373         the inner loop once a match is found.
25374
25375         (Invocation.OverloadResolve): Use foreach, simplify the code. 
25376
25377 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
25378
25379         * cfold.cs (BinaryFold): During an enumeration evaluation context,
25380         we actually unwrap the expression to allow for extra information
25381         to be extracted. 
25382
25383         * expression.cs: Use Shr_Un on unsigned operations. 
25384
25385 2002-05-08  Ravi Pratap  <ravi@ximian.com>
25386
25387         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
25388         applicable operators was not being considered correctly. This closes
25389         the bug Miguel reported.
25390
25391 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25392
25393         * attribute.cs: check that the type derives from System.Attribute
25394         and report the correct error in that case (moved the duplicate code to
25395         its own method, too).
25396
25397 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25398
25399         * attribute.cs: lookup attribute type name as the spec says: first the
25400         bare attribute name and then name + "Attribute" (nant compiles with
25401         mcs after this fix).
25402
25403 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
25406         Because of the way we parse things, we should try to see if a
25407         UIntConstant can fit in an integer.
25408
25409 2002-05-07  Ravi Pratap  <ravi@ximian.com>
25410
25411         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25412         when we are in an explicit context.
25413
25414         (ConvertReferenceExplicit): When converting from Iface type S to Class
25415         T make sure the rules are implemented as an OR.
25416
25417         * parameter.cs (ParameterType): Make it a property for now although the
25418         purpose really isn't anything immediate.
25419
25420         * expression.cs (Is*Applicable): Do better checking on the parameter type
25421         of a ref/out parameter. The ones from the system assemblies are already 
25422         marked with the correct type so we don't need to do any correction.
25423
25424         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25425         the object type is standard too so include that.
25426
25427 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25428
25429         * ecore.cs (StandardConversionExists): Augment with missing code:
25430         deal with IntConstant, LongConstants and Enumerations.
25431
25432         * assign.cs: Report the error, instead of failing silently
25433
25434         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25435         typecontainer that they are declared, because the
25436         typecontainer/namespace will have the list of using clauses that
25437         need to be applied.
25438
25439         Assembly Attributes were escaping the normal registration
25440         mechanism. 
25441
25442         (EmitCode): Apply attributes within an EmitContext that represents
25443         the container they were declared on.
25444
25445         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25446
25447 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25448
25449         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25450         Revamp completely - make much cleaner as we now operate only
25451         on a set of Types.
25452
25453         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25454         to implement the logic detailed in the spec more correctly.
25455
25456         (UserDefinedConversion): Update accordingly.
25457
25458 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25459
25460         * statement.cs: Return flow analysis information up.
25461
25462         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25463         and the default.
25464
25465         (token): Do not consume an extra character before calling
25466         decimal_digits.
25467
25468 2002-05-06  Piers Haken <piersh@friskit.com>
25469
25470         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25471
25472 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25473
25474         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25475         EmitContext during the instance constructor initializer
25476         resolution, to stop access to instance variables.
25477
25478         This is mandated by the spec, last paragraph of the `constructor
25479         initializers' section. 
25480
25481 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25482
25483         * cs-parser.jay, class.cs (Accessor): new class used to represent
25484         an accessor (get or set).  In the past we used `null' to represent
25485         a missing accessor.  But this is ambiguous because there was no
25486         way to tell in abstract indexers/properties if one of them was
25487         specified.
25488
25489         Now there is a way of addressing that.
25490
25491         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25492         instead of FindMembers.
25493
25494         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25495         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25496
25497         * attribute.cs: Treat indexers and properties as the same in terms
25498         of applying attributes
25499
25500         * ecore.cs (FindMostEncompassedType): Use statically initialized
25501         EmptyExpressions()s like we do elsewhere to avoid creating useless
25502         objects (and we take this out of the tight loop).
25503
25504         (GetConversionOperators): Move the code to extract the actual
25505         operators to a separate routine to clean things up.
25506
25507 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25508
25509         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25510         events are always registered FieldBuilders.
25511
25512         * class.cs (FieldBase): New class shared by Fields 
25513
25514         * delegate.cs: If we are a toplevel delegate, use our full name.
25515         If we are a nested delegate, then only use our tail name.
25516
25517 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25518
25519         * expression.cs (IsApplicable): Ensure that we add the "&" to
25520         ref/out types before comparing it with the type of the argument.
25521
25522         (IsParamsMethodApplicable): Ditto.
25523
25524         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25525         silly me ;-)
25526
25527         * delegate.cs : Handle the case when we have more than one applicable
25528         method. Flag an error only when we finish checking all.
25529
25530 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25531
25532         * expression.cs: Add support for boolean static initializers.
25533
25534 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25535
25536         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25537
25538         * parameter.cs (ComputeParameterTypes,
25539         ComputeAndDefineParameterTypes): Better error handling: now we
25540         clear the `types' cache if we fail during any of the type lookups.
25541         We also return the status code correctly to our caller
25542
25543         * delegate.cs: If we fail to define a delegate, abort the extra
25544         steps. 
25545
25546         * expression.cs (Binary.ResolveOperator): for
25547         operator==(object,object) and operator !=(object, object) we also
25548         have to verify that there is an implicit conversion from one to
25549         the other.
25550
25551         (ArrayAccess.DoResolve): Array Access can operate on
25552         non-variables. 
25553
25554 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25555
25556         * assign.cs (CompoundAssign): A new class used as a "flag" that
25557         the assignment actually is happening as part of a compound
25558         assignment operator.
25559
25560         During compound assignment, a few new rules exist to enable things
25561         like:
25562
25563         byte b |= 1 + 2
25564
25565         From the spec:
25566
25567         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25568         to the type of x) if y is implicitly convertible to the type of x,
25569         and the operator is a builtin operator and the return type of the
25570         operator is explicitly convertible to the type of x. 
25571
25572         * rootcontext.cs: Reset warning level to 2.  4 catches various
25573         "interesting" features in mcs, we must clean this up at some
25574         point, but currently am trying to kill other bugs ;-)
25575
25576         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25577         in container classes as well.  
25578
25579         * expression.cs (Binary.ResolveOperator): Handle string case
25580         before anything else (as operator overloading does emit an error
25581         before doing anything else).
25582
25583         This code could go away when we move to a table driven model, but
25584         i could not come up with a good plan last night.
25585
25586 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25587
25588         * typemanager.cs (CSharpName): reimplementation using regex.
25589         * class.cs: added null check for fields in Emit
25590         * rootcontext.cs: set warninglevel to 4
25591
25592 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25593
25594         * typemanager.cs (CSharpName): reimplemented with Lupus
25595         suggestion.
25596
25597 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25598
25599         * statement.cs (If): correclty implement Resolve, because we were
25600         not catching sem errors in there.  The same process is needed
25601         everywhere else. 
25602         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25603
25604
25605         (Statement.Warning_DeadCodeFound): Factorize code.
25606         (While): Report dead code here too.
25607
25608         (Statement): Added Resolve virtual method to allow
25609         for resolution split from the emit code.
25610
25611 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25612
25613         * statement.cs (EmitBoolExpression): No longer try to resolve the
25614         expression here.    
25615         (MakeBoolean): New utility function that resolve, implicitly
25616         converts to boolean and tags the expression. 
25617
25618
25619         (If, Do): Implement dead code elimination.
25620         (While): Implement loop inversion
25621
25622         (Do, While, For, If): Resolve the expression prior to calling our
25623         code generation.
25624
25625 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25626
25627         * class.cs:
25628           - added method Report28 (warning: program has more than one entry point)
25629           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25630           - modified method Method.Define, the part at the end of the method
25631
25632         * rootcontext.cs: added static public Location EntryPointLocation;
25633           
25634         * ../errors/cs0028.cs : Add test case for the above warning.              
25635
25636         * typemanager.cs:
25637           - modified method CSharpName to allow arrays of primitive type to
25638             be printed nicely (e.g. instead of System.Int32[][] it now prints
25639             int[][])
25640           - added method CSharpSignature: returns the signature of a method
25641             in string format to be used in reporting errors, warnings, etc.
25642
25643         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25644         with String.Empty.
25645
25646 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25647
25648         * delegate.cs (Define): Fix extremely silly bug where I was
25649         setting the type of the 'object' parameter of the BeginInvoke
25650         method to System.IAsyncResult instead of System.Object ;-)
25651
25652 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25653
25654         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25655         here. 
25656
25657         (Constructor.Emit): return if we fail to initialize the
25658         constructor.  Another door closed!  
25659
25660         * expression.cs (New.DoResolve): Improve error message (from -6 to
25661         1501).  Use DeclaredOnly lookup to find the exact constructor.
25662
25663         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25664         loop.  This is useful.
25665
25666         * cs-parser.jay: Adjust the default parameters so that destructors
25667         have the proper signature.
25668
25669 2002-04-26  Martin Baulig  <martin@gnome.org>
25670
25671         * driver.cs (LoadAssembly): If `assembly' contains any characters
25672         which are only valid in path names and not in assembly names
25673         (currently slash, backslash and point), use Assembly.LoadFrom ()
25674         instead of Assembly.Load () on the `assembly' (before iteration
25675         over the link_paths).
25676
25677 2002-04-26  Martin Baulig  <martin@gnome.org>
25678
25679         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25680
25681 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25682
25683         * class.cs (Property): use the new typemanager.MemberLookup
25684
25685         (TypeContainer.MemberLookup): Implement using the
25686         TypeManager.MemberLookup now. 
25687
25688         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25689         and return MemberInfos, so that these can be used without an
25690         EmitContext (what we had before).
25691
25692 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25693
25694         * expression.cs: Fix the case where the argument to params if the
25695         type of the params.  I omitted handling this before.   Fixed
25696
25697 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25698
25699         * driver.cs: Call BootCorlib_PopulateCoreType
25700
25701         * class.cs (Property.CheckBase): Check for properties only, not
25702         for all members. 
25703
25704         * interface.cs: Temporary hack: try/catch around the
25705         CustomAttributeBuilder, because I am getting an exception that I
25706         do not understand.
25707
25708         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25709         types whose definitions are required to be there (attributes are
25710         defined before standard types).
25711
25712         Compute definitions as we boot the various types, as they are used
25713         immediately (value_type class will need object_type, but if we do
25714         not initialize object_type, we will pass a null, which will let
25715         the runtime pick the System.Object from the existing corlib, which
25716         is not what we want).
25717
25718 2002-04-22  Patrik Torstensson <totte@labs2.com>
25719
25720         * cs-tokenizer.cs: fixed a number of trim() issues.
25721
25722 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25723
25724         * expression.cs (Argument.Type): Ensure that we return the correct
25725         type when we have out or ref parameters [in which case we 
25726         append a "&"].
25727
25728 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25729
25730         * class.cs (Property, Indexer): Allow extern modifier in there. 
25731
25732         * typemanager.cs (InitBaseTypes): Initializes object_type and
25733         value_type, since those will be used early on during the bootstrap
25734         process to compile corlib.
25735
25736         (InitCoreTypes): Move code from here to InitBaseTypes.
25737
25738 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25739
25740         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25741         single-dimension arrays as using the ldlen opcode.  
25742
25743         Daniel Lewis discovered this optimization.  
25744
25745         * typemanager.cs: Add signature for System.Array::get_Length
25746
25747 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25748
25749         * statement.cs: report the error when the foreach does not apply to an
25750         array nor a collection.
25751
25752 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25753
25754         * expression.cs: Add implicit conversions to the operator ~.
25755
25756         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25757
25758         * typemanager.cs: Locate the decimal constructor.
25759
25760 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25761
25762         * attribute.cs: use the new property of TypeOf.
25763         * expression.cs: added 'get' property around typearg.
25764
25765         These changes fix a build breaker reported by NickD. Is this the
25766         correct way to fix?  If not, please, revert my changes and make it
25767         work :-).
25768
25769 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25770
25771         * attribute.cs: Add support for typeof in attribute invocations.
25772         I am not sure that this is right though.
25773
25774 2002-04-14  Duncan Mak  <duncan@ximian.com>
25775
25776         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25777         Binary.Operator.Division case.
25778
25779 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25780
25781         * class.cs (DefineType): Ensure that we do a proper check on
25782         attribute types and also register it with the TypeManager.
25783
25784         (TypeContainer.Targets): The default for attribute types is
25785         AttributeTargets.All.
25786
25787         * attribute.cs (ApplyAttributes): Registering the attribute type
25788         is done elsewhere, not when we discover we have a Usage attribute.
25789
25790 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25791
25792         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25793         and get rid of is_delegate parameter.
25794
25795         * everywhere : update.
25796
25797 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25798
25799         * cs-parser.jay (compilation_unit): Revamp completely to use
25800         some new ideas that I got from Rhys' grammar to solve the problems
25801         with assembly level attributes.
25802
25803         (outer_declaration): New grammar production.
25804
25805         (attribute_sections): Add.
25806
25807         (opt_attributes): Base on attribute_sections
25808
25809         (namespace_declaration): Allow opt_attributes to tackle the case
25810         when we have assembly level attributes - we are clever in this
25811         regard now ;-)
25812
25813         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25814         attributes in the non-global context.
25815
25816         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25817         instead of SetGlobalAttributes.
25818
25819         * class.cs, rootcontext.cs : Ensure we define and generate 
25820         attribute types before anything else.
25821
25822         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25823         and flag the new error -20 for the case when the attribute type
25824         does not have valid targets specified. csc does not catch this.
25825
25826         * ../errors/errors.txt : update for error # -20
25827
25828 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25829
25830         * support.cs (InternalParameters.ParameterModifier): Do some null
25831         checking and return sane values.
25832
25833         * class.cs (Method.Define): If we are a PInvoke method, ensure
25834         that we are static and extern. Report error # 601
25835
25836         * ../errors/cs0601.cs : Add test case for the above error.
25837
25838 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25839
25840         * rootcontext.cs (attribute_types): We need to keep type of
25841         all attribute types separately and emit code for them first.
25842
25843         (RegisterAttribute) : Implement.
25844
25845         * class.cs (DefineType): Check if the current Type is a custom
25846         attribute type and register it accordingly.
25847
25848         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25849         adding the first attribute twice and rename to
25850
25851         (SetGlobalAttributes): this.
25852
25853         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25854         lookups.
25855
25856         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25857         if we are processing global arguments. Hmm, I am unsure of this.
25858
25859 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25860
25861         * expression.cs: added static array of strings to avoid calling
25862         Enum.ToString () for Operator in Binary. Significant recover of
25863         performance.
25864
25865 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25866
25867         * class.cs (FindMembers): Allow the Builders of the various
25868         members to be null.  If they are skip them.  This only happens
25869         during the PInvoke declaration.
25870
25871 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25872
25873         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25874         failure, so we do not keep going afterwards.
25875
25876         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25877         wanted to pass `false' as the `is_delegate' argument.  If this is
25878         the case, why not use delegate_type == null to mean `is_delegate =
25879         false' and anything else as is_delegate = true.
25880
25881 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25882
25883         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25884         code for the section, not the beginning of the tests.
25885
25886 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25887
25888         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25889
25890         * expression.cs (Binary): same.  Warn about errors where we have
25891         Enum/Enum in operator + as well.
25892
25893 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25894
25895         * statement.cs:
25896                 - added support for switch(bool)
25897                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25898                 - add TableSwitchEmit() to handle table-based switch statements
25899
25900 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25901
25902         * expression.cs (Invocation.OverloadResolve): Factor out code which
25903         does parameter compatibility checking with arguments so that we can 
25904         re-use the code even from Delegate.VerifyApplicability
25905
25906         (VerifyArgumentsCompat): Move above code here.
25907
25908         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25909         and instead make a call to the above method.
25910
25911 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25912
25913         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25914         We use it to keep track of classes which are attribute types.
25915
25916 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25917
25918         * delegate.cs (Delegate.Define): Correctly define the types in the
25919         presence of fixed and array parameters.
25920
25921         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25922         doing FindMembers.
25923
25924         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25925         include NonPublic after the first iteration.
25926
25927         * class.cs (Indexer.CheckBase): Only check if both parents are
25928         non-null. 
25929
25930         * cs-parser.jay (accessor_body): If empty, set to null.
25931
25932         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25933         same code path here to resolve constants names that we did have in
25934         MemberAccess.DoResolve.  There is too much code duplicated here.
25935
25936 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25937
25938         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25939
25940         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25941         to MakeUnionSet.
25942
25943         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25944         tokens, numbers and strings.
25945
25946         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25947         parenthesis.
25948
25949         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25950         asyncronous parameters and the regular parameters.  
25951
25952         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25953         specify the target directory.
25954
25955         * expression.cs: (This.DoResolve): Simplify
25956         (As.Emit): Optimize, do not generate IsInst if the expression is
25957         always of the given type.
25958
25959         (Is.DoResolve): Bug fix, we were reporting both always/never for
25960         the is expression.
25961
25962         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25963         creating too many unnecessary arrays.
25964
25965 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25966
25967         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25968         fields instead of rolling our own initializer.   Takes care of all
25969         implicit conversions, and drops unnecessary static checks/argument.
25970
25971 2002-03-31  Dick Porter  <dick@ximian.com>
25972
25973         * driver.cs: use the GetDirectories() return values properly, and
25974         use "/" as path separator.
25975
25976 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25977
25978         * expression.cs (Unary): Optimize - - expr into expr.
25979         (Binary): Optimize a + (-b) into a -b.
25980
25981         * codegen.cs (CodeGen): Made all methods static.
25982
25983 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25984
25985         * rootcontext.cs: 
25986
25987         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25988         TypeBuilder property.
25989
25990         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25991         instead. 
25992
25993         * tree.cs: Removed the various RecordXXXX, and replaced with a
25994         single RecordDecl.  Removed all the accessor methods, and just
25995         left a single access point Type 
25996
25997         * enum.cs: Rename DefineEnum to DefineType.
25998
25999         * decl.cs: New abstract method `DefineType' used to unify the
26000         Defines for Enumerations, Interfaces, TypeContainers and
26001         Delegates.
26002
26003         (FindType): Moved LookupInterfaceOrClass here.  Moved the
26004         LookupBaseClasses method that used to live in class.cs and
26005         interface.cs here, and renamed to FindType.
26006
26007         * delegate.cs: Implement DefineType.  Take advantage of the
26008         refactored pattern for locating the parent builder without taking
26009         the parent_builder argument (which we know does not work if we are
26010         nested, and triggering a toplevel definition).
26011
26012 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26013
26014         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26015         accessibility of a member has changed during override and report
26016         an error if so.
26017
26018         * class.cs (Method.Define, Property.Define): Only complain on
26019         overrides if the method is private, any other accessibility is
26020         fine (and since we just checked the permission is the same, we are
26021         good to go).
26022
26023         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26024         and elif are processed always.  The other pre-processing
26025         directives are only processed if we are "taking" the path
26026
26027 2002-03-29  Martin Baulig  <martin@gnome.org>
26028
26029         * class.cs (Method.Emit): Only emit symbolic debugging info if the
26030         current location is not Null.
26031
26032         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
26033         a separate method so we can profile it.
26034
26035         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
26036         `span.Seconds' are just seconds, but no minutes or hours.
26037         (MainDriver): Profile the CodeGen.SaveSymbols calls.
26038
26039 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26040
26041         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
26042         Remove the gratuitous set of Final:
26043
26044                                 // If an interface implementation, then we can set Final.
26045                                 if (((flags & MethodAttributes.Abstract) == 0) &&
26046                                     implementing.DeclaringType.IsInterface)
26047                                         flags |= MethodAttributes.Final;
26048
26049         I do not know what I was smoking when I used that.
26050
26051
26052         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
26053         step into fixing the name resolution issues for delegates and
26054         unifying the toplevel name resolution.
26055
26056 2002-03-28  Martin Baulig  <martin@gnome.org>
26057
26058         * class.cs (Method.Emit): If we have a symbol writer, call its
26059         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
26060         tell it about the current method.
26061
26062         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
26063         writer that we're going to emit the first byte of IL code for a new
26064         statement (a new source line).
26065         (EmitContext.EmitTopBlock): If we have a symbol writer, call
26066         EmitContext.Mark() before emitting any code.
26067
26068         * location.cs (SymbolDocument): Return null when we're Null.
26069
26070         * statement.cs (Statement): Moved the `Location loc' variable here.
26071         (Statement.EmitBoolExpression): If we have a symbol writer, call
26072         ec.Mark() before emitting any code to tell it that we're at the
26073         beginning of a new statement.
26074         (StatementExpression): Added `Location' argument to the constructor.
26075         (Block): Added public readonly variable `StartLocation' and public
26076         variable `EndLocation'.  The latter is to be set using SetEndLocation().
26077         (Block): Added constructor which takes a start and end location.
26078         (Block.SetEndLocation): New method. This sets the end location.
26079         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
26080         local variables we create.
26081         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
26082         each statement and do also mark the begin and end of the block.
26083
26084         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
26085         tell it the current lexer.Location, use Location.Null for the end of the
26086         block.
26087         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
26088         current block, set its end location using SetEndLocation().
26089         (statement_expression): StatementExpression constructor now takes the
26090         lexer.Location as additional argument.
26091         (for_statement, declare_local_variables): Likewise.
26092         (declare_local_variables): When creating a new implicit block, use the
26093         new Block constructor and pass it the lexer.Location.
26094
26095 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
26096
26097         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
26098         members also on the parent interfaces recursively.
26099
26100 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
26101
26102         * report.cs: Use new formats, since Gonzalo finished the missing
26103         bits. 
26104
26105         * expression.cs (Binary.ResolveOperator): added missing operator|
26106         operator& and operator^ for bool/bool.
26107
26108         * cs-parser.jay: CheckDef now takes a Location argument that is
26109         used to report errors more precisly (instead of reporting the end
26110         of a definition, we try to track something which is a lot closer
26111         to the source of the problem).
26112
26113         * cs-tokenizer.cs: Track global token use, so we can properly flag
26114         the use of #define/#undef after the first token has been seen.
26115
26116         Also, rename the reportXXXX to Error_DescriptiveName
26117
26118         * decl.cs (DeclSpace.IsTopLevel): Move property here from
26119         TypeContainer, so that Enum and Interface can use this too.
26120
26121         * class.cs (TypeContainer.LookupInterfaceOrClass,
26122         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
26123         `builder' argument.  Typically this was used to pass the parent
26124         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
26125         the definition).  
26126
26127         The problem is that a nested class could trigger the definition of
26128         a toplevel class, and the builder would be obviously wrong in that
26129         case. 
26130
26131         So we drop this argument, and we compute dynamically the
26132         TypeBuilder/ModuleBuilder (the correct information was available
26133         to us anyways from DeclSpace.Parent)
26134
26135         * interface.cs (Interface.DefineInterface): Drop builder
26136         parameter cleanup like class.cs
26137
26138         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
26139         like class.cs
26140
26141         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
26142         values. 
26143
26144         (Try.Emit): Propagate the returns value from the statement.
26145
26146         (Return.Emit): Even if we are leavning 
26147
26148         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
26149
26150         * modifiers.cs: Fix the computation of MethodAttributes flags.
26151
26152 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
26153
26154         * driver.cs: allow compilation of files that start with '/'.
26155         Add a default case when checking the argument of --target.
26156
26157 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
26158
26159         * interface.cs: Implement the same search algorithm for types in
26160         the interface code.
26161
26162         * delegate.cs: Do not allow multiple definition.
26163
26164         * Recovered ChangeLog that got accidentally amputated
26165
26166         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
26167
26168         * rootcontext.cs: Load manually enum to allow core classes to
26169         contain enumerations.
26170
26171         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
26172         Update to new static methods in TypeManager.
26173
26174         * typemanager.cs (GetMethod, GetConstructor): Use our
26175         implementation of FindMembers to find the members, since during
26176         corlib compilation, the types are TypeBuilders and GetMethod and
26177         GetConstructor do not work.
26178
26179         Make all methods in TypeManager static.
26180
26181         (InitCodeHelpers): Split the functionality from
26182         the InitCodeTypes function.
26183
26184         * driver.cs: Call InitCodeHelpers after we have populated the
26185         types. 
26186
26187         * cs-parser.jay (delegate_declaration): we did not used to compute
26188         the delegate name correctly for void delegates.
26189
26190 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
26191
26192         * rootcontext.cs (RootContext): Init the interface_resolve_order
26193         and type_container_resolve_order always.
26194
26195         (ResolveCore, BootstrapCorlib_ResolveClass,
26196         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
26197         compiler when compiling with --nostdlib
26198
26199         * class.cs (TypeContainer.DefineType): Check that our parent is
26200         not null.  This test is most important when we are bootstraping
26201         the core types.
26202
26203         * codegen.cs: Split out the symbol writing code.
26204
26205 2002-03-25  Martin Baulig  <martin@gnome.org>
26206
26207         * driver.cs (-g): Made -g an alias for --debug.
26208
26209 2002-03-24  Martin Baulig  <martin@gnome.org>
26210
26211         * codegen.cs (SymbolWriter): New public variable. Returns the
26212         current symbol writer.
26213         (CodeGen): Added `bool want_debugging_support' argument to the
26214          constructor. If true, tell the ModuleBuild that we want debugging
26215         support and ask it for the ISymbolWriter.
26216         (Save): If we have a symbol writer, call it's Close() method after
26217         saving the assembly.
26218
26219         * driver.c (--debug): New command line argument to create a
26220         debugger information file.
26221
26222         * location.cs (SymbolDocument): New public property. Returns an
26223         ISymbolDocumentWriter object for the current source file or null
26224         if we don't have a symbol writer.
26225
26226 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
26227
26228         * driver.cs (LoadAssembly): Correctly return when all the paths
26229         have been tried and not before.
26230
26231         * statement.cs (Switch.Emit): return the actual coverage for this
26232         statement (returns/not-returns)
26233
26234         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
26235         switch of the statement if we are the last switch section.  That
26236         kills two problems: try/catch problems (we used to emit an empty
26237         nop at the end) and switch statements where all branches would
26238         return. 
26239
26240 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
26241
26242         * driver.cs: Add default assemblies (the equivalent to the
26243         Microsoft CSC.RSP file)
26244
26245         * cs-tokenizer.cs: When updating `cols and setting it to zero,
26246         also update tokens_seen and set it to false.
26247
26248         * driver.cs: Implement --recurse for Mike.
26249
26250         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
26251         correctly splitting out the paths.
26252
26253 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
26254
26255         * interface.cs (Interface.PopulateProperty): Instead of using
26256         `parent' as the declaration space for the set parameters, use
26257         `this' 
26258
26259         * support.cs (InternalParameters): InternalParameters constructor
26260         takes a DeclSpace instead of a TypeContainer.
26261
26262         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
26263         types are being initialized, load the address of it before calling
26264         the function.  
26265
26266         (New): Provide a mechanism to disable the generation of local
26267         value type temporaries when the caller will be providing us with
26268         an address to store it.
26269
26270         (ArrayCreation.EmitDynamicInitializers): Use it.
26271
26272 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
26273
26274         * expression.cs (Invocation.EmitArguments): Only probe for array
26275         property if there is more than one argument.  Sorry about that.
26276
26277         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
26278         empty param arrays.
26279
26280         * class.cs (Method.LabelParameters): Fix incorrect code path that
26281         prevented the `ParamArrayAttribute' from being applied to the
26282         params attribute.
26283
26284 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
26285
26286         * support.cs (ReflectionParameters): Correctly compute whether the
26287         last argument is a params array.  Fixes the problem with
26288         string.Split ('a')
26289
26290         * typemanager.cs: Make the assemblies array always be non-null
26291         (empty, but non-null)
26292
26293         * tree.cs (RecordDecl): New function that abstracts the recording
26294         of names.  This reports error 101, and provides a pointer to the
26295         previous declaration.  Fixes a crash in the compiler.
26296
26297         * cs-parser.jay (constructor_declaration): Update to new grammar,
26298         and provide a constructor_body that can be empty.
26299
26300 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
26301
26302         * driver.cs: Add support for --resources.
26303
26304         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26305         Make all types for the various array helper methods be integer.
26306
26307         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26308         CheckState to ConvCast.
26309
26310         (ConvCast): Now it takes a `checked' state argument, to avoid
26311         depending on the emit context for the conversion, and just using
26312         the resolve time setting.
26313
26314         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26315         instead of Invocation.EmitArguments.  We do not emit the original
26316         arguments, instead we emit those which have been converted to
26317         unsigned int expressions.
26318
26319         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26320
26321         * codegen.cs: ditto.
26322
26323         * expression.cs (LocalVariableReference): Drop the use of the
26324         Store function that depended on the variable index.
26325
26326         * statement.cs (VariableInfo): Drop the `Idx' property from this
26327         class, as this is not taking into account the indexes for
26328         temporaries tat we generate during the execution, getting the
26329         indexes wrong.
26330
26331         * class.cs: First emit class initializers, then call the parent
26332         constructor. 
26333
26334         * expression.cs (Binary): Fix opcode emision.
26335         (UnaryMutator.EmitCode): Support checked code generation
26336
26337         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26338         matches for events for both the Static and Instance scans,
26339         pointing to the same element.   Fix that.
26340
26341 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
26342
26343         * rootcontext.cs (ResolveTree): Always set the
26344         interface_resolve_order, because nested interfaces will be calling
26345         into us.
26346
26347         * class.cs (GetInterfaceOrClass): Track the same resolution
26348         process used by TypeManager.LookupType.  This fixes the nested
26349         type lookups in class declarations (separate path from
26350         LookupType). 
26351
26352         (TypeContainer.DefineType): Also define nested interfaces.
26353         (TypeContainer.RegisterOrder): New public function used to
26354         register the order in which child interfaces need to be closed.
26355
26356         Nested interfaces need to be closed after their parents have been
26357         created. 
26358
26359         * interface.cs (InterfaceAttr): Put all the logic for computing
26360         the interface attribute here. 
26361
26362         (DefineInterface): Register our interface order with the
26363         RootContext or with the TypeContainer depending on the case.
26364
26365 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26366
26367         * cs-parser.jay: rework foreach statement to work with the new
26368         changes to the policy on SimpleNames.
26369
26370         * report.cs: support Stacktrace on warnings as well.
26371
26372         * makefile: drop --unsafe and /unsafe from the compile.
26373
26374 2002-03-13  Ravi Pratap  <ravi@ximian.com>
26375
26376         * ecore.cs (StandardConversionExists): Modify to take an Expression
26377         as the first parameter. Ensure we do null -> reference type conversion
26378         checking.
26379
26380         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26381         temporary Expression objects.
26382
26383 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26384
26385         * interface.cs: workaround bug in method overloading resolution
26386         (there is already a bugzilla bug for it).
26387
26388 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26389
26390         We could also solve this problem by having a separate path for
26391         performing type lookups, instead of DoResolve, we could have a
26392         ResolveType entry point, and only participating pieces of the
26393         production (simplename, deref, array) would implement this. 
26394
26395         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26396         signal SimpleName to only resolve type names and not attempt to
26397         resolve anything else.
26398
26399         * expression.cs (Cast): Set the flag.
26400
26401         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26402
26403         * class.cs: Only report 108 if there is no `new' modifier.
26404
26405         * cs-parser.jay: rework foreach statement to work with the new
26406         changes to the policy on SimpleNames.
26407
26408         * report.cs: support Stacktrace on warnings as well.
26409
26410         * makefile: drop --unsafe and /unsafe from the compile.
26411
26412 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26413
26414         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26415         lookups here, instead of doing that at parse time.  This means
26416         that our grammar will not introduce `LocalVariableReferences' as
26417         expressions at this point.  That solves the problem of code like
26418         this:
26419
26420         class X {
26421            static void Main ()
26422            { int X = 1;
26423             { X x = null }}}
26424
26425         This is only half the fix.  The full fix requires parameters to
26426         also be handled in this way.
26427
26428         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26429         makes the use more obvious of the DeclSpace.  The
26430         ec.TypeContainer.TypeBuilder is now only used to pull the
26431         TypeBuilder for it.
26432
26433         My theory is that I can get rid of the TypeBuilder completely from
26434         the EmitContext, and have typecasts where it is used (from
26435         DeclSpace to where it matters).  
26436
26437         The only pending problem is that the code that implements Aliases
26438         is on TypeContainer, and probably should go in DeclSpace.
26439
26440         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26441         lookups here, instead of doing that at parse time.  This means
26442         that our grammar will not introduce `LocalVariableReferences' as
26443         expressions at this point.  That solves the problem of code like
26444         this:
26445
26446         class X {
26447            static void Main ()
26448            { int X = 1;
26449             { X x = null }}}
26450
26451         This is only half the fix.  The full fix requires parameters to
26452         also be handled in this way.
26453
26454         * class.cs (Property.DefineMethod): When implementing an interface
26455         method, set newslot, when implementing an abstract method, do not
26456         set the flag (before we tried never setting it, or always setting
26457         it, which is the difference).
26458         (Indexer.DefineMethod): same.
26459         (Method.DefineMethod): same.
26460
26461         * ecore.cs: Only set the status used flag if we get back a Field.
26462
26463         * attribute.cs: Temporary hack, so Paolo can keep working.
26464
26465 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26466
26467         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26468         the unmanaged type in the case we have a MarshalAs attribute.
26469
26470         (Resolve): Handle the case when we are parsing the special MarshalAs
26471         attribute [we need to store the unmanaged type to use later]
26472
26473         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26474         MarshalAs Attribute.
26475
26476         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26477         on parameters and accordingly set the marshalling info.
26478
26479 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26480
26481         * class.cs: Optimizing slightly by removing redundant code after
26482         we switched to the `NoTypes' return value.
26483         (Property.DefineMethod): use NoTypes here too.
26484
26485         This fixes the bug I introduced in my last batch of changes.
26486
26487 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26488
26489         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26490
26491         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26492         Enums since those are types too. 
26493
26494         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26495
26496         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26497         thanks to a call during the lookup process.
26498
26499 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26500
26501         * statement.cs (Foreach): Lots of work to accomodate a particular
26502         kind of foreach statement that I had not kept in mind.  It is
26503         possible to have foreachs on classes that provide a GetEnumerator
26504         method that return objects that implement the "pattern" for using
26505         a foreach, there is no need to support GetEnumerator
26506         specifically. 
26507
26508         This is needed to compile nant.
26509
26510         * decl.cs: Only report 114 if the member is not `Finalize' and if
26511         the warning level is at least 2.
26512
26513         * class.cs: Moved the compare function from Method to
26514         MethodSignature. 
26515
26516         (MethodSignature.InheritableMemberSignatureCompare): Add new
26517         filter function that is used to extract inheritable methods from a
26518         class. 
26519
26520         (Method.Define): Use the new `inheritable_method_signature_filter'
26521         delegate
26522
26523         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26524         command. 
26525
26526 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26527
26528         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26529
26530         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26531
26532         * expression.cs: Pass location information to
26533         ConvertImplicitStandard. 
26534
26535         * class.cs: Added debugging code to track return values from
26536         interfaces. 
26537
26538 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26539
26540         * expression.cs (Is.DoResolve): If either side of the `is' is an
26541         interface, do not flag the warning.
26542
26543         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26544         for interfaces
26545
26546         * report.cs: Allow for --fatal to be used with --probe.
26547
26548         * typemanager.cs (NoTypes): Move the definition for the empty Type
26549         array here. 
26550
26551         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26552         properties. 
26553         (TypeContainer.DefineProxy): New function used to proxy to parent
26554         implementations when implementing interfaces.
26555         (TypeContainer.ParentImplements): used to lookup if our parent
26556         implements a public function that is required by an interface.
26557         (TypeContainer.VerifyPendingMethods): Hook this up.
26558
26559         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26560         `modules' and `assemblies' arraylists into arrays.  We only grow
26561         these are the very early start up of the program, so this improves
26562         the speedof LookupType (nicely measured).
26563
26564         * expression.cs (MakeByteBlob): Replaced unsafe code with
26565         BitConverter, as suggested by Paolo.
26566
26567         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26568         folding of string concatenation, but if either side is a string,
26569         and the other is not, then return null, and let the runtime use
26570         the concatenation on the string plus the object (using
26571         `Object.ToString'). 
26572
26573 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26574
26575         Constant Folding has been implemented now.
26576
26577         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26578         the error instead on types that are not supported in one's
26579         complement. 
26580
26581         * constant.cs (Constant and all children): New set of functions to
26582         perform implict and explicit conversions.
26583
26584         * ecore.cs (EnumConstant): Implement the new functions to perform
26585         conversion by proxying to the child expression.
26586
26587         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26588         own separate setting that can not be turned off from the command
26589         line using --unchecked or --checked and is only controlled using
26590         the checked/unchecked statements and expressions.  This setting is
26591         used by the constant folder to flag errors.
26592
26593         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26594         ConstantCheckState as well.   
26595
26596         During Resolve, they also have to flag the state, because the
26597         constant folder runs completely in the Resolve phase.
26598
26599         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26600         well.
26601
26602 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26603
26604         * cfold.cs: New file, this file contains the constant folder.
26605
26606         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26607         argument to track whether we are using the resulting address to
26608         load or store a value and provide better error messages. 
26609
26610         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26611         new AddressOf arguments.
26612
26613         * statement.cs (Foreach.EmitCollectionForeach): Update
26614
26615         * expression.cs (Argument.Emit): Call AddressOf with proper
26616         arguments to track usage.
26617
26618         (New.DoEmit): Call AddressOf with new arguments.
26619
26620         (Unary.Emit): Adjust AddressOf call.
26621
26622 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26623
26624         * cs-parser.jay (member_access): Change the case for pre-defined types
26625         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26626         this suggestion.
26627
26628         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26629         a method body.
26630
26631         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26632         essentially like methods and apply attributes like MethodImplOptions to them too.
26633
26634         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26635         not being null.
26636
26637         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26638         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26639         is the DeclSpace.
26640
26641         * Update code everywhere accordingly.
26642
26643         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26644
26645         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26646
26647 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26648
26649         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26650         try performing lookups against those instead of jumping straight into using
26651         the 'using' clauses.
26652
26653         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26654
26655         (LookupType): Perform lookups in implicit parents too.
26656
26657         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26658         sequence as RootContext.LookupType. 
26659
26660         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26661         the various cases of namespace lookups into this method.
26662
26663 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26664
26665         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26666         in positional arguments)
26667
26668         * class.cs (Operator): Update the AllowedModifiers to contain
26669         extern. 
26670
26671         * cs-parser.jay: Update operator declaration to allow for the
26672         operator body to be empty.
26673
26674         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26675         values. 
26676
26677 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26678
26679         * class.cs (Method.Emit): Label parameters.
26680
26681         * driver.cs: Return 1 or 0 as the program exit code.
26682
26683 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26684
26685         * expression.cs: Special case the `null' object when trying to
26686         auto-compute the type, as anything can be explicitly converted to
26687         that. 
26688
26689         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26690         spotting this Paolo.
26691
26692         (Expression.ImplicitNumericConversion): Perform comparissions of
26693         the type using the underlying type in the case of an enumeration
26694         rather than using the enumeration type for the compare.
26695
26696         Cope with the underlying == type case, which is not possible to
26697         catch before. 
26698
26699         (Expression.ConvertNumericExplicit): Perform comparissions of
26700         the type using the underlying type in the case of an enumeration
26701         rather than using the enumeration type for the compare.
26702
26703         * driver.cs: If the user does not supply an extension, assume .exe
26704
26705         * cs-parser.jay (if_statement): Rewrote so that we can track the
26706         location for the if statement.
26707
26708         * expression.cs (Binary.ConstantFold): Only concat strings when
26709         the operation is "+", not everything ;-)
26710
26711         * statement.cs (Statement.EmitBoolExpression): Take a location
26712         argument. 
26713         (If, While, Do): Track location.
26714
26715         * expression.cs (Binary.ResolveOperator): In the object + string
26716         case, I was missing a call to ConvertImplicit
26717
26718 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26719
26720         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26721         Location arguments. Ensure we use RootContext.LookupType to do our work
26722         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26723
26724         * interface.cs (PopulateMethod): Handle the type of the parameter being
26725         null gracefully.
26726
26727         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26728         have a params method with no fixed arguments and a call is made with no
26729         arguments.
26730
26731 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26732
26733         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26734         the verbatim-string-literal
26735
26736         * support.cs (InternalParameters.ParameterModifier): handle null
26737         fixed parameters.
26738         (InternalParameters.ParameterType): ditto.
26739
26740         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26741         duplicating the name of the variable parameter.
26742         (GetParameterByName): Fix bug where we were not looking up array
26743         paramters if they were the only present (thanks Paolo!).
26744         (GetParameterInfo): We only have an empty set of types if both
26745         fixed and array are set to null.
26746         (GetParameterInfo-idx): Handle FixedParameter == null
26747
26748         * cs-parser.jay: Handle the case where there is no catch
26749         statements (missing null test).
26750
26751 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26752
26753         * driver.cs (MainDriver): Be conservative on our command line
26754         handling.
26755
26756         Catch DirectoryNotFoundException when calling GetFiles.
26757
26758         (SplitPathAndPattern): Used to split the input specification into
26759         a path and a pattern that we can feed to Directory.GetFiles.
26760
26761 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26762
26763         * statement.cs (Fixed): Implement the last case of the Fixed
26764         statement (string handling).
26765
26766         * expression.cs (StringPtr): New class used to return a char * to
26767         a string;  Used by the Fixed statement.
26768
26769         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26770
26771         * expression.cs (Binary.ResolveOperator): Remove redundant
26772         MemberLookup pn parent type.
26773         Optimize union call, we do not need a union if the types are the same.
26774         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26775         type.
26776
26777         Specialize the use of MemberLookup everywhere, instead of using
26778         the default settings. 
26779
26780         (StackAlloc): Implement stackalloc keyword.
26781
26782         * cs-parser.jay: Add rule to parse stackalloc.
26783
26784         * driver.cs: Handle /h, /help, /?
26785
26786         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26787         before we supported unsafe code.
26788
26789         * makefile: add --unsafe to the self compilation of mcs.
26790
26791 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26792
26793         * expression.cs (PointerArithmetic): New class that is used to
26794         perform pointer arithmetic.
26795         (Binary.Resolve): Handle pointer arithmetic
26796         Handle pointer comparission.
26797         (ArrayPtr): Utility expression class that is used to take the
26798         address of an array.
26799
26800         (ElementAccess): Implement array access for pointers
26801
26802         * statement.cs (Fixed): Implement fixed statement for arrays, we
26803         are missing one more case before we are done.
26804
26805         * expression.cs (Indirection): Implement EmitAssign and set the
26806         ExprClass to Variable.  This allows pointer dereferences to be
26807         treated as variables, and to have values assigned to them.
26808
26809         * ecore.cs (Expression.StoreFromPtr): New utility function to
26810         store values dereferencing.
26811
26812 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26813
26814         * expression.cs (Binary.ResolveOperator): Ensure that we are
26815         not trying to operate on a void type - this fixes the reported
26816         bug.
26817
26818         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26819         the parent implementation is sealed.
26820
26821         * ../errors/cs0239.cs : Add.
26822
26823         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26824
26825         * typemanager.cs (unverifiable_code_type): Corresponds to 
26826         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26827         which have unsafe code in them.
26828
26829         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26830         unsafe context.
26831
26832 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26833
26834         * cs-tokenizer.cs: Add support for @"litreal strings"
26835
26836         Make tokenizer accept pre-processor directives
26837         on any column (remove the old C-like limitation). 
26838
26839         * rootcontext.cs (EmitCode): Emit any global attributes.
26840         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26841
26842         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26843
26844         * cs-parser.jay: Add support for global attributes.  
26845
26846 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26847
26848         * expression.cs (Indirection): New helper class.  Unary will
26849         create Indirection classes to be able to implement the
26850         IMemoryLocation interface on it.
26851
26852 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26853
26854         * cs-parser.jay (fixed_statement): reference the right statement.
26855
26856         * statement.cs (Fixed.Emit): Finish implementing the fixed
26857         statement for the &x case.
26858
26859 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26860
26861         * class.cs (Property.Define, Method.Define): Remove newslot when
26862         `implementing'.  
26863
26864         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26865         wrong.  NewSlot should only be used if the `new' keyword is present.
26866
26867         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26868         locating our system dir.  Sorry about this.
26869
26870 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26871
26872         * driver.cs (GetSystemDir): Compute correctly the location of our
26873         system assemblies.  I was using the compiler directory instead of
26874         the library directory.
26875
26876 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26877
26878         * expression.cs (BetterFunction): Put back in what Miguel commented out
26879         since it is the correct fix. The problem is elsewhere ;-)
26880
26881         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26882         parameters of the parms method are themselves compatible or not !
26883
26884         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26885         to check that a class implements an interface before saying that an implicit
26886         conversion was allowed. Use ImplementsInterface to do the checking.
26887
26888 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26889
26890         * class.cs (Method.Define): Track whether we are an explicit
26891         implementation or not.  And only call DefineMethodOverride if we
26892         are an explicit implementation.
26893
26894         (Property.DefineMethod): Ditto.
26895
26896 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26897
26898         * expression.cs (BetterFunction): Catch hideous bug which was
26899          preventing us from detecting ambiguous calls due to implicit casts i.e
26900         cs0121.
26901
26902 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26903
26904         * support.cs (Pair): Remove un-needed method.  I figured why I was
26905         getting the error in cs-parser.jay, the variable in a foreach loop
26906         is readonly, and the compiler does not really treat this as a variable.
26907
26908         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26909         instead of EQUALS in grammar.  
26910
26911         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26912
26913         * expression.cs (Unary.DoResolve): Check whether the argument is
26914         managed or not.
26915
26916 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26917
26918         * support.cs: Api for Pair to set a value.  Despite the fact that
26919         the variables are public the MS C# compiler refuses to compile
26920         code that accesses the field if the variable is part of a foreach
26921         statement. 
26922
26923         * statement.cs (Fixed): Begin implementation of the fixed
26924         statement.
26925
26926         (Block.AddVariable): Return the VariableInfo on success and null
26927         on failure instead of true/false. 
26928
26929         * cs-parser.jay (foreach): Catch errors on variables already
26930         defined (we were ignoring this value before) and properly unwind
26931         the block hierarchy
26932
26933         (fixed_statement): grammar for the fixed statement.
26934
26935 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26936
26937         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26938         pointer types to be incretemented.
26939
26940         (SizeOf): Implement.
26941
26942         * cs-parser.jay (pointer_member_access): Implement
26943         expr->IDENTIFIER production.
26944
26945         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26946         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26947         on safe contexts.
26948
26949         (Unary): Implement indirection.
26950
26951         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26952         use in non-unsafe context).
26953
26954         (SimpleName.DoResolve): Check for pointers in field access on safe
26955         contexts. 
26956
26957         (Expression.LoadFromPtr): Factor the load-indirect code in this
26958         function.  This was duplicated in UnboxCast and ParameterReference
26959
26960 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26961
26962         * expression.cs (ComposedCast): report an error if a pointer cast
26963         is used in a safe region.
26964
26965         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26966         pointer type casts in unsafe context.
26967
26968         * codegen.cs (EmitContext): Set up IsUnsafe.
26969
26970         * cs-parser.jay (non_expression_type): Add productions for pointer
26971         casts. 
26972
26973         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26974         code.  We should not use force into static mode if the method is
26975         not virtual.  Fixes bug in MIS
26976
26977         * statement.cs (Do.Emit, While.Emit, For.Emit,
26978         Statement.EmitBoolExpression): Add support to Do and While to
26979         propagate infinite loop as `I do return' semantics.
26980
26981         Improve the For case to also test for boolean constants.
26982
26983         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26984         to the list of attributes we can add.
26985
26986         Remove `EmitContext' argument.
26987
26988         * class.cs (Method.Define): Apply parameter attributes.
26989         (Constructor.Define): Apply parameter attributes.
26990         (MethodCore.LabelParameters): Move here the core of labeling
26991         parameters. 
26992
26993         * support.cs (ReflectionParameters.ParameterModifier,
26994         InternalParameters.ParameterModifier): Use IsByRef on the type and
26995         only return the OUT bit for these parameters instead of in/out/ref
26996         flags.
26997
26998         This is because I miss-understood things.  The ParameterInfo.IsIn
26999         and IsOut represent whether the parameter has the [In] and [Out]
27000         attributes set.  
27001
27002 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
27003
27004         * ecore.cs (FieldExpr.Emit): Release temporaries.
27005
27006         * assign.cs (LocalTemporary.Release): new function.
27007
27008         * codegen.cs (EmitContext.GetTemporaryStorage,
27009         EmitContext.FreeTemporaryStorage): Rework the way we deal with
27010         temporary storage.  Now we can "put back" localbuilders when we
27011         are done with them
27012
27013 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
27014
27015         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27016         need to make a copy of the variable to generate verifiable code.
27017
27018 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
27019
27020         * driver.cs: Compute dynamically the system directory.
27021
27022         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27023         Slower, but more generally useful.  Used by the abstract
27024         registering implementation. 
27025
27026         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27027         the rules for the special rule on Type/instances.  First check if
27028         we have the same name, and if so, try that special static path
27029         rather than the instance path.
27030
27031 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
27032
27033         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
27034         for, while and if.
27035
27036         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
27037         Enum, ValueType, Delegate or Array for non-corlib compiles.
27038
27039         * cs-tokenizer.cs: Catch long identifiers (645)
27040
27041         * typemanager.cs (IndexerPropetyName): Ravi never tested this
27042         piece of code.
27043
27044         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
27045         fix, we were returning too early, so we were not registering
27046         pending methods from abstract classes.
27047
27048         Do not register pending methods if the class is abstract.
27049
27050         * expression.cs (Conditional.DoResolve): Report circular implicit
27051         conversions when we neecd to compute it for conditional
27052         expressions. 
27053
27054         (Is.DoResolve): If the expression is always of the provided type,
27055         flag warning 183.  If the expression can not ever be of the
27056         provided type flag warning 184.
27057
27058         * class.cs: Catch 169 as well.
27059
27060         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
27061         read. 
27062
27063 2002-01-18  Nick Drochak  <ndrochak@gol.com>
27064
27065         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
27066
27067 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
27068
27069         * interface.cs: (PopulateMethod): Check for pointers being defined
27070         only if the unsafe context is active.
27071         (PopulateProperty): ditto.
27072         (PopulateIndexer): ditto.
27073
27074         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
27075         specified.  If pointers are present, make sure that they are
27076         present in an unsafe context.
27077         (Constructor, Constructor.Define): ditto.
27078         (Field, Field.Define): ditto.
27079         (Property, Property.Define): ditto.
27080         (Event, Event.Define): ditto.
27081
27082         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
27083         hashtable if there are classes or structs defined.
27084
27085         * expression.cs (LocalVariableReference.DoResolve): Simplify this
27086         code, as the constant resolution moved.
27087
27088         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
27089         the metadata, so we can flag error 133. 
27090
27091         * decl.cs (MemberCore.UnsafeOK): New function to test that a
27092         pointer is being declared in an unsafe context.
27093
27094 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
27095
27096         * modifiers.cs (Modifiers.Check): Require a Location argument.
27097         Report error 227 for Unsafe use.
27098
27099         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
27100
27101         * statement.cs (For.Emit): If the test is null, then report that
27102         we do `return', as we wont reach anything afterwards.
27103
27104         (Switch.SwitchGoverningType): Track the expression that matched
27105         the conversion.
27106
27107         * driver.cs: Allow negative numbers as an error code to flag.
27108
27109         * cs-parser.jay: Handle 1551.
27110
27111         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
27112
27113 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27114
27115         * cs-parser.jay: Report 1518 (type declaration can only contain
27116         class, struct, interface, enum or delegate)
27117
27118         (switch_label): Report 1523 (keywords `case' or `default' must
27119         preced code)
27120
27121         (opt_switch_sections): Report 1522 (empty switch)
27122
27123         * driver.cs: Report 1515 (response file specified multiple times)
27124         Report 1516 (Source file specified multiple times).
27125
27126         * expression.cs (Argument.Resolve): Signal 1510
27127
27128         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
27129         access not allowed in static code)
27130
27131 2002-01-11  Ravi Pratap  <ravi@ximian.com>
27132
27133         * typemanager.cs (IsPointerType): Utility method which we are going
27134         to need a lot.
27135
27136         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
27137         the object type, so we take care of that.
27138
27139         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
27140
27141         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
27142         added to non-params parameters :-)
27143
27144         * typemanager.cs (CSharpName): Include 'void' type too. 
27145
27146         (void_ptr_type): Include in the set of core types.
27147
27148         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
27149         duplicating code.
27150
27151         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
27152         an unsafe context.
27153
27154         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
27155         completely forgotten about it.
27156
27157 2002-01-10  Ravi Pratap  <ravi@ximian.com>
27158
27159         * cs-parser.jay (pointer_type): Add. This begins our implementation
27160         of parsing rules for unsafe code.
27161
27162         (unsafe_statement): Implement.
27163
27164         (embedded_statement): Modify to include the above.
27165
27166         * statement.cs (Unsafe): Implement new class for unsafe blocks.
27167
27168         * codegen.cs (EmitContext.InUnsafe): Add. This determines
27169         if the current context is an unsafe one.
27170
27171         * cs-parser.jay (local_variable_pointer_type): Since local variable types
27172         are handled differently, we need separate rules for them.
27173
27174         (local_variable_declaration): Update to use local_variable_pointer_type
27175         to allow variable declarations of unmanaged pointer types.
27176
27177         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
27178         in unsafe contexts.
27179
27180         * ../errors/cs0214.cs : Add.
27181
27182 2002-01-16  Nick Drochak  <ndrochak@gol.com>
27183
27184         * makefile: remove 'response' file when cleaning.
27185
27186 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
27187
27188         * cs-parser.jay: Report 1524.
27189
27190 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
27191
27192         * typemanager.cs (RegisterMethod): drop checking if we have
27193         registered this from here
27194
27195 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
27196
27197         * class.cs (Method.EmitDestructor): Implement calling our base
27198         destructor. 
27199
27200         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
27201         value of InFinally.
27202
27203         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
27204         this routine and will wrap the call in a try/catch block.  Deal
27205         with the case.
27206
27207 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
27208
27209         * ecore.cs (Expression.MemberLookup): instead of taking a
27210         parameter `same_type' that was used to tell whether we could
27211         access private members we compute our containing type from the
27212         EmitContext.
27213
27214         (FieldExpr): Added partial support for volatile fields.  This does
27215         not work for volatile fields exposed from assemblies, as I can not
27216         figure out how to extract the modreq from it.
27217
27218         Updated all the source files to use this.
27219
27220         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
27221         because it is referenced by MemberLookup very often. 
27222
27223 2002-01-09  Ravi Pratap  <ravi@ximian.com>
27224
27225         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
27226         TypeBuilder.GetCustomAttributes to retrieve what we need.
27227
27228         Get rid of redundant default_member_attr_type as this is the same as
27229         default_member_type which already exists.
27230
27231         * interface.cs, attribute.cs : Update accordingly.
27232
27233 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
27234
27235         * typemanager.cs: Enable IndexerPropertyName again.  It does not
27236         work for TYpeBuilders though.  Ravi, can you please fix this?
27237
27238         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
27239
27240         * expression.cs (Argument.Emit): Handle the case of ref objects
27241         being passed to ref functions;  
27242
27243         (ParameterReference.EmitLoad): Loads the content of the pointer
27244         without dereferencing.
27245
27246 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27247
27248         * cs-tokenizer.cs: Implemented the pre-processing expressions.
27249
27250 2002-01-08  Ravi Pratap  <ravi@ximian.com>
27251
27252         * class.cs (Indexer.DefineMethod): Incorporate the interface
27253         type in the name of the method if we are doing explicit interface
27254         implementation.
27255
27256         * expression.cs (ConversionExists): Remove as it is completely obsolete.
27257
27258         (BetterConversion): Fix extremely trivial bug where we were referring to
27259         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
27260         again !
27261
27262         * ../errors/bug16.cs : Add although we have fixed it.
27263
27264 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
27265
27266         * expression.cs (BaseIndexer): Begin implementation.
27267
27268         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
27269
27270         * cs-parser.jay (indexer_declarator): Use qualified_identifier
27271         production directly to remove a shift/reduce, and implement
27272         explicit interface implementation.
27273
27274         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
27275         after a floating point suffix.
27276
27277         * expression.cs (DoNumericPromotions): Improved the conversion for
27278         uint/uint.  If we have a constant, we avoid doing a typecast to a
27279         larger type.
27280
27281         * class.cs (Indexer): Implement explicit interface implementation
27282         for indexers.
27283
27284 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27285
27286         * class.cs: make the default instance constructor public and hidebysig.
27287
27288 2001-01-03  Ravi Pratap  <ravi@ximian.com>
27289
27290         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
27291         so we can call it from elsewhere.
27292
27293         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
27294         we emit it internally if the class has a defined indexer; otherwise the user
27295         emits it by decorating the class definition with the DefaultMemberAttribute.
27296
27297         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27298         attribute is not used on a type which defines an indexer.
27299
27300         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27301         character when we skip whitespace.
27302
27303         * ../errors/cs0646.cs : Add.
27304
27305 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
27306
27307         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27308         again. 
27309
27310         * makefile: Add practical target `mcs3.exe' which builds the third
27311         generation compiler. 
27312
27313         * expression.cs (New): Fix structures constructor calling.
27314
27315         * class.cs (Property, Method, Indexer): Emit Final flag on the
27316         method if we are an interface implementation and we are not
27317         abstract. 
27318
27319         * ecore.cs (PropertyExpr): New public field `IsBase', tells
27320         whether this property is referencing a `base' method.
27321
27322         * expression.cs (Invocation.EmitCall): take an extra argument:
27323         is_base, this is used to determine whether the `call' or
27324         `callvirt' opcode should be used.
27325
27326
27327         * delegate.cs: update EmitCall.
27328
27329         * class.cs (Method.Define): Set NewSlot for the cases where we are
27330         not implementing an interface method.
27331
27332         (Property.Define): ditto.
27333
27334 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
27335
27336         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27337         'r'.  Allows mcs to parse itself fully.
27338
27339 2002-01-02  Ravi Pratap  <ravi@ximian.com>
27340
27341         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27342         of the number of initializers that require the InitializeArray method.
27343
27344         (CheckIndices): Store the Expression in all cases - not the plain value. Also
27345         update the above field where necessary.
27346
27347         (MakeByteBlob): Update accordingly.
27348
27349         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
27350         greater than 2.
27351
27352         (EmitDynamicInitializers): Update in accordance with the new optimization.
27353
27354         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27355         same OpCode applies.
27356
27357         * cs-parser.jay : Fix some glaring errors I introduced.
27358
27359 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
27360
27361         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27362         so that we can check for name clashes there too.
27363
27364         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27365         for interface indexers.
27366
27367         * interfaces.cs (Define): Emit the default member attribute.
27368
27369         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27370         variable was being referred to while setting the value ;-)
27371
27372 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
27373
27374         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27375         byte-by-byte information when we know the data is zero.
27376
27377         Make the block always a multiple of 4, because
27378         DefineInitializedData has a bug.
27379
27380         * assign.cs: Fix, we should assign from the temporary, not from
27381         the source. 
27382
27383         * expression.cs (MakeByteBlob): Fix my incorrect code.
27384
27385 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
27386
27387         * typemanager.cs (EnumToUnderlying): This function is used to get
27388         the underlying type from an enumeration, because it does not
27389         always work. 
27390
27391         * constant.cs: Use the I4_S form for values between -128 and 127.
27392
27393         * statement.cs (Block.LookupLabel): Looks up a label.
27394         (Block): Drop support for labeled blocks.
27395
27396         (LabeledStatement): New kind of statement that represents a label
27397         only.
27398
27399         (Goto): Finally implement this bad boy.
27400
27401         * cs-parser.jay: Update to reflect new mechanism to implement
27402         labels.
27403
27404 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
27405
27406         * codegen.cs (EmitContext.This): a codegen property that keeps the
27407         a single instance of this instead of creating many different this
27408         instances. 
27409
27410         * delegate.cs (Delegate.DoResolve): Update to use the property;
27411
27412         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27413
27414         * expression.cs (BaseAccess.DoResolve): Ditto.
27415
27416 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27417
27418         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27419         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27420
27421         (InitCoreTypes): Update accordingly.
27422
27423         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27424         so we can quickly store the state.
27425
27426         (ApplyAttributes): Set the correct implementation flags
27427         for InternalCall methods.
27428
27429 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27430
27431         * expression.cs (EmitCall): if a method is not virtual, then do
27432         not use callvirt on it.
27433
27434         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27435         user defined stuff) requires the use of stobj, which takes an
27436         address on the stack instead of an array and an index.  So emit
27437         the Ldelema operation for it.
27438
27439         (EmitStoreOpcode): Use stobj for valuetypes.
27440
27441         (UnaryMutator.EmitCode): Use the right 1 value depending on
27442         whether we are dealing with int64/uint64, float or doubles.
27443
27444         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27445         constructors that I implemented last night.
27446
27447         (Constructor.IsDefault): Fix to work properly for static
27448         constructors.
27449
27450         * cs-parser.jay (CheckDef): report method signature errors.
27451         Update error number 103 to be 132.
27452
27453         * decl.cs: New AdditionResult enumeration value: MethodExists.
27454         Although we do this check for methods later on in the semantic
27455         analysis, catching repeated default constructors is so easy that
27456         we catch these here. 
27457
27458         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27459         promotions code.
27460
27461         (ParameterReference.EmitAssign, Emit): handle
27462         bools as bytes.
27463
27464         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27465         (ArrayAccess.EmitStoreOpcode): ditto.
27466
27467         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27468
27469         * expression.cs (MakeByteBlob): Complete all the missing types
27470         (uint, short, ushort, byte, sbyte)
27471
27472         * class.cs: Only init instance field initializers on instance
27473         constructors. 
27474
27475         Rename `constructors' to instance_constructors. 
27476
27477         (TypeContainer.AddConstructor): Only add constructors to the list
27478         if it is not static.
27479
27480         Make sure that we handle default_static_constructor independently
27481         everywhere where we handle instance_constructors
27482
27483 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27484
27485         * class.cs: Do not lookup or create a base initializer for a
27486         static constructor.
27487
27488         (ConstructorInitializer.Resolve): use the proper type to lookup
27489         for constructors.
27490
27491         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27492
27493         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27494         in DeclSpace. 
27495
27496         * decl.cs: CloseType is now an virtual method, the default
27497         implementation just closes this type.
27498
27499 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27500
27501         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27502         to PreserveSig by default. Also emit HideBySig on such methods.
27503
27504         Basically, set the defaults to standard values.
27505
27506         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27507         argument, if candidate is better, it can't be worse than the best !
27508
27509         (Invocation): Re-write bits to differentiate between methods being
27510         applicable in their expanded form and their normal form - for params
27511         methods of course.
27512
27513         Get rid of use_standard everywhere as only standard conversions are allowed
27514         in overload resolution. 
27515
27516         More spec conformance.
27517
27518 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27519
27520         * driver.cs: Add --timestamp, to see where the compiler spends
27521         most of its time.
27522
27523         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27524         `this' in static code.
27525
27526         (SimpleName.DoResolve): Implement in terms of a helper function
27527         that allows static-references to be passed upstream to
27528         MemberAccess.
27529
27530         (Expression.ResolveWithSimpleName): Resolve specially simple
27531         names when called by MemberAccess to implement the special
27532         semantics. 
27533
27534         (Expression.ImplicitReferenceConversion): Handle conversions from
27535         Null to reference types before others, as Null's type is
27536         System.Object. 
27537
27538         * expression.cs (Invocation.EmitCall): Handle the special case of
27539         calling methods declared on a reference type from a ValueType
27540         (Base classes System.Object and System.Enum)
27541
27542         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27543         the left hand side is a TypeExpr, not on every enumeration. 
27544
27545         (Binary.Resolve): If types are reference types, then do a cast to
27546         object on operators != and == of both arguments.
27547
27548         * typemanager.cs (FindMembers): Extract instance and static
27549         members if requested.
27550
27551         * interface.cs (PopulateProperty): Use void_type instead of null
27552         as the return type for the setter method.
27553
27554         (PopulateIndexer): ditto.
27555
27556 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27557
27558         * support.cs (ReflectionParameters): Fix minor bug where we
27559         were examining the wrong parameter for the ParamArray attribute.
27560
27561         Cope with requests for the type of the parameter at position
27562         greater than the params parameter's. We now return the element
27563         type of the params array as that makes more sense.
27564
27565         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27566         accordingly as we no longer have to extract the element type
27567         ourselves.
27568
27569         (Invocation.OverloadResolve): Update.
27570
27571 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27572
27573         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27574         against IEnumerator, test whether the return value is a descendant
27575         of the IEnumerator interface.
27576
27577         * class.cs (Indexer.Define): Use an auxiliary method to implement
27578         the other bits of the method definition.  Begin support for
27579         explicit interface implementation.
27580
27581         (Property.DefineMethod): Use TypeManager.void_type instead of null
27582         for an empty return value.
27583
27584 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27585
27586         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27587         dealing with a FieldExpr which is composed of a FieldBuilder, in
27588         the code path we did extract the constant, but we should have
27589         obtained the underlying value to be able to cast it (otherwise we
27590         end up in an infinite loop, this is what Ravi was running into).
27591
27592         (ArrayCreation.UpdateIndices): Arrays might be empty.
27593
27594         (MemberAccess.ResolveMemberAccess): Add support for section
27595         14.5.4.1 that deals with the special case of E.I when E is a type
27596         and something else, that I can be a reference to a static member.
27597
27598         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27599         handle a particular array type to create byte blobs, it is just
27600         something we dont generate byteblobs for.
27601
27602         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27603         arguments. 
27604
27605         * location.cs (Push): remove the key from the hashtable that we
27606         are about to add.   This happens for empty files.
27607
27608         * driver.cs: Dispose files after we have parsed them.
27609
27610         (tokenize): new function that only runs the tokenizer on its
27611         input, for speed testing.
27612
27613 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27614
27615         * class.cs (Event.Define): Define the private field only if there
27616         are no accessors defined.
27617
27618         * expression.cs (ResolveMemberAccess): If there is no associated
27619         field with the event, that means we have an event defined with its
27620         own accessors and we should flag error cs0070 since transforming
27621         ourselves into a field is not valid in that case.
27622
27623         * ecore.cs (SimpleName.DoResolve): Same as above.
27624
27625         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27626         and charset to sane values.
27627
27628 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27629
27630         * assign.cs (DoResolve): Perform check on events only if they 
27631         are being accessed outside the declaring type.
27632
27633         * cs-parser.jay (event_declarations): Update rules to correctly
27634         set the type of the implicit parameter etc.
27635
27636         (add_accessor, remove_accessor): Set current local parameters.
27637
27638         * expression.cs (Binary): For delegate addition and subtraction,
27639         cast the return value from the method into the appropriate delegate
27640         type.
27641
27642 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27643
27644         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27645         of these as the workaround is unnecessary.
27646
27647         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27648         delegate data - none of that is needed at all.
27649
27650         Re-write bits to extract the instance expression and the delegate method
27651         correctly.
27652
27653         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27654         on delegates too.
27655
27656         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27657         of attaching attributes instead of duplicating code everywhere.
27658
27659         * everywhere : Update code to do attribute emission using the above method.
27660
27661 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27662
27663         * expression.cs (IsParamsMethodApplicable): if there are not
27664         parameters, return immediately.
27665
27666         * ecore.cs: The 0 literal can be implicity converted to an enum
27667         type. 
27668
27669         (SimpleName.DoResolve): First lookup the type, then lookup the
27670         members. 
27671
27672         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27673         want to get its address.  If the InstanceExpression is not
27674         addressable, store the result in a temporary variable, then get
27675         the address of it.
27676
27677         * codegen.cs: Only display 219 errors on warning level or above. 
27678
27679         * expression.cs (ArrayAccess): Make it implement the
27680         IMemoryLocation interface.
27681
27682         (Binary.DoResolve): handle the operator == (object a, object b)
27683         and operator != (object a, object b) without incurring into a
27684         BoxedCast (because 5 != o should never be performed).
27685
27686         Handle binary enumerator operators.
27687
27688         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27689         value type, otherwise use Ldelem_ref.
27690
27691         Use precomputed names;
27692
27693         (AddressOf): Implement address of
27694
27695         * cs-parser.jay (labeled_statement): Fix recursive block
27696         addition by reworking the production.
27697
27698         * expression.cs (New.DoEmit): New has a special case:
27699                 
27700                  If we are dealing with a ValueType, we have a few
27701                  situations to deal with:
27702                 
27703                     * The target of New is a ValueType variable, that is
27704                       easy, we just pass this as the variable reference
27705                 
27706                     * The target of New is being passed as an argument,
27707                       to a boxing operation or a function that takes a
27708                       ValueType.
27709                 
27710                       In this case, we need to create a temporary variable
27711                       that is the argument of New.
27712
27713
27714 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27715
27716         * rootcontext.cs (LookupType): Check that current_type is not null before
27717         going about looking at nested types.
27718
27719         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27720         not implement the IAssignMethod interface any more.
27721
27722         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27723         where we tranform them into FieldExprs if they are being resolved from within
27724         the declaring type.
27725
27726         * ecore.cs (SimpleName.DoResolve): Do the same here.
27727
27728         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27729
27730         * ../errors/bug10.cs : Add.
27731
27732         * ../errors/cs0070.cs : Add.
27733
27734         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27735
27736         * assign.cs : Get rid of EventIsLocal everywhere.
27737
27738 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27739
27740         * ecore.cs (ConvertIntLiteral): finished the implementation.
27741
27742         * statement.cs (SwitchLabel): Convert the value we are using as a
27743         key before looking up the table.
27744
27745 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27746
27747         * codegen.cs (EmitTopBlock): Require a Location argument now.
27748
27749         * cs-parser.jay (constructor_declarator): We need to setup
27750         current_local_parameters before we parse the
27751         opt_constructor_initializer, to allow the variables to be bound
27752         to the constructor arguments.
27753
27754         * rootcontext.cs (LookupType): First lookup nested classes in our
27755         class and our parents before we go looking outside our class.
27756
27757         * expression.cs (ConstantFold): Extract/debox the values at the
27758         beginnning. 
27759
27760         * rootcontext.cs (EmitCode): Resolve the constants first before we
27761         resolve the types.  This is not really needed, but it helps debugging.
27762
27763         * statement.cs: report location.
27764
27765         * cs-parser.jay: pass location to throw statement.
27766
27767         * driver.cs: Small bug fix.
27768
27769         * report.cs: Updated format to be 4-zero filled digits.
27770
27771 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27772
27773         * expression.cs (CheckIndices): Fix minor bug where the wrong
27774         variable was being referred to ;-)
27775
27776         (DoEmit): Do not call EmitStaticInitializers when the 
27777         underlying type is System.Object.
27778
27779 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27780
27781         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27782         and do the usual workaround for SRE.
27783
27784         * class.cs (MyEventBuilder.EventType): New member to get at the type
27785         of the event, quickly.
27786
27787         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27788
27789         * assign.cs (Assign.DoResolve): Handle the case when the target
27790         is an EventExpr and perform the necessary checks.
27791
27792         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27793         interface.
27794
27795         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27796
27797         (EventExpr): Set the type in the constructor itself since we 
27798         are meant to be born fully resolved.
27799
27800         (EventExpr.Define): Revert code I wrote earlier.
27801                 
27802         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27803         instance expression is null. The instance expression is a This in that case
27804         or a null, depending on whether it is a static method or not.
27805
27806         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27807         refers to more than one method.
27808
27809         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27810         and accordingly flag errors.
27811
27812 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27813
27814         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27815
27816 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27817
27818         * location.cs (ToString): Provide useful rutine.
27819
27820 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27821
27822         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27823         objects, return the actual integral boxed.
27824
27825         * statement.cs (SwitchLabel): define an ILLabel for each
27826         SwitchLabel. 
27827
27828         (Switch.CheckSwitch): If the value is a Literal, extract
27829         the underlying literal.
27830
27831         Also in the unused hashtable we had, add the SwitchLabel so we can
27832         quickly look this value up.
27833
27834         * constant.cs: Implement a bunch of new constants.  Rewrite
27835         Literal based on this.  Made changes everywhere to adapt to this.
27836
27837         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27838         dereferencing array only once, and also copes with enumrations.
27839
27840         bytes are two bytes wide, not one.
27841
27842         (Cast): Perform constant conversions.
27843
27844         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27845         wrappers to the literals here.
27846
27847         * expression.cs (DoNumericPromotions): long literals can converted
27848         to ulong implicity (this is taken care of elsewhere, but I was
27849         missing this spot).
27850
27851         * ecore.cs (Expression.Literalize): Make the return type Literal,
27852         to improve type checking.
27853
27854         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27855
27856 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27857
27858         * literal.cs: Revert code from ravi that checked the bounds.  The
27859         bounds are sane by the definition of the type itself. 
27860
27861         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27862         need to actually look up in our parent hierarchy for interfaces
27863         implemented. 
27864
27865         * const.cs: Use the underlying type for enumerations
27866
27867         * delegate.cs: Compute the basename for the delegate creation,
27868         that should fix the delegate test case, and restore the correct
27869         Type Lookup semantics in rootcontext
27870
27871         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27872         referencing a nested type with the Reflection API is using the "+"
27873         sign. 
27874
27875         * cs-parser.jay: Do not require EOF token at the end.
27876
27877 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27878
27879         * rootcontext.cs (LookupType): Concatenate type names with
27880         a '.' instead of a '+' The test suite passes again.
27881
27882         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27883         field of the enumeration.
27884
27885         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27886         the case when the member is an EventExpr.
27887
27888         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27889         static has an associated instance expression.
27890
27891         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27892
27893         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27894
27895         * class.cs (Event.Define): Register event and perform appropriate checks
27896         for error #111.
27897
27898         We define the Add and Remove methods even if the use provides none because
27899         in that case, we provide default implementations ourselves.
27900
27901         Define a private field of the type of the event. This is done by the CSC compiler
27902         and we should be doing it too ;-)
27903
27904         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27905         More methods we use in code we generate.
27906
27907         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27908         is important.
27909
27910         (InitCoreTypes): Update accordingly for the above.
27911
27912         * class.cs (Event.Emit): Generate code for default accessors that we provide
27913
27914         (EmitDefaultMethod): Do the job in the above.
27915
27916         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27917         appropriate place.
27918
27919 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27920
27921         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27922         builders even if we were missing one.
27923
27924         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27925         pass the Basename as our class name instead of the Name.  The
27926         basename will be correctly composed for us.
27927
27928         * parameter.cs (Paramters): Now takes a Location argument.
27929
27930         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27931         make all the code call directly LookupType in RootContext and take
27932         this chance to pass the Location information everywhere.
27933
27934         * Everywhere: pass Location information.
27935
27936 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27937
27938         * class.cs (Constructor.Define): Updated way of detecting the
27939         length of the parameters.
27940
27941         (TypeContainer.DefineType): Use basename as the type name for
27942         nested types.
27943
27944         (TypeContainer.Define): Do not recursively define types here, as
27945         definition is taken care in order by the RootContext.
27946
27947         * tree.cs: Keep track of namespaces in a per-file basis.
27948
27949         * parameter.cs (Parameter.ComputeSignature): Update to use
27950         DeclSpace. 
27951
27952         (Parameters.GetSignature): ditto.
27953
27954         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27955         instead of a TypeContainer.
27956
27957         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27958         resolve names.  Because we need to be resolve in our context, not
27959         our parents.
27960
27961         * driver.cs: Implement response files.
27962
27963         * class.cs (TypeContainer.DefineType): If we are defined, do not
27964         redefine ourselves.
27965
27966         (Event.Emit): Emit the code for add/remove handlers.
27967         (Event.Define): Save the MethodBuilders for add/remove.
27968
27969         * typemanager.cs: Use pair here too.
27970
27971         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27972         DictionaryEntry requires the first argument to be non-null.  
27973
27974         (enum_declaration): Compute full name for registering the
27975         enumeration.
27976
27977         (delegate_declaration): Instead of using
27978         formal_parameter_list, use opt_formal_parameter_list as the list
27979         can be empty.
27980
27981         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27982         (EventParsing): New property that controls whether `add' and
27983         `remove' are returned as tokens or identifiers (for events);
27984
27985 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27986
27987         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27988         use MyEventBuilder only and let it wrap the real builder for us.
27989
27990         (MyEventBuilder): Revamp constructor etc.
27991
27992         Implement all operations that we perform on EventBuilder in precisely the same
27993         way here too.
27994
27995         (FindMembers): Update to use the EventBuilder member.
27996
27997         (Event.Emit): Update accordingly.
27998
27999 2001-12-18  Ravi Pratap  <ravi@ximian.com>
28000
28001         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28002         by calling the appropriate methods.
28003
28004         (GetCustomAttributes): Make stubs as they cannot possibly do anything
28005         useful.
28006
28007         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28008
28009 2001-12-17  Ravi Pratap  <ravi@ximian.com>
28010
28011         * delegate.cs (Delegate.Populate): Check that the return type
28012         and various parameters types are indeed accessible.
28013
28014         * class.cs (Constructor.Define): Same here.
28015
28016         (Field.Define): Ditto.
28017
28018         (Event.Define): Ditto.
28019
28020         (Operator.Define): Check that the underlying Method defined itself
28021         correctly - so it's MethodBuilder should not be null.
28022
28023         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28024         expression happens to be null.
28025
28026         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28027         members but as of now we don't seem to be able to do anything really useful with it.
28028
28029         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28030         not the EventBuilder.
28031
28032 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
28033
28034         * cs-tokenizer.cs: Add support for defines.
28035         Add support for #if, #elif, #else, #endif
28036
28037         (eval_var): evaluates a variable.
28038         (eval): stubbed for evaluating functions.
28039
28040         * cs-parser.jay: Pass the defines information
28041
28042         * driver.cs: Add --define command line option.
28043
28044         * decl.cs: Move MemberCore here.
28045
28046         Make it the base class for DeclSpace.  This allows us to catch and
28047         report 108 and 109 for everything now.
28048
28049         * class.cs (TypeContainer.Define): Extract all the members
28050         before populating and emit the warning 108 (new keyword required
28051         to override) instead of having each member implement this.
28052
28053         (MemberCore.Define): New abstract method, we will be using this in
28054         the warning reporting engine in Populate.
28055
28056         (Operator.Define): Adjust to new MemberCore protocol. 
28057
28058         * const.cs (Const): This does not derive from Expression, it is a
28059         temporary object we use to create fields, it is a MemberCore. 
28060
28061         * class.cs (Method.Define): Allow the entry point to be in a
28062         specific class.
28063
28064         * driver.cs: Rewrite the argument handler to clean it up a bit.
28065
28066         * rootcontext.cs: Made it just an auxiliary namespace feature by
28067         making everything static.
28068
28069         * driver.cs: Adapt code to use RootContext type name instead of
28070         instance variable.
28071
28072         * delegate.cs: Remove RootContext argument.
28073
28074         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
28075         argument. 
28076
28077         * class.cs (Event.Define): The lookup can fail.
28078
28079         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
28080
28081         * expression.cs: Resolve the this instance before invoking the code.
28082
28083 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
28084
28085         * cs-parser.jay: Add a production in element_access that allows
28086         the thing to become a "type" reference.  This way we can parse
28087         things like "(string [])" as a type.
28088
28089         Note that this still does not handle the more complex rules of
28090         casts. 
28091
28092
28093         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
28094
28095         * ecore.cs: (CopyNewMethods): new utility function used to
28096         assemble the list of methods from running FindMembers.
28097
28098         (MemberLookup): Rework FindMembers so that 
28099
28100 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
28101
28102         * class.cs (TypeContainer): Remove Delegates who fail to be
28103         defined.
28104
28105         * delegate.cs (Populate): Verify that we dont get null return
28106         values.   TODO: Check for AsAccessible.
28107
28108         * cs-parser.jay: Use basename to emit error 574 (destructor should
28109         have the same name as container class), not the full name.
28110
28111         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
28112         possible representation.  
28113
28114         Also implements integer type suffixes U and L.
28115
28116 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
28117
28118         * expression.cs (ArrayCreation.DoResolve): We need to do the
28119         argument resolution *always*.
28120
28121         * decl.cs: Make this hold the namespace.  Hold the root context as
28122         well.
28123         (LookupType): Move here.
28124
28125         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
28126
28127         * location.cs (Row, Name): Fixed the code, it was always returning
28128         references to the first file.
28129
28130         * interface.cs: Register properties defined through interfaces.
28131
28132         * driver.cs: Add support for globbing on the command line
28133
28134         * class.cs (Field): Make it derive from MemberCore as well.
28135         (Event): ditto.
28136
28137 2001-12-15  Ravi Pratap  <ravi@ximian.com>
28138
28139         * class.cs (Event::Define): Check that the type of the event is a delegate
28140         type else flag error #66.
28141
28142         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
28143         same.
28144
28145         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
28146         values of EntryPoint, CharSet etc etc.
28147
28148         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
28149
28150         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
28151         be null and we should ignore this. I am not sure if this is really clean. Apparently,
28152         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
28153         which needs this to do its work.
28154
28155         * ../errors/cs0066.cs : Add.
28156
28157 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
28158
28159         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
28160         helper functions.
28161
28162         * class.cs: (MethodSignature.MethodSignature): Removed hack that
28163         clears out the parameters field.
28164         (MemberSignatureCompare): Cleanup
28165
28166         (MemberCore): New base class used to share code between MethodCore
28167         and Property.
28168
28169         (RegisterRequiredImplementations) BindingFlags.Public requires
28170         either BindingFlags.Instace or Static.  Use instance here.
28171
28172         (Property): Refactored code to cope better with the full spec.
28173
28174         * parameter.cs (GetParameterInfo): Return an empty array instead
28175         of null on error.
28176
28177         * class.cs (Property): Abstract or extern properties have no bodies.
28178
28179         * parameter.cs (GetParameterInfo): return a zero-sized array.
28180
28181         * class.cs (TypeContainer.MethodModifiersValid): Move all the
28182         method modifier validation to the typecontainer so we can reuse
28183         this on properties.
28184
28185         (MethodCore.ParameterTypes): return an empty sized array of types.
28186
28187         (Property.Define): Test property modifier validity.
28188
28189         Add tests for sealed/override too.
28190
28191         (Method.Emit): abstract or extern methods have no bodies.
28192
28193 2001-12-14  Ravi Pratap  <ravi@ximian.com>
28194
28195         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
28196         thing.
28197
28198         (Method::Define, ::Emit): Modify accordingly.
28199
28200         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
28201
28202         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
28203
28204         * makefile: Pass in /unsafe.
28205
28206 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
28207
28208         * class.cs (MakeKey): Kill routine.
28209
28210         * class.cs (TypeContainer.Define): Correctly define explicit
28211         method implementations (they require the full interface name plus
28212         the method name).
28213
28214         * typemanager.cs: Deply the PtrHashtable here and stop using the
28215         lame keys.  Things work so much better.
28216
28217         This of course broke everyone who depended on `RegisterMethod' to
28218         do the `test for existance' test.  This has to be done elsewhere.
28219
28220         * support.cs (PtrHashtable): A hashtable that avoid comparing with
28221         the object stupid Equals method (because, that like fails all over
28222         the place).  We still do not use it.
28223
28224         * class.cs (TypeContainer.SetRequiredInterface,
28225         TypeContainer.RequireMethods): Killed these two routines and moved
28226         all the functionality to RegisterRequiredImplementations.
28227
28228         (TypeContainer.RegisterRequiredImplementations): This routine now
28229         registers all the implementations required in an array for the
28230         interfaces and abstract methods.  We use an array of structures
28231         which can be computed ahead of time to reduce memory usage and we
28232         also assume that lookups are cheap as most classes will not
28233         implement too many interfaces.
28234
28235         We also avoid creating too many MethodSignatures.
28236
28237         (TypeContainer.IsInterfaceMethod): Update and optionally does not
28238         clear the "pending" bit if we find that there are problems with
28239         the declaration.
28240
28241         (TypeContainer.VerifyPendingMethods): Update to report errors of
28242         methods that look like implementations but are not.
28243
28244         (TypeContainer.Define): Add support for explicit interface method
28245         implementation. 
28246
28247 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
28248
28249         * typemanager.cs: Keep track of the parameters here instead of
28250         being a feature of the TypeContainer.
28251
28252         * class.cs: Drop the registration of parameters here, as
28253         InterfaceMethods are also interface declarations.
28254
28255         * delegate.cs: Register methods with the TypeManager not only with
28256         the TypeContainer.  This code was buggy.
28257
28258         * interface.cs: Full registation here.
28259
28260 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
28261
28262         * expression.cs: Remove reducer for binary expressions, it can not
28263         be done this way.
28264
28265         * const.cs: Put here the code that used to go into constant.cs
28266
28267         * constant.cs: Put here the code for constants, this is a new base
28268         class for Literals.
28269
28270         * literal.cs: Make Literal derive from Constant.
28271
28272 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
28273
28274         * statement.cs (Return.Emit): Report error 157 if the user
28275         attempts to return from a finally block.
28276
28277         (Return.Emit): Instead of emitting a return, jump to the end of
28278         the function.
28279
28280         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
28281         LocalBuilder to store the result of the function.  ReturnLabel is
28282         the target where we jump.
28283
28284
28285 2001-12-09  Radek Doulik  <rodo@ximian.com>
28286
28287         * cs-parser.jay: remember alias in current namespace
28288
28289         * ecore.cs (SimpleName::DoResolve): use aliases for types or
28290         namespaces
28291
28292         * class.cs (LookupAlias): lookup alias in my_namespace
28293
28294         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
28295         aliases hashtable
28296         (LookupAlias): lookup alias in this and if needed in parent
28297         namespaces
28298
28299 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
28300
28301         * support.cs: 
28302
28303         * rootcontext.cs: (ModuleBuilder) Made static, first step into
28304         making things static.  I need this to avoid passing the
28305         TypeContainer when calling ParameterType.
28306
28307         * support.cs (InternalParameters.ParameterType): Remove ugly hack
28308         that did string manipulation to compute the type and then call
28309         GetType.  Use Parameter.ParameterType instead.
28310
28311         * cs-tokenizer.cs: Consume the suffix for floating values.
28312
28313         * expression.cs (ParameterReference): figure out whether this is a
28314         reference parameter or not.  Kill an extra variable by computing
28315         the arg_idx during emission.
28316
28317         * parameter.cs (Parameters.GetParameterInfo): New overloaded
28318         function that returns whether a parameter is an out/ref value or not.
28319
28320         (Parameter.ParameterType): The type of the parameter (base,
28321         without ref/out applied).
28322
28323         (Parameter.Resolve): Perform resolution here.
28324         (Parameter.ExternalType): The full type (with ref/out applied).
28325
28326         * statement.cs (Using.Emit, Using.EmitExpression): Implement
28327         support for expressions on the using statement.
28328
28329 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
28330
28331         * statement.cs (Using.EmitLocalVariableDecls): Split the
28332         localvariable handling of the using statement.
28333
28334         (Block.EmitMeta): Keep track of variable count across blocks.  We
28335         were reusing slots on separate branches of blocks.
28336
28337         (Try.Emit): Emit the general code block, we were not emitting it. 
28338
28339         Check the type of the declaration to be an IDisposable or
28340         something that can be implicity converted to it. 
28341
28342         Emit conversions if required.
28343
28344         * ecore.cs (EmptyExpression): New utility class.
28345         (Expression.ImplicitConversionExists): New utility function.
28346
28347 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
28348
28349         * statement.cs (Using): Implement.
28350
28351         * expression.cs (LocalVariableReference): Support read only variables.
28352
28353         * statement.cs: Remove the explicit emit for the Leave opcode.
28354         (VariableInfo): Add a readonly field.
28355
28356 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
28357
28358         * ecore.cs (ConvCast): new class used to encapsulate the various
28359         explicit integer conversions that works in both checked and
28360         unchecked contexts.
28361
28362         (Expression.ConvertNumericExplicit): Use new ConvCast class to
28363         properly generate the overflow opcodes.
28364
28365 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28366
28367         * statement.cs: The correct type for the EmptyExpression is the
28368         element_type, not the variable type.  Ravi pointed this out.
28369
28370 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28371
28372         * class.cs (Method::Define): Handle PInvoke methods specially
28373         by using DefinePInvokeMethod instead of the usual one.
28374
28375         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28376         above to do the task of extracting information and defining the method.
28377
28378 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28379
28380         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28381         of the condition for string type.
28382
28383         (Emit): Move that here. 
28384
28385         (ArrayCreation::CheckIndices): Keep string literals in their expression
28386         form.
28387
28388         (EmitDynamicInitializers): Handle strings appropriately.
28389
28390 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28391
28392         * codegen.cs (EmitContext): Replace multiple variables with a
28393         single pointer to the current Switch statement.
28394
28395         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28396         EmitContext.
28397
28398 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28399
28400         * statement.cs 
28401
28402         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28403         default'.
28404
28405         (Foreach.Emit): Foreach on arrays was not setting
28406         up the loop variables (for break/continue).
28407
28408         (GotoCase): Semi-implented.
28409
28410 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28411
28412         * attribute.cs (CheckAttribute): Handle system attributes by using
28413         Attribute.GetAttributes to examine information we need.
28414
28415         (GetValidPlaces): Same here.
28416
28417         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28418
28419         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28420
28421         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28422
28423         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28424
28425         (Method::Emit): Handle the case when we are a PInvoke method.
28426
28427 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28428
28429         * expression.cs: Use ResolveWithSimpleName on compound names.
28430
28431 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28432
28433         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28434         before trying to reduce it.
28435
28436         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28437
28438         * constant.cs (LookupConstantValue): Implement.
28439
28440         (EmitConstant): Use the above in emitting the constant.
28441
28442         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28443         that are user-defined by doing a LookupConstantValue on them.
28444
28445         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28446         too, like above.
28447
28448 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28449
28450         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28451
28452         (BaseAccess.DoResolve): Implement.
28453
28454         (MemberAccess.DoResolve): Split this routine into a
28455         ResolveMemberAccess routine that can be used independently
28456
28457 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28458
28459         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28460         As that share bits of the implementation.  Is returns a boolean,
28461         while As returns the Type that is being probed.
28462
28463 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28464
28465         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28466         instead of a Literal - much easier.
28467
28468         (EnumInTransit): Remove - utterly useless :-)
28469
28470         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28471
28472         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28473
28474         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28475         chain when we have no associated expression.
28476
28477 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28478
28479         * constant.cs (Define): Use Location while reporting the errror.
28480
28481         Also emit a warning when 'new' is used and there is no inherited
28482         member to hide.
28483
28484         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28485         populated.
28486
28487         (LookupEnumValue): Implement to lookup an enum member's value and define it
28488         if necessary.
28489
28490         (Populate): Re-write accordingly to use the above routine.
28491
28492 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28493
28494         * expression.cs (This): Fix prototype for DoResolveLValue to
28495         override the base class DoResolveLValue.
28496
28497         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28498         declarations) 
28499
28500         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28501         (we need to load the address of the field here).  This fixes
28502         test-22. 
28503
28504         (FieldExpr.DoResolveLValue): Call the DoResolve
28505         function to initialize the Instance expression.
28506
28507         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28508         correctly the GetEnumerator operation on a value type.
28509
28510         * cs-parser.jay: Add more simple parsing error catches.
28511
28512         * statement.cs (Switch): Add support for string switches.
28513         Handle null specially.
28514
28515         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28516
28517 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28518
28519         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28520
28521         (declare_local_constant): New helper function.
28522
28523         * statement.cs (AddConstant): Keep a separate record of constants
28524
28525         (IsConstant): Implement to determine if a variable is a constant.
28526
28527         (GetConstantExpression): Implement.
28528
28529         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28530
28531         * statement.cs (IsVariableDefined): Re-write.
28532
28533 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28534
28535         * class.cs (TypeContainer::FindMembers): Look for constants
28536         in the case when we are looking for MemberTypes.Field
28537
28538         * expression.cs (MemberAccess::DoResolve): Check that in the
28539         case we are a FieldExpr and a Literal, we are not being accessed
28540         by an instance reference.
28541
28542         * cs-parser.jay (local_constant_declaration): Implement.
28543
28544         (declaration_statement): Implement for constant declarations.
28545
28546 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28547
28548         * statement.cs (Switch): Catch double defaults.
28549
28550         (Switch): More work on the switch() statement
28551         implementation.  It works for integral values now, need to finish
28552         string support.
28553
28554
28555 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28556
28557         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28558         integer literals into other integer literals.  To be used by
28559         switch. 
28560
28561 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28562
28563         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28564         some memory.
28565
28566         (EmitDynamicInitializers): Cope with the above since we extract data
28567         directly from ArrayData now.
28568
28569         (ExpectInitializers): Keep track of whether initializers are mandatory
28570         or not.
28571
28572         (Bounds): Make it a hashtable to prevent the same dimension being 
28573         recorded for every element in that dimension.
28574
28575         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28576         from being found.
28577
28578         Also fix bug which was causing the indices to be emitted in the reverse
28579         order.
28580
28581 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28582
28583         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28584         unfinished.  They do not work, because the underlying code is
28585         sloppy.
28586
28587 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28588
28589         * cs-parser.jay: Remove bogus fixme.
28590
28591         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28592         on Switch statement.
28593
28594 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28595
28596         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28597         the same. 
28598
28599         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28600         parameter. Apparently, any expression is allowed. 
28601
28602         (ValidateInitializers): Update accordingly.
28603
28604         (CheckIndices): Fix some tricky bugs thanks to recursion.
28605
28606         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28607         I was being completely brain-dead.
28608
28609         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28610         and re-write acordingly.
28611
28612         (DelegateInvocation): Re-write accordingly.
28613
28614         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28615
28616         (MakeByteBlob): Handle types more correctly.
28617
28618         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28619         initialization from expressions but it is incomplete because I am a complete
28620         Dodo :-|
28621
28622 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28623
28624         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28625         on If.  Basically, we have to return `true' (ie, we do return to
28626         our caller) only if both branches of the if return.
28627
28628         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28629         short-circuit operators, handle them as short circuit operators. 
28630
28631         (Cast.DoResolve): Resolve type.
28632         (Cast.Cast): Take an expression as the target type.
28633
28634         * cs-parser.jay (cast_expression): Remove old hack that only
28635         allowed a limited set of types to be handled.  Now we take a
28636         unary_expression and we resolve to a type during semantic
28637         analysis.
28638
28639         Use the grammar productions from Rhys to handle casts (this is
28640         not complete like Rhys syntax yet, we fail to handle that corner
28641         case that C# has regarding (-x), but we will get there.
28642
28643 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28644
28645         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28646         field which is an array type.
28647
28648         * cs-parser.jay (declare_local_variables): Support array initialization too.
28649
28650         * typemanager.cs (MakeKey): Implement.
28651
28652         (everywhere): Use the above appropriately.
28653
28654         * cs-parser.jay (for_statement): Update for array initialization while
28655         declaring variables.
28656
28657         * ecore.cs : The error message was correct, it's the variable's names that
28658         were misleading ;-) Make the code more readable.
28659
28660         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28661         the correct type etc.
28662
28663         (ConvertExplicit): Handle Enum types by examining the underlying type.
28664
28665 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28666
28667         * parameter.cs (GetCallingConvention): Always return
28668         CallingConventions.Standard for now.
28669
28670 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28671
28672         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28673         and `r' after calling DoNumericPromotions.
28674
28675         * ecore.cs: Fix error message (the types were in the wrong order).
28676
28677         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28678         BindingFlags.Instance as well 
28679
28680         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28681         implicit int literal conversion in an empty cast so that we
28682         propagate the right type upstream.
28683
28684         (UnboxCast): new class used to unbox value types.
28685         (Expression.ConvertExplicit): Add explicit type conversions done
28686         by unboxing.
28687
28688         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28689         the target type before applying the implicit LongLiterals to ULong
28690         literal cast.
28691
28692 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28693
28694         * cs-parser.jay (for_statement): Reworked the way For works: now
28695         we declare manually any variables that are introduced in
28696         for_initializer to solve the problem of having out-of-band code
28697         emition (that is what got for broken).
28698
28699         (declaration_statement): Perform the actual variable declaration
28700         that used to be done in local_variable_declaration here.
28701
28702         (local_variable_declaration): Do not declare anything, just pass
28703         the information on a DictionaryEntry
28704
28705 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28706
28707         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28708         re-write of the logic to now make it recursive.
28709
28710         (UpdateIndices): Re-write accordingly.
28711
28712         Store element data in a separate ArrayData list in the above methods.
28713
28714         (MakeByteBlob): Implement to dump the array data into a byte array.
28715
28716 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28717
28718         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28719         into CheckIndices.
28720
28721         * constant.cs (Define): Implement.
28722
28723         (EmitConstant): Re-write fully.
28724
28725         Pass in location info.
28726
28727         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28728         respectively.
28729
28730         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28731         DictionaryEntry since we need location info too.
28732
28733         (constant_declaration): Update accordingly.
28734
28735         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28736         code into another method : UpdateIndices.
28737
28738 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28739
28740         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28741         some type checking etc.
28742
28743 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28744
28745         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28746         bits to provide dimension info if the user skips doing that.
28747
28748         Update second constructor to store the rank correctly.
28749
28750 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28751
28752         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28753         and try to implement.
28754
28755         * ../errors/cs0150.cs : Add.
28756
28757         * ../errors/cs0178.cs : Add.
28758
28759 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28760
28761         * statement.cs: Implement foreach on multi-dimensional arrays. 
28762
28763         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28764         name of the params argument.
28765
28766         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28767         initializing the array.
28768
28769         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28770         we can use this elsewhere.
28771
28772         * statement.cs: Finish implementation of foreach for single
28773         dimension arrays.
28774
28775         * cs-parser.jay: Use an out-of-band stack to pass information
28776         around, I wonder why I need this.
28777
28778         foreach_block: Make the new foreach_block the current_block.
28779
28780         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28781         function used to return a static Parameters structure.  Used for
28782         empty parameters, as those are created very frequently.
28783
28784         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28785
28786 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28787
28788         * interface.cs : Default modifier is private, not public. The
28789         make verify test passes again.
28790
28791 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28792
28793         * support.cs (ReflectionParameters): Fix logic to determine
28794         whether the last parameter is a params one. Test 9 passes again.
28795
28796         * delegate.cs (Populate): Register the builders we define with
28797         RegisterParameterForBuilder. Test 19 passes again.
28798
28799         * cs-parser.jay (property_declaration): Reference $6 instead
28800         of $$ to get at the location.
28801
28802         (indexer_declaration): Similar stuff.
28803
28804         (attribute): Ditto.
28805
28806         * class.cs (Property): Register parameters for the Get and Set methods
28807         if they exist. Test 23 passes again.
28808
28809         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28810         call to EmitArguments as we are sure there aren't any params arguments. 
28811         Test 32 passes again.
28812
28813         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28814         IndexOutOfRangeException. 
28815
28816         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28817         Test 33 now passes again.
28818
28819 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28820
28821         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28822         broke a bunch of things.  Will have to come up with a better way
28823         of tracking locations.
28824
28825         * statement.cs: Implemented foreach for single dimension arrays.
28826
28827 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28828
28829         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28830         an error.  This removes the lookup from the critical path.
28831
28832         * cs-parser.jay: Removed use of temporary_loc, which is completely
28833         broken. 
28834
28835 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28836
28837         * support.cs (ReflectionParameters.ParameterModifier): Report
28838         whether the argument is a PARAMS argument or not.
28839
28840         * class.cs: Set the attribute `ParamArrayAttribute' on the
28841         parameter argument.
28842
28843         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28844         and cons_param_array_attribute (ConstructorInfo for
28845         ParamArrayAttribute)., 
28846
28847         * codegen.cs: Emit the return using the `Return' statement, that
28848         way we can report the error correctly for missing return values. 
28849
28850         * class.cs (Method.Emit): Clean up.
28851
28852         * expression.cs (Argument.Resolve): Take another argument: the
28853         location where this argument is used.  Notice that this is not
28854         part of the "Argument" class as to reduce the size of the
28855         structure (we know the approximate location anyways).
28856
28857         Test if the argument is a variable-reference, if not, then
28858         complain with a 206.
28859
28860         (Argument.Emit): Emit addresses of variables.
28861
28862         (Argument.FullDesc): Simplify.
28863
28864         (Invocation.DoResolve): Update for Argument.Resolve.
28865
28866         (ElementAccess.DoResolve): ditto.
28867
28868         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28869         method should be virtual, as this method is always virtual.
28870
28871         (NewDelegate.DoResolve): Update for Argument.Resolve.
28872
28873         * class.cs (ConstructorInitializer.DoResolve): ditto.
28874
28875         * attribute.cs (Attribute.Resolve): ditto.
28876
28877 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28878
28879         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28880
28881         * expression.cs (ParameterReference): Drop IStackStorage and implement
28882         IAssignMethod instead. 
28883
28884         (LocalVariableReference): ditto.
28885
28886         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28887         IAssignMethod instead. 
28888
28889 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28890
28891         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28892         enumerations that are used in heavily used structures derive from
28893         byte in a laughable and pathetic attempt to reduce memory usage.
28894         This is the kind of pre-optimzations that you should not do at
28895         home without adult supervision.
28896
28897         * expression.cs (UnaryMutator): New class, used to handle ++ and
28898         -- separatedly from the other unary operators.  Cleans up the
28899         code, and kills the ExpressionStatement dependency in Unary.
28900
28901         (Unary): Removed `method' and `Arguments' from this class, making
28902         it smaller, and moving it all to SimpleCall, so I can reuse this
28903         code in other locations and avoid creating a lot of transient data
28904         strucutres when not required.
28905
28906         * cs-parser.jay: Adjust for new changes.
28907
28908 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28909
28910         * enum.cs (Enum.Populate): If there is a failure during
28911         definition, return
28912
28913         * cs-parser.jay (opt_enum_base): we used to catch type errors
28914         here, but this is really incorrect.  The type error should be
28915         catched during semantic analysis.
28916
28917 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28918
28919         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28920         current_local_parameters as expected since I, in my stupidity, had forgotten
28921         to do this :-)
28922
28923         * attribute.cs (GetValidPlaces): Fix stupid bug.
28924
28925         * class.cs (Method::Emit): Perform check on applicability of attributes.
28926
28927         (Constructor::Emit): Ditto.
28928
28929         (Field::Emit): Ditto.
28930
28931         (Field.Location): Store location information.
28932
28933         (Property, Event, Indexer, Operator): Ditto.
28934
28935         * cs-parser.jay (field_declaration): Pass in location for each field.
28936
28937         * ../errors/cs0592.cs : Add.
28938
28939 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28940
28941         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28942
28943         (InitCoreTypes): Update accordingly.
28944
28945         (RegisterAttrType, LookupAttr): Implement.
28946
28947         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28948         info about the same.
28949
28950         (Resolve): Update to populate the above as necessary.
28951
28952         (Error592): Helper.
28953
28954         (GetValidPlaces): Helper to the above.
28955
28956         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28957
28958         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28959
28960 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28961
28962         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28963
28964         * ../errors/cs0617.cs : Add.
28965
28966 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28967
28968         * enum.cs (Emit): Rename to Populate to be more consistent with what
28969         we expect it to do and when exactly it is called.
28970
28971         * class.cs, rootcontext.cs : Update accordingly.
28972
28973         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28974         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28975
28976         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28977
28978         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28979         of a fieldinfo using the above, when dealing with a FieldBuilder.
28980
28981 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28982
28983         * ../errors/cs0031.cs : Add.
28984
28985         * ../errors/cs1008.cs : Add.
28986
28987         * ../errrors/cs0543.cs : Add.
28988
28989         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28990         enum type.
28991
28992         (FindMembers): Implement.
28993
28994         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28995         enums and delegates too.
28996
28997         (enum_types): Rename to builder_to_enum.
28998
28999         (delegate_types): Rename to builder_to_delegate.
29000
29001         * delegate.cs (FindMembers): Implement.
29002
29003 2001-11-09  Ravi Pratap  <ravi@ximian.com>
29004
29005         * typemanager.cs (IsEnumType): Implement.
29006
29007         * enum.cs (Emit): Re-write parts to account for the underlying type
29008         better and perform checking etc.
29009
29010         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29011         of the underlying type.
29012
29013         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29014         value
29015
29016         * enum.cs (error31): Helper to report error #31.
29017
29018         * cs-parser.jay (enum_declaration): Store location of each member too.
29019
29020         * enum.cs (member_to_location): New hashtable. 
29021
29022         (AddEnumMember): Update location hashtable.
29023
29024         (Emit): Use the location of each member while reporting errors.
29025
29026 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
29027
29028         * cs-parser.jay: A for_initializer if is a
29029         local_variable_declaration really ammount to have an implicit
29030         block with the variable declaration and no initializer for for.
29031
29032         * statement.cs (For.Emit): Cope with null initializers.
29033
29034         This fixes the infinite loop on for initializers.
29035
29036 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
29037
29038         * enum.cs: More cleanup.
29039
29040         * ecore.cs: Remove dead code.
29041
29042         * class.cs (Property.Emit): More simplification.
29043         (Event.Emit): ditto.
29044
29045         Reworked to have less levels of indentation.
29046
29047 2001-11-08  Ravi Pratap  <ravi@ximian.com>
29048
29049         * class.cs (Property): Emit attributes.
29050
29051         (Field): Ditto.
29052
29053         (Event): Ditto.
29054
29055         (Indexer): Ditto.
29056
29057         (Operator): Ditto.
29058
29059         * enum.cs (Emit): Ditto.
29060
29061         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
29062         Enums too.
29063
29064         * class.cs (Field, Event, etc.): Move attribute generation into the
29065         Emit method everywhere.
29066
29067         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
29068         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
29069         as we had no way of defining nested enums !
29070
29071         * rootcontext.cs : Adjust code accordingly.
29072
29073         * typemanager.cs (AddEnumType): To keep track of enum types separately.
29074
29075 2001-11-07  Ravi Pratap  <ravi@ximian.com>
29076
29077         * expression.cs (EvalConstantExpression): Move into ecore.cs
29078
29079         * enum.cs (Enum): Rename some members and make them public and readonly
29080         according to our convention.
29081
29082         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
29083         nothing else.
29084
29085         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
29086
29087         (Enum::Emit): Write a simple version for now which doesn't try to compute
29088         expressions. I shall modify this to be more robust in just a while.
29089
29090         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
29091
29092         (TypeContainer::CloseType): Create the Enum types too.
29093
29094         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
29095
29096         * expression.cs (EvalConstantExpression): Get rid of completely.
29097
29098         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
29099         user-defined values and other cases.
29100
29101         (IsValidEnumLiteral): Helper function.
29102
29103         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
29104         out there in the case we had a literal FieldExpr.
29105
29106         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
29107
29108         (Literalize): Revamp a bit to take two arguments.
29109
29110         (EnumLiteral): New class which derives from Literal to wrap enum literals.
29111
29112 2001-11-06  Ravi Pratap  <ravi@ximian.com>
29113
29114         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
29115
29116         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
29117
29118         (Resolve): Use the above to ensure we have proper initializers.
29119
29120 2001-11-05  Ravi Pratap  <ravi@ximian.com>
29121
29122         * expression.cs (Expression::EvalConstantExpression): New method to 
29123         evaluate constant expressions.
29124
29125         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
29126
29127 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
29128
29129         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
29130         in an array.
29131
29132         (Binary.ResolveOperator): Handle operator != (object a, object b)
29133         and operator == (object a, object b);
29134
29135         (Binary.DoNumericPromotions): Indicate whether the numeric
29136         promotion was possible.
29137
29138         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
29139         Implement.  
29140
29141         Made the ArrayAccess implement interface IAssignMethod instead of
29142         IStackStore as the order in which arguments are passed reflects
29143         this.
29144
29145         * assign.cs: Instead of using expr.ExprClass to select the way of
29146         assinging, probe for the IStackStore/IAssignMethod interfaces.
29147
29148         * typemanager.cs: Load InitializeArray definition.
29149
29150         * rootcontext.cs (RootContext.MakeStaticData): Used to define
29151         static data that can be used to initialize arrays. 
29152
29153 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
29154
29155         * expression.cs: Handle operator== and operator!= for booleans.
29156
29157         (Conditioal.Reduce): Implement reducer for the ?: operator.
29158
29159         (Conditional.Resolve): Implement dead code elimination.
29160
29161         (Binary.Resolve): Catch string literals and return a new
29162         concatenated string.
29163
29164         (Unary.Reduce): Implement reduction of unary expressions.
29165
29166         * ecore.cs: Split out the expression core handling here.
29167
29168         (Expression.Reduce): New method used to perform constant folding
29169         and CSE.  This is needed to support constant-expressions. 
29170
29171         * statement.cs (Statement.EmitBoolExpression): Pass true and false
29172         targets, and optimize for !x.
29173
29174 2001-11-04  Ravi Pratap  <ravi@ximian.com>
29175
29176         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
29177         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
29178         set custom atttributes.
29179
29180         * literal.cs (Literal::GetValue): New abstract method to return the actual
29181         value of the literal, cast as an object.
29182
29183         (*Literal): Implement GetValue method.
29184
29185         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
29186         expressions to the arraylist but objects of type Argument.
29187
29188         * class.cs (TypeContainer::Emit): Emit our attributes too.
29189
29190         (Method::Emit, Constructor::Emit): Ditto.
29191
29192         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
29193         to be ignoring earlier.
29194
29195 2001-11-03  Ravi Pratap  <ravi@ximian.com>
29196
29197         * attribute.cs (AttributeSection::Define): Implement to do the business
29198         of constructing a CustomAttributeBuilder.
29199
29200         (Attribute): New trivial class. Increases readability of code.  
29201
29202         * cs-parser.jay : Update accordingly.
29203
29204         (positional_argument_list, named_argument_list, named_argument): New rules
29205
29206         (attribute_arguments): Use the above so that we are more correct.
29207
29208 2001-11-02  Ravi Pratap  <ravi@ximian.com>
29209
29210         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
29211         to perform all checks for a method with a params parameter.
29212
29213         (Invocation::OverloadResolve): Update to use the above method and therefore
29214         cope correctly with params method invocations.
29215
29216         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
29217         params too.
29218
29219         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
29220         constructors in our parent too because we can't afford to miss out on 
29221         protected ones ;-)
29222
29223         * attribute.cs (AttributeSection): New name for the class Attribute
29224
29225         Other trivial changes to improve readability.
29226
29227         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
29228         use the new class names.
29229
29230 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29231
29232         * class.cs (Method::Define): Complete definition for params types too
29233
29234         (Indexer::Define): Ditto.
29235
29236         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
29237         Cope everywhere with a request for info about the array parameter.
29238
29239 2001-11-01  Ravi Pratap  <ravi@ximian.com>
29240
29241         * tree.cs (RecordNamespace): Fix up to check for the correct key.
29242
29243         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
29244         local_variable_type to extract the string corresponding to the type.
29245
29246         (local_variable_type): Fixup the action to use the new helper method.
29247
29248         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
29249         go.
29250
29251         * expression.cs : Clean out code which uses the above.
29252
29253 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29254
29255         * typemanager.cs (RegisterMethod): Check if we already have an existing key
29256         and bale out if necessary by returning a false.
29257
29258         (RegisterProperty): Ditto.
29259
29260         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
29261         and print out appropriate error messages.
29262
29263         * interface.cs (everywhere): Ditto.
29264
29265         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
29266         location to constructor.
29267
29268         * class.cs (Property, Event, Indexer): Update accordingly.
29269
29270         * ../errors/cs111.cs : Added.
29271
29272         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
29273         of a method, as laid down by the spec.
29274
29275         (Invocation::OverloadResolve): Use the above method.
29276
29277 2001-10-31  Ravi Pratap  <ravi@ximian.com>
29278
29279         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
29280         now take a TypeContainer and a Parameters object.
29281
29282         (ParameterData): Modify return type of ParameterModifier method to be 
29283         Parameter.Modifier and not a string.
29284
29285         (ReflectionParameters, InternalParameters): Update accordingly.
29286
29287         * expression.cs (Argument::GetParameterModifier): Same here.
29288
29289         * support.cs (InternalParameters::ParameterType): Find a better way of determining
29290         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
29291         symbol in it at all so maybe this is only for now.
29292
29293 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29294
29295         * support.cs (InternalParameters): Constructor now takes an extra argument 
29296         which is the actual Parameters class.
29297
29298         (ParameterDesc): Update to provide info on ref/out modifiers.
29299
29300         * class.cs (everywhere): Update call to InternalParameters to pass in
29301         the second argument too.
29302
29303         * support.cs (ParameterData): Add ParameterModifier, which is a method 
29304         to return the modifier info [ref/out etc]
29305
29306         (InternalParameters, ReflectionParameters): Implement the above.
29307
29308         * expression.cs (Argument::ParameterModifier): Similar function to return
29309         info about the argument's modifiers.
29310
29311         (Invocation::OverloadResolve): Update to take into account matching modifiers 
29312         too.
29313
29314         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29315         a new SetFormalParameters object which we pass to InternalParameters.
29316
29317 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29318
29319         * expression.cs (NewArray): Merge into the ArrayCreation class.
29320
29321 2001-10-29  Ravi Pratap  <ravi@ximian.com>
29322
29323         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
29324         NewUserdefinedArray into one as there wasn't much of a use in having
29325         two separate ones.
29326
29327         * expression.cs (Argument): Change field's name to ArgType from Type.
29328
29329         (Type): New readonly property which returns the proper type, taking into 
29330         account ref/out modifiers.
29331
29332         (everywhere): Adjust code accordingly for the above.
29333
29334         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29335         whether we are emitting for a ref or out parameter.
29336
29337         * expression.cs (Argument::Emit): Use the above field to set the state.
29338
29339         (LocalVariableReference::Emit): Update to honour the flag and emit the
29340         right stuff.
29341
29342         * parameter.cs (Attributes): Set the correct flags for ref parameters.
29343
29344         * expression.cs (Argument::FullDesc): New function to provide a full desc.
29345
29346         * support.cs (ParameterData): Add method ParameterDesc to the interface.
29347
29348         (ReflectionParameters, InternalParameters): Implement the above method.
29349
29350         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29351         reporting errors.
29352
29353         (Invocation::FullMethodDesc): Ditto. 
29354
29355 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
29356
29357         * cs-parser.jay: Add extra production for the second form of array
29358         creation. 
29359
29360         * expression.cs (ArrayCreation): Update to reflect the above
29361         change. 
29362
29363         * Small changes to prepare for Array initialization.
29364
29365 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
29366
29367         * typemanager.cs (ImplementsInterface): interface might be null;
29368         Deal with this problem;
29369
29370         Also, we do store negative hits on the cache (null values), so use
29371         this instead of calling t.GetInterfaces on the type everytime.
29372
29373 2001-10-28  Ravi Pratap  <ravi@ximian.com>
29374
29375         * typemanager.cs (IsBuiltinType): New method to help determine the same.
29376
29377         * expression.cs (New::DoResolve): Get rid of array creation code and instead
29378         split functionality out into different classes.
29379
29380         (New::FormArrayType): Move into NewBuiltinArray.
29381
29382         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29383         quite useless.
29384
29385         (NewBuiltinArray): New class to handle creation of built-in arrays.
29386
29387         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29388         account creation of one-dimensional arrays.
29389
29390         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29391
29392         (NewUserdefinedArray::DoResolve): Implement.
29393
29394         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29395
29396         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29397         we maintain inside the TypeManager. This is necessary to perform lookups on the
29398         module builder.
29399
29400         (LookupType): Update to perform GetType on the module builders too.     
29401
29402         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29403
29404         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29405
29406 2001-10-23  Ravi Pratap  <ravi@ximian.com>
29407
29408         * expression.cs (New::DoResolve): Implement guts of array creation.
29409
29410         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29411
29412 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29413
29414         * expression.cs: Fix bug I introduced lsat night that broke
29415         Delegates. 
29416
29417         (Expression.Resolve): Report a 246 error (can not resolve name)
29418         if we find a SimpleName in the stream.
29419
29420         (Expression.ResolveLValue): Ditto.
29421
29422         (Expression.ResolveWithSimpleName): This function is a variant of
29423         ResolveName, this one allows SimpleNames to be returned without a
29424         warning.  The only consumer of SimpleNames is MemberAccess
29425
29426 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29427
29428         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29429         might arrive here.  I have my doubts that this is correct.
29430
29431         * statement.cs (Lock): Implement lock statement.
29432
29433         * cs-parser.jay: Small fixes to support `lock' and `using'
29434
29435         * cs-tokenizer.cs: Remove extra space
29436
29437         * driver.cs: New flag --checked, allows to turn on integer math
29438         checking. 
29439
29440         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29441         Threading.Monitor.Exit 
29442
29443 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29444
29445         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29446         Expression Class to be IndexerAccess.
29447
29448         Notice that Indexer::DoResolve sets the eclass to Value.
29449
29450 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29451
29452         * class.cs (TypeContainer::Emit): Emit code for indexers.
29453
29454         * assign.cs (IAssignMethod): New interface implemented by Indexers
29455         and Properties for handling assignment.
29456
29457         (Assign::Emit): Simplify and reuse code. 
29458
29459         * expression.cs (IndexerAccess, PropertyExpr): Implement
29460         IAssignMethod, clean up old code. 
29461
29462 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29463
29464         * typemanager.cs (ImplementsInterface): New method to determine if a type
29465         implements a given interface. Provides a nice cache too.
29466
29467         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29468         method.
29469
29470         (ConvertReferenceExplicit): Ditto.
29471
29472         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29473         various methods, with correct names etc.
29474
29475         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29476         Operator.UnaryNegation.
29477
29478         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29479         we have a unary plus or minus operator.
29480
29481         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29482         UnaryMinus.
29483
29484         * everywhere : update accordingly.
29485
29486         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29487         respectively.
29488
29489         * class.cs (Method::Define): For the case where we are implementing a method
29490         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29491         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29492
29493 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29494
29495         * interface.cs (FindMembers): Implement to work around S.R.E
29496         lameness.
29497
29498         * typemanager.cs (IsInterfaceType): Implement.
29499
29500         (FindMembers): Update to handle interface types too.
29501
29502         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29503         use IsAssignableFrom as that is not correct - it doesn't work.
29504
29505         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29506         and accordingly override EmitStatement.
29507
29508         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29509         using the correct logic :-)
29510
29511 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29512
29513         * ../errors/cs-11.cs : Add to demonstrate error -11 
29514
29515 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29516
29517         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29518         then pass this as a hint to ResolveLValue.
29519
29520         * expression.cs (FieldExpr): Add Location information
29521
29522         (FieldExpr::LValueResolve): Report assignment to readonly
29523         variable. 
29524
29525         (Expression::ExprClassFromMemberInfo): Pass location information.
29526
29527         (Expression::ResolveLValue): Add new method that resolves an
29528         LValue. 
29529
29530         (Expression::DoResolveLValue): Default invocation calls
29531         DoResolve. 
29532
29533         (Indexers): New class used to keep track of indexers in a given
29534         Type. 
29535
29536         (IStackStore): Renamed from LValue, as it did not really describe
29537         what this did.  Also ResolveLValue is gone from this interface and
29538         now is part of Expression.
29539
29540         (ElementAccess): Depending on the element access type
29541
29542         * typemanager.cs: Add `indexer_name_type' as a Core type
29543         (System.Runtime.CompilerServices.IndexerNameAttribute)
29544
29545         * statement.cs (Goto): Take a location.
29546
29547 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29548
29549         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29550         if two delegates are compatible.
29551
29552         (NewDelegate::DoResolve): Update to take care of the case when
29553         we instantiate a delegate from another delegate.
29554
29555         * typemanager.cs (FindMembers): Don't even try to look up members
29556         of Delegate types for now.
29557
29558 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29559
29560         * delegate.cs (NewDelegate): New class to take care of delegate
29561         instantiation.
29562
29563         * expression.cs (New): Split the delegate related code out into 
29564         the NewDelegate class.
29565
29566         * delegate.cs (DelegateInvocation): New class to handle delegate 
29567         invocation.
29568
29569         * expression.cs (Invocation): Split out delegate related code into
29570         the DelegateInvocation class.
29571
29572 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29573
29574         * expression.cs (New::DoResolve): Implement delegate creation fully
29575         and according to the spec.
29576
29577         (New::DoEmit): Update to handle delegates differently.
29578
29579         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29580         because of which we were printing out arguments in reverse order !
29581
29582         * delegate.cs (VerifyMethod): Implement to check if the given method
29583         matches the delegate.
29584
29585         (FullDelegateDesc): Implement.
29586
29587         (VerifyApplicability): Implement.
29588
29589         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29590         delegate invocations too.
29591
29592         (Invocation::Emit): Ditto.
29593
29594         * ../errors/cs1593.cs : Added.
29595
29596         * ../errors/cs1594.cs : Added.
29597
29598         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29599
29600 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29601
29602         * typemanager.cs (intptr_type): Core type for System.IntPtr
29603
29604         (InitCoreTypes): Update for the same.
29605
29606         (iasyncresult_type, asynccallback_type): Ditto.
29607
29608         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29609         correct.
29610
29611         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29612         too.
29613
29614         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29615         the builders for the 4 members of a delegate type :-)
29616
29617         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29618         type.
29619
29620         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29621
29622         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29623
29624 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29625
29626         * statement.cs (Break::Emit): Implement.   
29627         (Continue::Emit): Implement.
29628
29629         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29630         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29631         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29632         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29633         end loop
29634
29635         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29636         properties that track the label for the current loop (begin of the
29637         loop and end of the loop).
29638
29639 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29640
29641         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29642         use of emitting anything at all.
29643
29644         * class.cs, rootcontext.cs : Get rid of calls to the same.
29645
29646         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29647
29648         (Populate): Define the constructor correctly and set the implementation
29649         attributes.
29650
29651         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29652         have been defined.
29653
29654         (AddDelegateType): Implement.
29655
29656         (IsDelegateType): Implement helper method.
29657
29658         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29659
29660         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29661         and accordingly handle it.
29662
29663         * delegate.cs (Populate): Take TypeContainer argument.
29664         Implement bits to define the Invoke method. However, I still haven't figured out
29665         how to take care of the native int bit :-(
29666
29667         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29668         Qualify the name of the delegate, not its return type !
29669
29670         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29671         conversion.
29672
29673         (StandardConversionExists): Checking for array types turns out to be recursive.
29674
29675         (ConvertReferenceExplicit): Implement array conversion.
29676
29677         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29678
29679 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29680
29681         * cs-parser.jay (delegate_declaration): Store the fully qualified
29682         name as it is a type declaration.
29683
29684         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29685         readonly.
29686
29687         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29688         as TypeContainer::DefineType.
29689
29690         (Populate): Method in which all the definition of the various methods (Invoke)
29691         etc is done.
29692
29693         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29694         see.
29695
29696         (CloseDelegate): Finally creates the delegate.
29697
29698         * class.cs (TypeContainer::DefineType): Update to define delegates.
29699         (Populate, Emit and CloseType): Do the same thing here too.
29700
29701         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29702         delegates in all these operations.
29703
29704 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29705
29706         * expression.cs: LocalTemporary: a new expression used to
29707         reference a temporary that has been created.
29708
29709         * assign.cs: Handle PropertyAccess back here, so that we can
29710         provide the proper semantic access to properties.
29711
29712         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29713         a few more explicit conversions. 
29714
29715         * modifiers.cs: `NEW' modifier maps to HideBySig.
29716
29717         * expression.cs (PropertyExpr): Make this into an
29718         ExpressionStatement, and support the EmitStatement code path. 
29719
29720         Perform get/set error checking, clean up the interface.
29721
29722         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29723         them into toplevel access objects.
29724
29725 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29726
29727         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29728         SRE.
29729
29730         * typemanager.cs: Keep track here of our PropertyBuilders again to
29731         work around lameness in SRE.
29732
29733 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29734
29735         * expression.cs (LValue::LValueResolve): New method in the
29736         interface, used to perform a second resolution pass for LValues. 
29737
29738         (This::DoResolve): Catch the use of this in static methods.
29739
29740         (This::LValueResolve): Implement.
29741
29742         (This::Store): Remove warning, assigning to `this' in structures
29743         is 
29744
29745         (Invocation::Emit): Deal with invocation of
29746         methods on value types.  We need to pass the address to structure
29747         methods rather than the object itself.  (The equivalent code to
29748         emit "this" for structures leaves the entire structure on the
29749         stack instead of a pointer to it). 
29750
29751         (ParameterReference::DoResolve): Compute the real index for the
29752         argument based on whether the method takes or not a `this' pointer
29753         (ie, the method is static).
29754
29755         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29756         value types returned from functions when we need to invoke a
29757         method on the sturcture.
29758
29759
29760 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29761
29762         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29763         defining the type in the Modulebuilder or Typebuilder. This is to take
29764         care of nested types which need to be defined on the TypeBuilder using
29765         DefineNestedMethod.
29766
29767         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29768         methods in RootContext, only ported to be part of TypeContainer.
29769
29770         (TypeContainer::GetInterfaceOrClass): Ditto.
29771
29772         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29773
29774         * interface.cs (Interface::DefineInterface): New method. Does exactly
29775         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29776         too.
29777
29778         (Interface::GetInterfaces): Move from RootContext here and port.
29779
29780         (Interface::GetInterfaceByName): Same here.
29781
29782         * rootcontext.cs (ResolveTree): Re-write.
29783
29784         (PopulateTypes): Re-write.
29785
29786         * class.cs (TypeContainer::Populate): Populate nested types too.
29787         (TypeContainer::Emit): Emit nested members too.
29788
29789         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29790         instead just use the name argument passed in as it is already fully
29791         qualified.
29792
29793         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29794         to TypeContainer mapping to see if a type is user-defined.
29795
29796         * class.cs (TypeContainer::CloseType): Implement. 
29797
29798         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29799         the default constructor.
29800
29801         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29802         twice.
29803
29804         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29805
29806         * interface.cs (CloseType): Create the type here.
29807
29808         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29809         the hierarchy.
29810
29811         Remove all the methods which are now in TypeContainer.
29812
29813 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29814
29815         * delegate.cs (Define): Re-write bits to define the delegate
29816         correctly.
29817
29818 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29819
29820         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29821
29822         * expression.cs (ImplicitReferenceConversion): handle null as well
29823         as a source to convert to any reference type.
29824
29825         * statement.cs (Return): Perform any implicit conversions to
29826         expected return type.  
29827
29828         Validate use of return statement.  
29829
29830         * codegen.cs (EmitContext): Pass the expected return type here.
29831
29832         * class.cs (Method, Constructor, Property): Pass expected return
29833         type to EmitContext.
29834
29835 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29836
29837         * expression.cs: Make DoResolve take an EmitContext instead of a
29838         TypeContainer.
29839
29840         Replaced `l' and `location' for `loc', for consistency.
29841
29842         (Error, Warning): Remove unneeded Tc argument.
29843
29844         * assign.cs, literal.cs, constant.cs: Update to new calling
29845         convention. 
29846
29847         * codegen.cs: EmitContext now contains a flag indicating whether
29848         code is being generated in a static method or not.
29849
29850         * cs-parser.jay: DecomposeQI, new function that replaces the old
29851         QualifiedIdentifier.  Now we always decompose the assembled
29852         strings from qualified_identifier productions into a group of
29853         memberaccesses.
29854
29855 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29856
29857         * rootcontext.cs: Deal with field-less struct types correctly now
29858         by passing the size option to Define Type.
29859
29860         * class.cs: Removed hack that created one static field. 
29861
29862 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29863
29864         * statement.cs: Moved most of the code generation here. 
29865
29866 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29867
29868         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29869         seem very right.
29870
29871         (ElementAccess): Remove useless bits for now - keep checks as the spec
29872         says.
29873
29874 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29875
29876         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29877         and start performing checks according to the spec.
29878
29879 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29880
29881         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29882         rank_specifiers instead.
29883
29884         (rank_specifiers): Change the order in which the rank specifiers are stored
29885
29886         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29887
29888         * expression.cs (ElementAccess): Implement the LValue interface too.
29889
29890 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29891
29892         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29893         except that user defined conversions are not included.
29894
29895         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29896         perform the conversion of the return type, if necessary.
29897
29898         (New::DoResolve): Check whether we are creating an array or an object
29899         and accordingly do the needful.
29900
29901         (New::Emit): Same here.
29902
29903         (New::DoResolve): Implement guts of array creation.
29904
29905         (New::FormLookupType): Helper function.
29906
29907 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29908
29909         * codegen.cs: Removed most of the code generation here, and move the
29910         corresponding code generation bits to the statement classes. 
29911
29912         Added support for try/catch/finalize and throw.
29913
29914         * cs-parser.jay: Added support for try/catch/finalize.
29915
29916         * class.cs: Catch static methods having the flags override,
29917         virtual or abstract.
29918
29919         * expression.cs (UserCast): This user cast was not really doing
29920         what it was supposed to do.  Which is to be born in fully resolved
29921         state.  Parts of the resolution were being performed at Emit time! 
29922
29923         Fixed this code.
29924
29925 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29926
29927         * expression.cs: Implicity convert the result from UserCast.
29928
29929 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29930
29931         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29932         prevented it from working correctly. 
29933
29934         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29935         merely ConvertImplicit.
29936
29937 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29938
29939         * typemanager.cs: Make the LookupTypeContainer function static,
29940         and not per-instance.  
29941
29942         * class.cs: Make static FindMembers (the one that takes a Type
29943         argument). 
29944
29945         * codegen.cs: Add EmitForeach here.
29946
29947         * cs-parser.jay: Make foreach a toplevel object instead of the
29948         inline expansion, as we need to perform semantic analysis on it. 
29949
29950 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29951
29952         * expression.cs (Expression::ImplicitUserConversion): Rename to
29953         UserDefinedConversion.
29954
29955         (Expression::UserDefinedConversion): Take an extra argument specifying 
29956         whether we look for explicit user conversions too.
29957
29958         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29959
29960         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29961
29962         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29963         with the appropriate arguments.
29964
29965         * cs-parser.jay (cast_expression): Record location too.
29966
29967         * expression.cs (Cast): Record location info.
29968
29969         (Expression::ConvertExplicit): Take location argument.
29970
29971         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29972         to determine if we are doing explicit conversions.
29973
29974         (UserCast::Emit): Update accordingly.
29975
29976         (Expression::ConvertExplicit): Report an error if everything fails.
29977
29978         * ../errors/cs0030.cs : Add.
29979
29980 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29981
29982         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29983         virtual and newslot bits. 
29984
29985         * class.cs (TypeContainer::RegisterRequiredImplementations):
29986         Record methods we need.
29987
29988         (TypeContainer::MakeKey): Helper function to make keys for
29989         MethodBases, since the Methodbase key is useless.
29990
29991         (TypeContainer::Populate): Call RegisterRequiredImplementations
29992         before defining the methods.   
29993
29994         Create a mapping for method_builders_to_methods ahead of time
29995         instead of inside a tight loop.
29996
29997         (::RequireMethods):  Accept an object as the data to set into the
29998         hashtable so we can report interface vs abstract method mismatch.
29999
30000 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30001
30002         * report.cs: Make all of it static.
30003
30004         * rootcontext.cs: Drop object_type and value_type computations, as
30005         we have those in the TypeManager anyways.
30006
30007         Drop report instance variable too, now it is a global.
30008
30009         * driver.cs: Use try/catch on command line handling.
30010
30011         Add --probe option to debug the error reporting system with a test
30012         suite. 
30013
30014         * report.cs: Add support for exiting program when a probe
30015         condition is reached.
30016
30017 2001-10-03  Ravi Pratap  <ravi@ximian.com>
30018
30019         * expression.cs (Binary::DoNumericPromotions): Fix the case when
30020         we do a forcible conversion regardless of type, to check if 
30021         ForceConversion returns a null.
30022
30023         (Binary::error19): Use location to report error.
30024
30025         (Unary::error23): Use location here too.
30026
30027         * ../errors/cs0019.cs : Check in.
30028
30029         * ../errors/cs0023.cs : Check in.
30030
30031         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30032         case of a non-null MethodInfo object with a length of 0 !
30033
30034         (Binary::ResolveOperator): Flag error if overload resolution fails to find
30035         an applicable member - according to the spec :-)
30036         Also fix logic to find members in base types.
30037
30038         (Unary::ResolveOperator): Same here.
30039
30040         (Unary::report23): Change name to error23 and make first argument a TypeContainer
30041         as I was getting thoroughly confused between this and error19 :-)
30042
30043         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
30044         (::FindMostEncompassedType): Implement.
30045         (::FindMostEncompassingType): Implement.
30046         (::StandardConversionExists): Implement.
30047
30048         (UserImplicitCast): Re-vamp. We now need info about most specific
30049         source and target types so that we can do the necessary conversions.
30050
30051         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
30052         mathematical union with no duplicates.
30053
30054 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
30055
30056         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
30057         in order from base classes to child classes, so that we can in
30058         child classes look up in our parent for method names and
30059         attributes (required for handling abstract, virtual, new, override
30060         constructs: we need to instrospect our base class, and if we dont
30061         populate the classes in order, the introspection might be
30062         incorrect.  For example, a method could query its parent before
30063         the parent has any methods and would determine that the parent has
30064         no abstract methods (while it could have had them)).
30065
30066         (RootContext::CreateType): Record the order in which we define the
30067         classes.
30068
30069 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
30070
30071         * class.cs (TypeContainer::Populate): Also method definitions can
30072         fail now, keep track of this.
30073
30074         (TypeContainer::FindMembers): Implement support for
30075         DeclaredOnly/noDeclaredOnly flag.
30076
30077         (Constructor::Emit) Return the ConstructorBuilder.
30078
30079         (Method::Emit) Return the MethodBuilder. 
30080         Check for abstract or virtual methods to be public.
30081
30082         * rootcontext.cs (RootContext::CreateType): Register all the
30083         abstract methods required for the class to be complete and the
30084         interface methods that must be implemented. 
30085
30086         * cs-parser.jay: Report error 501 (method requires body if it is
30087         not marked abstract or extern).
30088
30089         * expression.cs (TypeOf::Emit): Implement.
30090
30091         * typemanager.cs: runtime_handle_type, new global type.
30092
30093         * class.cs (Property::Emit): Generate code for properties.
30094
30095 2001-10-02  Ravi Pratap  <ravi@ximian.com>
30096
30097         * expression.cs (Unary::ResolveOperator): Find operators on base type
30098         too - we now conform exactly to the spec.
30099
30100         (Binary::ResolveOperator): Same here.
30101
30102         * class.cs (Operator::Define): Fix minor quirk in the tests.
30103
30104         * ../errors/cs0215.cs : Added.
30105
30106         * ../errors/cs0556.cs : Added.
30107
30108         * ../errors/cs0555.cs : Added.
30109
30110 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30111
30112         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
30113         single integer which is really efficient
30114
30115 2001-10-01  Ravi Pratap  <ravi@ximian.com>
30116
30117         *  expression.cs (Expression::ImplicitUserConversion): Use location
30118         even in the case when we are examining True operators.
30119  
30120         * class.cs (Operator::Define): Perform extensive checks to conform
30121         with the rules for operator overloading in the spec.
30122
30123         * expression.cs (Expression::ImplicitReferenceConversion): Implement
30124         some of the other conversions mentioned in the spec.
30125
30126         * typemanager.cs (array_type): New static member for the System.Array built-in
30127         type.
30128
30129         (cloneable_interface): For System.ICloneable interface.
30130
30131         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
30132         we start resolving the tree and populating types.
30133
30134         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
30135  
30136 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
30137
30138         * expression.cs (Expression::ExprClassFromMemberInfo,
30139         Expression::Literalize): Create literal expressions from
30140         FieldInfos which are literals.
30141
30142         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
30143         type casts, because they were wrong.  The test suite in tests
30144         caught these ones.
30145
30146         (ImplicitNumericConversion): ushort to ulong requires a widening
30147         cast. 
30148
30149         Int32 constant to long requires widening cast as well.
30150
30151         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
30152         for integers because the type on the stack is not i4.
30153
30154 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
30155
30156         * expression.cs (report118): require location argument. 
30157
30158         * parameter.cs: Do not dereference potential null value.
30159
30160         * class.cs: Catch methods that lack the `new' keyword when
30161         overriding a name.  Report warnings when `new' is used without
30162         anything being there to override.
30163
30164         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
30165
30166         * class.cs: Only add constructor to hashtable if it is non-null
30167         (as now constructors can fail on define).
30168
30169         (TypeManager, Class, Struct): Take location arguments.
30170
30171         Catch field instance initialization in structs as errors.
30172
30173         accepting_filter: a new filter for FindMembers that is static so
30174         that we dont create an instance per invocation.
30175
30176         (Constructor::Define): Catch errors where a struct constructor is
30177         parameterless 
30178
30179         * cs-parser.jay: Pass location information for various new
30180         constructs. 
30181
30182         * delegate.cs (Delegate): take a location argument.
30183
30184         * driver.cs: Do not call EmitCode if there were problesm in the
30185         Definition of the types, as many Builders wont be there. 
30186
30187         * decl.cs (Decl::Decl): Require a location argument.
30188
30189         * cs-tokenizer.cs: Handle properly hex constants that can not fit
30190         into integers, and find the most appropiate integer for it.
30191
30192         * literal.cs: Implement ULongLiteral.
30193
30194         * rootcontext.cs: Provide better information about the location of
30195         failure when CreateType fails.
30196
30197 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
30198
30199         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
30200         as well.
30201
30202         * expression.cs (Binary::CheckShiftArguments): Add missing type
30203         computation.
30204         (Binary::ResolveOperator): Add type to the logical and and logical
30205         or, Bitwise And/Or and Exclusive Or code paths, it was missing
30206         before.
30207
30208         (Binary::DoNumericPromotions): In the case where either argument
30209         is ulong (and most signed types combined with ulong cause an
30210         error) perform implicit integer constant conversions as well.
30211
30212 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30213
30214         * expression.cs (UserImplicitCast): Method should always be
30215         non-null. 
30216         (Invocation::BetterConversion): Simplified test for IntLiteral.
30217
30218         (Expression::ImplicitNumericConversion): Split this routine out.
30219         Put the code that performs implicit constant integer conversions
30220         here. 
30221
30222         (Expression::Resolve): Become a wrapper around DoResolve so we can
30223         check eclass and type being set after resolve.
30224
30225         (Invocation::Badness): Remove this dead function
30226
30227         (Binary::ResolveOperator): Do not compute the expensive argumnets
30228         unless we have a union for it.
30229
30230         (Probe::Emit): Is needs to do an isinst and then
30231         compare against null.
30232
30233         (::CanConvert): Added Location argument.  If the Location argument
30234         is null (Location.Null), then we do not report errors.  This is
30235         used by the `probe' mechanism of the Explicit conversion.  We do
30236         not want to generate an error for something that the user
30237         explicitly requested to be casted.  But the pipeline for an
30238         explicit cast first tests for potential implicit casts.
30239
30240         So for now, if the Location is null, it means `Probe only' to
30241         avoid adding another argument.   Might have to revise this
30242         strategy later.
30243
30244         (ClassCast): New class used to type cast objects into arbitrary
30245         classes (used in Explicit Reference Conversions).
30246
30247         Implement `as' as well.
30248
30249         Reverted all the patches from Ravi below: they were broken:
30250
30251                 * The use of `level' as a mechanism to stop recursive
30252                   invocations is wrong.  That was there just to catch the
30253                   bug with a strack trace but not as a way of addressing
30254                   the problem.
30255
30256                   To fix the problem we have to *understand* what is going
30257                   on and the interactions and come up with a plan, not
30258                   just get things going.
30259
30260                 * The use of the type conversion cache that I proposed
30261                   last night had an open topic: How does this work across
30262                   protection domains.  A user defined conversion might not
30263                   be public in the location where we are applying the
30264                   conversion, a different conversion might be selected
30265                   (ie, private A->B (better) but public B->A (worse),
30266                   inside A, A->B applies, but outside it, B->A will
30267                   apply).
30268
30269                 * On top of that (ie, even if the above is solved),
30270                   conversions in a cache need to be abstract.  Ie, `To
30271                   convert from an Int to a Short use an OpcodeCast', not
30272                   `To convert from an Int to a Short use the OpcodeCast on
30273                   the variable 5' (which is what this patch was doing).
30274
30275 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30276
30277         * expression.cs (Invocation::ConversionExists): Re-write to use
30278         the conversion cache
30279
30280         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
30281         cache all conversions done, not just user-defined ones.
30282
30283         (Invocation::BetterConversion): The real culprit. Use ConversionExists
30284         to determine if a conversion exists instead of acutually trying to 
30285         perform the conversion. It's faster too.
30286
30287         (Expression::ConvertExplicit): Modify to use ConversionExists to check
30288         and only then attempt the implicit conversion.
30289
30290 2001-09-28  Ravi Pratap  <ravi@ximian.com>
30291
30292         * expression.cs (ConvertImplicit): Use a cache for conversions
30293         already found. Check level of recursion and bail out if necessary.
30294
30295 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30296
30297         * typemanager.cs (string_concat_string_string, string_concat_object_object):
30298         Export standard methods that we expect for string operations.
30299
30300         * statement.cs (Block::UsageWarning): Track usage of variables and
30301         report the errors for not used variables.
30302
30303         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30304         operator. 
30305
30306 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30307
30308         * codegen.cs: remove unnneded code 
30309
30310         * expression.cs: Removed BuiltinTypeAccess class
30311
30312         Fix the order in which implicit conversions are
30313         done.  
30314
30315         The previous fixed dropped support for boxed conversions (adding a
30316         test to the test suite now)
30317
30318         (UserImplicitCast::CanConvert): Remove test for source being null,
30319         that code is broken.  We should not feed a null to begin with, if
30320         we do, then we should track the bug where the problem originates
30321         and not try to cover it up here.
30322
30323         Return a resolved expression of type UserImplicitCast on success
30324         rather than true/false.  Ravi: this is what I was talking about,
30325         the pattern is to use a static method as a "constructor" for
30326         objects. 
30327
30328         Also, do not create arguments until the very last minute,
30329         otherwise we always create the arguments even for lookups that
30330         will never be performed. 
30331
30332         (UserImplicitCast::Resolve): Eliminate, objects of type
30333         UserImplicitCast are born in a fully resolved state. 
30334
30335         * typemanager.cs (InitCoreTypes): Init also value_type
30336         (System.ValueType). 
30337
30338         * expression.cs (Cast::Resolve): First resolve the child expression.
30339
30340         (LValue): Add new method AddressOf to be used by
30341         the `&' operator.  
30342
30343         Change the argument of Store to take an EmitContext instead of an
30344         ILGenerator, because things like FieldExpr need to be able to call
30345         their children expression to generate the instance code. 
30346
30347         (Expression::Error, Expression::Warning): Sugar functions for
30348         reporting errors.
30349
30350         (Expression::MemberLookup): Accept a TypeContainer instead of a
30351         Report as the first argument.
30352
30353         (Expression::ResolvePrimary): Killed.  I still want to improve
30354         this as currently the code is just not right.
30355
30356         (Expression::ResolveMemberAccess): Simplify, but it is still
30357         wrong. 
30358
30359         (Unary::Resolve): Catch errors in AddressOf operators.
30360
30361         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30362         index to a byte for the short-version, or the compiler will choose
30363         the wrong Emit call, which generates the wrong data.
30364
30365         (ParameterReference::Emit, ::Store): same.
30366
30367         (FieldExpr::AddressOf): Implement.
30368
30369         * typemanager.cs: TypeManager: made public variable instead of
30370         property.
30371
30372         * driver.cs: document --fatal.
30373
30374         * report.cs (ErrorMessage, WarningMessage): new names for the old
30375         Error and Warning classes.
30376
30377         * cs-parser.jay (member_access): Turn built-in access to types
30378         into a normal simplename
30379
30380 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30381
30382         * expression.cs (Invocation::BetterConversion): Fix to cope
30383         with q being null, since this was introducing a bug.
30384
30385         * expression.cs (ConvertImplicit): Do built-in conversions first.
30386
30387 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30388
30389         * expression.cs (UserImplicitCast::Resolve): Fix bug.
30390
30391 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30392
30393         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30394         I had introduced long ago (what's new ?).
30395
30396         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
30397         the work of all the checking. 
30398         (ConvertImplicit): Call CanConvert and only then create object if necessary.
30399         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30400
30401         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30402         that is the right way. 
30403
30404         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
30405         overloading resolution. Use everywhere instead of cutting and pasting code.
30406
30407         (Binary::ResolveOperator): Use MakeUnionSet.
30408
30409         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
30410         we have to convert to bool types. Not complete yet.
30411
30412 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30413
30414         * typemanager.cs (TypeManager::CSharpName): support ushort.
30415
30416         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30417         to provide an expression that performsn an implicit constant int
30418         conversion (section 6.1.6).
30419         (Expression::ConvertImplicitRequired): Reworked to include
30420         implicit constant expression conversions.
30421
30422         (Expression::ConvertNumericExplicit): Finished.
30423
30424         (Invocation::Emit): If InstanceExpression is null, then it means
30425         that we perform a call on this.
30426
30427 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30428
30429         * expression.cs (Unary::Emit): Remove some dead code.
30430         (Probe): Implement Resolve and Emit for `is'.
30431         (Expression::ConvertImplicitRequired): Attempt to do constant
30432         expression conversions here.  Maybe should be moved to
30433         ConvertImplicit, but I am not sure.
30434         (Expression::ImplicitLongConstantConversionPossible,
30435         Expression::ImplicitIntConstantConversionPossible): New functions
30436         that tell whether is it possible to apply an implicit constant
30437         expression conversion.
30438
30439         (ConvertNumericExplicit): Started work on explicit numeric
30440         conversions.
30441
30442         * cs-parser.jay: Update operator constants.
30443
30444         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30445         (Parameters::GetSignature): Hook up VerifyArgs here.
30446         (Parameters::VerifyArgs): Verifies that no two arguments have the
30447         same name. 
30448
30449         * class.cs (Operator): Update the operator names to reflect the
30450         ones that the spec expects (as we are just stringizing the
30451         operator names).
30452
30453         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30454         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30455         previous usage did only work for our methods.
30456         (Expression::ConvertImplicit): Handle decimal implicit numeric
30457         conversions as well.
30458         (Expression::InternalTypeConstructor): Used to invoke constructors
30459         on internal types for default promotions.
30460
30461         (Unary::Emit): Implement special handling for the pre/post
30462         increment/decrement for overloaded operators, as they need to have
30463         the same semantics as the other operators.
30464
30465         (Binary::ResolveOperator): ditto.
30466         (Invocation::ConversionExists): ditto.
30467         (UserImplicitCast::Resolve): ditto.
30468
30469 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30470
30471         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30472         operator, return after emitting body. Regression tests pass again !
30473
30474         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30475         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30476         (Invocation::OverloadResolve): Ditto.
30477         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30478
30479         * everywhere : update calls to the above methods accordingly.
30480
30481 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30482
30483         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30484
30485         * expression.cs (ExpressionStatement): New base class used for
30486         expressions that can appear in statements, so that we can provide
30487         an alternate path to generate expression that do not leave a value
30488         on the stack.
30489
30490         (Expression::Emit, and all the derivatives): We no longer return
30491         whether a value is left on the stack or not.  Every expression
30492         after being emitted leaves a single value on the stack.
30493
30494         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30495         facilties of ExpressionStatement if possible.
30496
30497         * cs-parser.jay: Update statement_expression.
30498
30499 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30500
30501         * driver.cs: Change the wording of message
30502
30503 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30504
30505         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30506         the type of the expression to the return type of the method if
30507         we have an overloaded operator match ! The regression tests pass again !
30508         (Unary::ResolveOperator): Ditto.
30509
30510         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30511         to find "op_Implicit", not "implicit" ;-)
30512         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30513         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30514
30515         * everywhere : Correct calls to the above accordingly.
30516
30517         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30518         (ConvertImplicit): Do user-defined conversion if it exists.
30519
30520 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30521
30522         * assign.cs: track location.
30523         (Resolve): Use implicit conversions on assignment.
30524
30525         * literal.cs: Oops.  Not good, Emit of short access values should
30526         pass (Bytes) or the wrong argument will be selected.
30527
30528         * expression.cs (Unary::Emit): Emit code for -expr.
30529
30530         (Unary::ResolveOperator): Handle `Substract' for non-constants
30531         (substract from zero from the non-constants).
30532         Deal with Doubles as well. 
30533
30534         (Expression::ConvertImplicitRequired): New routine that reports an
30535         error if no implicit conversion exists. 
30536
30537         (Invocation::OverloadResolve): Store the converted implicit
30538         expressions if we make them
30539
30540 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30541
30542         * class.cs (ConstructorInitializer): Take a Location argument.
30543         (ConstructorBaseInitializer): Same here.
30544         (ConstructorThisInitializer): Same here.
30545
30546         * cs-parser.jay : Update all calls accordingly.
30547
30548         * expression.cs (Unary, Binary, New): Take location argument.
30549         Update accordingly everywhere.
30550
30551         * cs-parser.jay : Update all calls to the above to take a location
30552         argument.
30553
30554         * class.cs : Ditto.
30555
30556 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30557
30558         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30559         (Invocation::BetterConversion): Same here
30560         (Invocation::ConversionExists): Ditto.
30561
30562         (Invocation::ConversionExists): Implement.
30563
30564 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30565
30566         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30567         Also take an additional TypeContainer argument.
30568
30569         * All over : Pass in TypeContainer as argument to OverloadResolve.
30570
30571         * typemanager.cs (CSharpName): Update to check for the string type and return
30572         that too.
30573
30574         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30575         a given method.
30576
30577 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30578
30579         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30580         (Invocation::BetterFunction): Implement.
30581         (Invocation::BetterConversion): Implement.
30582         (Invocation::ConversionExists): Skeleton, no implementation yet.
30583
30584         Okay, things work fine !
30585
30586 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30587
30588         * typemanager.cs: declare and load enum_type, delegate_type and
30589         void_type. 
30590
30591         * expression.cs (Expression::Emit): Now emit returns a value that
30592         tells whether a value is left on the stack or not.  This strategy
30593         might be reveted tomorrow with a mechanism that would address
30594         multiple assignments.
30595         (Expression::report118): Utility routine to report mismatches on
30596         the ExprClass.
30597
30598         (Unary::Report23): Report impossible type/operator combination
30599         utility function.
30600
30601         (Unary::IsIncrementableNumber): Whether the type can be
30602         incremented or decremented with add.
30603         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30604         complemented. 
30605         (Unary::ResolveOperator): Implement ++, !, ~,
30606
30607         (Invocation::Emit): Deal with new Emit convetion.
30608
30609         * All Expression derivatives: Updated their Emit method to return
30610         whether they leave values on the stack or not.
30611
30612         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30613         stack for expressions that are statements. 
30614
30615 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30616
30617         * expression.cs (LValue): New interface.  Must be implemented by
30618         LValue objects.
30619         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30620         LValue interface.
30621
30622         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30623         interface for generating code, simplifies the code.
30624
30625 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30626
30627         * expression.cs (everywhere): Comment out return statements in ::Resolve
30628         methods to avoid the warnings.
30629
30630 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30631
30632         * driver.cs (parse): Report error 2001 if we can not open the
30633         source file.
30634
30635         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30636         not resolve it.
30637
30638         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30639         object. 
30640
30641         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30642         otherwise nested blocks end up with the same index.
30643
30644         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30645
30646         * expression.cs:  Instead of having FIXMEs in the Resolve
30647         functions, throw exceptions so it is obvious that we are facing a
30648         bug. 
30649
30650         * cs-parser.jay (invocation_expression): Pass Location information.
30651
30652         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30653         Use a basename for those routines because .NET does not like paths
30654         on them. 
30655
30656         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30657         already defined.
30658
30659 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30660
30661         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30662         are loading the correct data types (throws an exception if not).
30663         (TypeManager::InitCoreTypes): Use CoreLookupType
30664
30665         * expression.cs (Unary::ResolveOperator): return the child
30666         expression for expressions which are just +expr.
30667         (Unary::ResolveOperator): Return negative literals for -LITERAL
30668         expressions (otherwise they are Unary {Literal}).
30669         (Invocation::Badness): Take into account `Implicit constant
30670         expression conversions'.
30671
30672         * literal.cs (LongLiteral): Implement long literal class.
30673         (IntLiteral): export the `Value' of the intliteral. 
30674
30675 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30676
30677         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30678
30679         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30680         instead of 'Operator'
30681
30682         * expression.cs (Binary::ResolveOperator): Update accordingly.
30683         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30684         and 'Minus'
30685
30686         * cs-parser.jay (unary_expression): Update to use the new names.
30687
30688         * gen-treedump.cs (GetUnary): Same here.
30689
30690         * expression.cs (Unary::Resolve): Implement.
30691         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30692         operators are found instead of making noise ;-)
30693         (Unary::ResolveOperator): New method to do precisely the same thing which
30694         Binary::ResolveOperator does for Binary expressions.
30695         (Unary.method, .Arguments): Add.
30696         (Unary::OperName): Implement.   
30697         (Unary::ForceConversion): Copy and Paste !
30698
30699         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30700         a unary operator.
30701
30702         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30703         for the inbuilt operators. Only overloading works for now ;-)
30704
30705 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30706
30707         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30708         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30709
30710         * expression.cs (This::Emit): Implement. 
30711         (This::Resolve): Implement.
30712         (TypeOf:Resolve): Implement.
30713         (Expression::ResolveSimpleName): Add an implicit this to instance
30714         field references. 
30715         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30716         Bind instance variable to Field expressions.
30717         (FieldExpr::Instance): New field used to track the expression that
30718         represents the object instance.
30719         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30720         binding 
30721         (FieldExpr::Emit): Implement.
30722
30723         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30724         the last instruction contains a return opcode to avoid generating
30725         the last `ret' instruction (this generates correct code, and it is
30726         nice to pass the peverify output).
30727
30728         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30729         initializer for static and instance variables.
30730         (Constructor::Emit): Allow initializer to be null in the case of
30731         static constructors.  Only emit initializer for instance
30732         constructors. 
30733
30734         (TypeContainer::FindMembers): Return a null array if there are no
30735         matches.
30736
30737         Also fix the code for the MemberTypes.Method branch, as it was not
30738         scanning that for operators (or tried to access null variables before).
30739
30740         * assign.cs (Assign::Emit): Handle instance and static fields. 
30741
30742         * TODO: Updated.
30743
30744         * driver.cs: Stop compilation if there are parse errors.
30745
30746         * cs-parser.jay (constructor_declaration): Provide default base
30747         initializer for non-static constructors.
30748         (constructor_declarator): Do not provide a default base
30749         initializers if none was specified.
30750         Catch the fact that constructors should not have parameters.
30751
30752         * class.cs: Do not emit parent class initializers for static
30753         constructors, that should be flagged as an error.
30754
30755 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30756
30757         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30758         Move back code into TypeContainer::Populate.
30759
30760 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30761
30762         * class.cs (TypeContainer::AddConstructor): Fix the check to
30763         compare against Name, not Basename. 
30764         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30765
30766         * cs-parser.jay : Update accordingly.
30767
30768         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30769         for methods, don't forget to look into the operators too.
30770         (RegisterMethodBuilder): Helper method to take care of this for
30771         methods, constructors and operators.
30772         (Operator::Define): Completely revamp.
30773         (Operator.OperatorMethod, MethodName): New fields.
30774         (TypeContainer::Populate): Move the registering of builders into
30775         RegisterMethodBuilder.
30776         (Operator::Emit): Re-write.
30777
30778         * expression.cs (Binary::Emit): Comment out code path to emit method
30779         invocation stuff for the case when we have a user defined operator. I am
30780         just not able to get it right !
30781
30782 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30783
30784         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30785         argument. 
30786
30787         (Expression::MemberLookup): Provide a version that allows to
30788         specify the MemberTypes and BindingFlags. 
30789
30790         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30791         so it was not fetching variable information from outer blocks.
30792
30793         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30794         Beforefieldinit as it was buggy.
30795
30796         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30797         that Ravi put here.  
30798
30799         * class.cs (Constructor::Emit): Only emit if block is not null.
30800         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30801         deal with this by semantically definining it as if the user had
30802         done it.
30803
30804         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30805         constructors as we now "emit" them at a higher level.
30806
30807         (TypeContainer::DefineDefaultConstructor): Used to define the
30808         default constructors if none was provided.
30809
30810         (ConstructorInitializer): Add methods Resolve and Emit. 
30811
30812         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30813
30814 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30815
30816         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30817         the default constructor builder with our hashtable for methodbuilders
30818         to methodcores.
30819
30820         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30821         and argument_count is 0 in which case we have a match.
30822         (Binary::ResolveOperator): More null checking and miscellaneous coding
30823         style cleanup.
30824
30825 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30826
30827         * rootcontext.cs (IsNameSpace): Compare against null.
30828
30829         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30830
30831         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30832         and Unary::Operator.
30833
30834         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30835         accordingly.
30836
30837         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30838         we have overloaded operators.
30839         (Binary::ResolveOperator): Implement the part which does the operator overload
30840         resolution.
30841
30842         * class.cs (Operator::Emit): Implement.
30843         (TypeContainer::Emit): Emit the operators we have too.
30844
30845         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30846         the case when we have a user-defined operator.
30847
30848 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30849
30850         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30851
30852 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30853
30854         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30855         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30856         (Constructor::Emit): Implement.
30857         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30858         if we have no work to do. 
30859         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30860         Emit method.
30861
30862         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30863         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30864
30865         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30866         of parent.parent.
30867
30868 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30869
30870         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30871         in the source.
30872         (Tree::RecordNamespace): Method to do what the name says ;-)
30873         (Tree::Namespaces): Property to get at the namespaces hashtable.
30874
30875         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30876         keep track.
30877
30878         * rootcontext.cs (IsNamespace): Fixed it :-)
30879
30880 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30881
30882         * class.cs (TypeContainer::FindMembers): Add support for
30883         constructors. 
30884         (MethodCore): New class that encapsulates both the shared aspects
30885         of a Constructor and a Method.  
30886         (Method, Constructor): Factored pieces into MethodCore.
30887
30888         * driver.cs: Added --fatal which makes errors throw exceptions.
30889         Load System assembly as well as part of the standard library.
30890
30891         * report.cs: Allow throwing exceptions on errors for debugging.
30892
30893         * modifiers.cs: Do not use `parent', instead use the real type
30894         container to evaluate permission settings.
30895
30896         * class.cs: Put Ravi's patch back in.  He is right, and we will
30897         have to cope with the
30898
30899 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30900
30901         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30902         FamORAssem, not FamANDAssem.
30903
30904 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30905
30906         * driver.cs: Added --parse option that only parses its input files
30907         and terminates.
30908
30909         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30910         incorrect.  IsTopLevel is not used to tell whether an object is
30911         root_types or not (that can be achieved by testing this ==
30912         root_types).  But to see if this is a top-level *class* (not
30913         necessarly our "toplevel" container). 
30914
30915 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30916
30917         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30918         parent instead of a direct call to GetType.
30919
30920 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30921
30922         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30923         Modifiers.TypeAttr. This should just be a call to that method.
30924
30925         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30926         object so that we can determine if we are top-level or not.
30927
30928         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30929         TypeContainer too.
30930
30931         * enum.cs (Enum::Define): Ditto.
30932
30933         * modifiers.cs (FieldAttr): Re-write.
30934
30935         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30936         (TypeContainer::HaveStaticConstructor): New property to provide access
30937         to precisely that info.
30938
30939         * modifiers.cs (MethodAttr): Re-write.
30940         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30941
30942         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30943         of top-level types as claimed.
30944
30945 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30946
30947         * expression.cs (MemberLookup): Fruitless attempt to lookup
30948         constructors.  Maybe I need to emit default constructors?  That
30949         might be it (currently .NET emits this for me automatically).
30950         (Invocation::OverloadResolve): Cope with Arguments == null.
30951         (Invocation::EmitArguments): new function, shared by the new
30952         constructor and us.
30953         (Invocation::Emit): Handle static and instance methods.  Emit
30954         proper call instruction for virtual or non-virtual invocations.
30955         (New::Emit): Implement.
30956         (New::Resolve): Implement.
30957         (MemberAccess:Resolve): Implement.
30958         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30959         to track instances.
30960         (FieldExpr::Resolve): Set type.
30961
30962         * support.cs: Handle empty arguments.
30963                 
30964         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30965         SimpleLookup): Auxiliary routines to help parse a qualifier
30966         identifier.  
30967
30968         Update qualifier_identifier rule.
30969
30970         * codegen.cs: Removed debugging messages.
30971
30972         * class.cs: Make this a global thing, this acts just as a "key" to
30973         objects that we might have around.
30974
30975         (Populate): Only initialize method_builders_to_methods once.
30976
30977         * expression.cs (PropertyExpr): Initialize type from the
30978         PropertyType. 
30979
30980         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30981         Resolve pattern.  Attempt to implicitly convert value to boolean.
30982         Emit code.
30983
30984         * expression.cs: Set the type for the int32/int32 argument case.
30985         (Binary::ResolveOperator): Set the return type to boolean for
30986         comparission operators
30987
30988         * typemanager.cs: Remove debugging print code.
30989
30990         (Invocation::Resolve): resolve type.
30991
30992         * class.cs: Allocate a MemberInfo of the correct size, as the code
30993         elsewhere depends on the test to reflect the correct contents.
30994
30995         (Method::) Keep track of parameters, due to System.Reflection holes
30996
30997         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30998         mapping here.
30999
31000         (TypeContainer::FindMembers): Use ArrayList and then copy an array
31001         of the exact size and return that.
31002
31003         (Class::LookupMethodByBuilder): New function that maps
31004         MethodBuilders to its methods.  Required to locate the information
31005         on methods because System.Reflection bit us again.
31006
31007         * support.cs: New file, contains an interface ParameterData and
31008         two implementations: ReflectionParameters and InternalParameters
31009         used to access Parameter information.  We will need to grow this
31010         as required.
31011
31012         * expression.cs (Invocation::GetParameterData): implement a cache
31013         and a wrapper around the ParameterData creation for methods. 
31014         (Invocation::OverloadResolve): Use new code.
31015
31016 2001-09-13  Ravi Pratap  <ravi@ximian.com>
31017
31018         * class.cs (TypeContainer::EmitField): Remove and move into 
31019         (Field::Define): here and modify accordingly.
31020         (Field.FieldBuilder): New member.
31021         (TypeContainer::Populate): Update accordingly.
31022         (TypeContainer::FindMembers): Implement.
31023
31024 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
31025
31026         * statement.cs: (VariableInfo::VariableType): New field to be
31027         initialized with the full type once it is resolved. 
31028
31029 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
31030
31031         * parameter.cs (GetParameterInfo): Use a type cache to compute
31032         things only once, and to reuse this information
31033
31034         * expression.cs (LocalVariableReference::Emit): Implement.
31035         (OpcodeCast::Emit): fix.
31036
31037         (ParameterReference::Resolve): Implement.
31038         (ParameterReference::Emit): Implement.
31039
31040         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
31041         that are expressions need to stay as Expressions.
31042
31043         * typemanager.cs (CSharpName): Returns the C# name of a type if
31044         possible. 
31045
31046         * expression.cs (Expression::ConvertImplicit): New function that
31047         implements implicit type conversions.
31048
31049         (Expression::ImplicitReferenceConversion): Implements implicit
31050         reference conversions.
31051
31052         (EmptyCast): New type for transparent casts.
31053
31054         (OpcodeCast): New type for casts of types that are performed with
31055         a sequence of bytecodes.
31056
31057         (BoxedCast): New type used for casting value types into reference
31058         types.  Emits a box opcode.
31059
31060         (Binary::DoNumericPromotions): Implements numeric promotions of
31061         and computation of the Binary::Type.
31062
31063         (Binary::EmitBranchable): Optimization.
31064
31065         (Binary::Emit): Implement code emission for expressions.
31066
31067         * typemanager.cs (TypeManager): Added two new core types: sbyte
31068         and byte.
31069
31070 2001-09-12  Ravi Pratap  <ravi@ximian.com>
31071
31072         * class.cs (TypeContainer::FindMembers): Method which does exactly
31073         what Type.FindMembers does, only we don't have to use reflection. No
31074         implementation yet.
31075
31076         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
31077         typecontainer objects as we need to get at them.
31078         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
31079
31080         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
31081         typecontainer object.
31082
31083         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
31084         of just a Report object.
31085
31086 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31087
31088         * class.cs (Event::Define): Go back to using the prefixes "add_" and
31089         "remove_"
31090         (TypeContainer::Populate): Now define the delegates of the type too.
31091         (TypeContainer.Delegates): Property to access the list of delegates defined
31092         in the type.
31093
31094         * delegates.cs (Delegate::Define): Implement partially.
31095
31096         * modifiers.cs (TypeAttr): Handle more flags.
31097
31098 2001-09-11  Ravi Pratap  <ravi@ximian.com>
31099
31100         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
31101         and not <=
31102         (Operator::Define): Re-write logic to get types by using the LookupType method
31103         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
31104         (Indexer::Define): Ditto.
31105         (Event::Define): Ditto.
31106         (Property::Define): Ditto.
31107
31108 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31109
31110         * class.cs (TypeContainer::Populate): Now define operators too. 
31111         (TypeContainer.Operators): New property to access the list of operators
31112         in a type.
31113         (Operator.OperatorMethodBuilder): New member to hold the method builder
31114         for the operator we are defining.
31115         (Operator::Define): Implement.
31116
31117 2001-09-10  Ravi Pratap  <ravi@ximian.com>
31118
31119         * class.cs (Event::Define): Make the prefixes of the accessor methods
31120         addOn_ and removeOn_ 
31121
31122         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
31123         of the location being passed in too. Ideally, this should go later since all
31124         error reporting should be done through the Report object.
31125
31126         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
31127         (Populate): Iterate thru the indexers we have and define them too.
31128         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
31129         for the get and set accessors.
31130         (Indexer::Define): Implement.
31131
31132 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
31133
31134         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
31135         my previous implementation, did not work.
31136
31137         * typemanager.cs: Add a couple of missing types (the longs).
31138
31139         * literal.cs: Use TypeManager.bool_type instead of getting it.
31140
31141         * expression.cs (EventExpr): New kind of expressions.
31142         (Expressio::ExprClassFromMemberInfo): finish
31143
31144 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
31145
31146         * assign.cs: Emit stores to static fields differently.
31147
31148 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31149
31150         * Merge in changes and adjust code to tackle conflicts. Backed out my
31151         code in Assign::Resolve ;-) 
31152
31153 2001-09-08  Ravi Pratap  <ravi@ximian.com>
31154
31155         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
31156         instead Report.Error and also pass in the location.
31157         (CSharpParser::Lexer): New readonly property to return the reference
31158         to the Tokenizer object.
31159         (declare_local_variables): Use Report.Error with location instead of plain 
31160         old error.
31161         (CheckDef): Ditto.
31162
31163         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
31164         (Operator.CheckBinaryOperator): Ditto.
31165
31166         * cs-parser.jay (operator_declarator): Update accordingly.
31167
31168         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
31169         (CheckBinaryOperator): Same here.
31170
31171         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
31172         on the name without any prefixes of namespace names etc. This is because we
31173         already might have something already fully qualified like 
31174         'System.Console.WriteLine'
31175
31176         * assign.cs (Resolve): Begin implementation. Stuck ;-)
31177
31178 2001-09-07  Ravi Pratap  <ravi@ximian.com>
31179
31180         * cs-tokenizer.cs (location): Return a string which also contains
31181         the file name.
31182
31183         * expression.cs (ElementAccess): New class for expressions of the
31184         type 'element access.'
31185         (BaseAccess): New class for expressions of the type 'base access.'
31186         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
31187         respectively.
31188
31189         * cs-parser.jay (element_access): Implement action.
31190         (base_access): Implement actions.
31191         (checked_expression, unchecked_expression): Implement.
31192
31193         * cs-parser.jay (local_variable_type): Correct and implement.
31194         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
31195
31196         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
31197
31198         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
31199         name and the specifiers.
31200
31201         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
31202
31203         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
31204         making them all public ;-)
31205
31206         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
31207         class anyways.
31208
31209 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
31210
31211         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
31212         PropertyExprs.
31213         (FieldExpr, PropertyExprs): New resolved expressions.
31214         (SimpleName::MemberStaticCheck): Perform static checks for access
31215         to non-static fields on static methods. Maybe this should be
31216         generalized for MemberAccesses. 
31217         (SimpleName::ResolveSimpleName): More work on simple name
31218         resolution. 
31219
31220         * cs-parser.jay (primary_expression/qualified_identifier): track
31221         the parameter index.
31222
31223         * codegen.cs (CodeGen::Save): Catch save exception, report error.
31224         (EmitContext::EmitBoolExpression): Chain to expression generation
31225         instead of temporary hack.
31226         (::EmitStatementExpression): Put generic expression code generation.
31227
31228         * assign.cs (Assign::Emit): Implement variable assignments to
31229         local variables, parameters and fields.
31230
31231 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
31232
31233         * statement.cs (Block::GetVariableInfo): New method, returns the
31234         VariableInfo for a variable name in a block.
31235         (Block::GetVariableType): Implement in terms of GetVariableInfo
31236
31237         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
31238         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
31239
31240 2001-09-06  Ravi Pratap  <ravi@ximian.com>
31241
31242         * cs-parser.jay (operator_declaration): Continue on my quest : update
31243         to take attributes argument.
31244         (event_declaration): Ditto.
31245         (enum_declaration): Ditto.
31246         (indexer_declaration): Ditto.
31247
31248         * class.cs (Operator::Operator): Update constructor accordingly.
31249         (Event::Event): Ditto.
31250
31251         * delegate.cs (Delegate::Delegate): Same here.
31252
31253         * enum.cs (Enum::Enum): Same here.
31254
31255 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31256
31257         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
31258
31259         * ../tests/cs0658.cs : New file to demonstrate error 0658.
31260
31261         * attribute.cs (Attributes): New class to encapsulate all attributes which were
31262         being passed around as an arraylist.
31263         (Attributes::AddAttribute): Method to add attribute sections.
31264
31265         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
31266         (struct_declaration): Update accordingly.
31267         (constant_declaration): Update.
31268         (field_declaration): Update.
31269         (method_header): Update.
31270         (fixed_parameter): Update.
31271         (parameter_array): Ditto.
31272         (property_declaration): Ditto.
31273         (destructor_declaration): Ditto.
31274
31275         * class.cs (Struct::Struct): Update constructors accordingly.
31276         (Class::Class): Ditto.
31277         (Field::Field): Ditto.
31278         (Method::Method): Ditto.
31279         (Property::Property): Ditto.
31280         (TypeContainer::OptAttribute): update property's return type.
31281
31282         * interface.cs (Interface.opt_attributes): New member.
31283         (Interface::Interface): Update to take the extra Attributes argument.
31284
31285         * parameter.cs (Parameter::Parameter): Ditto.
31286
31287         * constant.cs (Constant::Constant): Ditto.
31288
31289         * interface.cs (InterfaceMemberBase): New OptAttributes field.
31290         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
31291         the attributes as a parameter.
31292         (InterfaceProperty): Update constructor call.
31293         (InterfaceEvent): Ditto.
31294         (InterfaceMethod): Ditto.
31295         (InterfaceIndexer): Ditto.
31296
31297         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
31298         pass the attributes too.
31299         (interface_event_declaration): Ditto.
31300         (interface_property_declaration): Ditto.
31301         (interface_method_declaration): Ditto.
31302         (interface_declaration): Ditto.
31303
31304 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
31305
31306         * class.cs (Method::Define): Track the "static Main" definition to
31307         create an entry point. 
31308
31309         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31310         EntryPoint if we find it. 
31311
31312         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31313         (EmitContext::ig): Make this variable public.
31314
31315         * driver.cs: Make the default output file be the first file name
31316         with the .exe extension.  
31317
31318         Detect empty compilations
31319
31320         Handle various kinds of output targets.  Handle --target and
31321         rename -t to --dumper.
31322
31323         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31324         methods inherited from Expression return now an Expression.  This
31325         will is used during the tree rewriting as we resolve them during
31326         semantic analysis.
31327
31328         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31329         the spec.  Missing entirely is the information about
31330         accessability of elements of it.
31331
31332         (Expression::ExprClassFromMemberInfo): New constructor for
31333         Expressions that creates a fully initialized Expression based on
31334         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31335         a Type.
31336
31337         (Invocation::Resolve): Begin implementing resolution of invocations.
31338
31339         * literal.cs (StringLiteral):  Implement Emit.
31340
31341 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31342
31343         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31344         member.
31345
31346 2001-09-04  Ravi Pratap  <ravi@ximian.com>
31347
31348         * cs-parser.jay (attribute_arguments): Implement actions.
31349         (attribute): Fix bug in production. Implement action.
31350         (attribute_list): Implement.
31351         (attribute_target): Implement.
31352         (attribute_target_specifier, opt_target_specifier): Implement
31353         (CheckAttributeTarget): New method to check if the attribute target
31354         is valid.
31355         (attribute_section): Implement.
31356         (opt_attributes): Implement.
31357
31358         * attribute.cs : New file to handle attributes.
31359         (Attribute): Class to hold attribute info.
31360
31361         * cs-parser.jay (opt_attribute_target_specifier): Remove production
31362         (attribute_section): Modify production to use 2 different rules to 
31363         achieve the same thing. 1 s/r conflict down !
31364         Clean out commented, useless, non-reducing dimension_separator rules.
31365
31366         * class.cs (TypeContainer.attributes): New member to hold list
31367         of attributes for a type.
31368         (Struct::Struct): Modify to take one more argument, the attribute list.
31369         (Class::Class): Ditto.
31370         (Field::Field): Ditto.
31371         (Method::Method): Ditto.
31372         (Property::Property): Ditto.
31373
31374         * cs-parser.jay (struct_declaration): Update constructor call to
31375         pass in the attributes too.
31376         (class_declaration): Ditto.
31377         (constant_declaration): Ditto.
31378         (field_declaration): Ditto.
31379         (method_header): Ditto.
31380         (fixed_parameter): Ditto.
31381         (parameter_array): Ditto.
31382         (property_declaration): Ditto.
31383
31384         * constant.cs (Constant::Constant): Update constructor similarly.
31385         Use System.Collections.
31386
31387         * parameter.cs (Parameter::Parameter): Update as above.
31388
31389 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31390
31391         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31392         (TypeContainer.delegates): New member to hold list of delegates.
31393
31394         * cs-parser.jay (delegate_declaration): Implement the action correctly 
31395         this time as I seem to be on crack ;-)
31396
31397 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
31398
31399         * rootcontext.cs (RootContext::IsNamespace): new function, used to
31400         tell whether an identifier represents a namespace.
31401
31402         * expression.cs (NamespaceExpr): A namespace expression, used only
31403         temporarly during expression resolution.
31404         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31405         utility functions to resolve names on expressions.
31406
31407 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
31408
31409         * codegen.cs: Add hook for StatementExpressions. 
31410
31411         * class.cs: Fix inverted test for static flag in methods.
31412
31413 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31414
31415         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31416         to make it coincide with MS' number.
31417         (Operator::CheckBinaryOperator): Ditto.
31418
31419         * ../errors/errors.txt : Remove error numbers added earlier.
31420
31421         * ../errors/cs1019.cs : Test case for error # 1019
31422
31423         * ../errros/cs1020.cs : Test case for error # 1020
31424
31425         * cs-parser.jay : Clean out commented cruft.
31426         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31427         used anywhere - non-reducing rule.
31428         (namespace_declarations): Non-reducing rule - comment out.
31429
31430         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31431         with TypeContainer::AddEnum.
31432
31433         * delegate.cs : New file for delegate handling classes.
31434         (Delegate): Class for declaring delegates.
31435
31436         * makefile : Update.
31437
31438         * cs-parser.jay (delegate_declaration): Implement.
31439
31440 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31441
31442         * class.cs (Event::Define): Implement.
31443         (Event.EventBuilder): New member.
31444
31445         * class.cs (TypeContainer::Populate): Update to define all enums and events
31446         we have.
31447         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31448         readonly fields for all these cases ?
31449
31450 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31451
31452         * class.cs (Property): Revamp to use the convention of making fields readonly.
31453         Accordingly modify code elsewhere.
31454
31455         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31456         the Define method of the Property class.
31457
31458         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31459         trivial bug.
31460         (TypeContainer::Populate): Update to define all the properties we have. Also
31461         define all enumerations.
31462
31463         * enum.cs (Define): Implement.
31464
31465 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31466
31467         * cs-parser.jay (overloadable_operator): The semantic value is an
31468         enum of the Operator class.
31469         (operator_declarator): Implement actions.
31470         (operator_declaration): Implement.
31471
31472         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31473         validity of definitions.
31474         (Operator::CheckBinaryOperator): Static method to check for binary operators
31475         (TypeContainer::AddOperator): New method to add an operator to a type.
31476
31477         * cs-parser.jay (indexer_declaration): Added line to actually call the
31478         AddIndexer method so it gets added ;-)
31479
31480         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31481         already taken care of by the MS compiler ?  
31482
31483 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31484
31485         * class.cs (Operator): New class for operator declarations.
31486         (Operator::OpType): Enum for the various operators.
31487
31488 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31489
31490         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31491         ostensibly handle this in semantic analysis.
31492
31493         * cs-parser.jay (general_catch_clause): Comment out
31494         (specific_catch_clauses, specific_catch_clause): Ditto.
31495         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31496         (catch_args, opt_catch_args): New productions.
31497         (catch_clause): Rewrite to use the new productions above
31498         (catch_clauses): Modify accordingly.
31499         (opt_catch_clauses): New production to use in try_statement
31500         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31501         and re-write the code in the actions to extract the specific and
31502         general catch clauses by being a little smart ;-)
31503
31504         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31505         Hooray, try and catch statements parse fine !
31506
31507 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31508
31509         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31510         string from the hashtable of variables.
31511
31512         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31513         I end up making that mistake ;-)
31514         (catch_clauses): Fixed gross error which made Key and Value of the 
31515         DictionaryEntry the same : $1 !!
31516
31517 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31518
31519         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31520
31521         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31522         when the add and remove accessors are specified. 
31523
31524 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31525
31526         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31527         information about indexer_declarator.
31528         (indexer_declarator): Implement actions.
31529         (parsing_indexer): New local boolean used to keep track of whether
31530         we are parsing indexers or properties. This is necessary because 
31531         implicit_parameters come into picture even for the get accessor in the 
31532         case of an indexer.
31533         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31534
31535         * class.cs (Indexer): New class for indexer declarations.
31536         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31537         (TypeContainer::indexers): New member to hold list of indexers for the
31538         type.
31539
31540 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31541
31542         * cs-parser.jay (add_accessor_declaration): Implement action.
31543         (remove_accessor_declaration): Implement action.
31544         (event_accessors_declaration): Implement
31545         (variable_declarators): swap statements for first rule - trivial.
31546
31547         * class.cs (Event): New class to hold information about event
31548         declarations.
31549         (TypeContainer::AddEvent): New method to add an event to a type
31550         (TypeContainer::events): New member to hold list of events.
31551
31552         * cs-parser.jay (event_declaration): Implement actions.
31553
31554 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31555
31556         * cs-parser.jay (dim_separators): Implement. Make it a string
31557         concatenating all the commas together, just as they appear.
31558         (opt_dim_separators): Modify accordingly
31559         (rank_specifiers): Update accordingly. Basically do the same
31560         thing - instead, collect the brackets here.
31561         (opt_rank_sepcifiers): Modify accordingly.
31562         (array_type): Modify to actually return the complete type string
31563         instead of ignoring the rank_specifiers.
31564         (expression_list): Implement to collect the expressions
31565         (variable_initializer): Implement. We make it a list of expressions
31566         essentially so that we can handle the array_initializer case neatly too.
31567         (variable_initializer_list): Implement.
31568         (array_initializer): Make it a list of variable_initializers
31569         (opt_array_initializer): Modify accordingly.
31570
31571         * expression.cs (New::NType): Add enumeration to help us
31572         keep track of whether we have an object/delegate creation
31573         or an array creation.
31574         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31575         members to hold data about array creation.
31576         (New:New): Modify to update NewType
31577         (New:New): New Overloaded contructor for the array creation
31578         case.
31579
31580         * cs-parser.jay (array_creation_expression): Implement to call
31581         the overloaded New constructor.
31582
31583 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31584
31585         * class.cs (TypeContainer::Constructors): Return member
31586         constructors instead of returning null.
31587
31588 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31589
31590         * typemanager.cs (InitCoreTypes): Initialize the various core
31591         types after we have populated the type manager with the user
31592         defined types (this distinction will be important later while
31593         compiling corlib.dll)
31594
31595         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31596         on Expression Classification.  Now all expressions have a method
31597         `Resolve' and a method `Emit'.
31598
31599         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31600         generation from working.     Also add some temporary debugging
31601         code. 
31602
31603 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31604
31605         * codegen.cs: Lots of code generation pieces.  This is only the
31606         beginning, will continue tomorrow with more touches of polish.  We
31607         handle the fundamentals of if, while, do, for, return.  Others are
31608         trickier and I need to start working on invocations soon.
31609
31610         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31611         s.InitStatement. 
31612
31613         * codegen.cs (EmitContext): New struct, used during code
31614         emission to keep a context.   Most of the code generation will be
31615         here. 
31616
31617         * cs-parser.jay: Add embedded blocks to the list of statements of
31618         this block.  So code generation proceeds in a top down fashion.
31619
31620 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31621
31622         * statement.cs: Add support for multiple child blocks.
31623
31624 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31625
31626         * codegen.cs (EmitCode): New function, will emit the code for a
31627         Block of code given a TypeContainer and its ILGenerator. 
31628
31629         * statement.cs (Block): Standard public readonly optimization.
31630         (Block::Block constructors): Link children. 
31631         (Block::Child): Child Linker.
31632         (Block::EmitVariables): Emits IL variable declarations.
31633
31634         * class.cs: Drop support for MethodGroups here, delay until
31635         Semantic Analysis.
31636         (Method::): Applied the same simplification that I did before, and
31637         move from Properties to public readonly fields.
31638         (Method::ParameterTypes): Returns the parameter types for the
31639         function, and implements a cache that will be useful later when I
31640         do error checking and the semantic analysis on the methods is
31641         performed.
31642         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31643         and made a method, optional argument tells whether this is a class
31644         or a structure to apply the `has-this' bit.
31645         (Method::GetCallingConvention): Implement, returns the calling
31646         convention. 
31647         (Method::Define): Defines the type, a second pass is performed
31648         later to populate the methods.
31649
31650         (Constructor::ParameterTypes): implement a cache similar to the
31651         one on Method::ParameterTypes, useful later when we do semantic
31652         analysis. 
31653
31654         (TypeContainer::EmitMethod):  New method.  Emits methods.
31655
31656         * expression.cs: Removed MethodGroup class from here.
31657
31658         * parameter.cs (Parameters::GetCallingConvention): new method.
31659
31660 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31661
31662         * class.cs (TypeContainer::Populate): Drop RootContext from the
31663         argument. 
31664
31665         (Constructor::CallingConvention): Returns the calling convention.
31666         (Constructor::ParameterTypes): Returns the constructor parameter
31667         types. 
31668
31669         (TypeContainer::AddConstructor): Keep track of default constructor
31670         and the default static constructor.
31671
31672         (Constructor::) Another class that starts using `public readonly'
31673         instead of properties. 
31674
31675         (Constructor::IsDefault): Whether this is a default constructor. 
31676
31677         (Field::) use readonly public fields instead of properties also.
31678
31679         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31680         track of static constructors;  If none is used, turn on
31681         BeforeFieldInit in the TypeAttributes. 
31682
31683         * cs-parser.jay (opt_argument_list): now the return can be null
31684         for the cases where there are no arguments. 
31685
31686         (constructor_declarator): If there is no implicit `base' or
31687         `this', then invoke the default parent constructor. 
31688
31689         * modifiers.cs (MethodAttr): New static function maps a set of
31690         modifiers flags into a MethodAttributes enum
31691         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31692         MethodAttr, TypeAttr to represent the various mappings where the
31693         modifiers are used.
31694         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31695
31696 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31697
31698         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31699         method arguments.
31700
31701         * interface.cs (PopulateIndexer): Implemented the code generator
31702         for interface indexers.
31703
31704 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31705
31706         * interface.cs (InterfaceMemberBase): Now we track the new status
31707         here.  
31708
31709         (PopulateProperty): Implement property population.  Woohoo!  Got
31710         Methods and Properties going today. 
31711
31712         Removed all the properties for interfaces, and replaced them with
31713         `public readonly' fields. 
31714
31715 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31716
31717         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31718         initialize their hashtables/arraylists only when they are needed
31719         instead of doing this always.
31720
31721         * parameter.cs: Handle refs and out parameters.
31722
31723         * cs-parser.jay: Use an ArrayList to construct the arguments
31724         instead of the ParameterCollection, and then cast that to a
31725         Parameter[] array.
31726
31727         * parameter.cs: Drop the use of ParameterCollection and use
31728         instead arrays of Parameters.
31729
31730         (GetParameterInfo): Use the Type, not the Name when resolving
31731         types. 
31732
31733 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31734
31735         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31736         and instead use public readonly fields.
31737
31738         * class.cs: Put back walking code for type containers.
31739
31740 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31741
31742         * class.cs (MakeConstant): Code to define constants.
31743
31744         * rootcontext.cs (LookupType): New function.  Used to locate types 
31745
31746
31747 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31748
31749         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31750         this System.Reflection code is.  Kudos to Microsoft
31751
31752         * typemanager.cs: Implement a type cache and avoid loading all
31753         types at boot time.  Wrap in LookupType the internals.  This made
31754         the compiler so much faster.  Wow.  I rule!
31755
31756         * driver.cs: Make sure we always load mscorlib first (for
31757         debugging purposes, nothing really important).
31758
31759         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31760         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31761
31762         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31763         on namespaces that have been imported using the `using' keyword.
31764
31765         * class.cs (TypeContainer::TypeAttr): Virtualize.
31766         (Class::TypeAttr): Return attributes suitable for this bad boy.
31767         (Struct::TypeAttr): ditto.
31768         Handle nested classes.
31769         (TypeContainer::) Remove all the type visiting code, it is now
31770         replaced with the rootcontext.cs code
31771
31772         * rootcontext.cs (GetClassBases): Added support for structs. 
31773
31774 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31775
31776         * interface.cs, statement.cs, class.cs, parameter.cs,
31777         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31778         Drop use of TypeRefs, and use strings instead.
31779
31780 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31781
31782         * rootcontext.cs: 
31783
31784         * class.cs (Struct::Struct): set the SEALED flags after
31785         checking the modifiers.
31786         (TypeContainer::TypeAttr): new property, returns the
31787         TypeAttributes for a class.  
31788
31789         * cs-parser.jay (type_list): Oops, list production was creating a
31790         new list of base types.
31791
31792         * rootcontext.cs (StdLib): New property.
31793         (GetInterfaceTypeByName): returns an interface by type name, and
31794         encapsulates error handling here.
31795         (GetInterfaces): simplified.
31796         (ResolveTree): Encapsulated all the tree resolution here.
31797         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31798         types. 
31799
31800         * driver.cs: Add support for --nostdlib, to avoid loading the
31801         default assemblies.
31802         (Main): Do not put tree resolution here. 
31803
31804         * rootcontext.cs: Beginning of the class resolution.
31805
31806 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31807
31808         * rootcontext.cs: Provide better error reporting. 
31809
31810         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31811
31812         * rootcontext.cs (CreateInterface): Handle the case where there
31813         are no parent interfaces.
31814
31815         (CloseTypes): Routine to flush types at the end.
31816         (CreateInterface): Track types.
31817         (GetInterfaces): Returns an array of Types from the list of
31818         defined interfaces.
31819
31820         * typemanager.c (AddUserType): Mechanism to track user types (puts
31821         the type on the global type hash, and allows us to close it at the
31822         end). 
31823
31824 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31825
31826         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31827         RecordInterface instead.
31828
31829         * cs-parser.jay: Updated to reflect changes above.
31830
31831         * decl.cs (Definition): Keep track of the TypeBuilder type that
31832         represents this type here.  Not sure we will use it in the long
31833         run, but wont hurt for now.
31834
31835         * driver.cs: Smaller changes to accomodate the new code.
31836
31837         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31838         when done. 
31839
31840         * rootcontext.cs (CreateInterface):  New method, used to create
31841         the System.TypeBuilder type for interfaces.
31842         (ResolveInterfaces): new entry point to resolve the interface
31843         hierarchy. 
31844         (CodeGen): Property, used to keep track of the code generator.
31845
31846 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31847
31848         * cs-parser.jay: Add a second production for delegate_declaration
31849         with `VOID'.
31850
31851         (enum_body): Put an opt_comma here instead of putting it on
31852         enum_body or enum_member_declarations so we can handle trailing
31853         commas on enumeration members.  Gets rid of a shift/reduce.
31854
31855         (type_list): Need a COMMA in the middle.
31856
31857         (indexer_declaration): Tell tokenizer to recognize get/set
31858
31859         * Remove old targets.
31860
31861         * Re-add the parser target.
31862
31863 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31864
31865         * cs-parser.jay: Add precendence rules for a number of operators
31866         ot reduce the number of shift/reduce conflicts in the grammar.
31867
31868 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31869
31870         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31871         and put it here.
31872
31873         Get rid of old crufty code.
31874
31875         * rootcontext.cs: Use this to keep track of the parsed
31876         representation and the defined types available to the program. 
31877
31878         * gen-treedump.cs: adjust for new convention.
31879
31880         * type.cs: Split out the type manager, and the assembly builder
31881         from here. 
31882
31883         * typemanager.cs: the type manager will live here now.
31884
31885         * cil-codegen.cs: And the code generator here. 
31886
31887 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31888
31889         * makefile: Fixed up for easy making.
31890
31891 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31892
31893         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31894         the 
31895
31896         (unary_expression): Expand pre_increment_expression and
31897         post_decrement_expression to reduce a shift/reduce.
31898
31899 2001-07-11  Simon Cozens
31900
31901         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31902
31903         Improve allow_keyword_as_indent name.
31904
31905 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31906
31907         * Adjustments for Beta2. 
31908
31909 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31910
31911         * decl.cs: Added `Define' abstract method.
31912         (InTransit): new property, used to catch recursive definitions. 
31913
31914         * interface.cs: Implement `Define'. 
31915
31916         * modifiers.cs: Map Modifiers.constants to
31917         System.Reflection.TypeAttribute flags.
31918
31919         * class.cs: Keep track of types and user-defined types.
31920         (BuilderInit): New method for creating an assembly
31921         (ResolveType): New function to launch the resolution process, only
31922         used by interfaces for now.
31923
31924         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31925         that are inserted into the name space. 
31926
31927 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31928
31929         * ARGH.  I have screwed up my tree so many times due to the use of
31930         rsync rather than using CVS.  Going to fix this at once. 
31931
31932         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31933         load types.
31934
31935 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31936
31937         * Experiment successful: Use System.Type rather that our own
31938         version of Type.  
31939
31940 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31941
31942         * cs-parser.jay: Removed nsAliases from here.
31943
31944         Use new namespaces, handle `using XXX;' 
31945
31946         * namespace.cs: Reimplemented namespace handling, use a recursive
31947         definition of the class.  Now we can keep track of using clauses
31948         and catch invalid using clauses.
31949
31950 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31951
31952         * gen-treedump.cs: Adapted for all the renaming.
31953
31954         * expression.cs (Expression): this class now has a Type property
31955         which returns an expression Type.
31956
31957         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31958         `Type', as this has a different meaning now in the base
31959
31960 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31961
31962         * interface.cs, class.cs: Removed from all the sources the
31963         references to signature computation, as we can not do method
31964         signature computation during the parsing time, as we are not
31965         trying to solve at that point distinguishing:
31966
31967         class X {
31968                 void a (Blah x) {}
31969                 void a (NS.Blah x) {}
31970         }
31971
31972         Which depending on the context might be valid or not, as we do not
31973         know if Blah is the same thing as NS.Blah at that point.
31974
31975         * Redid everything so the code uses TypeRefs now instead of
31976         Types.  TypeRefs are just temporary type placeholders, that need
31977         to be resolved.  They initially have a pointer to a string and the
31978         current scope in which they are used.  This is used later by the
31979         compiler to resolve the reference to an actual Type. 
31980
31981         * DeclSpace is no longer a CIR.Type, and neither are
31982         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31983         are all DeclSpaces, but no Types. 
31984
31985         * type.cs (TypeRefManager): This implements the TypeRef manager,
31986         which keeps track of all the types that need to be resolved after
31987         the parsing has finished. 
31988
31989 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31990
31991         * ARGH.  We are going to have to store `foreach' as a class rather
31992         than resolving it, as we need to verify error 1579 after name
31993         resolution.   *OR* we could keep a flag that says `This request to
31994         IEnumerator comes from a foreach statement' which we can then use
31995         to generate the error.
31996
31997 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31998
31999         * class.cs (TypeContainer.AddMethod): we now add methods to the
32000         MethodGroup instead of the method hashtable.  
32001
32002         * expression.cs: Add MethodGroup abstraction, which gets us one
32003         step closer to the specification in the way we handle method
32004         declarations.  
32005
32006         * cs-parser.jay (primary_expression): qualified_identifier now
32007         tried to match up an identifier to a local variable reference or
32008         to a parameter reference.
32009
32010         current_local_parameters is now a parser global variable that
32011         points to the current parameters for the block, used during name
32012         lookup.
32013
32014         (property_declaration): Now creates an implicit `value' argument to
32015         the set accessor.
32016
32017 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
32018
32019         * parameter.cs: Do not use `param' arguments as part of the
32020         signature, per the spec.
32021
32022 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
32023
32024         * decl.cs: Base class for classes, structs and interfaces.  This
32025         is the "Declaration Space" 
32026
32027         * cs-parser.jay: Use CheckDef for checking declaration errors
32028         instead of having one on each function.
32029
32030         * class.cs: Factor out some code for handling error handling in
32031         accordance to the "Declarations" section in the "Basic Concepts"
32032         chapter in the ECMA C# spec.
32033
32034         * interface.cs: Make all interface member classes derive from
32035         InterfaceMemberBase.
32036
32037 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
32038
32039         * Many things: all interfaces are parsed and generated in
32040         gen-treedump.  Support for member variables, constructors,
32041         destructors, properties, constants is there.
32042
32043         Beginning of the IL backend, but very little done, just there for
32044         testing purposes. 
32045
32046 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
32047
32048         * cs-parser.jay: Fix labeled statement.
32049
32050         * cs-tokenizer.cs (escape): Escape " and ' always.
32051         ref_line, ref_name: keep track of the line/filename as instructed
32052         by #line by the compiler.
32053         Parse #line.
32054
32055 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
32056
32057         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
32058         to match the values in System.CodeDOM.
32059
32060         Divid renamed to Divide.
32061
32062         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
32063         statements. 
32064         (Statements.set): remove.
32065
32066         * System.CodeDOM/CodeCatchClause.cs: always have a valid
32067         statements. 
32068
32069         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
32070         falseStatements always have valid values. 
32071
32072         * cs-parser.jay: Use System.CodeDOM now.
32073