2009-02-09 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2009-02-09  Marek Safar  <marek.safar@gmail.com>
2
3         * expression.cs: Initializer of reference argument use temporary
4         variable to be verifiable.
5         
6         * parameter.cs: Share EmitLdArg.
7
8 2009-02-09  Marek Safar  <marek.safar@gmail.com>
9
10         A fix for bug #473559
11         * class.cs: Fixed: Not reporting error about nested class with the
12         same name.
13
14 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
15
16         Contributed under the MIT/X11 license.
17
18         * generic.cs: Added VerifyVariantTypeParameters which performs new
19         variance verification logic. The old logic, based on the spec, was
20         wrong because the spec is full of LIES!
21
22         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
23
24         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
25
26         * class.cs:
27         * ecore.cs: Added calls to the new variance verification logic.
28
29         * parameter.cs:
30         * delegate.cs: Removed calls to the old variance verification logic.
31
32 2009-02-06  Marek Safar  <marek.safar@gmail.com>
33
34         * delegate.cs: Use cached Invoke method directly.
35
36 2009-02-06  Marek Safar  <marek.safar@gmail.com>
37
38         * expression.cs: Emit expression tree for hoisted variable access.
39
40 2009-02-04  Marek Safar  <marek.safar@gmail.com>
41
42         * namespace.cs: Add better extension class check.
43
44 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
45
46         * generic.cs: Fixed typeo (TypeParameter.Variacne).
47
48 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
49
50         This patch adds initial generic variance support to the compiler.
51         It is contributed under the MIT/X11 license.
52
53         * typemanager.cs: Modified ImplementsInterface to check variance.
54         Added VerifyVariantTypeParameters which checks the specified type to see
55         if it uses a variant type parameter as a type argument (which is not
56         allowed). Added IsVariantOf which determins if the first type is a
57         variant of the second. NOTE: This only supports reference types at
58         the moment to conform with the current level of VM support. When the
59         VM supports value types, this will follow step.
60
61         * generic.cs: Added the Variance enum. Added a Variance property to
62         TypeParameter and added variance support to definition phase. Added a
63         Variance property to TypeParameterName. Also check to make sure that
64         no variant types appear in generic method parameters.
65
66         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
67         keywords if the langversion supports it.
68
69         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
70         that variant types are only used in legal positions. Also added
71         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
72         parameters.
73
74         * decl.cs: Construct TypeParameter with the variance information.
75
76         * convert.cs: Checks variance in ImplicitReferenceConversionExists
77         and ImplicitConversionStandard.
78
79         * rootcontext.cs: Added new "Future" language version.
80
81         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
82         type parameters are not used as type arguments in interface inheritance.
83         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
84         parameters are not used as method return types. In MemberBase.
85         ResolveMemberType, ensure that variant type parameters are not used
86         as type arguments. Also call VerifyNoVariantTypeParameters on every
87         set of parameters which are resolved.
88
89         * delegate.cs: Modified Delegate.Define to ensure that variant
90         parameters are not used as type arguments and that a contravariant
91         parameter is not used as the return type. Also call
92         VerifyNoVariantTypeParameters on the delegate parameters.
93
94         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
95         to specify generic variance.
96
97         * driver.cs: Added support for LanguageVersion.Future in the form of
98         "-langversion:future".
99
100         * generic-mcs.cs: Stubbed out new members in generic.cs.
101
102 2009-02-03  Marek Safar  <marek.safar@gmail.com>
103
104         * class.cs, generic.cs: Emit type parameter constraints for nested
105         types.
106
107 2009-02-02  Marek Safar  <marek.safar@gmail.com>
108
109         A fix for bug #471213
110         * class.cs: Avoid emitting backing field for abstract event fields.
111
112 2009-02-01  Marek Safar  <marek.safar@gmail.com>
113
114         A fix for bug #359731
115         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
116         expressions.
117
118 2009-01-30  Marek Safar  <marek.safar@gmail.com>
119
120         A fix for bug #470767
121         * statement.cs: Introduced BlockScopeExpression, needed when 
122         expression tree conversion has to emit scope variables.
123
124 2009-01-29  Marek Safar  <marek.safar@gmail.com>
125
126         * class.cs: Remove duplicate CallingConvention.
127
128 2009-01-29  Marek Safar  <marek.safar@gmail.com>
129
130         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
131         when I finally found the right naming convention.
132
133 2009-01-29  Marek Safar  <marek.safar@gmail.com>
134
135         * cs-tokenizer.cs: Put back different open parens optimization.
136
137 2009-01-28  Marek Safar  <marek.safar@gmail.com>
138
139         A fix for bug #470227
140         * cs-tokenizer.cs: Remove too agressive parser optimization.
141
142 2009-01-28  Marek Safar  <marek.safar@gmail.com>
143
144         A fix for bug #324319
145         * class.cs: Remove too early base type resolve.
146
147 2009-01-27  Marek Safar  <marek.safar@gmail.com>
148
149         A fix for bug #324319
150         * ecore.cs: Explicitly type null when assigning to type argument to
151         make pass verifier check.
152
153 2009-01-27  Marek Safar  <marek.safar@gmail.com>
154
155         * anonymous.cs: Fixed recent regression when initializing captured 
156         this.
157
158 2009-01-26  Marek Safar  <marek.safar@gmail.com>
159
160         A fix for bug #469019
161         * anonymous.cs: Use all parent type parameters when instantiating
162         nested generic storey.
163
164 2009-01-26  Marek Safar  <marek.safar@gmail.com>
165
166         * expression.cs: Check for null instance methodgroup expression.
167
168 2009-01-26  Marek Safar  <marek.safar@gmail.com>
169
170         A fix for bug #469244
171         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
172         instance inside a conditional expression.
173
174 2009-01-23  Marek Safar  <marek.safar@gmail.com>
175
176         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
177         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
178         GetElementType and HasElementType. IsValueType clean up.
179
180 2009-01-23  Marek Safar  <marek.safar@gmail.com>
181
182         * nullable.cs: Use common EmitCall.
183         
184         * expression.cs: Emit constraint. for virtual calls only.
185
186 2009-01-23  Marek Safar  <marek.safar@gmail.com>
187
188         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
189         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
190         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
191         checks.
192
193 2009-01-22  Jb Evain  <jbevain@novell.com>
194
195         * anonymous.cs: make anonymous types' ToString implementation
196         match what csc outputs.
197
198 2009-01-21  Marek Safar  <marek.safar@gmail.com>
199
200         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
201         up.
202
203 2009-01-17  Marek Safar  <marek.safar@gmail.com>
204
205         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
206         verifier checks.
207
208 2009-01-16  Marek Safar  <marek.safar@gmail.com>
209
210         * nullable.cs (LiftedBinaryOperator): Check for all possible null
211         expressions.
212
213 2009-01-15  Marek Safar  <marek.safar@gmail.com>
214
215         A fix for bug #466634
216         * statement.cs: Add reference for nested storey when only this
217         is captured.
218
219 2009-01-15  Marek Safar  <marek.safar@gmail.com>
220
221         A fix for bug #466474
222         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
223         was specified.
224
225 2009-01-15  Marek Safar  <marek.safar@gmail.com>
226
227         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
228         Fixed nested stories parent referencing process. Also fixes #463985.
229
230 2009-01-06  Marek Safar  <marek.safar@gmail.com>
231
232         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
233         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
234         implementation. Also fixes #463108.
235
236 2009-01-05  Marek Safar  <marek.safar@gmail.com>
237
238         A fix for bug #416109
239         * decl.cs: Issue correct CLSAttribute warning location.
240
241 2009-01-05  Marek Safar  <marek.safar@gmail.com>
242
243         A fix for bug #456775
244         * attribute.cs: Use attribute owner scope when resolving attribute
245         arguments.
246
247 2009-01-05  Marek Safar  <marek.safar@gmail.com>
248
249         A fix for bug #457257
250         * decl.cs: Fixed incorrect member declaring type comparison.
251
252 2009-01-05  Marek Safar  <marek.safar@gmail.com>
253
254         A fix for bug #460896
255         * driver.cs: Handle /RES resources as embeddable.
256
257 2009-01-05  Marek Safar  <marek.safar@gmail.com>
258
259         A fix for bug #462515
260         * ecore.cs: Report inacessible members upwards.
261
262 2009-01-05  Marek Safar  <marek.safar@gmail.com>
263
264         A fix for bug #463190, #463192
265         * decl.cs, namespace.cs: Also import internal extension classes.
266
267 2009-01-04  Marek Safar  <marek.safar@gmail.com>
268
269         A fix for bug #463415
270         * generic.cs: Use right index for RemoveDependentTypes.
271
272 2009-01-02  Marek Safar  <marek.safar@gmail.com>
273
274         A fix for bug #463196
275         * expression.cs: Fixed enum to null comparison.
276
277 2009-01-02  Marek Safar  <marek.safar@gmail.com>
278
279         A fix for bug #463121
280         * nullable.cs: Fixed nullable user equality operator comparison.
281
282 2009-01-02  Marek Safar  <marek.safar@gmail.com>
283
284         A fix for bug #462950
285         * class.cs, decl.cs: Use full explicit name when defining automatic
286         property backing field.
287
288 2009-01-02  Marek Safar  <marek.safar@gmail.com>
289
290         A fix for bug #462592
291         * pending.cs: Emit type arguments for generic proxy method.
292
293 2008-12-30  Marek Safar  <marek.safar@gmail.com>
294
295         * expression.cs (As): Mutate all type arguments.
296
297 2008-12-29  Marek Safar  <marek.safar@gmail.com>
298
299         A fix for bug #462622
300         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
301         context.
302
303 2008-12-29  Marek Safar  <marek.safar@gmail.com>
304
305         A fix for bug #450782
306         * ecore.cs: Consider more variables of form V.I to be fixed.
307
308 2008-12-29  Marek Safar  <marek.safar@gmail.com>
309
310         A fix for bug #460712
311         * typemanager.cs: Core types could be imported.
312
313 2008-12-28  Marek Safar  <marek.safar@gmail.com>
314
315         A fix for bugs #460847, #460772, #458049, #457339, #447807
316         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
317         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
318         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
319         user lambdas used inside query clauses.
320
321 2008-12-18  Marek Safar  <marek.safar@gmail.com>
322
323         A fix for bug #460229
324         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
325
326 2008-12-18  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #459952
329         * decl.cs, namespace.cs: Use common CheckAccessLevel.
330
331 2008-12-18  Marek Safar  <marek.safar@gmail.com>
332
333         A fix for bug #459630
334         * convert.cs: Enum to valuetype conversion is not allowed.
335
336 2008-12-18  Marek Safar  <marek.safar@gmail.com>
337
338         A fix for bug #457087
339         * generic.cs: Don't crash when constraint comes from type
340         declaration.
341
342 2008-12-16  Marek Safar  <marek.safar@gmail.com>
343
344         A fix for bug #459221
345         * anonymous.cs, statement.cs: Delay only captured this
346         initialization.
347
348 2008-12-12  Marek Safar  <marek.safar@gmail.com>
349
350         A fix for bug #457489
351         * anonymous.cs, statement.cs: Split anonymous storey instantiation
352         and initialization to capture scope initializers correctly.
353
354 2008-12-11  Marek Safar  <marek.safar@gmail.com>
355
356         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
357         ParameterReference refactoring.
358
359 2008-12-03  Marek Safar  <marek.safar@gmail.com>
360
361         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
362         to be imported from any assembly.
363
364 2008-12-03  Marek Safar  <marek.safar@gmail.com>
365
366         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
367         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
368         from anonymous method and lambda expression.
369
370 2008-12-01  Marek Safar  <marek.safar@gmail.com>
371
372         A fix for bug #448560
373         * expression.cs (As): Box any generic type arguments to be
374         verifiable.
375
376 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
377
378         Add tripwire for implicit conversion bugs
379         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
380         for CS1501 error.
381         (MethodGroupExpr.OverloadResolve): Add sanity check between
382         IsApplicable and VerifyArgumentsCompat.
383         (VerifyArgumentsCompat): Report CS1501 where appropriate.
384
385 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
386
387         Fix build break in System.Data_test
388         * convert.cs (ImplicitConversionExists): Move NullLiteral
389         conversions ...
390         (ImplicitStandardConversionExists): ... here.
391
392 2008-11-28  Marek Safar  <marek.safar@gmail.com>
393
394         * literal.cs: Emit correctly explicit null to nullable cast.
395
396 2008-11-28  Marek Safar  <marek.safar@gmail.com>
397
398         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
399         resolve.
400
401 2008-11-28  Marek Safar  <marek.safar@gmail.com>
402
403         A fix for bug #449005
404         * convert.cs, nullable.cs: Use only one implicit nullable
405         conversion.
406
407 2008-11-27  Marek Safar  <marek.safar@gmail.com>
408
409         * convert.cs, literal.cs: More Convert cleanup is needed.
410
411 2008-11-27  Marek Safar  <marek.safar@gmail.com>
412
413         * decl.cs, class.cs: Fixed misleading error message.
414
415 2008-11-26  Marek Safar  <marek.safar@gmail.com>
416
417         A fix for bug #449005
418         * nullable.cs (EmitEquality): Disable optimization for user operator
419         operands.
420
421 2008-11-25  Marek Safar  <marek.safar@gmail.com>
422
423         A fix for bug #447027
424         * anonymous.cs (HoistedVariable): Cache also outer access to deal
425         with context variables stored as expression instances.
426
427 2008-11-25  Marek Safar  <marek.safar@gmail.com>
428
429         A fix for bug #447027
430         * delegate.cs: Fixed delegate VerifyMethod logic.
431
432 2008-11-24  Marek Safar  <marek.safar@gmail.com>
433
434         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
435         but not verifiable.
436
437 2008-11-21  Marek Safar  <marek.safar@gmail.com>
438
439         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
440         member type resolve to follow normal flow, instead of random
441         property access.
442
443 2008-11-21  Marek Safar  <marek.safar@gmail.com>
444
445         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
446         type.
447
448 2008-11-21  Marek Safar  <marek.safar@gmail.com>
449
450         * const.cs: Emit decimal array constant as literal.
451
452 2008-11-20  Marek Safar  <marek.safar@gmail.com>
453
454         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
455
456 2008-11-19  Marek Safar  <marek.safar@gmail.com>
457
458         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
459         into real property (saves 8 MB for corlib compilation).
460
461 2008-11-19  Marek Safar  <marek.safar@gmail.com>
462
463         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
464         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
465         generic-mcs.cs: Small cleanup of TypeArguments.
466
467 2008-11-18  Marek Safar  <marek.safar@gmail.com>
468
469         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
470         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
471         of ConstructedType expression, renamed to GenericTypeExpr.
472
473 2008-11-17  Marek Safar  <marek.safar@gmail.com>
474
475         A fix for bug #445303
476         * location.cs (IsConditionalDefined): Handle undefined global
477         defines.
478
479 2008-11-17  Marek Safar  <marek.safar@gmail.com>
480
481         A fix for bug #444678
482         * expression.cs (TryReduceConstant): Always create new constant
483         instance.
484
485 2008-11-17  Marek Safar  <marek.safar@gmail.com>
486
487         A fix for bug #444673
488         * ecore.cs: Ignore open generic types when used as generic type
489         instance fields.
490
491 2008-11-17  Marek Safar  <marek.safar@gmail.com>
492
493         A fix for bug #445458
494         * expression.cs, cs-parser.jay: Don't crash when an expression
495         statement is null.
496
497 2008-11-17  Marek Safar  <marek.safar@gmail.com>
498
499         A fix for bug #445464
500         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
501         inside unbound type.
502
503 2008-11-14  Jb Evain  <jbevain@novell.com>
504
505         * driver.cs: ignore empty -nowarn argument such as
506         the one in -nowarn:12,13,,.
507
508 2008-11-13  Marek Safar  <marek.safar@gmail.com>
509
510         A fix for bug #444271
511         * anonymous.cs: Rescan parent storeys when best candidate was
512         undone.
513
514 2008-11-13  Marek Safar  <marek.safar@gmail.com>
515
516         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
517         useless UnboundTypeExpression.
518         
519         * attribute.cs: Do check obsolete attribute on generic types.
520
521 2008-11-12  Marek Safar  <marek.safar@gmail.com>
522
523         A fix for bugs #425680, #400139
524         * ecore.cs, expression.cs: Trying to do some almost_matched_members
525         refactoring.
526
527 2008-11-11  Marek Safar  <marek.safar@gmail.com>
528
529         A fix for bug #435747
530         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
531         compound value types assignment. Few micro optimizations added.
532
533 2008-11-10  Marek Safar  <marek.safar@gmail.com>
534
535         A fix for bug #442610
536         * anonymous.cs (MutateConstructor): More SRE hacking.
537
538 2008-11-10  Marek Safar  <marek.safar@gmail.com>
539
540         A fix for bug #442579
541         * ecore.cs: Also initialize expanded form of a method with 1 params
542         parameter.
543
544 2008-11-06  Marek Safar  <marek.safar@gmail.com>
545
546         * expression.cs (UnaryMutator): Do early l-side check.
547
548 2008-11-05  Miguel de Icaza  <miguel@novell.com>
549
550         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
551         Init, otherwise we would crash later on when checking for friend
552         assemblies. 
553
554         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
555         Otherwise we never get any meaningful information as to what
556         failed. 
557
558 2008-11-05  Marek Safar  <marek.safar@gmail.com>
559
560         A fix for bug #436318
561         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
562
563 2008-11-05  Miguel de Icaza  <miguel@novell.com>
564
565         * namespace.cs: Turns out that it was a really bad idea to hide
566         the errors for namespaces not found here in eval mode.    
567
568         * eval.cs: When we process using clauses, only enter those into
569         the list of valid using clauses after they have been validated.   
570
571         The above change gives the proper semantics: it does not
572         senselessly report the same errors with broken using statements by
573         never storing them in the first place when they are invalid.
574
575 2008-11-05  Marek Safar  <marek.safar@gmail.com>
576
577         A fix for bug #421839
578         * cs-parser.jay: Remove expression from coalesce rule to force lower
579         priority than the assignment operator.
580
581 2008-11-05  Marek Safar  <marek.safar@gmail.com>
582
583         A fix for bug #437875
584         * nullable.cs: Compile correctly method group operand used with null
585         coalescing operator.
586
587 2008-11-04  Marek Safar  <marek.safar@gmail.com>
588
589         A fix for bug #434589
590         * expression.cs (Binary): Ignore lifted conversions when at least
591         one operand is of reference type.
592
593 2008-11-04  Marek Safar  <marek.safar@gmail.com>
594
595         * cs-parser.jay: Better syntax error report.
596
597 2008-11-03  Marek Safar  <marek.safar@gmail.com>
598
599         A fix for bug #436792
600         * cs-parser.jay: Use GetLocation to access location.
601
602 2008-11-03  Marek Safar  <marek.safar@gmail.com>
603
604         A fix for bug #440774
605         * cs-parser.jay: Also set current_array_type when parsing local
606         variables types.
607
608 2008-11-03  Marek Safar  <marek.safar@gmail.com>
609
610         A fix for bug #440785
611         * expression.cs (As): Don't resolve self modifing expression
612         multiple times.
613
614 2008-11-03  Marek Safar  <marek.safar@gmail.com>
615
616         A fix for bug #439447
617         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
618
619 2008-11-03  Marek Safar  <marek.safar@gmail.com>
620
621         A fix for bug #437571
622         * cs-parser.jay: Fixes internal error for invalid expression
623         statements.
624
625 2008-10-17  Marek Safar  <marek.safar@gmail.com>
626
627         * ecore.cs: Resolve correctly ambiguous params delegate methods.
628
629 2008-10-17  Marek Safar  <marek.safar@gmail.com>
630
631         * generic.cs, anonymous.cs: Simplified GetDeclarations.
632
633 2008-10-17  Marek Safar  <marek.safar@gmail.com>
634
635         * cs-tokenizer.cs: More precise cast parsing.
636
637 2008-10-16  Martin Baulig  <martin@ximian.com>
638
639         * anonymous.cs (AnonymousMethodStorey): Put back the
640         `hoisted_locals' hashtable and use it in EmitType().
641
642 2008-10-15  Marek Safar  <marek.safar@gmail.com>
643
644         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
645         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
646         ~5MB for corlib.
647
648 2008-10-14  Marek Safar  <marek.safar@gmail.com>
649
650         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
651
652 2008-10-14  Marek Safar  <marek.safar@gmail.com>
653
654         * statement.cs: Mutate scope initializers.
655
656 2008-10-14  Marek Safar  <marek.safar@gmail.com>
657
658         * expression.cs: Use typeless value for This constant.
659         
660         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
661
662 2008-10-14  Marek Safar  <marek.safar@gmail.com>
663
664         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
665         tokenizer.
666
667 2008-10-13  Marek Safar  <marek.safar@gmail.com>
668
669         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
670         type to type cast.
671
672 2008-10-13  Marek Safar  <marek.safar@gmail.com>
673
674         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
675         parser and tokenizer. Fixes many ambiguities including #433258.
676
677 2008-10-10  Marek Safar  <marek.safar@gmail.com>
678
679         * cs-parser.jay: Fixed missing accessor recovery.
680
681 2008-10-10  Marek Safar  <marek.safar@gmail.com>
682
683         A fix for bug #433701
684         * expression.cs: Better error message.
685
686 2008-10-10  Marek Safar  <marek.safar@gmail.com>
687
688         * cs-parser.jay, expression.cs: Start reporting real parser errors.
689         
690         * Makefile: Disabled unused debug symbols.
691
692         Also fixes: #320556, #321097, #321656, #321876, #351316
693
694 2008-10-09  Miguel de Icaza  <miguel@novell.com>
695
696         * eval.cs: rename "<interactive>" to "{interactive}", to work
697         around a requirement in the compiler that this be a valid
698         filename, and in Windows it is not (433886).
699
700 2008-10-09  Marek Safar  <marek.safar@gmail.com>
701
702         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
703
704 2008-10-08  Marek Safar  <marek.safar@gmail.com>
705
706         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
707         cs-parser.jay: Generic type declaration and type arguments cleanup.
708
709 2008-10-05  Marek Safar  <marek.safar@gmail.com>
710
711         * cs-parser.jay: Allow parsing weird array creation construct.
712
713 2008-10-05  Marek Safar  <marek.safar@gmail.com>
714
715         * cs-parser.jay: Conflicts reduction.
716
717 2008-10-04  Marek Safar  <marek.safar@gmail.com>
718
719         * cs-parser.jay: Conflicts reduction.
720
721 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
722
723         Fix #398325
724         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
725         property.  Add a 'count' hint about the use of the shared vector.
726         Ensure that we don't leak out dirty bits.
727         (UsageVector.MergeChild): Throw away information about variables
728         in child vectors.
729         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
730
731 2008-10-03  Marek Safar  <marek.safar@gmail.com>
732
733         A fix for bug #431746
734         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
735         parameters when iterator is created.
736
737 2008-10-03  Marek Safar  <marek.safar@gmail.com>
738
739         A fix for bug #431827
740         * expression.cs: Fixed right based pointer arithmetic operations
741         emit.
742
743 2008-10-03  Marek Safar  <marek.safar@gmail.com>
744
745         A fix for bug #353779
746         * assign.cs, expression.cs: Fixed compound assignment conversions.
747
748 2008-10-02  Marek Safar  <marek.safar@gmail.com>
749
750         A fix for bug #375262
751         * statement.cs: Refactor ArrayForeach to be usable with string
752         indexer. Optimized single dimentional arrays foreach.
753
754 2008-10-02  Marek Safar  <marek.safar@gmail.com>
755
756         A fix for bug #431255
757         * anonymous.cs, expression.cs: Removed broken optimization.
758
759 2008-10-01  Marek Safar  <marek.safar@gmail.com>
760
761         * anonymous.cs: Use full type parameters of parent generic
762         containers. Removed unnecessary AddParentStoreyReference call.
763
764 2008-10-01  Marek Safar  <marek.safar@gmail.com>
765
766         A fix for bug #324702
767         * class.cs: Use better shorter names for explicit interface member
768         implementations.
769
770         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
771
772 2008-10-01  Marek Safar  <marek.safar@gmail.com>
773         
774         * expression.cs: Use new interface to check fixed expression.
775
776 2008-10-01  Marek Safar  <marek.safar@gmail.com>
777
778         A fix for bug #421101
779         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
780         interface to check for fixed fixed-buffers.
781
782 2008-10-01  Marek Safar  <marek.safar@gmail.com>
783
784         A fix for bug #429264
785         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
786         
787         * delegate.cs: Removed unnecessary casts.
788
789 2008-09-30  Marek Safar  <marek.safar@gmail.com>
790
791         A fix for bug #352151
792         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
793         class.cs: Fixed already defined explicit interface members check.
794
795 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
796
797         cs-tokenizer.cs: Fix typo.
798
799 2008-09-28  Miguel de Icaza  <miguel@novell.com>
800
801         * eval.cs (InteractiveBase): The quit command now just sets a
802         flag, instead of calling Environment.Exit(), it is milder on
803         embedded hosts. 
804
805         CompiledMethod is now in Mono.CSharp, not nested inside
806         the Evaluator, it was inconvenient to use.
807
808 2008-09-27  Miguel de Icaza  <miguel@novell.com>
809
810         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
811         code to be invoked without having to reparse.
812
813 2008-09-27  Miguel de Icaza  <miguel@novell.com>
814
815         * ecore.cs: The recent changes to FieldExpr broke this as well.
816         Fixes LINQ queries in the interactive shell.
817
818         * Multiple files: indentation fixing for the Mono coding
819         guidelines for the switch statement.
820
821         * eval.cs: Make the Evaluator API thread safe.
822
823 2008-09-26  Marek Safar  <marek.safar@gmail.com>
824
825         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
826         constructor parsing.
827
828 2008-09-26  Marek Safar  <marek.safar@gmail.com>
829
830         A fix for bug #325326
831         * statement.cs: Check possible mistaken empty statement using
832         explicit blocks only.
833
834 2008-09-25  Miguel de Icaza  <miguel@novell.com>
835
836         * eval.cs (LoadAssembly, ReferenceAssembly): Call
837         RootNamespace.ComputeNamespaces to update the internal list of
838         namespaces, this is no longer done for us.
839
840         (InteractiveBase): Use the Evaluator APIs instead of calling into
841         Driver directly
842
843 2008-09-25  Marek Safar  <marek.safar@gmail.com>
844
845         A fix for bug #429264
846         * expression.cs: Missing mutator for access to multidimensional
847         arrays.
848
849 2008-09-25  Marek Safar  <marek.safar@gmail.com>
850
851         * class.cs, statement: Emit DebuggerHidden attribute for iterator
852         entry wrapper.
853         
854         * driver.cs: Missing input argument check.
855
856 2008-09-25  Marek Safar  <marek.safar@gmail.com>
857
858         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
859         expression.cs, statement.cs, rootcontext.cs, class.cs, 
860         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
861         DefineMembers.
862
863 2008-09-24  Miguel de Icaza  <miguel@novell.com>
864
865         * ecore.cs (FieldExpr): Only initialize eclass when we return a
866         fully constructed FieldExpr, fixes the regression introduced in
867         the last commit.
868         
869         * ecore.cs, expression.cs: Plug back the eclass initialization as
870         otherwise it regresses `csharp'. 
871
872 2008-09-24  Marek Safar  <marek.safar@gmail.com>
873
874         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
875         ecore.cs, attribute.cs: Moved obsolete method checks from emit
876         phase to resolve phase. It resolves problems with expression trees
877         and fixes bugs #323796, #325156.
878
879 2008-09-23  Marek Safar  <marek.safar@gmail.com>
880
881         * codegen.cs: Report better error when symbol writer is missing.
882
883 2008-09-23  Marek Safar  <marek.safar@gmail.com>
884
885         * codegen.cs: Set .NET symbol writer.
886         
887         * decl.cs: Guard against null generic arguments.
888         
889         * report.cs: Don't report exactly same additional details.
890
891 2008-09-22  Marek Safar  <marek.safar@gmail.com>
892
893         A fix for bug #324917
894         * cs-parser.jay: Add missing multidimensional non-expression type
895         ranks.
896         
897 2008-09-22  Marek Safar  <marek.safar@gmail.com>
898
899         A fix for bug #428191
900         * anonymous.cs: Create an outer generic fields also for non-storey
901         anonymous methods.
902
903 2008-09-22  Marek Safar  <marek.safar@gmail.com>
904
905         A fix for bug #378294
906         * class.cs: Make fixed size buffers gmcs feature only.
907
908 2008-09-22  Marek Safar  <marek.safar@gmail.com>
909
910         A fix for bug #355622, #324993
911         * assign.cs, const.cs, class.cs: Create new EmitContext for each
912         field initializer.
913
914 2008-09-19  Marek Safar  <marek.safar@gmail.com>
915
916         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
917         error reporting.
918
919 2008-09-19  Marek Safar  <marek.safar@gmail.com>
920
921         A fix for bug #416110
922         * generic.cs: Struct constraint results in default ctor and
923         ValueType base type constraint to be set.
924
925 2008-09-19  Marek Safar  <marek.safar@gmail.com>
926
927         A fix for bug #423791
928         * generic.cs: Fixed params output type type-inference.
929
930 2008-09-19  Marek Safar  <marek.safar@gmail.com>
931
932         * cs-parser.jay, expression.cs: Fixed few expression crashes.
933         
934 2008-09-19  Marek Safar  <marek.safar@gmail.com>
935
936         * cs-tokenizer.cs: Don't break on extra partial modifier.
937
938 2008-09-19  Marek Safar  <marek.safar@gmail.com>
939
940         A fix for bug #427592
941         * generic.cs: Use common parameter resolve method.
942
943 2008-09-18  Marek Safar  <marek.safar@gmail.com>
944
945         A fix for bug #414758
946         * expression.cs, ecore.cs: Fixed crash when accessing non-static
947         property.
948
949 2008-09-18  Marek Safar  <marek.safar@gmail.com>
950
951         * driver.cs, namespace.cs: Read types and namespaces after all
952         requested assemblies are loaded, fixes issues with System.Core
953         auto-reference, and #419888.
954
955 2008-09-18  Marek Safar  <marek.safar@gmail.com>
956
957         A fix for bug #417705
958         * cs-parser.jay: Fixed as/is operator expression split.
959
960 2008-09-18  Marek Safar  <marek.safar@gmail.com>
961
962         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
963         Fixed expression tree representation of empty new expression and
964         new initializer expression.
965
966 2008-09-18  Miguel de Icaza  <miguel@novell.com>
967
968         * eval.cs: Remove warning, keep reference to driver around.
969
970         * Hide fields that do not need to be public.
971
972 2008-09-17  Marek Safar  <marek.safar@gmail.com>
973
974         A fix for bug #426385
975         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
976         conversion for array elements.
977
978 2008-09-17  Marek Safar  <marek.safar@gmail.com>
979
980         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
981         void parsing conflicts.
982
983 2008-09-15  Marek Safar  <marek.safar@gmail.com>
984
985         A fix for bug #425601
986         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
987         System.Core only when there is no custom ExtensionAttribute
988         implementation.
989
990 2008-09-15  Miguel de Icaza  <miguel@novell.com>
991
992         * namespace.cs: Do not report CS0246 (name
993
994 2008-09-12  Marek Safar  <marek.safar@gmail.com>
995
996         A fix for bug #425669
997         * generic.cs: Don't cache generic static anonymous method 
998         containers.
999
1000 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1001
1002         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1003         conflicting constraints.
1004
1005 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1006
1007         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1008         mcs too.
1009
1010 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1011
1012         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1013         to null pointer conversion fixes.
1014
1015 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1016
1017         * cs-parser.jay, expression.cs: An implicitly typed local variable
1018         declarator cannot use an array initializer.
1019
1020 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1021
1022         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1023
1024 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1025
1026         * generic.cs (InflatedConstraints): Don't crash when constraints
1027         are different.
1028         
1029         * cs-parser.jay: const_declarator is a block.
1030
1031         * constant.cs: Check for not allowed NaN conversions.
1032
1033 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1034
1035         * driver.cs: Drop --shell argument, the compiler is no longer a
1036         REPL. 
1037
1038         * eval.cs: Move most of the code that deals with evaluation into
1039         this file and document the public API from repl.cs
1040
1041         * repl.cs: Remove from here.
1042         
1043 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1044
1045         A fix for bug #424684
1046         * generic.cs: Generic class constraints must come first.
1047
1048 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1049
1050         * cs-parser.jay: Improve error reporting for syntax errors in
1051         statements and expressions, we now report the expected tokens
1052         instead of reporting the useless "; expected".
1053
1054         Drop the strings from the token declaration, it turns out that
1055         they did not do what I thought they did.  Instead they were adding
1056         two sets of tokens to the tables.
1057
1058 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1059
1060         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1061         delegate.cs: Share special type check.
1062
1063 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1064
1065         A fix for bug #423981
1066         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1067
1068 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1069
1070         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1071         ConvertImplicitly.
1072
1073 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1074
1075         A fix for bugs: #324750, #335946
1076         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1077         lookup rule to determine ?-based tokens.
1078
1079 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1080
1081         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1082         expressions (like event adding or removing) end up here, so we
1083         need to treat those as statements.
1084
1085         Add LoadAssembly method.
1086
1087 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1088
1089         * repl.cs: Add Time method.
1090
1091 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1092
1093         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1094
1095 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1096
1097         * repl.cs: Add workaround for old compilers.
1098
1099 2008-09-04  Jb Evain  <jbevain@novell.com>
1100
1101         * repl.cs (PrettyPrint): pretty print everything that
1102         implements IDictionary, as well as IEnumerables. Also,
1103         add a quit helper property.
1104
1105 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1106
1107         * constant.cs: Better error reporting for decimal literals.
1108         
1109         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1110         field attributes.
1111         
1112 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1113                         Miguel de Icaza  <miguel@novell.com>
1114
1115         A fix for bug #422951
1116         * assign.cs (Assign.DoResolve): Perform the type conversions
1117         checks before we attempt to initialize `New' initializers. 
1118
1119 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1120
1121         A fix for bug #422853
1122         * delegate.cs (DelegateCreation): Add special handling for
1123         EmptyExpression.Null instance expression which is just another
1124         hack for undecided member instance exression.
1125
1126 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1127
1128         * expression.cs, ecore.cs: Emit full expression tree for reduced
1129         binary expressions.
1130
1131 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1132
1133         * expression.cs (This): Guard against multi-resolving.
1134         
1135         * ecore.cs, statement.cs (Throw): Simplified.
1136         
1137         * flowanalysis.cs: Also verify event fields.
1138
1139 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1140
1141         * assign.cs (Assign.DoResolve): Perform the type conversions
1142         checks before we attempt to initialize `New' initializers. 
1143
1144         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1145
1146         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1147         public. 
1148
1149         * repl.cs: Update help.
1150
1151 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1152
1153         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1154         handling of the default config handling, including the special
1155         treatment of System.Core assembly. 
1156
1157         Fixes the REPL processing for LINQ.
1158
1159 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1160
1161         A fix for bug #422507
1162         * expression.cs (UnboxCast): Add missing child expression mutator.
1163
1164 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1165
1166         * driver.cs: Don't self reference System.Core assembly.
1167
1168 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1169
1170         A fix for bug #422507
1171         * expression.cs (StringConcat): Add missing type mutator.
1172
1173 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1174
1175         * generic.cs (TypeInferenceContext): Follow equality rule for
1176         constructed type lower bound type inference.
1177
1178 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1179
1180         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1181         <dblank@cs.brynmawr.edu> which updates the cursor position on
1182         refresh.
1183         
1184 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1185
1186         A fix for bug #367145
1187         * driver.cs: Fixed import of extension methods when using -noconfig
1188         option.
1189
1190 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1191
1192         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1193         version from non-generic implementation instead.
1194
1195 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1196
1197         A fix for bug #418908
1198         * class.cs: Use AddScopeStatement for field initializers.
1199
1200 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1201
1202         A fix for bug #415385
1203         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1204
1205 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1206
1207         A fix for bug #421736
1208         * iterators.cs: Don't crash on unreachable iterators.
1209
1210 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1211
1212         A fix for bug #421628
1213         * parameter.cs, attribute.cs: Clone also parameter attributes.
1214
1215 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1216
1217         * namespace.cs (LookupType): In EvalMode, try to replace
1218         the TypeBuilder from our cache with a Type as Reflection.Emit does
1219         not  like to mix code from older assemblies emitted and new
1220         assemblies emitted. 
1221
1222         This sounds like a serious Mono bug that prevents multiple
1223         assemblies to be generated and consumed at the same time.
1224
1225         * cs-parser.jay (push_current_class): Do not make interactive
1226         classes internal or private, make them public as we currently
1227         generate each new class in a new assembly.   
1228
1229 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1230
1231         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1232         remove types that are entered into the global namespace during
1233         parsing so that we can remove them on failure.
1234  
1235         * cs-parser.jay: Parsing: we now keep track of types that are
1236         entered into global variables and queue those in case the parsing
1237         or resolution fail.
1238  
1239         This happens in a few situations: during partial-input, we invoke
1240         the parser repeatedly for example with the string "class X", this
1241         would cause X to be registed, and we need to remove this
1242         registration so that another parse attempt later with say "class X {"
1243         would actually work.
1244  
1245         Additionally, if there is an error in the resolution phase, for
1246         example: "class X : NonExistant {}" th
1247         
1248         * cs-parser.jay: Be more precise with the errors being raised,
1249         instead of flagging all exceptions during parsing to be attributed
1250         to the parsing process, distinguish those from errors happening in
1251         the actions and hint that using -v would produce the actual
1252         exception. 
1253
1254         * repl.cs: Do not load all compiler references on each reset,
1255         doing the partial reset takes care of this.
1256         
1257 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1258
1259         * repl.cs: Add support for loading all the files from
1260         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1261         as shell libraries.
1262
1263         Introduce a micro-parser that is able to deambiguate on its input
1264         whether we are dealing with a compilation unit (namespace, class,
1265         interface, struct, delegate) declaration or a statement.   This
1266         allows both declarations and statements to be entered. 
1267
1268         Set history size by default to 300 lines.
1269
1270         Instead of distinguishing based on the parser.InteractiveResult,
1271         have only two cases: statements were parsed, or a compilation unit
1272         was.   Always pull the Using statement additions from the
1273         compilation unit parse.
1274         
1275         * cs-tokenizer.cs: Rename tokens to better describe their intent
1276         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1277         
1278         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1279         EvalMode is used to trigger the lookup of global variables while
1280         StatementMode is used turn variable declarations into static
1281         fields.
1282
1283         * getline.cs: Allow history size to be set.
1284         
1285 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1286
1287         A fix for bug #360755
1288         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1289
1290 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1291
1292         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1293         
1294         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1295         member name, it is too confusing
1296         
1297         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1298         
1299         * rootcontext.cs: Finally default to warning level 4.
1300
1301 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1302
1303         * class.cs (CheckBase): Ignore overloaded operators.
1304
1305 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1306
1307         A fix for bug #420830
1308         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1309
1310 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1311
1312         A fix for bug #420832
1313         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1314
1315 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1316
1317         A fix for bug #420386
1318         * nullables.cs: Fixed logic of nullable user comparison operators involving
1319         null values.
1320
1321 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1322         
1323         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1324
1325 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1326
1327         * repl.cs: Add support for aborting the running code with C-c. 
1328
1329 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1330
1331         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1332
1333 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1334
1335         * cs-parser.jay (interactive_statement_list): A new set of rules
1336         for hosting statements that uses the "interactive_" prefix.   
1337
1338         * repl.cs: Add support for parsing `using' as a statement or as a
1339         directive.  Deambiguating before passing this to the parser.
1340
1341         We need to distinguish statement_expressions that occur at the
1342         toplevel vs those that occur embedded into expressions.
1343
1344         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1345         that fixes the cursor key handling, and a history bug.
1346         
1347 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1348
1349         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1350         limitations in Console, instead the 2.0 bootstrap libraries now
1351         include the Console bits.
1352
1353         Also, remove the use of Nullables from getline.cs
1354
1355         ------------
1356         
1357         Interactive support for the C# compiler.   Use gmcs --shell to
1358         enter a read-eval-print loop shell.
1359
1360         Docs: http://www.mono-project.com/CsharpRepl
1361         
1362         * sources: include repl.cs here and getline.cs for gmcs.exe,
1363         everything else is getline.cs impaired.
1364
1365         * Makefile: when bootstrapping pass a special flag
1366         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1367         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1368         This distinguishes those two cases.
1369
1370         * repl.cs: Support for a read-eval-print loop.   Will be soon
1371         refactored into eval support and then REPL on top of it.
1372
1373         * ecore.cs: If a simplename lookup fails, before erroring out,
1374         if we are in EvalMode to resolve the name to a declaration in the
1375         Eval-land.    
1376
1377         This means that variable declarations that happened in previous
1378         classes (as repl puts every statement in a separate class) are
1379         made visible in this way.
1380
1381         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1382         triggered an error due to the end of file being reached.   This is
1383         used to do multi-line input, and notify the caller that the user
1384         needs to provide more text before a successful parse.
1385
1386         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1387         to drive the evaluation with a custom wrapper. 
1388
1389         * driver.cs: Add support for --shell, and refactor some code to be
1390         reused from repl.cs
1391         
1392         * namespace.cs: Add support for serializing the contents of the
1393         namespaces and reloading them.  
1394
1395         * getline.cs: A managed implementation of ReadLine under
1396         X11/Apache2 license terms.  Easy to embed in other applications as
1397         well.
1398
1399         * namespace.cs: Add some functions to save and restore the
1400         namespace state.
1401
1402         * rootcontext.cs: New public field.
1403
1404         * cs-tokenizer.cs: Add support for one of the possible characters
1405         we introduce into the token stream.  
1406
1407         This patch does not affect the regular tokenization process, the
1408         only performance hit would happen if there is an invalid character
1409         on the input string.
1410
1411         * support.cs: Move isatty helper routine here.
1412
1413         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1414         code generator for in-memory assemblies.
1415
1416 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1417
1418         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1419         parameter cannot be always used as a type.
1420
1421 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1422
1423         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1424
1425 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1426
1427         * convert.cs: Implement explicit array to IList<T> conversion.
1428
1429 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1430
1431         A fix for bug #362740
1432         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1433
1434 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1435         
1436         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1437         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1438         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1439         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1440         handling to use just one type of infrastructure and deal with generics
1441         more effectivelly.
1442
1443 2008-07-23  Martin Baulig  <martin@ximian.com>
1444
1445         *** Merged this from trunk revision 108527 ***
1446
1447         * statement.cs
1448         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1449         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1450         scope variable.
1451
1452 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1453         
1454         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1455         error checks.
1456
1457 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1458         
1459         * delegate.cs: Fixed compiler crash when creating delegate using partial
1460         method.
1461         
1462         * typemanager.cs: MulticastDelegate is not a delegate.
1463
1464 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1465         
1466         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1467         checks.
1468
1469 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1470
1471         * cs-parser.jay (type): Allow 'var' in mcs too.
1472         (local_variable_type): Likewise.
1473
1474 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1475         
1476         * driver.cs: Removed broken -noconfig variants.
1477
1478 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1479         
1480         A fix for bug #417078
1481         * expression.cs: Emit correctly left side pointer operators.
1482
1483 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1484
1485         * generic.cs, lambda.cs: Inflate method generic arguments only.
1486
1487 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1488
1489         * class.cs: Fixed struct layout check regression.
1490
1491 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1492
1493         * cs-parser.jay, enum.cs: Simplified enum parsing.
1494         
1495         * decl.cs: Check all type parameters conflicts.
1496         
1497         * expression.cs, statement.cs, attribute.cs: More expression checks.
1498
1499 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1500
1501         * generic.cs: Add type inference types restriction.
1502         
1503         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1504         anonymous.cs, expression.cs: Allocate less accessor parameters.
1505
1506 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1507
1508         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1509         classes.
1510
1511 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1512
1513         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1514
1515 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1516
1517         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1518         Also fixes #362146 and #381592.
1519
1520 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1521
1522         * ecore.cs: Reduced constant cannot be used as an attribute value.
1523         
1524         * cs-parser.jay: Base expression has to be a type.
1525         
1526         * expression.cs (Conditional): Uses ReducedExpression.
1527
1528 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1529
1530         A fix for bug #376826
1531         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1532         address of hoisted local variable or parameter cannot be taken.
1533
1534 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1535
1536         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1537         anonymous method inside checked/unchecked expression.
1538
1539 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1540
1541         * typemanager.cs (IsEqual): Guard against null.
1542         
1543         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1544         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1545         routine. Fixed few misleading conversion errors.
1546
1547 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1548
1549         * class.cs: Consider generics when checking cycles in struct layout.
1550
1551 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1552
1553         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1554
1555 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1556
1557         A fix for bug #414165
1558         * anonymous.cs: Use same anonymous implementation method for all anonymous
1559         method emits.
1560
1561 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1562
1563         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1564         constraints.
1565
1566 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1567
1568         * cs-parser.jay: Typeof argument has to be a type expression.
1569         
1570         * namespace.cs: Check alias and namespace definitions collisions.
1571         
1572         * class.cs, pending.cs: Moved explicit interface accessor implementation
1573         check.
1574         
1575         * delegate.cs, expression.cs: Verify special name invocations.
1576         
1577 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1578
1579         * cs-parser.jay: Don't choke on empty generic type arguments.
1580         
1581         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1582         
1583         * expression.cs, ecore.cs: Minor expressions bugs.
1584
1585 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1586
1587         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1588         and added more error handling.
1589         
1590         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1591         
1592         *  modifiers.cs, enum.cs: Fixed.
1593
1594 2008-07-31  Jb Evain  <jbevain@novell.com>
1595
1596         * driver.cs: remove -pkg ability of smcs.
1597
1598 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1599
1600         * statement.cs (Switch): Correctly set empty default target for single
1601         blocks.
1602
1603 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1604
1605         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1606         string switch statement implementation to use string dictionary which
1607         significantly (2-8x) improves performance of generated code.
1608
1609 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1610
1611         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1612         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1613         
1614 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1615
1616         A fix for bug #412595
1617         * typemanager.cs, convert.cs, expression.cs: Some types are never
1618         convertible to each other.
1619
1620 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1621
1622         * nullable.cs (CreateNullConstant): An error messages update.
1623
1624 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1625
1626         A fix for bug #412595
1627         * cfold.cs: Don't cast undefined bool constant.
1628
1629 2008-07-29  Martin Baulig  <martin@ximian.com>
1630
1631         * symbolwriter.cs
1632         (SymbolWriter.Reset): New public static method.
1633
1634         * driver.cs
1635         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1636
1637 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1638
1639         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1640         
1641         * expression.cs (ElementAccess): Exact size allocation.
1642
1643 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1644
1645         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1646
1647 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1648
1649         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1650         
1651         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1652         flow analysis.
1653
1654 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1655
1656         A fix for bug #412217
1657         * assign.cs: Mutate also assignment type.
1658
1659 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1660
1661         A fix for bug #323644
1662         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1663         indexers.
1664
1665 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1666
1667         A fix for bug #412134
1668         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1669         non-enumerable operands when overloading equality or bitwise operators.
1670
1671 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1672
1673         * anonymous.cs: Cache closed generic anonymous method delegates.
1674
1675 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1676
1677         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1678         anonymous.cs, statement.cs: Always emit anonymous method as static method
1679         when is instance free. Use nesting for nested anynomous methods blocks.
1680         
1681 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1682
1683         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1684         types.
1685
1686 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1687
1688         * expression.cs: Removed MakeSimpleCall.
1689
1690 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1691
1692         A fix for bug #323012
1693         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1694         Base method implementing interface has to be public.
1695
1696 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1697
1698         * cs-parser.jay: Don't break on missing argument.
1699
1700 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1701
1702         A fix for bug #320993
1703         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1704           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1705
1706 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1707
1708         A fix for bug #320748
1709         * convert.cs: Implicit user operators cannot convert to interfaces
1710
1711 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1712
1713         A fix for bug #312686
1714         * driver.cs: Ignore empty assembly references.
1715
1716 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1717
1718         A fix for bug #387040
1719         * ecore.cs: Skip constrains check for an explicit implementation.
1720
1721 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #409045
1724         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1725           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1726           identifiers are file specific unless passed as input arguments.
1727
1728 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1729
1730          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1731          to emit UnmanagedMarshal data under 2.0 profile.
1732
1733 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1734
1735         A fix for bug #410369
1736         * parameter.cs: Clone correctly ParamsParameter.
1737
1738 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1739
1740         * expression.cs (Argument): Always report type for type based expressions
1741         errors.
1742
1743 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1744
1745         A fix for bug #410666
1746         * anonymous.cs: Correctly initialize generic storey reference.
1747
1748 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1749
1750         * convert.cs: Don't box same type arguments.
1751
1752 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1753
1754         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1755         Finished missing generic type mutators.
1756
1757 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1758
1759         * iterators.cs, statement.cs: Finished statements CloneTo.
1760
1761 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1762
1763         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1764         
1765         * expression.cs: Emit optimized default value expressions in expression tree
1766         array initializer.
1767
1768 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1769
1770         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1771
1772 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1773
1774         A fix for bug #367536
1775         * cs-parser.jay: Check static constructor of generic types for an access
1776         modifier.
1777
1778 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1779
1780         A fix for bug #353800
1781         * lambda.cs: Emit ret for contextual statements.
1782         
1783         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1784         up emitting redundant ret for all anonymous methods with return.
1785
1786 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1787
1788         A fix for bug #365188
1789         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1790         create anonymous method storey in unreachable block.
1791
1792 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1793
1794         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1795         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1796         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1797         statement.cs: Fixed relevant defects found by Gendarme.
1798
1799 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1800
1801         A fix for bug #325291
1802         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1803         statement.cs: Replaced IAnonymousHost with top level block flag.
1804
1805 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1806
1807         * cs-parser.jay: Clean up unused open_parens.
1808
1809 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1810
1811         * ecore.cs: Custom error message for a range variable assignment.
1812
1813 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1814
1815         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1816         load.
1817
1818 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1819
1820         * literal.cs: Null literal is of object type.
1821
1822 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1823
1824         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1825         expression of nullable equality comparison.
1826
1827 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1828
1829         * expression.cs(PointerArithmetic): Removed redundant assignment.
1830
1831 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1832
1833         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1834
1835 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1836
1837         A fix for bug #408361
1838         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1839         they are replaced by GetMethod.
1840
1841 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1842
1843         A fix for bug #408721 by jeremie.laval@gmail.com
1844         * expression.cs (Indirection): Implemented CloneTo.
1845
1846 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1847
1848         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1849         assert check.
1850
1851 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1852
1853         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1854
1855 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1856
1857         * linq.cs: Reset tranparent parameter counter in probing mode.
1858
1859 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1860
1861         * anonymous.cs: Mutate anonymous method type.
1862
1863 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1864
1865         * ecore.cs, anonymous.cs: Mutate field expressions.
1866
1867 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1868
1869         A fix for bug #369670
1870         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1871
1872 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1873
1874         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1875
1876 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1877
1878         Fix bug #314902
1879         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1880         only one '>', and finds a '>>', abort the generic lookahead.
1881
1882 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1883
1884         A fix for bug #319902
1885         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
1886
1887 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1888
1889         A fix for bug #406371
1890         * statement.cs: Moved EmitSymbolInfo to Block.
1891
1892 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1893
1894         * ecore.cs: Report better error for extension method overload failures.
1895
1896 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1897
1898         * expression.cs (Is): No need to box reference values.
1899
1900 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1901
1902         * class.cs: Use event resolve context when initializing CreateEmitContext.
1903
1904 2008-07-09  Marek Safar  <marek.safar@gmail.com>
1905
1906         A fix for bug #394436
1907         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
1908         method used inside expression trees. Added more LINQ to expression tree
1909         conversions.
1910
1911 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1912
1913         A fix for bug #378189, #370577
1914         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
1915         from expression.
1916
1917 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1918
1919         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
1920         hierarchically.
1921
1922 2008-07-08  Marek Safar  <marek.safar@gmail.com>
1923
1924         A fix for bug #406702
1925         * anonymous.cs: Always park anonymous method in the nearest parent storey.
1926
1927 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1928
1929         A fix for bug #406648
1930         * cs-parser.jay: Report nullable use in mcs for some cases.
1931
1932 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1933
1934         * ecore.cs: Improved argument mismatch error messages.
1935
1936 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1937
1938         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
1939
1940 2008-07-07  Marek Safar  <marek.safar@gmail.com>
1941
1942         * expression.cs (TypeOf): Mutate type argument.
1943
1944 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1945
1946         * class.cs: Report missing partial modifier for correct type.
1947
1948 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1949
1950         * ecore.cs, expression.cs (VariableReference): Variable property is 
1951         protected.
1952
1953 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1954
1955         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
1956         
1957 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1958
1959         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
1960         method delegates.
1961
1962 2008-07-04  Marek Safar  <marek.safar@gmail.com>
1963
1964         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
1965         anonymous method storey to an instance method when only "this" is hoisted.
1966
1967 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1968
1969         A fix for bug #321615
1970         * expression.cs: Pointer comparisons use unsigned operator.
1971
1972 2008-07-03  Marek Safar  <marek.safar@gmail.com>
1973
1974         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
1975
1976 2008-07-02  Marek Safar  <marek.safar@gmail.com>
1977
1978         A fix for bug #404905
1979         * class.cs: Always initialize local unsafe variables.
1980
1981 2008-06-30  Marek Safar  <marek.safar@gmail.com>
1982
1983         A fix for bug #396987
1984         * expression.cs (NewInitialize): Clear local temporary variable for next run
1985
1986 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1987
1988         A fix for bug #401020
1989         * ecore.cs: Both types and modifiers have to match for ref and out arguments
1990
1991 2008-06-27  Marek Safar  <marek.safar@gmail.com>
1992
1993         A fix for bug #398319
1994         * cs-parser.jay: Implemented undocumented base access expression inside
1995         anonymous types.
1996
1997 2008-06-26  Marek Safar  <marek.safar@gmail.com>
1998
1999         A fix for bug #404227
2000         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2001
2002 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2003
2004         A fix for bug #404227
2005         * convert.cs: Fixed explicit array to interface cast.
2006
2007 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2008
2009         A fix for bug #403894
2010         * delegate.cs: Mutate DelegateInvocation type.
2011
2012 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2013
2014         A fix for bug #379348
2015         * delegate.cs: Box a load of generic parameters.
2016
2017 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2018
2019         * expression.cs: Add an array creation arguments mutate.
2020
2021 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2022
2023         A fix for bug #386068
2024         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2025         parameter.
2026
2027 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2028
2029         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2030         CloneTo.
2031
2032 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2033
2034         A fix for bug #403518
2035         * delegate.cs: Type correctly anonymous method new invocation.
2036
2037 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2038
2039         A fix for bug #394826
2040         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2041         calls.
2042
2043 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2044
2045         A fix for bug #394826
2046         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2047         needed.
2048
2049 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2050
2051         * class.cs: Clone indexer parameters for localized capturing.
2052
2053 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2054
2055         A fix for bug #402379
2056         * expression.cs: Don't crash when an object initializer resolve fails.
2057
2058 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2059
2060         A fix for bug #402888
2061         * expression.cs: Mutate conditional expression.
2062
2063 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2064
2065         A fix for bug #401012
2066         * class.cs: Keep StructLayout in shared container.
2067
2068 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2069
2070         A fix for bug #400438
2071         * decl.cs, class.cs: Only properties can be automatically implemented.
2072
2073 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2074
2075         * statement.cs (ChangeToIterator): Copy also labels.
2076
2077 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2078
2079         * ecore.cs: Pass type argument details to parent extension method.
2080
2081 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2082
2083         A fix for bug #375966
2084         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2085
2086 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2087
2088         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2089
2090 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2091
2092         A fix for bug #394347
2093         * anonymous.cs: Cache compatible delegates as compatibility check produces
2094         a new method every time.
2095
2096 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2097
2098         * anonymous.cs: Propagate storey reference for single references.
2099
2100 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2101
2102         A fix for bug #387615
2103         * assign.cs, expression.cs: Correctly clone compound assignment.
2104
2105 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2106
2107         A fix for bug #359611, #359604
2108         * anonymous.cs: Mutate all types of hoisted parameters.
2109
2110 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2111
2112         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2113         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2114         expression.cs, codegen.cs, statement.cs
2115         
2116         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2117         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2118         
2119         ** Anonymous methods, lambda expressions rewrite **
2120         
2121         Anonymous expressions are now resolved when an explicit block is resolved 
2122         and they don't require any registration procedure anymore. Further,
2123         anonymous methods are defined when explicit block is emitted which allows
2124         better control of whole process and opens possibilities for more
2125         optimizations as well as alternative to reverse whole process.
2126         
2127         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2128         process consistent and to correctly emit hoisted generic methods when they
2129         have at least 1 hoisted variable.
2130         
2131 2008-06-17  Martin Baulig  <martin@ximian.com>
2132
2133         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2134         iterator method.
2135         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2136         virtual property; check it in Emit().
2137         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2138         an iterator.
2139         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2140         an iterator.
2141         (Indexer.Define): Likewise.
2142
2143 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2144
2145         * convert.cs: Don't use IsInterface on type arguments.
2146         
2147         * delegate.cs: DelegateInvocation uses MethodInfo.
2148         
2149         * parameter.cs: Removed IsTypeParameter.
2150         
2151         * generic-mcs.cs: More missing stuff.
2152
2153 2008-06-16  Martin Baulig  <martin@ximian.com>
2154
2155         * modifiers.cs
2156         (Modifiers.DEBUGGER_HIDDEN): New public const.
2157
2158         * typemanager.cs
2159         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2160
2161         * class.cs
2162         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2163         (AbstractPropertyEventMethod): Likewise.
2164         (Constructor.Emit): Likewise.
2165         (SourceMethod.SetCompilerGenerated): Removed.
2166
2167         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2168         on MoveNext().
2169
2170         * anonymous.cs
2171         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2172         if we're an `IteratorHost'.
2173         (AnonymousMethodMethod..ctor): Don't set
2174         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2175         not on the method.
2176
2177 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2178
2179         * statement.cs: Clean-up foreach statements.
2180
2181 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2182
2183         * class.cs: Stop using public method which should not exist
2184         (MethodBuilder.SetGenericMethodSignature).
2185
2186 2008-06-11  Martin Baulig  <martin@ximian.com>
2187
2188         * location.cs
2189         (Location.LookupFile): Add `CompilationUnit' argument; when given
2190         a relative file name, make it relative to the directory the .cs
2191         file is located in instead of using the current directory.
2192
2193 2008-06-11  Martin Baulig  <martin@ximian.com>
2194
2195         * class.cs
2196         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2197         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2198         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2199         (SourceMethod.SetCompilerGenerated): Likewise.
2200
2201 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2202
2203         * codegen.cs, driver: Only write symbol file when it's asked for.
2204
2205 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2206
2207         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2208
2209 2008-06-10  Martin Baulig  <martin@ximian.com>
2210
2211         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2212
2213 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2214
2215         A fix for bug #316290
2216         * expression.cs: Include decimal operators in predefined table.
2217         
2218         * parameters.cs: More readonlyness.
2219
2220 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2221
2222         A fix for bug #397213
2223         * cs-parser.jay: One more missing current_local_parameters reset.
2224
2225 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2226
2227         A fix for bug #396633
2228         * class.cs: Host backing field in partial container.
2229
2230 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2231
2232         A fix for bug #397068
2233         * expression.cs: Check both operand types when predefined operator is used.
2234
2235 2008-06-05  Martin Baulig  <martin@ximian.com>
2236
2237         Merged the `debugger-kahalo' branch.
2238
2239         * class.cs
2240         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2241         we're an iterator method.
2242         (SourceMethod): Reflect latest symbol writer changes;
2243         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2244         now `start_row' and `end_row'.
2245         (Constructor.Emit): Fix the logic whether to emit symbol information.
2246
2247         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2248         generated methods.
2249
2250         * location.cs
2251         (CompilationUnit): New public class; derives from `SourceFile'.
2252         (SourceFileEntry.DefineSymbolInfo): New public method.
2253         (SourceFileEntry.SetChecksum): New public method.
2254         (Location): Encode hidden line numbers by using `column == 255';
2255         the .ctor now accepts `column == -1' to mark a hidden line number.
2256         (Location.Hidden): New public property.
2257         (Location.CheckPoint): Add `CompilationUnit'.
2258         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2259         (Location.Push): Add `CompilationUnit compile_unit' argument.
2260         (Location.CompilationUnit): New public property.
2261
2262         * statement.cs
2263         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2264
2265         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2266
2267         * driver.cs: `SourceFile' -> `CompilationUnit'.
2268
2269         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2270
2271         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2272
2273         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2274         `#line hidden'.
2275
2276         * symbolwriter.cs
2277         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2278         new symbol writer API to also pass the file.
2279
2280 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2281
2282         * statement.cs: Emit catch variable assignment using variable expression.
2283         
2284 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2285
2286         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2287         with other variable types.
2288
2289 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2290
2291         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2292         GetLength method emit, it breaks resolve rules.
2293         
2294 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2295             Marek Safar  <marek.safar@gmail.com>
2296                         
2297         A fix for bug #395542
2298         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2299         declaration.
2300         
2301 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2302
2303         A fix for bug #395287
2304         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2305
2306 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2307
2308         A fix for bug #395845
2309         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2310         non-nullable parameter type.
2311         
2312 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2313
2314         * class.cs: Handle contructor initializer as a statement in top-level block.
2315
2316 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2317
2318         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2319         security attributes.
2320
2321 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2322
2323         * ecore.cs, expression.cs: Small IVariable refactoring.
2324
2325 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2326
2327         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2328
2329 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2330
2331         * cs-parser.jay: Removed redundant catch type check.
2332
2333 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2334
2335         A fix for bug #390372
2336         * nullable.cs: Set correct return type.
2337
2338 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2339
2340         A fix for bug #391062
2341         * typemanager.cs: Fixed crash when comparing null types.
2342
2343 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2344
2345         A fix for bug #391871
2346         * cs-parser.jay: Better error handling for invalid catch type.
2347
2348 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2349
2350         A fix for bug #392155
2351         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2352
2353 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2354
2355         A fix for bug #390666
2356         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2357         expressions.
2358
2359 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2360
2361         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2362         in getter.
2363
2364 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2365
2366         A fix for bug #389625
2367         * delegate.cs, generic.cs: Some progress on method group return type
2368         inference.
2369
2370 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2371
2372         A fix for bug #378419
2373         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2374
2375 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2376
2377         * class.cs (Constructor): Added IsCompilerGenerated.
2378
2379 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2380
2381         * expression.cs: Enum binary operators can accept non-enum operand only when
2382         is implicitly convertible to underlying type.
2383
2384 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2385
2386         A fix for bug #389272
2387         * support.cs: Workaround System.InvalidOperationException for enums.
2388
2389 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2390
2391         A fix for bug #389073
2392         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2393
2394 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2395
2396         * driver.cs: Split Parse.
2397         
2398         * location.cs (LookupFile): Uses string.Empty.
2399
2400 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2401
2402         * expression.cs, parameter.cs: Small ParameterReference clean up.
2403
2404 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2405
2406         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2407         hack. Fixes #387502.
2408
2409 2008-05-06  Martin Baulig  <martin@ximian.com>
2410
2411         * class.cs (Constructor.Emit): Fix the logic whether to emit
2412         symbol information.
2413
2414 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2415
2416         Fix #385503
2417         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2418         InvalidOperationException when the iterator is before the start or
2419         after the end.
2420
2421 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2422
2423         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2424         when left is nullable type.
2425
2426 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2427
2428         A fix for bug #386628
2429         * expression.cs (LocalVariableReference): Continue in resolving when
2430         variable is not assigned.
2431
2432 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2433
2434         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2435         nullable operations.
2436
2437 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2438
2439         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2440         it saves many redundant temporary variables for nullable operations.
2441
2442 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2443
2444         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2445         
2446         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2447         method.
2448         
2449         * nullable.cs: Constant coalescing operator optimizations.
2450
2451 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2452
2453         * constant.cs: Use unsigned conversion for values which are unsigned only.
2454
2455 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2456
2457         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2458         coalescing operator as it should be.
2459
2460 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2461
2462         A fix for bug #371016
2463         * expression.cs: All predefined delegate operators require implicit method
2464         group conversion.
2465         
2466 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2467
2468         * constant.cs: Emit long constant as uint when fits the range.
2469         
2470         * convert.cs, expression.cs: Fixed few unsafe conversions.
2471
2472 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2473
2474         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2475
2476 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2477
2478         Fix #385758
2479         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2480         'expr'.
2481         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2482
2483 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2484
2485         * constant.cs, literal.cs: IsLiteral property for error reporting.
2486         
2487         * ecore.cs, expression.cs: Implemented Property expression.
2488
2489 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2490
2491         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2492         
2493         * nullable.cs: Implemented nullable coalescing null operator.
2494
2495         * ecore.cs, expression.cs: Expression trees work.
2496
2497 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2498
2499         * ecore.cs: CreateExpressionTree is finally abstract.
2500
2501         * expression.cs, linq.cs: Updated.
2502
2503 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2504
2505         * expression.cs, ecore.cs: Block base access expression inside expression
2506         tree.
2507
2508 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2509
2510         A fix for bug #385058
2511         * expression.cs: User-defined operator implementations always take
2512         precedence over predefined operator implementations.
2513
2514 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2515
2516         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2517         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2518         expression tree conversions.
2519         
2520 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2521
2522         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2523         operators method details to Operator class.
2524
2525 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2526
2527         * anonymous.cs: Pass unsafe flags to anonymous container.
2528         
2529         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2530         inside expression tree.
2531
2532 2008-04-29  Martin Baulig  <martin@ximian.com>
2533
2534         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2535         (Tokenizer.PopPosition): Also restore the `line'.
2536
2537 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2538
2539         * delegate.cs: Implemented Invoke expression.
2540
2541 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2542
2543         * expression.cs: Fixed equality reference comparison regression.
2544
2545 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2546
2547         * ecore.cs: Clean up EmptyCast hack.
2548         
2549         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2550         using correct conversion rules. Also fixes #383993.
2551
2552 2008-04-28  Martin Baulig  <martin@ximian.com>
2553
2554         * class.cs (Constructor.Emit): Don't emit debugging information
2555         for generated default .ctor's.
2556
2557 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2558
2559         * convert.cs: Empty-cast ushort to int conversion.
2560
2561 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2562
2563         A fix for bug #384191
2564         * ecore.cs, expression.cs: Fixed expression cloning.
2565
2566 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2567
2568         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2569
2570 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2571
2572         Fix #381559, test-638.cs, test-639.cs
2573         * assign.cs (CompoundAssign.Helper): New wrapper.
2574         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2575         access.
2576         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2577         Pass unconverted expressions to the params array creation expression.
2578         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2579         (PropertyExpr.EmitAssign): Likewise.
2580         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2581         element if it is of kind CompoundAssign.Helper.
2582         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2583         first before anything else.
2584         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2585         (ArrayAccess.LoadArrayAndArguments): Simplify.
2586
2587 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2588
2589         * expression.cs: Fixed cloning of typeof(void).
2590
2591 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2592
2593         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2594         (Assign.Emit): Likewise.  Move it to ...
2595         (CompoundAssign.DoResolve): ... here and ...
2596         (CompoundAssign.Emit): ... here.
2597         (EventAddOrRemove): New helper to handle += and -= on events, and
2598         avoid the use of BinaryDelegates.
2599         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2600         (EventExpr.EmitAddOrRemove): Improve.
2601         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2602
2603         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2604         create VarExprs for 'foo.bar.var'.
2605         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2606         is a highly inappropriate name for its functionality.
2607
2608 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2609
2610         Simplify handling of multiple assignments
2611         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2612         inheritable-only.
2613         (SimpleAssign): New.  Class to be used for normal assignments.
2614         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2615         * expression.cs, parameter.cs, statement.cs: Likewise.
2616
2617 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2618
2619         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2620         for incompatible underlying types, more to come, uff.
2621
2622 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2623
2624         Fix gtest-388.cs
2625         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2626         Handle 'leave_copy'.
2627
2628 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2629
2630         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2631
2632 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2633
2634         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2635         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2636         * statement.cs (While, Do, For): Allow test to have side effects.
2637         (For.DoEmit): Always emit InitStatement.
2638
2639         Fix test-635.cs
2640         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2641         Always create SideEffectConstant.
2642         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2643         of type EnumConstant.
2644
2645         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2646         Handle 'right' being SideEffectConstant of type 'bool'.
2647
2648         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2649         Use left.EmitBranchable instead of open coding it, so as to
2650         improve optimization opportunities.
2651
2652         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2653
2654         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2655         assumptions.
2656         (Expression.EmitSideEffect): Document.
2657
2658 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2659
2660         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2661
2662 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2663
2664         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2665
2666 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2667
2668         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2669         conversion to expression tree.
2670
2671 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2672
2673         * ecore.cs: Removed unused expression.
2674
2675 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2676
2677         * expression.cs: Implemented NegateChecked and New expressions.
2678
2679 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2680
2681         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2682
2683 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2684
2685         Fix #351102
2686         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2687         needing final 'ret' instruction.
2688
2689 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2690
2691         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2692
2693 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2694
2695         * expression.cs: Emit ldnull and not null expression as an instance argument
2696          of static method expression calls.
2697
2698 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2699
2700         A fix for bug #378200
2701         * expression.cs: Fixed crash when creating parameterless expression tree
2702         method call.
2703
2704 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2705
2706         A fix for bug #375297
2707         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2708         method.
2709
2710 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2711
2712         A fix for bug #377596
2713         * decl.cs, class.cs: Emit delegate type argument attributes.
2714
2715 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2716
2717         A fix for bug #365314
2718         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2719         
2720 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2721
2722         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2723         only.
2724
2725 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2726
2727         * generic.cs (TypeParameter): Removed redundant location.
2728
2729 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2730
2731         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2732         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2733         FullNamedExpression in all declaration type expression, statements will come
2734         later.
2735
2736 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2737
2738         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2739         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2740
2741 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2742
2743         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2744         code.
2745
2746 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2747
2748         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2749         constraints.
2750
2751 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2752
2753         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2754         name expressions.
2755         Also fixes #340463.
2756
2757 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2758
2759         Hook up 'EmitSideEffect'
2760         * constant.cs (Constant.EmitSideEffect): New.
2761         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2762         (SideEffectConstant.EmitSideEffect): New.
2763         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2764         unconditional branch in EmitBranchable.
2765         (FieldExpr.EmitBranchable): New.
2766         * expression.cs (Unary.EmitSideEffect): New.
2767         (Binary.EmitSideEffect): New.
2768         (VariableReference.EmitSideEffect): New.  Do nothing.
2769
2770 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2771
2772         Introduce 'EmitSideEffect'
2773         * ecore.cs (Expression.EmitSideEffect): New.
2774         (TypeCast): Rename from EmptyCast.
2775         (EmptyCast): New.
2776         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2777         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2778         * convert.cs, nullable.cs: Update to changes.
2779
2780 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2781
2782         * class.cs, cs-parser.jay: Early check for base types expression.
2783
2784 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2785
2786         * decl.cs (MemberName): Declare PrettyName as obsolete.
2787
2788 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2789
2790         * namespace.cs: Use MemberName comparison.
2791
2792 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2793
2794         Fix build break
2795         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2796         FullName.
2797         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2798         (MemberName.FullyQualifiedName): New.  Provides the functionality
2799         that users assume FullName would have.
2800         * ecore.cs, namespace.cs: Update to changes.
2801
2802         * statement.cs (Using.assign): Make into ExpressionStatement.
2803         (Using.EmitPreTryBody): Simplify.
2804
2805 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2806
2807         * report.cs: ColorFormat is protected.
2808         
2809         * rootcontext.cs: Unused fields clean-up.
2810         
2811         * namespace.cs: Made UsingEntry name private.
2812
2813 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2814
2815         * cs-tokenizer.cs, location.cs: Removed unused field.
2816
2817 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2818             Raja R Harinath  <harinath@hurrynot.org>
2819
2820         Fix #379822
2821         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2822         (SideEffectConstant.side_effect): Rename from 'right'.
2823         (SideEffectConstant..ctor): Normalize 'side_effect'.
2824         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2825         value of this constant.
2826         * cfold.cs: Update to changes.
2827
2828 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2829
2830         * cs-paser.jay: Removed unused variable.
2831         
2832         * driver.cs: Made Compile instance method.
2833
2834 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2835
2836         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2837
2838 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2839
2840         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2841
2842 2008-04-13  Jb Evain  <jbevain@novell.com>
2843
2844         * namespace.cs: update the System.Core fullname for 2.1
2845         * driver.cs: update the list of required assemblies for 2.1.
2846         Merged from the Moonlight 2 branch.
2847
2848 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2849
2850         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2851         types and user defined operators. User operators arguments has to be checked
2852         for null value before invocation, which also means no operator is called
2853         when any argument is not convertible to unwrapped nullable type.
2854         
2855 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2856
2857         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2858         of Unary expressions to follow operator overloading rules precisely.
2859         Also fixes #321794, #323794
2860         
2861 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2862
2863         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2864         expression.
2865         
2866 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2867
2868         * expression.cs, ecore.cs: Implemented MemberInit expression.
2869         
2870 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2871
2872         Fix mono/tests/exception4.cs
2873         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2874         ec.NeedReturnLabel () rather emitting a 'nop'.
2875
2876         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2877         simple heuristic.
2878         (TryCatch.SomeCodeFollows): Likewise.
2879         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2880         for 'break', 'continue' and 'return' statements inside a try.
2881         We're fairly sure that the generated IL stream will have more
2882         instructions textually following the try.
2883         (FlowBranchingTryCatch): Likewise.
2884
2885         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
2886         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
2887         overrides.
2888
2889         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
2890         wrapper -- forward everything to CollectionForeach.
2891         (CollectionForeach.NonDisposableWrapper): New.
2892         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
2893         instead of a pop + branch to end.
2894
2895 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2896
2897         A fix for bug #377485
2898         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
2899         Propagate location for extension method groups. Report conversion failure at
2900         right place.
2901
2902 2008-04-07  Marek Safar  <marek.safar@gmail.com>
2903
2904         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
2905         ListInit and Field expressions.
2906
2907 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
2908
2909         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
2910         Since $PC is always -1 inside the body of MoveNext, the fault
2911         handler is a no-op.
2912         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
2913         * statement.cs (ExceptionStatement.emit_finally): Likewise.
2914         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
2915
2916         The denouement!  Fix #324708
2917         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
2918         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
2919         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
2920         'finally' inside the finally clause.
2921
2922         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
2923         inside an iterator.  Don't emit the body of the 'finally' inside
2924         the finally clause yet.
2925
2926         Use the ResumableStatement infrastructure for MoveNext ()
2927         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
2928         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
2929         'old_resume_points'.  Move dispatcher upfront.
2930         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
2931         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
2932         in an enumerator.  This encodes the main fix in this patch series
2933         -- we can only jump into the first instruction of a try from the
2934         outside, but we want to emit try/finally regions in iterators and
2935         resume in the middle of them.
2936
2937 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
2938
2939         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
2940         of NeedReturnLabel here.
2941
2942         Introduce a common point for emitting try/finally to IL
2943         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
2944         features of the various subclasses, which are now driven by ...
2945         (ExceptionStatement.EmitPreTryBody): ... this and ...
2946         (ExceptionStatement.EmitTryBody): ... this and the original
2947         EmitFinallyBody.
2948         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
2949         Remove DoEmit and update to follow above protocol.
2950
2951         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
2952         of the dispatcher are the same, skip emitting the 'switch'.
2953         * iterator.cs (Iterator.EmitDispose): Update to changes.
2954
2955         Clean up handling of 'using' statement
2956         * statement.cs (UsingTemporary): New.  Carved out of ...
2957         (Using): ... this.  Simplify drastically.  Handle exactly
2958         one variable.
2959         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
2960         or Using as appropriate.  If there are multiple variable declared,
2961         create nested Using statements.
2962         (resource_acquisition): Kill.
2963
2964         * statement.cs (ExceptionStatement.EmitForDispose): Use
2965         EmitFinallyBody, not EmitFinally.
2966
2967         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
2968         * iterator.cs: Update to changes.
2969
2970         Start using the ResumableStatement infrastructure
2971         * statement.cs (ResumeableStatement.PrepareForDispose): New.
2972         (ResumableStatement.EmitForDispose): New.
2973         (ExceptionStatement): Override them.
2974         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
2975         EmitForDispose to create the body of the Dispose method.  Don't
2976         use OldResumePoint.
2977
2978         * iterator.cs (Iterator.AddResumePoint): Move here from ...
2979         * statement.cs (Toplevel.AddResumePoint): ... here.
2980         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
2981         * flowanalysis.cs (FlowBranchingIterator): New.
2982         * codegen.cs (EmitContext): Update to changes.
2983
2984         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
2985         (Iterator.old_resume_points): Rename from 'resume_points'.
2986         (Iterator.MoveNextStatement): Remove unused class.
2987
2988         New infrastructure for try/finally in iterators (still unused)
2989         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
2990         (FlowBranchingToplevel.AddResumePoint): Hook into
2991         ToplevelBlock.AddResumePoint.
2992         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
2993         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
2994         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
2995         resume points and assign program-counter values.
2996         (ExceptionBlock.AddResumePoint): Collect resume points for
2997         de-muxer at the top of try block.
2998         * iterators.cs (Yield.CheckContext): Simplify.
2999         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3000
3001 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3002
3003         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3004         argument to an ExitStatement.
3005         (FlowBranchingException): Refactor saved origins code.
3006         * statement.cs (ExitStatement): Update to cahges.
3007         * iterator.cs (YieldBreak): Likewise.
3008
3009         * statement.cs (ResumableStatement): New.  Common base class for
3010         YieldReturn and ExceptionStatement.
3011         (ExitStatement): New.  Common base class for Return and YieldBreak.
3012         (Return): Update to changes.
3013         * iterator.cs (YieldBreak): Likewise.
3014         * lambda.cs (ContextualReturn): Likewise.
3015
3016         Fix #377028
3017         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3018         emit a meaningful error message.
3019
3020         Fix #324765, #319508
3021         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3022         (VariableInfo.SetAssigned): Set it.
3023         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3024         determine if CS0219 or CS0168 is appropriate.  Don't use
3025         flow-analysis information.
3026         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3027         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3028         (EmitContext.EndFlowBranching): ... this.
3029
3030 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3031
3032         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3033
3034 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3035
3036         A fix for bug #376508
3037         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3038         ImplicitConversionExists.
3039
3040 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3041
3042         * expression.cs (Binary): Added remaining binary operators to expression
3043         tree builder.
3044
3045         * nullable.cs: Optimize shift with null argument.
3046
3047 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3048
3049         Fix minor IL regression
3050         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3051         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3052         * cs-parser.jay (try_statement): Update to changes.
3053
3054         * statement.cs (TryFinally.need_exc_block): Delete.
3055         (TryFinally): Update to changes.
3056
3057         Now all ExceptionStatements are unconditional
3058         * statement.cs (CollectionForeach.DisposableWrapper): New.
3059         Extract out the try/finally code into a new wrapper.
3060         (CollectionForeach.Resolve): Use it to simplify the code.
3061
3062 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3063
3064         Start at simplifying ExceptionStatement semantics a bit
3065         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3066         * cs-parser.jay (try_statement): Update to changes.
3067         (opt_catch_clauses): Remove.
3068         * flowanalysis.cs: Update to changes.
3069         (FlowBranching.BranchingType.TryCatch): New.
3070         (FlowBranchingTryCatch): New.
3071
3072         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3073         (FlowBranching.CreateBranching): Update to changes.
3074         (FlowBranchingBlock.AddSibling): Add sanity check.
3075         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3076         Update to changes.
3077
3078         * iterators.cs (Iterator.MarkFinally): Remove.
3079         * statement.cs (ExceptionStatement): Update to changes.
3080
3081         Add support for skipping over finally blocks at runtime.  First
3082         in a series to fix #324708
3083         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3084         (Iterator.EmitMoveNext): Initialize it.
3085         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3086         branch over the body of the 'finally' clause.
3087
3088 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3089
3090         Avoid lopsided use of Foo/DoFoo names
3091         * statement.cs (ExpressionStatement.EmitFinallyBody):
3092         Rename from EmitFinally.
3093         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3094         * iterator.cs: Update to changes.
3095
3096 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3097
3098         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3099         based on UserOperatorCall. More binary nullable operators clean up.
3100
3101 2008-04-02  Martin Baulig  <martin@ximian.com>
3102
3103         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3104
3105 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3106
3107         * nullable.cs: Merge user and empty conversions when lifting expression
3108         trees.
3109         
3110         * expression.cs (StringConcat): Implemented expression tree representation.
3111
3112 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3113
3114         * nullable.cs: When lifting null literal and a user operator exists, no call 
3115         is made.
3116         
3117 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3118
3119         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3120         null.
3121
3122 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3123
3124         * nullable.cs, expression.cs: Use namespace instead heavily nested
3125         monster abstract class.
3126
3127 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3128
3129         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3130         lifting of null literal and user operators. Clean up of some temporary
3131         nullable hacks.
3132
3133 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3134
3135         Fix #368224, test-629.cs
3136         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3137         if it crossed an unwind-protect boundary.
3138         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3139         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3140         inside an unwind-protected region.
3141         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3142         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3143         'leave' instead of a 'br' if unwind-protected.
3144         (Iterator.EmitYieldBreak): Likewise.
3145
3146 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3147
3148         * driver.cs: Only define versioninfo resources if no win32 resource
3149         file was specified.
3150
3151 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3152
3153         A fix for bug #372375
3154         * convert.cs: Fixed boxing of nullable types.
3155
3156 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3157
3158         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3159         type.
3160
3161 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3162
3163         A fix for bug #374619
3164         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3165         
3166 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3167
3168         * lambda.cs: Check return type only for invocation.
3169         
3170 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3171
3172         A fix for bug #374214
3173         * ecore.cs: Correctly report argument type mismatch.
3174
3175 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3176
3177         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3178         and not rely on broken IsEnum.
3179
3180 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3181
3182         * nullable.cs: New file, extracted from generic.cs.
3183         
3184         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3185
3186 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3187
3188         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3189         predefined comparison operators and null literals.
3190         
3191         * report.cs: New warning ID.
3192         
3193 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3194
3195         A fix for bug #370577
3196         * lambda.cs: Check return type too.
3197
3198 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3199
3200         A fix for bug #372846
3201         * class.cs: Automatic properties can be declared as unsafe.
3202
3203 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3204
3205         * location.cs: Use string based concatenation.
3206         
3207         * expression.cs: LiftedBinaryOperator is gmcs only.
3208         
3209 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3210
3211         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3212         conversions rules and expression trees.
3213
3214 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3215
3216         * delegate.cs: Use extension method source as delegate target.
3217
3218 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3219
3220         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3221         binary operations to be purely based on binary operations and optimized
3222         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3223         and other ET refactoring.
3224         
3225         * typemanager.cs: Fixed warning.
3226         
3227 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3228
3229         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3230         
3231         * symbolwriter.cs: Fixed.
3232
3233 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3234
3235         * anonymous.cs, driver.cs: Reset anonymous types counters.
3236
3237 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3238
3239         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3240         
3241         * class.cs: Use fullname for all type member definitions.
3242         
3243 2008-02-19  Martin Baulig  <martin@ximian.com>
3244
3245         * class.cs
3246         (IMethodData.EmitExtraSymbolInfo): New interface method.
3247         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3248         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3249         interface method here as an empty public virtual method.
3250
3251         * anonymous.cs
3252         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3253         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3254         CodeGen.SymbolWriter.SetRealMethodName().       
3255
3256 2008-02-18  Martin Baulig  <martin@ximian.com>
3257
3258         * anonymous.cs
3259         (ScopeInfo.EmitType): Override this and emit debugging
3260         information for captured variables.
3261         (RootScopeInfo.EmitType): Override this and emit symbol
3262         information for a captured `this'.
3263
3264 2008-02-15  Martin Baulig  <martin@ximian.com>
3265
3266         * iterators.cs: Emit debugging info.
3267
3268         * codegen.cs
3269         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3270         (EmitContext.OmitDebuggingInfo): New public property.
3271
3272         * statement.cs
3273         (While): Override Emit() and don't emit symbol info there; do it
3274         inside DoEmit() instead.
3275         (Block.Emit): Omit symbol information while emitting the scope
3276         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3277         block logic.
3278         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3279         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3280         .ctor to make `IsIterator' work.
3281
3282 2008-03-14  Martin Baulig  <martin@ximian.com>
3283
3284         * symbolwriter.cs: Added the new symbol writer function from the
3285         debugger's `terrania' branch; temporarily enclose them inside
3286         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3287         my vacations.
3288
3289 2008-03-14  Martin Baulig  <martin@ximian.com>
3290
3291         * symbolwriter.cs
3292         (SymbolWriter): Make this a public static class.
3293
3294         * codegen.cs
3295         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3296         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3297
3298 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3299
3300         A fix for bug #370577
3301         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3302         return type.
3303         
3304 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3305
3306         * typemanager.cs (CSharpName): Made 250 times faster.
3307
3308 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3309
3310         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3311         
3312 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3313
3314         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3315         crash when predefined field does not exist.
3316         
3317 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3318
3319         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3320         
3321 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3322
3323         * class.cs (FixedField): Don't crash when contructors are missing.
3324
3325 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3326
3327         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3328         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3329         check internal types accessibility for internal and external types.
3330         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3331
3332 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3333
3334         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3335         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3336         attribute.cs, statement: Use corect instance of predefined types (work
3337         related to #364674).
3338
3339 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3340
3341         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3342         
3343 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3344
3345         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3346         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3347         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3348         predefined types clean up, delayed predefined types members initialization
3349         (work related to #364674).
3350
3351 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3352
3353         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3354         
3355 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3356
3357         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3358         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3359         predefined types clean up (work related to #364674).
3360
3361 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3362
3363         * ecore.cs: Print an error message instead of throwing exception.
3364         
3365 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3366
3367         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3368         expression.cs, statement.cs: Unififed null literal representation.
3369
3370 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3371
3372         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3373         expression.cs: Refactored binary operators resolve phase and improved speed.
3374         The nullable code is still missing and won't work correctly, more fixes
3375         required.
3376
3377         It also fixes #323726, #324312, #324248, and many other unreported issues.
3378
3379 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3380
3381         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3382         instead of 'gmcs'.
3383
3384 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3385
3386         * ecore.cs: Clean-up and split BetterConversion.
3387         
3388 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3389
3390         Fix #363791
3391         * enum.cs (EnumMember.Value): Only access 'value' if
3392         ResolveValue says it's ok.
3393         (EnumMember.DoResolveValue): Don't set prev_member.value.
3394         (Enum.GetDefinition): Reverse arguments of Equals --
3395         EnumMember.Value can return 'null'.
3396
3397         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3398
3399 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3400
3401         * generic.cs, expression.cs: More ongoing work on expression trees.
3402         
3403 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3404
3405         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3406         handle missing matches when mutiple operators exist.
3407         
3408 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3409
3410         A fix for bug #363218
3411         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3412         initializers.
3413         
3414 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3415
3416         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3417         update. This time to deal correctly with SideEffectConstant expression used
3418         as an argument for another constant folding.
3419
3420 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3421
3422         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3423         MethodBuilder.
3424
3425 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3426
3427         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3428
3429 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3430
3431         A fix for bug #328136
3432         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3433         side is a false constant, because we still need to evaluate the right-hand
3434         side.
3435
3436         * statement.cs (If): Emit two types of boolean constants (simple constant,
3437         side-effect constant).
3438
3439 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3440
3441         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3442
3443         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3444         constants.
3445
3446 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3447
3448         A fix for bug #361457
3449         * ecore.cs (IsApplicable): Params methods have lower priority.
3450
3451         * support.cs: Return correct parameter modifier for params types.
3452
3453 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3454
3455         * generic.cs (TypeParameter): Cache attribute target name.
3456
3457         * support.cs: Removed unused variable.
3458
3459         * typemanager.cs: Removed debugging leftover.
3460
3461         * ecore.cs: Use local type instead of a property;
3462
3463         * class.cs (VerifyMembers): Consider also parent to test whether type member
3464         is local or public.
3465
3466         * expression.cs (FullMethodDesc): Removed.
3467
3468         * attribute.cs (IsValidArgumentType): Made static.
3469
3470 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3471
3472         Cleanup to be more readable.
3473         * Makefile (GMCS_PROFILE): Remove.
3474         (COMPILER_NAME): New helper.
3475
3476 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3477
3478         * cs-tokenizer.cs: if a conditional expression happens inside a
3479         (...) this also means that we do not need to de-ambiguate between
3480         an parenthesized expression and a cast.
3481
3482         Fixes 346484.
3483
3484         * constant.cs (SideEffectConstant): a constant value that happens
3485         to have a side effect.
3486
3487         Fixes the build regressions introduced by the fix for #359789
3488
3489 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3490
3491         * expression.cs (Conditional.Emit): when emitting the ternary
3492         operator, use local variables to generate code verifiable code.
3493
3494         The verifier cannot infer that the type on stack before the
3495         stloc.0 is executed is of type ParentB. This happens because the
3496         stack merge algorithm uses only parent types when deciding which
3497         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3498         335.
3499
3500         This code compiled with mcs is not verifiable under MS. The MS
3501         verifier picks the first common interface of Foo and Bar, which is
3502         wrong, but doesn't use a full join type of the 2 interfaces.
3503
3504         CSC uses a clever hack to compile such code in a verifiable
3505         way. It stores the intermediate values in a local variable with
3506         the expected type.
3507
3508         Fixes: #358102
3509
3510 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3511
3512         * expression.cs: Do not fold BitwiseAnd operators when the left
3513         side is a false constant, because we still need to evaluate the
3514         right-hand side.
3515
3516         Fixes #359789
3517
3518         * support.cs: Instead of throwing an InternalErrorException when
3519         the position of the stream is outside the boundary of our buffer,
3520         reset the state of the reader, and restart the reading from the
3521         beginning of the file.
3522
3523 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3524
3525         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3526
3527 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3528
3529         A fix for bug #361686
3530         * decl.cs: A protected types used inside a private class which parents
3531         derives from the protected class are accessible.
3532
3533 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3534
3535         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3536         the parameterless constructor.
3537
3538 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3539
3540         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3541         lookup methods to use standard member cache when doing member lookup.
3542
3543 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3544
3545         * driver.cs: Don't report full path for referenced module as assembly error.
3546
3547 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3548
3549         * Makefile: Fixed `qh' target to work on all machines.
3550
3551         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3552         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3553         and HasElementType with TypeManager implementation.
3554
3555 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3556
3557         A fix for bugs #325134, #359749
3558         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3559         first binds point to non-method member expression.
3560
3561 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3562
3563         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3564
3565 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3566
3567         A fix for bugs #321394, #323028
3568         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3569         Reworked naive IsAccessibleAs implementation to handle nested types.
3570
3571 2008-02-05  Jb Evain  <jbevain@novell.com>
3572
3573         * class.cs: use generic type comparison for parameters
3574         as well.
3575
3576 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3577
3578         A fix for bug #325372
3579         * class.cs: Use generic type comparison when testing method signatures.
3580
3581 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3582
3583         A fix for bug #357047
3584         * ecore.cs: Applied C# 3.0 changes to better conversion.
3585
3586 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3587
3588         A fix for bug #358374
3589         * cs-parser.jay: Correctly set modifiers for all constructor types.
3590
3591 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3592
3593         A fix for bug #355251
3594         * generic.cs: Added base class constraint based type inference.
3595
3596 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3597
3598         A fix for bug #357255
3599         * decl.cs: One more missing visibility check.
3600
3601 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3602
3603         * support.cs: Fixed broken return.
3604
3605 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3606
3607         * report.cs: Correctly reset warnings count after probing.
3608
3609 2008-01-25  Martin Baulig  <martin@ximian.com>
3610
3611         * namespace.cs
3612         (NamespaceEntry.SymbolFileID): Make this work again after
3613         MemberName.ToString() is gone.
3614
3615 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3616
3617         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3618         expressions.
3619
3620 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3621
3622         * generic.cs: Use full implicit conversion for type inference fixing.
3623
3624 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3625
3626         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3627         Fixed user operator conversions.
3628
3629 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3630
3631         * generic.cs: Do nullable type to null comparison optimization during
3632         resolve phase.
3633
3634 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3635
3636         A fix for bug #355163
3637         * generic.cs: Enabled l-value resolve on nullable expressions.
3638
3639 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3640
3641         A fix for bug #353986
3642         * class.cs: Ingore static ctors with parameters for any further checks.
3643
3644 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3645
3646         A fix for bug #354310
3647         * namespace.cs: Removed redundant check.
3648
3649 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3650
3651         A fix for bug #354928
3652         * expression.cs: ElementInitializers can be resolved only once.
3653
3654 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3655
3656         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3657         Condition expressions.
3658
3659 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3660
3661         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3662
3663 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3664
3665         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3666         not allowed.
3667
3668         * generic.cs: Implemented coalesce expression.
3669
3670 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3671
3672         A fix for bug #355145
3673         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3674         expression tree type inference.
3675
3676 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3677
3678         Fix #354663
3679         * expression.cs (Binary.IsUnsignedType): Fix typo.
3680
3681 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3682
3683         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3684
3685 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3686
3687         A fix for bug #355161
3688         * ecore.cs, expression.cs: Wider range of extension method supported
3689         expressions.
3690
3691 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3692
3693         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3694         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3695         bug #354970.
3696
3697 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3698
3699         A fix for bug #355148
3700         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3701
3702 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3703
3704         * expression.cs (CreateExpressionTree): Add support for or and
3705         logical or, and indent following the coding conventions.
3706
3707         * typemanager.cs (LinqExpression): renamed from
3708         ExpressionTreeManager, for a shorter name.
3709
3710         Use TypeManager.CoreLookupType to lookup types from our core
3711         assemblies and turn those into "Type" variables.
3712
3713         Consumers that previously used "Namespace" and "Type" from this
3714         class should instead use the TypeExpression which is a type that
3715         is fully resolved (without involving the regular C# resolution
3716         rules). 
3717
3718         This typically looks like this:
3719
3720         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3721         new MemberAccess (texpr, name, type_arguments, loc)
3722
3723         This avoids the problem in: #355178
3724
3725 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3726
3727         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3728         feature in parser only as we do in other cases.
3729         
3730 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3731
3732         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3733         typemanager.cs: A refactoring of params arguments to reuse existing
3734         expressions (params -> array initializer) to emit params argument instead
3735         of specialized handling.
3736         It was required by expression tree implementation and it has other benefits
3737         as well, we now apply same optimization for params arguments as we do for
3738         array initializers.
3739         
3740 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3741
3742         A fix for bug #353526
3743         * generic.cs: A type inference of params arguments may not required any
3744         temporary array creation.
3745         
3746 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3747
3748         A fix for bug #353534
3749         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3750         supported for delegates only.
3751         
3752 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3753
3754         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3755         type for more than 1 candidates.
3756         
3757 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3758
3759         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3760         expressions.
3761         
3762 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3763
3764         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3765         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3766         operator) expressions. 
3767                 
3768 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3769
3770         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3771         not accessed from the generated IL.
3772
3773 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3774
3775         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3776         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3777         statement.cs: The first expression tree implementation drop, mostly
3778         infrastructure work.
3779
3780 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3781
3782         * ecore.cs (IsNestedChild): Refactored.
3783
3784 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3785
3786         * lambda.cs: Don't use a cast on unknown expression statement.
3787
3788 2008-01-10  Geoff Norton  <gnorton@novell.com>
3789
3790         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3791         arguments
3792
3793 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3794
3795         * doc.cs: Report better /doc crash details.
3796         
3797 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3798
3799         A fix for bug #352536
3800         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3801
3802 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3803
3804         A fix for bug #352287
3805         * ecore.cs, expression.cs: Do `this' access checking in all member access
3806         expressions.
3807         
3808 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3809
3810         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3811         
3812         * report.cs: Reset message stacks.
3813         
3814 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3815
3816         * generic.cs (InferInPhases): Correctly calculate params position.
3817         
3818 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3819
3820         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3821         arguments.
3822
3823 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3824
3825         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3826         
3827         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3828         
3829         * driver.cs: Updated --help option.
3830         
3831 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3832
3833         * generic.cs (InferParamsTypeArguments): Removed.
3834         (InferInPhases): Add params type inference.
3835         (LowerBoundInference): Fixed scoring mechanism.
3836         
3837         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3838         
3839 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3840
3841         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3842         byte array for unsigned "baked" assemblies.
3843
3844 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3845
3846         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3847         array for assemblies that are not strongnamed.
3848
3849 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3850
3851         A fix for bug #351481
3852         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3853         declaring type for nested generic types.
3854         
3855 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3856
3857         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3858         instead of ToString.
3859         
3860 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3861
3862         A fix for bug #351047
3863         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3864         null and structs only when equality and inequality operators are defined
3865         either as an user-operators or predefined operators.
3866         
3867 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3868
3869         A fix for bug #351047
3870         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3871         
3872 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3873
3874         A fix for bug #351257
3875         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3876         
3877 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3878
3879         A fix for bug #351157
3880         * class.cs (Using): Fixed yet another broken cloning.
3881         
3882         (Block): Put back more sensible default value for statements.
3883         
3884 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
3885
3886         * codegen.cs: Allow AssemblyVersion with only major version component.
3887         Fixes bug #351055.
3888
3889 2007-12-29  Marek Safar  <marek.safar@gmail.com>
3890
3891         A fix for bug #324654
3892         * class.cs: Use FullName property as member name.
3893
3894 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3895
3896         A fix for bug #342117
3897         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
3898         constructor constraint.
3899
3900 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3901
3902         A fix for bug #338273
3903         * class.cs (ProbertyBase): Access modifier checks are required for overrides
3904         only.
3905
3906 2007-12-28  Marek Safar  <marek.safar@gmail.com>
3907
3908         A fix for bug #350839
3909         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
3910
3911 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3912
3913         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3914         GHOP:
3915         
3916         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3917
3918         * statement.cs: Changed some Hashtables to use HybridDictionaries
3919         instead. It was observed that some HashTables only contained a few
3920         items in the vast majority of cases. Since HybridDictionary is
3921         more efficient on small sets (<10 elements), "known_variables"
3922         from class ExplicitBlock as well as "labels" and "constants " from
3923         class Block were changed to HybridDictionaries. 
3924
3925         Atsai results: (56216kb->54987kb)
3926
3927         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
3928
3929
3930 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
3931
3932         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
3933         GHOP:
3934         
3935         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
3936         
3937         * expression.cs: foreach loop to for loop, saved on allocation of
3938         enumerator (59333kb->59141kb)
3939
3940         * statement.cs. Changed foreach loops to for loops, saved on
3941         allocation of enumerator (59141kb->59006kb)
3942
3943         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
3944         when constructed with no specified capacity. This was causing a
3945         few ArrayLists to allocate more memory than they would potentially
3946         need in the Block class and MemberCache class. Setting the
3947         ArrayLists to construct with a capacity of 1 saves some
3948         memory. (56216kb->55585kb)
3949
3950 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3951
3952         A fix for bug #347189 (2nd issue)
3953         * expression.cs (MemberAccess): Nested type can be found in base non-generic
3954         type.
3955
3956 2007-12-27  Miguel de Icaza  <miguel@novell.com>
3957         
3958         * report.cs: Do not use colors if stdout and stderr are not a
3959         terminal.
3960
3961 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3962
3963         A fix for bug #346998
3964         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
3965         overloads.
3966
3967 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3968
3969         A fix for bug #343465
3970         * class.cs: Explicit method name for nested types uses dots only.
3971
3972 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3973
3974         A fix for bug #343707
3975         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
3976
3977 2007-12-27  Marek Safar  <marek.safar@gmail.com>
3978
3979         * ecore.cs: Report type inference errors only when arguments count matches
3980         parameter count.
3981         
3982         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
3983         
3984         * expression.cs, report.cs: New warning.
3985         
3986         * typemanager.cs: Catch anonymous method type too.
3987
3988 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3989
3990         A fix for bug #346379
3991         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
3992
3993 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3994
3995         A fix for bug #347359
3996         * expression.cs (Invocation): Don't resolve already resolved expression.
3997
3998 2007-12-23  Marek Safar  <marek.safar@gmail.com>
3999
4000         A fix for bug #347189
4001         * class.cs (FixedField): Use non-dependent code only in the define phase.
4002
4003 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4004
4005         A fix for bug #348076
4006         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4007
4008 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4009
4010         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4011         discovered extension methods.
4012
4013 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4014
4015         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4016         method.
4017
4018 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4019
4020         * report.cs (ErrorMessage): Add support for using colors on
4021         terminals that support it. 
4022
4023 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4024
4025         * ecore.cs: Use information about expanded params for error reporting.
4026
4027 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4028
4029         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4030         and logic for params overloads.
4031         
4032 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4033
4034         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4035         as this is also created from the parser.  Fixes #349034
4036
4037 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4038
4039         * statement.cs (Throw.CloneTo): it is valid to have empty
4040         expressions for throw. 
4041
4042 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4043
4044         * cs-parser.jay: Set delegate constraint parsing region correctly.
4045
4046 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4047
4048         A fix for bug #345467
4049         * typemanager.cs (IsEqual): Compare generic parameters position only.
4050         
4051 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4052
4053         * expression.cs (BaseAccess): Type arguments can be null.
4054
4055 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4056
4057         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4058         consistent even when an error has occured.
4059         (Switch.Resolve): Likewise.
4060
4061 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4062
4063         A fix for bug #334505
4064         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4065         overrides.
4066         
4067 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4068
4069         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4070         refactorings required to resolve extension methods correctly when mixing
4071         generics and non-generics members.
4072         
4073 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4074
4075         A fix for bug #342584
4076         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4077         conversion.
4078         
4079 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4080
4081         A fix for bug #342512
4082         * delegate.cs: Use delegate argument expression when is available. Don't
4083         emit virtual call when class is sealed.
4084         
4085 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4086
4087         A fix for bug #325423
4088         * assign.cs (FieldInitializer): Use resolved expression for emit.
4089         
4090         * class.cs: Print less confusing error message.
4091         
4092 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4093
4094         * cs-tokenizer.cs: Removed GMCS ifdefs.
4095         
4096         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4097         mcs.
4098         
4099         * cs-parser.jay: Disabled nullable check.
4100         
4101         * generic-mcs: Copied more generic stuff.
4102                 
4103 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4104
4105         * gcs-parser.jay: Merged to cs-parser.jay.
4106         
4107         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4108         * *.csproj, *.sources: Updated to use only jay parser file.
4109
4110 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4111
4112         * gcs-parser.jay: Added nullable and default expression feature checks.
4113         
4114 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4115
4116         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4117         it fixes many TODOs and hidden bugs.
4118         
4119         * expression: Removed duplicate error check.
4120
4121 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4122
4123         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4124         implicitly type local variable only when it is used in a declaration.
4125
4126 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4127
4128         * attribute.cs: Use CS0612 for empty strings.
4129
4130 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4131
4132         * lambda.cs, statement.cs: Contextual return may act as a statement.
4133
4134 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4135
4136         A fix for a regression cause by #324222
4137         * class.cs: Don't report unused even when it implements an interface.
4138         
4139 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4140
4141         A fix for bug #341205
4142         * ecore.cs, expression.cs: Method group expression cannot do static
4143         method access with an instance reference check before overloading takes
4144         a place.
4145         
4146 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4147
4148         A fix for bug #325359
4149         * class.cs: Use predictable name for automatically generated property.
4150         
4151 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4152
4153         A fix for bug #324996
4154         * expression.cs (Is): Handle case where D is nullable and T is not
4155         correctly.
4156         
4157         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4158         
4159 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4160
4161         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4162         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4163         Flush small error reporting changes.
4164         
4165 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4166
4167         A fix for bug #324996
4168         * expression.cs: Rewrote Is expression implementation to work with
4169         generics, nullable types, anonymous method. A const result expression 
4170         uses existing infrastructure instead of custom not fully-featured one.
4171         
4172 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4173
4174         A fix for bug #340202
4175         * class.cs: Consider generics for volatile field.
4176
4177 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4178
4179         A fix for bug #335594
4180         * expression.cs: Use conversion rules when handling string addition.
4181         
4182 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4183
4184         A fix for bug #336651
4185         * expression.cs: Fixed a crash when probing is on.
4186         
4187 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4188
4189         A fix for bug #324242
4190         * covert.cs: Added a conversion from any nullable-type with an 
4191         underlying enum-type to the type System.Enum.
4192         
4193 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4194
4195         A fix for bug #324222
4196         * class.cs: Report all non-used event fields.
4197         
4198 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4199
4200         A fix for bug #325161
4201         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4202         qualifier for generic types.
4203         
4204 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4205
4206         A fix for bug #322971
4207         * expression.cs, ecore.cs: Added intermediate result value check for
4208         indexers. 
4209         
4210 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4211
4212         A fix for bug #324754
4213         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4214         when it was requested.
4215
4216 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4217
4218         A fix for bug #325101
4219         * expression.cs: Do type not value comparison for `is' expression.
4220
4221 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4222
4223         A fix for bug #320236
4224         * convert.cs: Don't apply user conversion on underlying target type.
4225
4226 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4227
4228         * expression.cs: Don't use unresolved expression for error reporting.
4229  
4230 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4231
4232         A fix for bugs #337712, #324490
4233         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4234         overloading resolution too.
4235         
4236         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4237         the process consistent and more robust.
4238         
4239         * expression.cs, linq.cs, report.cs: Update.
4240
4241 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4242
4243         A fix for bug #332909
4244         * attribute.cs: Resolve attributes in correct context using error
4245         handling procedure.
4246         
4247         * rootcontext.cs: Define Obsolete attribute members as core members.
4248         
4249 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4250
4251         * statement.cs: Removed unused methods.
4252         
4253 2007-10-31  Wade Berrier  <wberrier@novell.com>
4254
4255         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4256         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4257         during 'make dist')
4258
4259 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4260
4261         A fix for bug #338102
4262         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4263         methods registered as non-generics.
4264         
4265 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4266
4267         A fix for bugs #337712, #324490
4268         * delegate.cs: Delegate covariance and contravariance is not allowed for
4269         value types.
4270         
4271 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4272
4273         A fix for bug #337719 
4274         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4275         `from' keyword.
4276         
4277 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4278  
4279         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4280
4281 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4282  
4283         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4284         query expressions.
4285
4286 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4287
4288         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4289
4290 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4291  
4292         A fix for bug #334652
4293         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4294         extension methods when we have not found the best candidate in normal
4295         container.
4296
4297 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4298
4299         * AssemblyInfo.cs: Keep up-to-date.
4300
4301 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4302
4303         * Makefile: Fixed generics compiler name.
4304         
4305 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4306
4307         * lambda.test: removed, lambda parsing is done differently.
4308         
4309         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4310
4311 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4312
4313         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4314
4315 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4316
4317         * Makefile, *.sources : All C# compilers are in mcs folder.
4318         
4319         * *.cs: Use existing 2_1 define for smcs.
4320
4321 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4322
4323         A fix for bug #335847
4324         * assign.cs, expression.cs: Couple of changes to avoid creating a
4325         temporary variable for each object initializer assignment statement. It
4326         simplifies struct initialization too, otherwise two temporary variables
4327         would be required.
4328         Implemented optimization of redundant default element initializers.
4329         
4330 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4331
4332         A fix for bug #336766
4333         * expression.cs (Class.CheckBase): Use generic name when method is
4334         generic.
4335         
4336 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4337
4338         A fix for bug #334737
4339         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4340         variable and not variable argument for prepared copies.
4341
4342 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4343
4344         A fix for bug #325110
4345         * class.cs, expression.cs, attribute.cs: Use open generic method when
4346         checking conditional attribute.
4347         
4348 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4349
4350         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4351         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4352         FeatureIsNotAvailable.
4353
4354 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4355
4356         ** C# 3.0 Partial methods
4357         
4358         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4359         methods support. Because of member cache issue with generics only
4360         non-generics partial methods are fully supported.
4361         
4362 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4363         
4364         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4365         generics and to use member cache for member checking. It also improves
4366         performance and fixes remaining overloads issues.
4367         
4368 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4369         
4370         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4371         roottypes.cs, typemanager.cs:
4372                 
4373         A member cache creation logic changed to add members immediately and
4374         not rely on fallback. The member cache is now only prefered way
4375         how to access and find type declaration members. It saves 5 MB of memory
4376         during MWF compilation and makes code ready for more optimizations and
4377         clean-ups, it's also a pre-requirement for partial methods.
4378         
4379 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4380
4381         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4382         handling for generic parameters.
4383
4384 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4385         
4386         * class.cs (FixedField): Removed redundant volatile check.
4387         
4388 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4389         
4390         * class.cs, decl.cs: Fixed overload members verification to do only one
4391         check per possible collision.
4392         
4393 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4394         
4395         A fix for bug #325478
4396         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4397         and create only one disposable flags container.
4398         
4399 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4400         
4401         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4402         * statement.cs (Fixed): Fixed variables cloning.
4403         
4404 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4405         
4406         A fix for bug #333342
4407         * class.cs (EventField): Don't mark value type event as synchronized. 
4408         
4409 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4410         
4411         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4412         inference to identify best candidate method correctly.
4413         (ProperyExpr): A range variable is read only and cannot be modified.
4414         
4415 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4416         
4417         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4418         logic to identify best candidate method correctly.
4419         
4420 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4421         
4422         * location.cs (Equals, GetHashCode): Removed.
4423         
4424 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4425         
4426         * report.cs: Implemented message recorder. It is used mainly for lambda
4427         expressions to capture otherwise swallowed error messages.
4428         
4429         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4430
4431         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4432         and not at the top.
4433         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4434                 
4435         * expression.cs (MemberAccess): Always report lookup failure.
4436         
4437         * location.cs: Implemented Equals, GetHashCode.
4438         
4439         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4440         
4441 2007-10-10  Jb Evain  <jbevain@novell.com>
4442
4443         * codegen.cs: re-enable assembly version check.
4444
4445 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4446         
4447         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4448         checks.
4449         
4450         * namespace.cs (UsingAlias): Do correct version check.
4451         
4452 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4453         
4454         * expresison.cs, ecore.cs: Issue extension method error message when
4455         appropriate.
4456         
4457         * rootcontext.cs: Added ISO_2 compiler mode option.
4458
4459 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4460         
4461         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4462          message.
4463         
4464 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4465         
4466         * attribute.cs (GetString, GetBoolean): Work with both literal and
4467         constant.
4468         
4469         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4470         Moved method overload specific methods to MethodGroupExpr.
4471         
4472         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4473         it should be less memory consuming.
4474         
4475 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4476
4477         * codegen.cs: remove the assembly version check until the buildbot is
4478         fixed.
4479
4480 2007-10-07  Jb Evain  <jbevain@novell.com>
4481
4482         * attribute.cs (Attribute.GetString): if the value
4483         expression is a StringConstant, return its string value.
4484
4485 2007-10-07  Jb Evain  <jbevain@novell.com>
4486
4487         * typemanager.cs: add `assembly_version_attribute_type`.
4488         * codegen.cs: on attribute emission, check that the
4489         AssemblyVersionAttribute doesn't overflow.
4490
4491 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4492         
4493         A fix for bug #324677
4494         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4495         parent container of a scope container with currently resolved one. 
4496         
4497 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4498         
4499         A fix for bug #325534
4500         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4501         only.
4502         
4503 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4504         
4505         A fix for bug #327504
4506         * class.cs (Operator.Define): Refactored implicit and explicit user
4507         operator conversion rules.
4508         
4509 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4510         
4511         A fix for bug #327520
4512         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4513         
4514 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4515         
4516         A fix for bug #328022
4517         * class.cs (MethodData.Define): Use correct method to check whether
4518         a method implementents an accessor.
4519         
4520 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4521         
4522         A fix for bug #330069
4523         * statement.cs (Fixed.Resolve): Read the first array element only when
4524         an array is instantiated. 
4525         
4526 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4527         
4528         * expression.cs, assign.cs, generics.cs: Print correct operator when
4529         compound assignment is used.
4530         
4531 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4532         
4533         A fix for bug #325841
4534         * expression.cs (ArrayAccess): Use full argument cloning only for
4535         string compound concatenation.
4536         
4537 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4538         
4539         A fix for bug #328774
4540         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4541         assignment.
4542         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4543         assignment.
4544
4545 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4546
4547         Fix #328490
4548         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4549         Event accessibility checks here.  Remove some bogus code that
4550         accidently made GenericMethods work.
4551         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4552
4553 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4554         
4555         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4556         
4557         * statement.cs (Block): Refactored AddVariable to allow error handling
4558         customization.
4559         
4560         * generic.cs: New stub.
4561         
4562 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4563         
4564         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4565         flag.
4566         
4567 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4568
4569         * class.cs: Use partial container to record whether any partial part
4570         contains static field initializer and therefore default contructor has
4571         to be defined.
4572         
4573 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4574
4575         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4576         mono-list when only one of two partial parts has defined accessibility
4577         modifier.
4578         
4579 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4580
4581         A fix for bug #82845
4582         
4583         * class.cs (TypeContainer): Set correct resolve context for all field
4584         initializers.
4585         
4586 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4587
4588         * assign.cs: Fixed a crash when field is resolved twice with an error.
4589         
4590         * codegen.cs: Changed InFieldInitializer to be flag.
4591         
4592         * anonymous.cs, ecore.cs, expression.cs: Update after
4593         IsInFieldInitializer rename.
4594         
4595         * const.cs: Removed unused parameter.
4596         
4597         * class.cs: Changed the way how we resolve and emit field initializers.
4598         The field initilizers have to have access to contructor block to emit
4599         compiler generated code.
4600
4601 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4602
4603         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4604         generics use TypeContainer instead.
4605         
4606 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4607         
4608         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4609
4610         * lambda.cs (ResolveParameters): Use more powerful
4611         InflateGenericArgument.
4612         
4613         * parameters.cs: Better exception message.
4614                 
4615 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4616
4617         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4618         correct expression block type. 
4619         
4620         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4621         
4622         * expression.cs (Invocation): Extracted method group resolve to
4623         DoResolveOverload.
4624         
4625 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4626
4627         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4628         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4629         
4630         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4631         generic extension methods.
4632
4633 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4634
4635         A fix for bug #82676 (Do I get it right now?)
4636         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4637         object before a standard conversion is applied.
4638         
4639 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4640
4641         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4642         #82676.
4643         
4644 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4645
4646         A fix for bug #82676
4647         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4648         non-generic interface types.
4649         
4650 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4651
4652         A fix for bug #82690
4653         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4654         
4655 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4656
4657         A fix for bug #82571
4658         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4659         modifier for container based methods.
4660         
4661 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4662
4663         A fix for bug #82676
4664         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4665         any interface-type T means to any of interface type T.
4666
4667 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4668
4669         * namespace.cs: We have 2 versions of System.Core assembly.
4670
4671 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4672
4673         A fix for bug #82652
4674         * class.cs (Class.GetClassBases): Compare types and not expressions.
4675
4676 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4677
4678         A fix for bug #82620
4679         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4680         actually never worked before.
4681         (IndexerAccess): Emit prepared arguments before they are modified.
4682         
4683 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4684
4685         A fix for bug #82563
4686         * assign.cs: Revert wrong fix.
4687         
4688         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4689         correctly.
4690         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4691         Instead of ldelema/stdind we have to use temporary variables to handle
4692         cases like String.Concat (params string[]).
4693         
4694 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4695
4696         * class.cs: EmitAttributes to Emit rename.
4697         
4698         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4699         null.
4700         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4701         GetClsCompliantAttributeValue execution.
4702         
4703 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4704
4705         * anonymous.cs: Use shorter type prefix.
4706         
4707         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4708         when exist.
4709         
4710         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4711         variables when probing is on.
4712         
4713         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4714         unresolved variables.
4715         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4716         handle transparent identifiers.
4717         
4718 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4719
4720         * attribute.cs (IsClsCompliant): Add nullable types test.
4721         
4722 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4723
4724         * doc.cs : catch other types of exception than XmlException to
4725           report CS1570. Fixed bug #82565.
4726
4727 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4728
4729         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4730         The number of delegate parameters has to match.
4731         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4732         arrays.
4733
4734 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4735
4736         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4737         to fix problem with private arguments.
4738
4739 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4740
4741         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4742         
4743         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4744         
4745         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4746         empty. Add cloning suport.
4747         
4748         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4749
4750 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4751
4752         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4753         to create EmptyCast. It handles EmptyConstantCast specialization for
4754         constants.
4755         
4756 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4757
4758         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4759         (EmitArrayArgument): One routine for array arguments.
4760         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4761         
4762 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4763
4764         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4765
4766 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4767
4768         * anonymous.cs: MemberLookupFinal update.
4769
4770         * class.cs (ConstructorInitializer): Is expression based.
4771         
4772         * delegate.cs: MethodGroupExpr update.
4773         
4774         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4775         messages.
4776         (Error_MemberLookupFailed): Customizable error override.
4777         (MethodGroupExpr): Keep queried type for later usage.
4778         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4779         resolve.
4780         
4781         * expression.cs: Error_MemberLookupFailed refactoring.
4782         (New.DoResolve): Resolve as much as possible.
4783         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4784         customization for invalid member types.
4785
4786         * statement.cs: MethodGroupExpr update.
4787         
4788 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4789
4790         * modifier.cs (Check): Check all modifiers and not only accessibility
4791         ones.
4792
4793 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4794
4795         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4796         type and not an expression.
4797
4798 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4799
4800         * statement.cs (Catch.Clone): Type and variable can be null.
4801
4802 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4803
4804         A fix for bug #81979
4805         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4806         I am really not sure whether this is the best fix.
4807         
4808         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4809         only once.
4810         
4811 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4812
4813         ** C# 3.0 Object and collection initializers (major re-write)
4814         
4815         * assign.cs (DoResolve): Initializers are not assign related.
4816         
4817         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4818         used during collection or object initialization.
4819         
4820         * expression.cs (Error_InvalidArguments): Add initializers specific
4821         messages. More will come later because it requires some general
4822         refactoring.
4823         (New.DoResolve): Better error handling for unsafe types.
4824         (EmptyExpressionStatement): New class.
4825         (ElementInitializer): An object initializer expression.
4826         (CollectionElementInitializer): A collection initializer expression.
4827         (CollectionOrObjectInitializers): A block of object or collection
4828         initializers.
4829         (NewInitialize): New expression with element/object initializers.
4830         
4831         * statement.cs: Reverted object/collection initializer hacks.
4832         
4833         * typemanager.cs (CSharpName): Filter __arglist type.
4834         
4835 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4836
4837         ** C# 3.0 Anonymous Types (update to the latest standard)
4838         
4839         * expression.cs (Binary.ResolveOperator): Threat all null based types
4840         same.
4841         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4842         (AnonymousTypeParameter): Updated.
4843         
4844         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4845         (AnonymousTypeClass): New anonymous type container.
4846         
4847         * class.cs (AddField): Return operation result.
4848         
4849         * generic.cs: Another empty TypeArguments overload.
4850         
4851         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4852         are stored at top of normal hierarchy.
4853         
4854         * typemanager.cs (CSharpName): Filter anonymous types.
4855         
4856 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4857
4858         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4859         as single Concat call. How could we miss that :-(
4860         
4861 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4862
4863         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4864         
4865 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4866
4867         * expression.cs: Fix the previous commit, the creation of the
4868         arguments array list needs also to be conditional on the arguments
4869         not being null.
4870
4871         * class.cs: Add a little bit of help to help narrow down problems.
4872
4873         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4874         not try to copy in that case. 
4875
4876         * driver.cs: When building SMCS, include a new different set of
4877         default assemblies here.   Do this here so we can control whether
4878         to include the default assemblies with /noconfig.
4879
4880 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4881
4882         A fix for bug #81979
4883         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4884         only.
4885
4886 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4887
4888         A fix for bug #82300
4889
4890         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
4891         we are in probing scope.
4892
4893 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4894
4895         A fix for bug #82301
4896
4897         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
4898         (Statement.CloneTo): Clone and not map children blocks.
4899
4900 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4901
4902         A fix for bug #82299
4903
4904         * expression.cs (LocalVariableReference.CloneTo): Remap local info
4905         variable too.
4906         
4907         * statement.cs (Statement.CloneTo): Clone variables before statements
4908         to allow remaping of local variables.
4909
4910 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4911
4912         A fix for bug #82296
4913
4914         * anonymous.cs,
4915         * report.cs: Log crash details for future clone problems.
4916         
4917         * statement.cs (Return.Clone): Don't clone non-existent expression.
4918
4919 2007-08-03  Raja R Harinath  <harinath@gmail.com>
4920
4921         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
4922         (Class.AddBasesForPart): Move CS0537 check here from ...
4923         * cs-parser.jay (class_declaration): ... here.  Move calling of
4924         'AddBasesForPart' to ...
4925         (class_bases): ... here.
4926         (struct_declaration, interface_declaration): Update to changes.
4927
4928 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4929
4930         A fix for bug #81923
4931
4932         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
4933         conversion is allowed.
4934
4935 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4936
4937         A fix for bug #81564
4938
4939         * ecore.cs (EventExpr): Add IsBase handling.
4940
4941         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
4942         too.    
4943         
4944 2007-08-02  Raja R Harinath  <harinath@gmail.com>
4945
4946         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
4947         * cs-parser.jay: Some whitespace cleanups.
4948         (current_delegate): New.
4949         (type_name): New.
4950         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
4951         a dummy code block, and use 'type_name' instead of 'member_name'.
4952         (interface_declaration, class_declaration): Likewise.
4953         (delegate_declaration): Likewise.  Rearrange slightly and use
4954         'current_delegate'.
4955         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
4956         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
4957
4958 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4959
4960         A fix for bug #82039
4961
4962         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
4963         available.
4964
4965         * typemanager.cs (CSharpName): Split to string overload.
4966
4967 2007-08-02  Marek Safar  <marek.safar@gmail.com>
4968
4969         * expression.cs,
4970         * report.cs: Updated warning CS0472.
4971
4972 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4973
4974         A fix for bug #82181
4975         * cs-parser.jay,
4976         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
4977
4978 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4979
4980         A fix for bug #82277
4981         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
4982
4983 2007-08-01  Marek Safar  <marek.safar@gmail.com>
4984
4985         ** C# 3.0 Type Inference (major bits are working)
4986         
4987         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
4988         (.ImplicitStandardConversionExists): Uses compatible.
4989         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
4990         (.InferReturnType): New method.
4991         (.Compatible): Refactored.
4992         (.ResolveParameters): Uses factory to create resolved parameters.
4993         (.CompatibleMethod): Add probing mode support.
4994         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
4995         clearly distinguish between 2 different operations.
4996         (LambdaMethod): Moved to lambda.cs.
4997         (AnonymousMethod): Removed unused fields and methods.
4998         (AnonymousDelegate): Simplified.
4999         
5000         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5001         
5002         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5003         
5004         * delegate.cs (Delegate): New mehods to reduce code duplication.
5005         (.GetConstructor): New method.
5006         (.GetInvokeMethod): New method.
5007         (DelegateCreation): Updated.
5008         
5009         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5010         does not exist.
5011         (OverloadResolve): Made probing little bit faster.
5012         
5013         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5014         when probing is on.
5015         
5016         * generic.cs (TypeInferenceContext): Dummy implementation.
5017         
5018         * iterators.cs: Updated after Resolve/Define rename.
5019         
5020         * lambda.cs (LambdaExpression)
5021         (.ResolveParameters): Handles both type of arguments and type inference too.
5022         
5023         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5024         (InflateTypes): Updated.
5025         
5026         * support.cs (InflateTypes): Changed signature and updated.
5027         
5028         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5029         (MemberLookup_FindMembers): More MS tricks.
5030         (GetParameterData): Ditto.
5031         (GetDelegateParameters): Uses quick path for dynamic types.
5032         
5033 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5034
5035         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5036         only.
5037
5038 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5039
5040         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5041         syntax.
5042         
5043 2007-07-26  Jb Evain  <jbevain@novell.com>
5044
5045         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5046         which takes a boolean 'report_errors', similar to the GetMethod.
5047         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5048         in .net 2.1, do not report errors here.
5049
5050         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5051         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5052         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5053         in .net 2.1.
5054
5055         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5056         of the type InternalsVisibleToAttribute before the first call
5057         to CoreLookupType which is allowed to fail (third boolean parameter
5058         to true). Because, during the resolution for a type that is not
5059         immediately found, we try to check if the type is not defined in
5060         a friend assembly, and to do so, we need the
5061         InternalVisibleToAttribute.
5062
5063 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5064
5065         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5066         feature that allows structs to be compared against null and inline
5067         the result as true or false.
5068
5069         Notice that the same code is not permitted inside a generic block
5070         of code that would do:
5071
5072         class Foo<T> where T : struct {
5073             bool Eval (T x)
5074             {
5075                  return x == null;
5076             }
5077         }
5078
5079         It is only allowed if the type of T is not bound (no where
5080         clause).   In my opinion, this CSC 2 behavior is broken but people
5081         seem to be using it (IronRuby does, a few bug reports on bugzilla
5082         have it and some people have complained about it).
5083
5084         All of the users that depend on this behavior have code that is
5085         very likely broken. 
5086         
5087         * report.cs (Warning, Error): make these take object arguments,
5088         not strings, as that allows us to take advantage of Format.
5089
5090 2007-07-20  William Holmes  <billholmes54@gmail.com>
5091
5092         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5093           Left member variable for the Count.
5094         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5095           MemberName.CountTypeArguments to avoid a NRE. 
5096
5097         This code is contributed under the MIT X11 license
5098
5099 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5100
5101         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5102
5103 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5104
5105         * doc.cs : generic method arguments are written as ``x while generic
5106           type arguments are `x. Combined with the previous change, fixed bug
5107           #79706.
5108
5109 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5110
5111         Fix #82120
5112         * expression.cs (Binary.ResolveOperator): When converting
5113         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5114
5115 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5116
5117         * doc.cs : when T: or whatever x: is specified, it does not really
5118           check the doc comment's syntax correctness. Fixed bug #82006.
5119
5120 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5121
5122         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5123         LambdaExpression better.
5124         
5125         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5126         
5127         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5128         
5129         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5130         as it can be generated.
5131         
5132         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5133         modifiers.
5134         
5135         * lambda.cs (LambdaExpression): Refactored to share same code with
5136         AnonymousMethodExpression.
5137         
5138 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5139
5140         * anonymous.cs (MakeName): Include host name for easier debugging.
5141         (LambdaMethod): New class for lambda spcecific stuff.
5142         
5143         * attribute.cs: Set EmitContext return type.
5144
5145         * class.cs: Set EmitContext return type.
5146         
5147         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5148         with null/void meaning.
5149         
5150         * iterators.cs (ContainerType): Implemented.
5151         
5152         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5153         
5154         * statement.cs (Return): Updated to lambda expressions.
5155         (Block.CloneTo): Parent can be null.
5156                 
5157 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5158
5159         A fix for bug #81917
5160         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5161         
5162         * class.cs (FixedField): Check whether field is in unsafe scope.
5163
5164         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5165         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5166
5167         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5168         FieldExpr.
5169         
5170         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5171                 
5172 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5173
5174         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5175         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5176         from Report class.
5177
5178 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5179
5180         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5181         
5182 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5183
5184         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5185         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5186         
5187         * codegen.cs(EmitContext): Add ProbingMode flag.
5188         
5189         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5190         
5191         * driver.cs: For now set both warning values.
5192         
5193         * ecore.cs (SimpleName): Name is readonly.
5194         (MethodGroup.OverloadResolve): One quick path for probing.
5195         
5196         * expression.cs (Unary): Set Oper r/o.
5197         (Binary): Set Oper r/o.
5198         (ParameterReference): Set few instance variables as r/o.
5199         (ParameterReference.DoResolveBase): Don't capture aruments when 
5200         the probing is on.
5201         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5202         (Arglist): arguments are private.
5203         (SizeOf): type is private and r/o.
5204         (MemberAccess): arguments are private.
5205
5206         * report.cs: Enhanced reporting on/off capabilities.
5207         
5208         * lambda.cs: Uses ec.IsInProbingMode.
5209         (ContextualReturn): Derives from return.
5210         
5211         * rootcontext.cs: For now set both warning values.
5212         
5213         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5214         copy if one exists.
5215         (Return.Resolve): Don't die immediately.
5216         (Block.Resolve): Speed-up probing.
5217         (Block.CloneTo): Clone only child blocks.
5218
5219 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5220
5221         * iterators.cs: reverted Miguel's latest change (r81925) as it
5222         breaks the build in System.
5223
5224 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5225
5226         * iterators.cs (Yield.CheckContext): Check for the iterator type
5227         also here as we can call into Yield even in codepaths that are not
5228         directly checked by
5229         (MethodOrOperator is the only path that was checked).
5230
5231         In addition to the standard check, use a more specific check for
5232         constructors to report a more verbose error. 
5233
5234 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5235
5236         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5237         report the warning and continue 
5238
5239         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5240         values on the stack on the call to Emit.   Use EmitStatement if
5241         possible, or using Emit + Pop if not possible.   Fixes #82064
5242
5243 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5244
5245         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5246         avoid try...finally in some cases.
5247
5248 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5249
5250         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5251         
5252         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5253         instead of method. Re-use standard error handling.
5254         (ConstructorInitializer.Emit): Simplified.
5255         
5256         * delegate.cs: Updated after Invocation.EmitCall change.
5257         
5258         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5259         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5260         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5261         method and don't permanently changing input arguments.
5262         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5263         is resolved it has one of the candidates is the best one which is later
5264         used to emit. Removed a few unused method.
5265         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5266
5267         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5268         (Binary.ResolveOperator): Ditto.
5269         (ConditionalLogicalOperator.DoResolve): Ditto.
5270         (Invocation): Uses method group.
5271         (Invocation.DoResolve): Simplified.
5272         (Invocation.EmitCall): Removed useless is_static.
5273         (Invocation.Emit): Delegate to method group.
5274         (Invocation.EmitStatement): Simplified.
5275         (New): Uses method group.
5276         (MemberAccess.DoResolve): Don't destroy original expression.
5277         
5278         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5279         
5280 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5281
5282         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5283         
5284         * anonymous.cs,
5285         * lambda.cs: Add custom error message type.
5286
5287 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5288
5289         * lambda.cs: Simplified little bit.
5290         
5291         * parameter.cs: Introduced ImplicitLambdaParameter.
5292         (Parameters.CreateFullyResolved): New factory instead of ctor.
5293         
5294         * anonymous.cs,
5295         * class.cs,
5296         * delegate.cs: Updated parameter creation.
5297         
5298 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5299
5300         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5301         arguments.
5302         
5303         * generic.cs: Synchronized with gmcs.
5304         
5305 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5306
5307         * class.cs (Indexer): Check return type as soon as possible.
5308         
5309         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5310         members too.
5311         
5312         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5313         
5314         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5315         
5316         * parameter.cs (Parameter): Use expression type when it is available.
5317         
5318         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5319         method modifier for the first parameter only.
5320
5321 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5322
5323         A fix for bug #81938
5324         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5325         
5326         * constant.cs: Tide up an exception message.
5327
5328 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5329
5330         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5331         an uninitialized variable is used.
5332         
5333         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5334
5335 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5336
5337         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5338         not found error handling.
5339
5340         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5341         simplified.
5342         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5343         (ArrayCreation.DoResolve): Simplified.
5344         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5345         its own resolve process.
5346         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5347
5348 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5349
5350         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5351         more error details.
5352         
5353 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5354
5355         * cs-tokenizer.cs: Removed var related stuff.
5356         
5357         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5358         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5359         a type and a keyword at same time.
5360         
5361         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5362         matches to "var".
5363         
5364         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5365         implicitly typed arrays, more changes will follow.
5366         
5367         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5368         
5369 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5370
5371         * ecore.cs (VarExpr): Removed Handled field.
5372         
5373         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5374         build-in assign functionality.
5375         (ForEach.Resolve): Removed all implicitly typed local variable code and
5376         simplified.
5377         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5378         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5379
5380 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5381
5382         * assign.cs: Removed implicitly typed local variable check.
5383         
5384         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5385         referencing implicitly typed local variable.
5386         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5387         variable here.
5388         
5389         * statement.cs (Fixed): Removed unsupported implicitly typed local
5390         variable code.
5391
5392 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5393
5394         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5395
5396 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5397
5398         A fix for bugs #81855 and #76274
5399         * attribute.cs (AttachTo): Always set owner for global attributes to
5400         prefined owner.
5401         
5402         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5403         usefull too.
5404         
5405         * cs-parser.jay: Assembly and module attributes must precede all other
5406         elements except using clauses and extern alias declarations.
5407
5408 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5409
5410         A fix for bug #81748
5411         * cs-tokenizer.cs,
5412         * expression.cs: More checks for non ISO-1 features.
5413
5414 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5415
5416         A fix for bug #81807
5417         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5418         present inside switch statement and it is required by nullable check.
5419
5420 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5421
5422         A fix for bug #81840
5423         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5424         when type matching fails.
5425         
5426         * namespace.cs: Tiny error message change.
5427
5428 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5429
5430         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5431         reporting. Added automatic property check.
5432         
5433         * class.cs: Updated after CheckAbstractAndExtern relocation.
5434         (AEventPropertyAccessor.GetSignatureForError): Customized.
5435         
5436 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5437
5438         * class.cs (DefineBaseTypes): Base type can be undefined.
5439         
5440         * ecore.cs (TypeLookup): Minor refactoring.
5441         (DoResolveAsTypeStep): Removed redundant check.
5442
5443         * namespace.cs (Lookup): Removed redundant check.
5444                 
5445         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5446         ResolveAsTypeTerminal step.
5447         (BootstrapCorlib_*): Simplified.
5448         (PopulateCoreType): Core types can be now external.
5449
5450 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5451
5452         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5453          verification only.
5454          (InferTypeArguments): Infers anonymous expression type arguments.
5455          (Compatible): Split to Compatible and InferTypeArguments. 
5456         
5457         * lambda.cs: Updated.
5458
5459 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5460
5461         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5462
5463 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5464
5465         Fix #80477, cs0135-2.cs, cs0135-3.cs
5466         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5467         names to the "known" variables list.
5468         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5469         parameter names are also "known".
5470         (Block.CheckError136): Remove.
5471         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5472         null.
5473
5474 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5475
5476         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5477
5478 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5479
5480         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5481         internal error not an user error.
5482          
5483         * expression.cs (IsApplicable): Refactored to make debugging easier.
5484
5485         * support.cs: More tricks for non-mono runtimes.
5486         
5487         * typemanager.cs (CoreLookupType): Made public.
5488         (InitSystemCore): All linq specific stuff moved to linq.cs
5489
5490 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5491
5492         * typemanager.cs (CSharpSignature): One more missing build-in types
5493         replacement.
5494         More tricks for non-mono runtime.
5495
5496 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5497
5498         * statement.cs (Block.CheckError136_InParents): Remove.
5499         (Block.AddVariable): Use GetParameterInfo instead.
5500         (ToplevelBlock.ProcessArguments): Likewise.
5501
5502 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5503
5504         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5505         information too.
5506         (ToplevelBlock.GetParameterInfo): Split out of ...
5507         (ToplevelBlock.GetParameterRefernce): ... this.
5508         (ToplevelBlock.ParameterMap): Remove.
5509         * expression.cs (ParameterReference): Update to use
5510         ToplevelParameterInfo.
5511
5512         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5513         regression.
5514
5515         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5516         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5517
5518         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5519         (ToplevelBlock.ProcessParameters) ... here.
5520         (ToplevelBlock..ctor): Invoke it.
5521
5522         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5523         new parameters.
5524
5525         * statement.cs (IKnownVariable): New interface.
5526         (LocalInfo): Implement it.
5527         (ToplevelParameterInfo): New class.
5528         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5529         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5530         GetKnownVariableInfo.
5531
5532 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5533
5534         Partly speed up CS0136 error checks.
5535         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5536         'recurse' parameter.
5537         (Block.DoCheckError136): Only check errors in parameters.  Move
5538         local variable checks ...
5539         (Block.AddVariable): ... here, and ...
5540         (ToplevelBlock.ResolveMeta): ... here.
5541
5542 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5543
5544         * statement.cs (Block.IsChildOf): Remove.
5545
5546         * statement.cs (Statement.Clone): Move special case code ...
5547         (Block.CloneTo): ... here.
5548
5549 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5550
5551         * statement.cs (ToplevelBlock.container): Remove field.  It's
5552         redundant with 'Parent'.
5553         (ToplevelBlock.ContainerBlock): Remove accessor.
5554         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5555         child with parent here, ...
5556         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5557         current_block.
5558         (start_anonymous): Don't save current_block.
5559         (top_current_block): Remove.
5560
5561         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5562         (Block.Resolve): Update to changes.
5563         (Block..ctor): Move setting of "correct" 'Toplevel'
5564         and 'Explicit' fields to ...
5565         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5566
5567 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5568
5569         Kill Block.Implicit
5570         * statement.cs (Block.Implicit): Remove.
5571         (Block): Update to changes.
5572         * flowanalysis.cs: Likewise.
5573
5574         Mildly speed up CheckInvariantMeaningInBlock
5575         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5576         Recursively call AddKnownVariable to all enclosing blocks.
5577         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5578         Remove recursive calls.
5579         (Block): Update to changes.
5580
5581         New ExplicitBlock invariants
5582         * statement.cs (Block.Explicit): New field.  It points to the
5583         immediately enclosing non-implicit block.
5584         (Block..ctor): Maintain the invariant.
5585         * cs-parser.jay: Take advantage of invariant.
5586
5587         Introduce ExplicitBlock
5588         * statement.cs (ExplicitBlock): New.
5589         (ToplevelBlock): Derive from it.
5590         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5591         sense of flag.
5592         (Block.Implicit): Update to changes.
5593         * cs-parser.jay: Update to changes.
5594
5595         Remove unused field
5596         * codegen.cs (EmitContext.IsLastStatement): Remove.
5597         * statement.cs (Block.DoEmit): Update to changes.
5598
5599 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5600
5601         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5602         modifying current_block directly.
5603
5604 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5605         
5606         * class.cs: Implemented automatic properties (C# 3.0)
5607           Thanks to Marek for the help.
5608
5609 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5610
5611         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5612         variable as assigned, note also that all its components are
5613         assigned too.
5614         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5615
5616 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5617
5618         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5619         member is marked as compiler generated.
5620         
5621         * decl.cs (MemberCore): Refactored ModFlags into property.
5622
5623         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5624         (Check): Check only accessibility modifiers.
5625
5626 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5627
5628         Track all assignable slots in one bit array
5629         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5630         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5631         logic from VariableMap constructor here.  Use the same 'offset'
5632         variable that's later used for computing offsets of local
5633         variables.
5634         * flowanalysis.cs (UsageVector.parameters): Remove.
5635         (UsageVector): Update to changes.
5636         (VariableMap): Remove.
5637
5638         Avoid creating ParameterMap in every block
5639         * statement.cs (Block.ParameterMap): Move ...
5640         (ToplevelBlock.ParameterMap): ... here.
5641         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5642         only once.
5643         * flowanalysis.cs (FlowBranching.param_map): Remove.
5644         (FlowBranching.UsageVector): Update to changes.
5645         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5646
5647         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5648
5649         * expression.cs (ParameterReference): Distinguish between block
5650         where parameter was referenced and declared.
5651
5652 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5653
5654         * flowanalysis.cs, statement.cs: Put back improved error handling.
5655
5656 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5657         
5658         * assign.cs:
5659         * expression.cs:
5660           Imporved object and collection initialization (C# 3.0).
5661
5662 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5663
5664         A fix for bug #81380
5665         * expression.cs (Is.DoResolve): Only value types have constant `is'
5666         behaviour.
5667
5668 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5669
5670         * statement.cs (ToplevelBlock.child): Remove.
5671
5672 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5673
5674         Rationalize ResolveMeta: refactoring
5675         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5676         out constant handling code into ...
5677         (Block.DoResolveConstants): ... this.
5678
5679         Rationalize ResolveMeta: kill local_map
5680         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5681         (Block.AssignableSlots): New.
5682         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5683         for locals -- move code from VariableMap here.  Avoid unnecessary
5684         allocations.
5685         * flowanalysis.cs (FlowBranching.local_map): Remove.
5686         (FlowBranching..ctor): Use Block.AssignableSlots.
5687         (VariableMap): Remove unused constructors.
5688
5689 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5690
5691         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5692
5693 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5694
5695         * typemanager.cs (IsFriendAssembly): Should not be called for building
5696         assembly.
5697
5698 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5699
5700         * literal.cs (NullConstant): Print null in all cases.
5701         
5702         * expression.cs (Binary.ResolveOperator): Implemented delegate
5703          comparison based on C# 2.0 changes.
5704
5705 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5706
5707         This code is contributed under the MIT X11 license
5708         
5709         The following enables support for several C# 3.0 language features:
5710         
5711         * cs-tokenizer.cs: Added support for the "var" keyword.
5712         
5713         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5714           Added VarExpr class to facilitate type inferencing.
5715         
5716         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5717           to support anonymous types.
5718         
5719         * assign.cs: Added support for type inferencing and initialization.
5720         
5721         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5722         
5723         * expression.cs: Added implicit array support to ArrayCreation.
5724           Added 5 types and 1 interface:
5725           
5726           IInitializable                Implementing classes can inject initializing
5727                                         statements after object instantiation.
5728           
5729           Initializer                   Stores data for object initialization.
5730           
5731           AnonymousType                 An expression for anonymous types.
5732           
5733           AnonymousTypeParameter        Stores data about an anonymous type's field.
5734           
5735           NewInitialize                 An expression for object initialization.
5736           
5737           CollectionInitialize          An expression for collection initialization.
5738         
5739         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5740           statements.
5741
5742 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5743
5744         A fix for bug #81500
5745         * cs-tokenizer.cs: Add special handling for coalescing operator.
5746
5747 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5748
5749         A fix for bug #81529
5750         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5751         its value from base class until it is redefined.
5752
5753 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5754
5755         Fix regression in cs0631-3.cs
5756         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5757         fallback.  Make error fallback catch more cases.
5758
5759 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5760
5761         * cs-parser.jay: Allow parameters in operator declarations to have
5762         attributes. 
5763
5764 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5765
5766         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5767         exists. 
5768
5769         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5770         inside the ContextualReturn, it does not have to be an
5771         ExpressionStatement. 
5772
5773 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5774
5775         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5776         set, set it.
5777
5778 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5779
5780         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5781         method in two methods: ResolveNoDefine and Resolve.
5782
5783         ResolveNoDefine will stop just after ResolveTopBlock has been
5784         called.   
5785
5786         Resolve will then continue by creating a method and issuing the
5787         call to method.Define ().
5788
5789         (AnonymousMethod): Split and implement the new Resolve and
5790         ResolveNoDefine as well.
5791
5792         * lambda.cs (LambdaExpression): Split the anonymous method
5793         resolution code into a separate routine (CoreCompatibilityTest)
5794         from DoCompatibleTest.
5795
5796         (LambdaExpression.TryBuild): New method, this method tries to
5797         build the LambdaExpression with the given set of types to be used
5798         as the types for the various parameters of the lambda expression. 
5799
5800         If the compilation succeed with the given types, the infered type
5801         of the Anonymous method is returned, otherwise null is returned.
5802
5803 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5804
5805         A fix for bug #81414
5806         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5807
5808 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5809
5810         * cs-tokenizer.cs: Change various identifiers here from the
5811         camelCasing to the recommended Linux-like style for instance
5812         variables from the Coding Guidelines. 
5813
5814 2007-04-19  Martin Baulig  <martin@ximian.com>
5815
5816         * convert.cs
5817         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5818         System.Enum to System.ValueType.
5819
5820 2007-04-13  Martin Baulig  <martin@ximian.com>
5821
5822         Rewrote implicit reference conversions.  We need to distinguish
5823         between implicit reference conversions (13.1.4) and implicit
5824         boxing conversions (13.1.5).
5825
5826         According to the spec, there's an an implicit conversion
5827         "From a one-dimensional array-type S[] to IList<T> and base
5828         interfaces of this interface, provided there is an implicit
5829         reference conversion from S to T."  Note that this does not
5830         include boxing conversions.
5831
5832         * convert.cs
5833         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5834         (Convert.ImplicitReferenceConversion): Split into
5835         ImplicitReferenceConversionCore() and
5836         ImplicitBoxingConversionExist().
5837         (Convert.ImplicitReferenceConversionExists): Use the new
5838         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5839
5840 2007-04-12  Martin Baulig  <martin@ximian.com>
5841
5842         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5843         `TypeManager.null_type' checks up to the top of the method.
5844
5845 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5846
5847         A fix for bug #81350
5848         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5849         extension methods.
5850
5851 2007-04-11  Martin Baulig  <martin@ximian.com>
5852
5853         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5854         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5855         to make this work for generic classes; fixes #79561.
5856
5857 2007-04-11  Martin Baulig  <martin@ximian.com>
5858
5859         * expression.cs (As): Add support for nullable types; fixes #79371.
5860
5861 2007-04-11  Martin Baulig  <martin@ximian.com>
5862
5863         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5864         `type.FullName' is null; fixes #80243.
5865
5866 2007-04-11  Martin Baulig  <martin@ximian.com>
5867
5868         * expression.cs (Invocation.IsApplicable): Don't modify the method
5869         if type inference succeeded, but the method was not applicable.
5870         Fixes #81250.
5871
5872 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5873
5874         A fix for bug #81324
5875         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5876         internal and external namespaces containers.
5877
5878 2007-04-10  Martin Baulig  <martin@ximian.com>
5879
5880         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5881         TypeManager.DropGenericMethodArguments() so we also call
5882         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5883
5884 2007-04-10  Martin Baulig  <martin@ximian.com>
5885
5886         * iterators.cs (Iterator.CreateIterator): Don't crash if
5887         `method.ReturnType' is null.  This happens if something went wrong
5888         while resolving that typ (we already reported an error in this case).
5889
5890 2007-04-10  Martin Baulig  <martin@ximian.com>
5891
5892         * expression.cs (New.DoResolve): Don't call CheckComImport() on
5893         generic interfaces; report the CS0144 directly.
5894
5895 2007-04-10  Martin Baulig  <martin@ximian.com>
5896
5897         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
5898         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
5899
5900 2007-04-10  Martin Baulig  <martin@ximian.com>
5901
5902         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
5903
5904 2007-04-09  Raja R Harinath  <rharinath@novell.com>
5905
5906         A better fix
5907         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
5908         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
5909
5910         Fix #81338
5911         * statement.cs (For.Resolve): If resolution fails, use
5912         KillFlowBranching.
5913
5914 2007-04-08  Marek Safar  <marek.safar@gmail.com>
5915
5916         * anonymous.cs (MakeName): Make faster and zero-based.
5917         (VerifyExplicitParameterCompatibility): Back to mode where generic
5918         parameter is ignored.
5919         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
5920
5921         * class.cs (EmitType): Method can emit another new method.
5922
5923         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
5924
5925         * driver.cs: Updated.
5926
5927         * lambda.cs: Reuse predefined empty parameters.
5928
5929         * parameter.cs: Updated
5930
5931         * support.cs: Implemented InflateTypes.
5932
5933         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
5934         (InitSystemCore): Introduced to isolate 3.0 dependencies.
5935
5936 2007-04-03  Martin Baulig  <martin@ximian.com>
5937
5938         Fix #80632.
5939
5940         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
5941         version of TypeManager.IsOverride() which also works with generic
5942         types.  
5943
5944 2007-04-03  Martin Baulig  <martin@ximian.com>
5945
5946         Fix #81044.
5947
5948         * convert.cs
5949         (Convert.ExplicitReferenceConversion): We need to cast when
5950         converting from IList<T> to S[].
5951
5952 2007-04-01  Marek Safar  <marek.safar@gmail.com>
5953
5954         * decl.cs (FindExtensionMethods): Consider all candidates with same name
5955         at this level.
5956         
5957         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
5958
5959 2007-03-31  Marek Safar  <marek.safar@gmail.com>
5960
5961         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
5962         argument and return type inferring.
5963
5964         * codegen.cs (InferReturnType): Flag whether return can be inferred.
5965         (ReturnType): Turned to property.
5966
5967         * statement.cs (Return): Implemented return type inferring.
5968
5969         * support.cs (ReflectionParameters): Use local types if possible.
5970
5971 2007-03-30  Raja R Harinath  <rharinath@novell.com>
5972
5973         * flowanalysis.cs (FlowBranching.Reachability): Remove.
5974         (FlowBranching.UsageVector): Update to changes.
5975
5976         Prepare to kill 'Reachability'
5977         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
5978         argument of constructor.
5979
5980 2007-03-29  Raja R Harinath  <rharinath@novell.com>
5981
5982         Prepare to kill 'Reachability'
5983         * flowanalysis.cs (UsageVector.is_unreachable): New.
5984         (UsageVector): Update to maintain 'is_unreachable' in parallel to
5985         'reachability', and verify they're consistent.
5986
5987         Fix #81121
5988         * expression.cs (New.EmitStatement): Handle type parameters here too.
5989
5990 2007-03-29  Martin Baulig  <martin@ximian.com>
5991
5992         Fix #79148.
5993
5994         * anonymous.cs
5995         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
5996         CompilerGeneratedClass.
5997         (ScopeInfo.EmitScopeInstance): Make this protected.
5998         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
5999         `ec.CurrentAnonymousMethod.Scope == Scope'.
6000
6001         * statement.cs (Block.ScopeInfo): Make this a property.
6002
6003 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6004
6005         Prepare to kill 'Reachability'
6006         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6007         (FlowBranching.UsageVector.Reachability): Remove property.
6008         (FlowBranching.UsageVector.IsUnreachable): New property.
6009         (FlowBranching.UsageVector.ResetBarrier): New.
6010         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6011         * codegen.cs, statement.cs: Update to changes.
6012
6013 2007-03-27  Martin Baulig  <martin@ximian.com>
6014
6015         Fix #81209.
6016
6017         * decl.cs
6018         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6019         generic types.
6020
6021 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6022
6023         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6024         instead of TriState.  Remove all mention of TriState.
6025
6026         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6027         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6028         and maintain invariants.
6029
6030 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6031
6032         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6033
6034 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6035
6036         * expression.cs: Stop using obsolete 2.0 opcodes.
6037
6038 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6039
6040         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6041         one of the latests Martin's fixes.
6042
6043 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6044
6045         * expression.cs: On BigEndian systems, swap the bytes, temporary
6046         solution until we get a new bitconverter class.
6047
6048 2007-03-23  Martin Baulig  <martin@ximian.com>
6049
6050         Fix #81158.
6051
6052         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6053         "Method" and "Method`1".  Normally, a cache lookup is done on the
6054         "Method" form (ie. without the generic arity), but this one makes
6055         lookups on the full form work as well.
6056
6057 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6058
6059         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6060         unused properties.
6061
6062 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6063         * class.cs: 
6064         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6065         ordered_member_list, to TypeBuilder to store members to be defined
6066         in the order they were parsed in.
6067         - ordered_explicit_member_list contains all properties indexers
6068           and methods that are defined as explicit implementation of an
6069           interface or base class.
6070         - ordered_member_list contains all properties indexers and methods
6071           that are not defined as explicit implementation of an interface
6072           or base class.
6073
6074         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6075         functionality in these removed classes has been replaced with 
6076         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6077         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6078
6079         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6080         to CheckForDuplications inside GetMethod and SetMethod Define Method
6081         to handle method property and indexer name conflicts.
6082
6083         Fixes #79434
6084
6085         All code is contributed under the MIT/X11 license.
6086
6087 2007-03-20  Martin Baulig  <martin@ximian.com>
6088
6089         * class.cs (TypeContainer.Interfaces): Removed; they're now
6090         included in `TypeContainer.Types'.
6091
6092 2007-03-20  Martin Baulig  <martin@ximian.com>
6093
6094         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6095
6096         * class.cs (TypeContainer.CreateType): New public method.  This is
6097         now called before DefineType() to create the TypeBuilders.
6098         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6099         has already been created by CreateType().
6100         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6101         don't resolve our base classes here; this has been moved into
6102         DefineBaseTypes().  We're now called from CreateType().
6103         (TypeContainer.DefineBaseTypes): New private method; resolve our
6104         base classes here.  We're now called from DefineType().
6105
6106         * rootcontext.cs
6107         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6108         our types first to create all the TypeBuilders.  After that, call
6109         TypeContainer.DefineType() on all the types which'll resolve their
6110         base classes and setup the resolve order.
6111
6112 2007-03-20  Martin Baulig  <martin@ximian.com>
6113
6114         * class.cs (TypeContainer.Enums): Removed; they're now included in
6115         `TypeContainer.Types'.  
6116
6117 2007-03-20  Martin Baulig  <martin@ximian.com>
6118
6119         * class.cs
6120         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6121         (TypeContainer.DoResolveMembers): Call DefineType() on our
6122         `compiler_generated' classes; moved here from DefineNestedTypes().
6123
6124         * rootcontext.cs
6125         (RootContext.ResolveTree): Call ResolveMembers() on all
6126         TypeContainer's in the `type_container_resolve_order'.
6127
6128 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6129
6130         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6131
6132 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6133
6134         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6135         implementation flags.
6136
6137 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6138
6139         * class.cs: More optimizations for type parameters.
6140
6141 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6142
6143         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6144
6145         * ecore.cs, parameter.cs: More common code for both corlibs.
6146
6147         * typemanager.cs (IsGenericMethod): Simplified.
6148
6149 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6150
6151         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6152         'returns'.
6153         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6154
6155         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6156         unconditionally.  Simplify explanation.
6157         (Try.Resolve, Using.Resolve): Likewise.
6158
6159 2007-03-15  Martin Baulig  <martin@ximian.com>
6160
6161         Fix #80731.
6162
6163         * decl.cs (DeclSpace): If we're a partial class, use our
6164         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6165
6166 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6167
6168         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6169         'throws'.
6170         (FlowBranching.UsageVector): Update to changes.
6171         (FlowBranching.MergeSiblings): Likewise.
6172         * statement.cs: Likewise.
6173
6174 2007-03-15  Martin Baulig  <martin@ximian.com>
6175
6176         Fix #79302.
6177
6178         * decl.cs
6179         (MemberCache): Added a special .ctor for type parameters.
6180
6181         * typemanager.cs
6182         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6183         `MemberCache'.  
6184
6185 2007-03-09  Martin Baulig  <martin@ximian.com>
6186
6187         * enum.cs (Enum): Make this a TypeContainer.
6188         (EnumMember): Derive from `Const'.
6189
6190         * const.cs
6191         (Const.DoResolveValue): New protected virtual method; move most of
6192         the functionality of ResolveValue() here so we can override it in
6193         `EnumMember'.
6194         (Const.CreateConstantReference): Make this virtual.
6195
6196         * class.cs (Kind): Add `Kind.Enum'.
6197         (TypeContainer.Emit): Don't emit the enums here; they're already
6198         in the `RootContext.typecontainer_resolve_order'.
6199
6200         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6201         here; they're already in the `typecontainer_resolve_order'.
6202
6203         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6204         TypeManager.DropGenericTypeArguments().
6205
6206         * typemanager.cs
6207         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6208         (TypeManager.IsEnumType): Likewise.
6209         (TypeManager.EnumToUnderlying): Likewise.
6210         (TypeManager.IsEqual): Add support for enums.
6211
6212 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6213
6214         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6215         DefaultParameterValueAttribute to be undefined, say if System.dll
6216         is not referenced.
6217
6218 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6219
6220         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6221         any mscorlib.
6222
6223 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6224
6225         * class.cs, parameter.cs: Unified parameters verification.
6226
6227 2007-03-08  Martin Baulig  <martin@ximian.com>
6228
6229         * cs-parser.jay (constructor_header): Pass the location to the
6230         newly created TopLevelBlock.
6231
6232 2007-03-07  Martin Baulig  <martin@ximian.com>
6233
6234         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6235
6236 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6237
6238         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6239         with the changes from David, fixes the build.
6240
6241 2007-03-05  David Mitchell  <dmitchell@logos.com>
6242
6243         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6244         and its base interfaces to a one-dimensional array type S[],
6245         provided there is an implicit or explicit reference conversion
6246         from S to T.
6247
6248 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6249
6250         * cs-tokenizer.cs: Implemented basic linq grammar.
6251
6252         * driver.cs: Set linq lang version on demand.
6253
6254 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6255
6256         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6257
6258 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6259
6260         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6261         (Fixes #80455)
6262
6263         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6264         here.
6265         Check property and event extern attributes.
6266
6267         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6268         charset.
6269
6270 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6271
6272         A fix for bug #80407
6273         * ecore.cs: Don't report ambiguity error when methods have same parent.
6274
6275 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6276
6277         A fix for bug #80878
6278         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6279
6280 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6281
6282         * attribute.cs: Enable ExtensionAttribute presence test.
6283
6284 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6285
6286         * class.cs: Warn about missing GetHashCode only when Equals is override.
6287
6288         * decl.cs: Check accessibility of type arguments.
6289
6290         * typemanager.cs: Correctly report nullable array.
6291
6292 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6293
6294         * class.cs, report.cs: Capture more details when things go wrong.
6295
6296 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6297
6298         A fix for bug #80650
6299         * cs-parser.jay: Anonymous container starts at constructor declaration
6300         and not at block beginning because it has to be usable in constructor
6301         initializer.
6302
6303         * statement.cs: Use context location and not block one for error reporting.
6304
6305 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6306
6307         A fix for bug #78712
6308         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6309         too.
6310
6311 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6312
6313         A fix for bug #80493 by Atsushi Enomoto
6314         * cs-parser.jay: Ignore invalid attribute target.
6315
6316 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6317  
6318         * cs-tokenizer.cs: Ignore '\0' as white space character.
6319
6320 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6321
6322         * cs-parser.jay: Add support for lambda expressions to the mcs
6323         compiler as well.
6324
6325         * lambda.cs: Only clone when we are probing, not on the final call
6326         (Compatible is the final call). 
6327
6328         * statement.cs (CloneContext): Introduce class to provide block
6329         remapping during clone.
6330
6331         All statements Clone themselves now.
6332
6333         (Clone): special handling for blocks, when we clone a block, we
6334         register the block inside this routine, as children of the block
6335         might trigger a lookup. 
6336         
6337         * expression.cs: Add support for CloneContext in all expressions. 
6338         
6339 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6340  
6341         A fix for bug #80493
6342         * statement.cs: Report ambiguous warning when interfaces are not related.
6343
6344 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6345
6346         C# 3.0 extension methods.
6347
6348         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6349         cannot be used directly.
6350
6351         * class.cs (Class.Emit): Emit extension attribute if any class method
6352         is extension method.
6353         (Method.Define): Add basic extension method validation conditions.
6354         (Method.Emit): Emit extension attribute for method.
6355
6356         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6357         extension method exists. Currently we follow same approach as Microsoft
6358         does, emit even if a method or a class are private but this can change
6359         later.
6360
6361         * cs-parser.jay: Add handling of `this' keyword in method parameters
6362         context.
6363
6364         * decl.cs (DeclSpace.IsStaticClass): New property.
6365         (MemberCache.FindExtensionMethods): Looks for extension methods with
6366         defined name and extension type.
6367
6368         * doc.cs: Updated after OverloadResolve changes.
6369
6370         * driver.cs: Add new soft reference to System.Core.dll.
6371
6372         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6373         (ExtensionMethodGroupExpr): Represents group of extension methods.
6374
6375         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6376         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6377         to MethodGroupExpr and made non-static for easier customization.
6378         (Invocation.DoResolve): Add extension method lookup when no standard
6379         method was found.
6380         (MemberAccess.DoResolve): Try extension methods if no member exists.
6381
6382         * modifiers.cs: Add METHOD_EXTENSION modifier.
6383
6384         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6385         as well as candidate extension type.
6386         (ComputeNamespaces): When assembly constains extension methods registers
6387         them.
6388         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6389         extension method lookup.
6390         (Namespace.LookupExtensionMethod): Looks for extension method in this
6391         namespace.
6392         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6393         find a method which matches name and extensionType.
6394
6395         * parameter.cs (Parameter): Add This modifer.
6396         (HasExtensionMethodModifier): New property.
6397         (Resolve): Add extension parameter check.
6398         (ModFlags): turned to property to exclude this modifier as it is not real
6399         parameter modifier.
6400         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6401
6402         * support.cs (ParameterData): Add ExtensionMethodType.
6403         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6404
6405         * typemanager.cs: Add type and ctor extension attribute type.
6406
6407 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6408
6409         * report.cs (DisableErrors, EnableErrors): used to prevent error
6410         output when we are "trying" to compile various methods with
6411         different types. 
6412
6413         * ecore.cs (Expression): Add Clone method that calls the virtual
6414         CloneTo method.  The current CloneTo method in Expression throws
6415         an exception so we can track down all the places where this must
6416         be implemented (not using abstract, because that would be a lot of
6417         up-front-work before we can start testing the implementation
6418         idea). 
6419
6420         Important: we only need Clone capabilities for expressions created
6421         by the parser, as the expressions we will be cloning are
6422         expressions in the pre-resolved state.   This vastly simplifies
6423         the work required. 
6424         
6425         (SimpleName): Add CloneTo that does nothing.
6426         (EmptyCast): Add CloneTo.
6427         
6428         * expression.cs (Binary): Implement CloneTo.
6429         (Invocation.IsApplicable): Store the current ec in
6430         EmitContext.TempEc and restore it on return.  This is used so we
6431         do not have to sprinkle hundres of methods with an extra
6432         EmitContext, we know that the only user is the lambda expression
6433         ImplicitConversionExists code. 
6434         
6435         (Argument): Add Cloning capabilities.
6436         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6437         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6438         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6439         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6440         IndexerAccess): Add Clone capability.
6441
6442         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6443
6444         (Argument): Add cloning capability.
6445
6446         * assign.cs (Assign): Implement CloneTo.
6447
6448         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6449         
6450         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6451         version by calling Convert with the EmitContext (that we are
6452         currently storing in ec, this is not great, but will do for now,
6453         to avoid passing EmitContext parameters to hundreds of functions
6454         that do not need them now).
6455
6456         (SetExpression): Remove, it is not needed.
6457         
6458         (ContextualReturn): Implement CloneTo.
6459
6460         * statement.cs (Statement): Implement cloning infrastructure,
6461         similar to expressions.
6462
6463         (Block): Partial implementation of Clone for statements.
6464
6465         (Return): Implement clone.
6466         
6467         * constant.cs (Constant.CloneTo): New method, does nothing.
6468
6469         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6470         solution, until we decide how to exactly do this.  
6471         
6472 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6473  
6474         A fix for bug #80493
6475         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6476         a property is override we need to use second accessor.
6477
6478 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6479  
6480         A fix for bug #80418
6481         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6482         methods.
6483
6484 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6485
6486         Another fix for bug #80749
6487         * pending.cs: Abstract class has priority over interfaces.
6488
6489 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6490
6491         Another fix for bug #80749
6492         * pending.cs: Abstract class has priority over interfaces.
6493
6494 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6495
6496         Another fix for bug #80749
6497         * pending.cs: Abstract class has priority over interfaces.
6498
6499 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6500
6501         Another fix for bug #80749
6502         * pending.cs: Abstract class has priority over interfaces.
6503
6504 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6505
6506         * class.cs Better error message.
6507
6508         * driver.cs: Add shorter versions of -optimize option.
6509
6510 2007-02-13  Martin Baulig  <martin@ximian.com>
6511
6512         * class.cs (Constructor.Emit): Check the return value of
6513         ec.ResolveTopBlock() and return on error.
6514
6515 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6516
6517         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6518         message to fix error message regression.
6519
6520 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6521
6522         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6523
6524 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6525
6526         A fix for bug #80749
6527         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6528         its parent container.
6529
6530         * class.cs (DefineFieldInitializers): Each initializer can has different
6531         resolve context.
6532
6533         * const.cs: Updated.
6534
6535 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6536
6537         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6538         now all the heavy lifting to check that embedded statements or
6539         expressions have the right form is done in the ContextualReturn.
6540
6541         (ContextualReturn): New class.  
6542
6543         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6544         method that can be invoked to report 201, so we do not replicate
6545         this everywhere.
6546
6547         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6548         
6549         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6550         treating tabs as spaces. 
6551
6552 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6553
6554         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6555         * assign.cs: Use full implicit conversion for right side check.
6556
6557 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6558
6559         * statement.cs (Switch): Switch over boolean type is not standardized.
6560
6561 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6562
6563         A fix for bug #80755
6564         * decl.cs (FindBaseEvent): Don't use method cache for events.
6565
6566 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6567
6568         * cs-parser.jay: Better syntax error handling.
6569
6570         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6571         instead of underlying type value.
6572
6573 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6574
6575         * driver.cs: Check define identifier before is registered.
6576
6577         * namespace.cs: Use existing error message.
6578
6579         * report.cs: New warning.
6580
6581 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6582
6583         A fix for bug #80742
6584         * expression.cs: Delegate Invoke method can be called directly.
6585
6586 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6587
6588         A fix for bug #80676
6589         * class.cs (IsEntryPoint): The Main method can have params modifier.
6590
6591 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6592
6593         * parameter.cs (Parameter, Parameters): Add Clone method.
6594
6595         * anonymous.cs (Compatible): Turn method into virtual method, so
6596         LambdaExpression can implement a different behavior.
6597
6598         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6599         out the basic checking here, so it can be used by
6600         LambdaExpressions.
6601         
6602         * lambda.cs: Introduce "Compatible" function that will do the
6603         heavy lifting.
6604
6605 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6606
6607         * attribute.cs: Unified one error message.
6608
6609         * class.cs (Class): Use type attributes and not properties to test static
6610         class.
6611         (IsEntryPoint): Don's pass local variable.
6612
6613         * convert.cs: Removed duplicate check.
6614
6615         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6616
6617         * driver.cs: Don't crash when soft reference does not exist.
6618
6619         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6620         (UsingEntry): Removed redundant allocation.
6621
6622         * parameter.cs: Add fast path for type parameters.
6623
6624         * support.cs: Don't allocate attribute when it's not used.
6625
6626 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6627
6628         * anonymous.cs
6629         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6630         this into a virtual method, so we can override it in LambdaExpression.
6631
6632         * driver.cs: Improve diagnostics in case of failure. 
6633
6634         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6635         write a function that is slightly more complex and that parses:
6636
6637         type identifier [, type identifier]* )
6638
6639         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6640         this expression:
6641
6642                 (canEmpty ? i >= 0 : i > 0)
6643
6644 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6645
6646         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6647         exception on possibly valid code.
6648
6649 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6650
6651         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6652         Push/PopPosition.
6653         (parse_opt_type_arguments): Remove.  It's almost the same as
6654         parse_less_than.
6655         (parse_namespace_or_typename): Use parse_less_than.
6656
6657 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6658
6659         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6660         this bug took a few hours to find, because the state saved and
6661         restored by PushPosition and PopPosition was ignoring the state of
6662         parse_generic_less_than.
6663
6664         I can also now remove the handling of OP_LT and OP_GT, this solves
6665         the big mistery.
6666         
6667         * cs-tokenizer.cs: store the location for the ARROW token, we use
6668         that in the parser.
6669
6670         (PushPosition, PopPosition): save/restore also `current_token',
6671         restore `parse_generic_less_than' (was missing).
6672
6673         (parse_opt_type_arguments): use parse_type, not
6674         parse_namespace_or_typename to parse types.
6675
6676         * lambda.cs: Empty new file, will eventually have the lambda
6677         expression implementation.
6678
6679         * lambda.test: used to test the internal tokenizer. 
6680
6681         * report.cs (FeatureIsNotISO1): Rename from
6682         FeatureIsNotStandardized, because it was about the language level
6683         (1 vs 2) it was not about standarization.
6684
6685         (FeatureRequiresLINQ): New.
6686
6687         * support.cs (SeekableStreamReader): Only require that the reader
6688         is a TextReader, not a StreamReader, so we can plug StringReader. 
6689
6690         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6691         given position in the input stream the following tokens can be
6692         parsed as a type followed by an identifier.
6693
6694         (is_punct): after a '(' if parse_type_and_parameter returns true,
6695         then return a special token OPEN_PARENS_LAMBDA which is used to
6696         avoid reduce/reduce errors in the grammar for the
6697         lambda_expression rules.
6698
6699         (parse_type): implement a type parser inside the
6700         tokenizer, the parser only returns true or false depending on
6701         whether the input at a given position can be parsed as a type.
6702
6703         (peek_token): new method used during type parsing.
6704
6705 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6706
6707         Fix #80531
6708         * anonymous.cs (ScopeInfo.InflateParameters): New.
6709         (AnonymousContainer.Resolve): Use it to redirect types of
6710         delegate parameters.
6711
6712 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6713
6714         Fix #80530
6715         * expression.cs (Error_InvalidArguments): Don't use two different
6716         messages for CS1503.  Use ExtraInformation and
6717         SymbolRelatedToPreviousError instead.
6718
6719         Fix #80358
6720         * decl.cs (DeclSpace.initialize_type_params): Don't access
6721         'type_params' of a partial class directly.
6722
6723 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6724
6725         * constant.cs: Removed a handful of out-of-range checks that were
6726         not necessary. 
6727
6728 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6729
6730         * expression.cs (CheckUselessComparison): Add additional check for char
6731         constants.
6732
6733         * namespace.cs: Fixed typo.
6734
6735 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6736
6737         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6738         gone, instead we inline the test, preventing the needless casts to
6739         longs, ulongs and doubles for the parameters, avoiding calls to
6740         methods that overchecked stuff, and instead inlined things
6741         nicely. 
6742
6743 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6744
6745         * cs-parser.jay: Better parameter error handling.
6746
6747 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6748
6749         A fix for bug #80368, #80522
6750         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6751         whether array initializer contains constants only.
6752         (ArrayCreation.Emit): Use better formula to decide when
6753         are array initializers for static initialization.
6754         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6755         have to emit even constants otherwise they are pre-initialized.
6756
6757 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6758             Raja R Harinath  <rharinath@novell.com>
6759
6760         Fix emit order of 'get' vs. 'set'.
6761         * support.cs (Accessors): New.
6762         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6763         Note the order in which accessors are declared in the source.
6764         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6765         Refactored from Property.Define and Indexer.Define.
6766         (PropertyBase.DefineAccessors): New helper that calls the above in
6767         appropriate order as noted by the parser.
6768         (Property.Define, Indexer.Define): Update to changes.
6769         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6770
6771 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6772
6773         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6774         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6775         there's an implicit conversion from the current type to the target
6776         type before converting the underlying constant.
6777
6778 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6779
6780         * const.cs (ResolveValue): Updated after constant conversion was made more
6781         generic.
6782
6783         * constant.cs (GetAttributableValue): constant to object conversion is
6784         used for attributes only.
6785         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6786         constant conversions.
6787         (LongConstant.ConvertImplicitly): Ditto.
6788
6789         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6790         (ImplicitConversionStandard): Handle constant conversion as extra step.
6791         It solves the issue when constant conversion was called indirectly like
6792         inside array initializer and constant folding was skipped.
6793
6794         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6795         this change.
6796
6797         * statement.cs(ImplicitConversionStandard): Updated after constant
6798         conversion was made more generic.
6799
6800 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6801
6802         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6803         Constraints, solves the problem where the compiler incorrectly
6804         reported that a type parameter was not constrained to a class (Bug
6805         80518)
6806
6807 2007-01-14  Marek Habersack  <grendello@gmail.com>
6808
6809         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6810
6811 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6812
6813         A fix for bug #80368
6814         * assign.cs (FieldInitializer): New class implements field
6815         initializer statement.
6816
6817         * attribute.cs: Update after FieldMember rename.
6818
6819         * class.cs (PropertyBasedMember): New common class for property based
6820         types.
6821         (InterfaceMemberBase): New base class for all members which can be used as
6822         an interface members.
6823         (MethodCore): Moved really common code to InterfaceMemberBase.
6824         (Method.Define): Equal and GetHasCode detection is relevant for methods
6825         only.
6826         (MethodData.Define): Don't assume that public event implements an
6827         interface automatically.
6828         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6829         modifier is used.
6830         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6831         (FieldMember): Merged with FieldBase.
6832         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6833         event extern modifier can be used.
6834         (EventField.EventFieldAccessor): Moved event field specific code here.
6835         (Event.AllowedModifiers): Even event can be extern.
6836         (Event.FindOutBaseMethod): New override specific to events.
6837         (Indexer.parameters): Reintroduce parameters because base class holds
6838         only properties common data.
6839         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6840         need do extra parameters check.
6841
6842         * const.cs: Update after FieldMember rename.
6843
6844         * decl.cs (MemberCache.FindBaseEvent): New method.
6845
6846         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6847         to reflect that indexer is now derived from PropertyBased.
6848
6849         * ecore.cs (GetMemberType): Made public.
6850         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6851         obsolete event.
6852
6853         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6854         
6855         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6856         (RegisterEvent): Removed.
6857         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6858         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6859
6860 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6861
6862         Fix #80249
6863         * statement.cs (CollectionForeach.TryType): Prefer generic
6864         GetEnumerator over non-generic variant.  Fix code to follow comments.
6865
6866 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6867
6868         Fix #80446
6869         * support.cs (ReflectionParameter): Don't use an invalid index on
6870         the generic parameter data.
6871
6872 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6873
6874         * driver.cs: Just add a tiny bit of infrastructure.
6875
6876 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6877
6878         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6879         where field type is struct from current assembly.
6880         
6881         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6882         it is possible.
6883
6884 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6885
6886         A fix for bug #80381
6887         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
6888         the core types.
6889
6890         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
6891         messages.
6892         (Namespace.LookupType): Always use core types from corlib when speficied.
6893
6894         * report.cs: A new warning.
6895
6896         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
6897         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
6898         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
6899
6900         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
6901         (InitCoreTypes): Set expression type of object_type and value_type
6902         immediately after lookup.
6903
6904 2007-01-01  Miguel de Icaza  <miguel@novell.com>
6905
6906         * cs-tokenizer.cs: Accept Pc class characters (Connector
6907         Punctuation) as valid identifiers.  Fixes #78259
6908
6909         * expression.cs (Invocation.DoResolve): Moved the check for the
6910         use of `this' for doing method calls to the Invocation resolution
6911         step, after overload resolution has taken place instead of doing
6912         the check at the low-level `This.DoResolve' level.
6913
6914         The `This.DoResolve'(appens before overload resolution, so it has
6915         no way of knowing if the method that will be called will be
6916         instace or static, triggering an erroneous report for cs0188 (Bug
6917         78113).
6918
6919         We now do the check for instance method invocations after we know
6920         what method will be called.
6921
6922         (This.CheckThisUsage): Move the actual use of this structure
6923         checking into its own method and expose it. 
6924
6925         * Everywhere that called Error_ValueCannotBeConverted: pass a new
6926         EmitContext.
6927
6928         Exceptions: Null.ConvertImplicitly,
6929         Constant.ImplicitConversionRequired as there are too many call
6930         sites for passing the ec. 
6931
6932         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
6933         EmitContext, if the value is null, then we do not try to provide
6934         the extra information from the error (If a userdefined conversion
6935         exists, as UserDefinedConversion requires a non null-EmitContext).
6936
6937         Fixes: #80347
6938
6939 2006-12-30  Raja R Harinath  <rharinath@novell.com>
6940
6941         * flowanalysis.cs (MyBitVector): Document some invariants.
6942         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
6943         introduced below, and add a couple of others, 
6944
6945 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6946
6947         * attribute.cs (GetMethodObsoleteAttribute): Uses new
6948         GetPropertyFromAccessor and GetEventFromAccessor.
6949         
6950         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
6951         overrides non-obsolete one.
6952         (Indexer.Define): Error message has been moved to the parser.
6953
6954         * cs-parser.jay: Better syntax errors handling.
6955
6956         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
6957         when an invocation has no arguments.
6958
6959         * ecore.cs: Removed not used caching.
6960
6961         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
6962         implementation.
6963
6964         * report.cs: Add a new warning.
6965
6966         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
6967
6968         * typemanager.cs (enumeration_type): Removed.
6969         (CSharpSignature): Reuses IsSpecialMethod.
6970         (IsEqual): Hack for MS BCL.
6971         (GetPropertyFromAccessor): New method.
6972         (GetEventFromAccessor): New method.
6973         (IsSpecialMethod): Fixed to handle more cases.
6974
6975 2006-12-30  Marek Safar  <marek.safar@gmail.com>
6976
6977         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
6978         Made white spaces array static.
6979
6980         * ecore.cs (RemoveGenericArity): Optimized.
6981
6982         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
6983         10 times faster).
6984         (MyBitVector.initialize_vector): Simplified.
6985
6986 2006-12-22  Miguel de Icaza  <miguel@novell.com>
6987
6988         * ecore.cs: Am not entirely happy with this hack, but it seems to
6989         address the issue in 80257 (a small test case for
6990         CreativeDocs.NET). 
6991
6992         I set the MethodGroupExpr.Type to an internal compiler type
6993         (itself in this case) to force the resolution to take place.   Why
6994         it does not take place with a null is beyond me.
6995
6996 2006-12-20  Marek Safar  <marek.safar@gmail.com>
6997
6998         A fix for bug #80288
6999         * expression.cs (ResolveOperator): Consider user defined conversion for
7000         logical and operator too.
7001         (EmitBranchable): Optimization for logical and when full constant folding
7002         could not be applied but one operand is constant.
7003
7004 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7005
7006         * class.cs (GetClassBases): Write 5 times every day, will never use
7007         FullName for error reporting.
7008
7009         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7010
7011 2006-12-19  Martin Baulig  <martin@ximian.com>
7012
7013         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7014         the symbol file info here.
7015
7016 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7017
7018         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7019         of `elseif' is taking then following sections are not taking.
7020         Fixes an issue reported on mono mailing list.
7021
7022 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7023
7024         A fix for bug #80300
7025         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7026         a caller is not taking.
7027
7028 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7029
7030         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7031         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7032         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7033         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7034         * class.cs: Update to changes.
7035
7036 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7037
7038         A fix for bug #79934
7039         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7040         partial container.
7041
7042         * class.cs (ResolveMembers): Register an iterator in current container and
7043         not in shared one.
7044
7045 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7046
7047         Fix test-543.cs
7048         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7049         satisfy a params annotated parameter.
7050
7051 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7052
7053         A fix for bug #77014
7054         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7055         paramters correctly and not rely on hacks in Parameters class.
7056         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7057         at any possition.
7058         (Invocation.VerifyArgumentsCompat): Ditto.
7059         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7060         any possition.
7061
7062         * parameter.cs (HasParams): Don't assume that params is the last one.
7063
7064         * support.cs (ReflectionParameters.ctor): Look for params attribute
7065         correctly.
7066         (ReflectionParameters.ParameterType): Removed hack when we returned last
7067         parameter for out of range parameters.
7068         (ParameterName, ParameterModifier): Ditto.
7069
7070 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7071
7072         A fix for bug #79987
7073         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7074         when assembly is not CLS compliant but type is. I have no idea why is this
7075         allowed.
7076
7077         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7078
7079 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7080
7081         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7082         in struct constructors, they are basically no-ops.
7083
7084 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7085
7086         * cs-tokenizer.cs (Position): Save preprocessor status too.
7087
7088 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7089
7090         A fix for bug #77794
7091         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7092
7093 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7094
7095         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7096         Fixes #69299.
7097         (pp_expr): Report error for an invalid expression.
7098         (handle_preprocessing_directive): Simplified; add more error checking.
7099
7100 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7101
7102         A fix for bug #74939
7103         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7104         directives handling.
7105
7106 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7107
7108         A fix for bugs #80093, and #75984
7109         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7110         logic, it seems to me as it worked before "by coincidence".
7111         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7112         (cleanup): Enabled endif check.
7113
7114 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7115
7116         A fix for bug #80162
7117         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7118         enumerators are never ambiguous.
7119
7120 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7121
7122         Fix #80060
7123         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7124
7125 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7126
7127         A fix for bug #80144
7128         * class.cs (EventProperty.Define): Explicit implementation means
7129         that an even is used.
7130
7131 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7132
7133         Fixes the operators implementation (part II)
7134
7135         * cfold.cs (DoConstantNumericPromotions): Renamed to
7136         DoBinaryNumericPromotions and simplified.
7137         (BinaryFold): Couple of conversion fixes; simplified.
7138
7139         * constant.cs, ecore.cs, literal.cs
7140         (ToType): Renamed to ConvertImplicitly.
7141         (Reduce): Renamed to ConvertExplicitly.
7142
7143         * class.cs, convert.cs: Updated.
7144
7145         * expression.cs: TryReduce doesn't throw an exception.
7146
7147 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7148
7149         A fix for bug #80108
7150         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7151         compatible.
7152
7153 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7154
7155         Fixes unary operators implementation (part I)
7156         Also fixes #80026
7157
7158         * cfold.cs (Error_CompileTimeOverflow): Made internal
7159
7160         * const.cs (IConstant): Changed to use reference to constant and
7161         not constant itself.
7162         Updated IConstant implementations.
7163
7164         * constant.cs (CreateConstant): New factory method.
7165         Updated IConstant implementation.
7166
7167         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7168
7169         * ecore.cs: Updated to use CreateConstantReference.
7170
7171         * enum.cs: Reflects IConstant changes.
7172
7173         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7174
7175         * literal.cs (NullConstant): Change to be independently usable.
7176
7177 2006-11-29  Martin Baulig  <martin@ximian.com>
7178
7179         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7180         we need to emit the scope initializer before calling the base .ctor.
7181
7182         * anonymous.cs: Merged back from the new anonymous methods branch.
7183         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7184
7185         * expression.cs (ParameterReference.DoResolveBase): Create a
7186         "normal" ScopeInfo when capturing parameters rather than using the
7187         root scope; this makes things work with anonymous methods having
7188         parameters.
7189
7190         * statement.cs
7191         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7192
7193 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7194
7195         A fix for bug #79987
7196         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7197         check to a base class.
7198         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7199         only when assembly has missing attribute.
7200         * report.cs: Update.
7201
7202 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7203
7204         * cs-tokenizer.cs: Merged with gmcs version.
7205
7206 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7207
7208         * cs-tokenizer.cs,
7209         * cs-parser.jay: Better error message when partial keyword is misplaced.
7210
7211 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7212
7213         A fix for bug #79810
7214         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7215         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7216         a RuntimeWrappedException by default.
7217
7218 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7219
7220         A fix for bug #79843
7221         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7222         implementation.
7223         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7224
7225 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7226
7227         * driver.cs, namespace.cs: Uses faster IndexOf version.
7228
7229 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7230
7231         A fix for bug #79941
7232         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7233         operators.
7234         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7235         even if internal name is different.
7236         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7237         (UserDefinedConversion): Simplified as the operators cannot be internal.
7238         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7239         conversions.
7240         (MethodLookup): Replaced EmitContext with parentType.
7241         * expression.cs: Updated.
7242
7243 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7244
7245         * driver.cs (BadAssembly): Handle all the ugliness of
7246         DefineDynamicAssembly.
7247
7248 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7249
7250         Address parts of #58244 -- most of what's left is in the runtime
7251         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7252         CS1509 error checks, and handle them for all assembly loads, not
7253         just the first invocation.
7254         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7255         * codegen.cs (AssemblyClass.AddModule): ... here.
7256
7257 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7258
7259         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7260         IEnumerable<T> is ambiguous.
7261
7262 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7263
7264         A fix for bug #67689
7265         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7266         GetEnumerator is ambiguous.
7267
7268         * report.cs: Add new warning.
7269
7270 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7271
7272         A fix for bug #78602
7273         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7274         to protected member can be nested type.
7275
7276 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7277
7278         A fix for bug #78965
7279         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7280         to protected member must derive from current type.
7281
7282 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7283
7284         assign.cs: Reuses error method.
7285
7286         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7287         instead of type for constants.
7288         (Expression.Error_ValueAssignment): Common error method.
7289
7290         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7291         for any assignment.
7292
7293 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7294
7295         A fix for bug #79081
7296         * expression.cs (MemberAccess.DoResolve): Check nested type
7297         accessibility.
7298
7299 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7300
7301         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7302
7303 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7304
7305         A fix for bug #76591
7306         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7307
7308 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7309
7310         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7311         type forwarder of the same type multiple times.
7312
7313 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7314
7315         Fix #78820
7316         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7317         instance as an rvalue, even when we later resolve as an lvalue.
7318
7319 2006-10-25  Martin Baulig  <martin@ximian.com>
7320
7321         * anonymous.cs: Fix #79673.
7322
7323 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7324
7325         A fix for bug #79666
7326         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7327         ignored when is optimized (= default value) as its value is already set.
7328
7329 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7330
7331         A fix for bug #79724
7332         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7333         TypeContainer for type lookup.
7334
7335 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7336
7337         A fix for bug #79231
7338         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7339         * expression.cs (OverloadResolve): Always convert type name for
7340         an error message.
7341         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7342         other member.
7343
7344 2006-10-18  Martin Baulig <martin@ximian.com>
7345
7346         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7347
7348 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7349
7350         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7351         an int32, but requesting an int64 from the conversion
7352
7353 2006-10-12  Martin Baulig  <martin@ximian.com>
7354
7355         * anonymous.cs
7356         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7357         
7358 2006-10-12  Martin Baulig  <martin@ximian.com>
7359
7360         * statement.cs
7361         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7362
7363 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7364
7365         * convert.cs: Remove broken code: I was doing the "Existance"
7366         tests for Implicit conversions.
7367
7368 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7369
7370         * convert.cs: Added one missing case in
7371         ImplicitStandardConversionExists uint64 to intptr.
7372
7373         Fixes #59800
7374         
7375         * typemanager.cs (uintptr_type): another core known type.   
7376
7377         * ecore.cs (OperatorCast): routine used to do cast operations that
7378         depend on op_Explicit.  We could change some of the Decimal
7379         conversions to use this.
7380
7381         This one has a probe mechanism that checks both types for an op_
7382         which it coudl be used to eliminate two classes: CastToDecimal
7383         and CastFromDecimal.
7384
7385         * convert.cs: Implement the conversions documented in #59800
7386         
7387 2006-10-10  Martin Baulig  <martin@ximian.com>
7388
7389         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7390         before RootScope.ResolveMembers().
7391
7392         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7393         `CurrentType' if appropriate.
7394
7395 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7396
7397         A fix for bug #78568
7398         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7399         when contains binary operators.
7400         * cs-parser.jay: Updated.
7401
7402 2006-10-09  Martin Baulig  <martin@ximian.com>
7403
7404         * delegate.cs
7405         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7406         moved that into Define() and also do the other type parameter
7407         checks there.  Fixes #79094.  Added gtest-292.cs.
7408
7409         * expression.cs
7410         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7411         since that doesn't include type parameters; don't use `Ldelema'
7412         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7413
7414 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7415
7416         A fix for #77796
7417         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7418         conversion is allowed.
7419
7420 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7421
7422         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7423         error reporting when no error occurs.
7424
7425 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7426
7427         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7428         does not exist.
7429
7430 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7431
7432         Fix #79584
7433         * class.cs (DefineTypeBuilder): Check circular dependencies before
7434         setting the parent of the TypeBuilder.
7435         (CheckRecursiveDefinition): Don't use 'BaseType', since
7436         it may not be valid until after DefineTypeBuilder.  Use
7437         'base_type' instead.
7438
7439 2006-10-04  Martin Baulig  <martin@ximian.com>
7440
7441         Merged the Anonymous Methods patch.
7442
7443         * anonymous.cs, iterators.cs: The new anonymous methods code.
7444
7445         * statement.cs (Variable): New public abstract class.
7446         (LocalInfo.Variable): New public property.
7447         (LocalInfo.ResolveVariable): New public method.
7448         (Block.Flags): Add `IsIterator'.
7449         (Block.AddVariable): Improved the CS0136 check.
7450         (Block.AnonymousChildren): New public property.
7451         (Block.AddAnonymousChild): New public method.
7452         (ToplevelBlock): Update to use the new anonymous method framework.
7453         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7454         `ToplevelBlock'; this is required to correctly implement the
7455         CS0136 check.
7456         (Fixed, Using): Use `TemporaryVariable' instead of directly
7457         creating the `LocalBuilder'.
7458
7459         * parameter.cs (Parameter.ResolveVariable): New public method.
7460         (Parameters.ResolveVariable): Likewise.
7461
7462         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7463
7464         * class.cs (TypeContainer): Replaced the `iterators' list and
7465         corresponding methods with a list of `CompilerGeneratedClass'es.
7466         (TypeContainer.ResolveMembers): New public method.
7467         (Method): `IIteratorContainer' has been replaced by
7468         `IAnonymousHost'.
7469
7470         * expression.cs (VariableReference): New public abstract base
7471         class for `LocalVariableReference', `ParameterReference' and
7472         `This'.
7473
7474         * codegen.cs (EmitContext): Removed `capture_context',
7475         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7476         (EmitContext.EmitThis): Removed.
7477
7478         * cs-parser.jay: Replace `iterator_container' with
7479         `anonymous_host'.       
7480
7481 2006-10-04  Martin Baulig  <martin@ximian.com>
7482
7483         * generic.cs (GenericMethod): Don't make this abstract.
7484         (Constraints.Clone): Added dummy implementation.
7485
7486 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7487
7488         Fix #79577
7489         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7490         'declspaces'.  Avoid allocating arrays willy-nilly.
7491
7492         Fix #79553
7493         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7494         cases out of the switch.
7495
7496 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7497
7498         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7499         message when non-generic type is used with the type arguments.
7500         * expression.cs: Updated.
7501
7502 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7503
7504         Fix #79013
7505         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7506         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7507         Change semantics slightly.  Don't insist on having only one
7508         temporary EmptyExpression -- just throttle the creation of new ones.
7509
7510         Fix #79451
7511         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7512         non-interfaces too.  If no methods are found, don't try to create
7513         a MethodGroupExpr.
7514
7515 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7516
7517         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7518         generic type.
7519
7520         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7521         us produce better error message.
7522
7523 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7524
7525         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7526         of the `|' operator.
7527
7528         * report.cs: A new warning added.
7529
7530 2006-09-27  Martin Baulig  <martin@ximian.com>
7531
7532         * generic.cs (GenericMethod): Don't make this abstract.
7533
7534 2006-09-27  Martin Baulig  <martin@ximian.com>
7535
7536         * report.cs
7537         (InternalErrorException): Added overloaded ctor taking a params array.
7538
7539 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7542         Fixed the cases when same error was reported twice.
7543
7544         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7545         now report symbol information.
7546
7547 2006-09-25  Martin Baulig  <martin@ximian.com>
7548
7549         * class.cs: Completely unified with the gmcs version.
7550
7551 2006-09-25  Martin Baulig  <martin@ximian.com>
7552
7553         * typemanager.cs (TypeManager.IsNullableType): New public function.
7554         (TypeManager.IsNullableTypeOf): Likewise.
7555         (TypeManager.IsNullableValueType): Likewise.
7556
7557         * class.cs (MethodCore): Added the `GenericMethod' argument from
7558         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7559
7560 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7561
7562         * convert.cs: Unify with gmcs version.
7563
7564 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7565
7566         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7567         verify them as well.
7568
7569         * report.cs: New warning.
7570
7571 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7572
7573         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7574         for anonymous block with out argument.
7575
7576 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7577
7578         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7579         not used private events only.
7580
7581 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7582
7583         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7584
7585         * const.cs (Const.Define): Check for constant type.
7586         (Const.IsConstantTypeValid): Looks for valid constant types.
7587
7588         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7589
7590         * ecore.cs (EmptyConstantCast): New common class for all constant based
7591         EmptyCast(s).
7592
7593         * expression.cs (Is.DoResolve): Handle null constant especially.
7594         (New.DoResolve): Check for new void().
7595         (MemberAccess.DoResolve): Cope with all kind of nulls.
7596
7597         * literal.cs (NullConstant): Uses EmptyConstantCast.
7598         (NullDefault): Based on EmptyConstantCast.
7599         (NullLiteral): Uses EmptyConstantCast.
7600
7601         * statement.cs (Block.ResolveMeta): Check for constant type.
7602
7603 2006-09-22  Martin Baulig  <martin@ximian.com>
7604
7605         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7606
7607 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7608
7609         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7610         not the null type.
7611
7612         Fix part of #79451
7613         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7614         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7615         code slightly.
7616
7617 2006-09-22  Martin Baulig  <martin@ximian.com>
7618
7619         * ecore.cs: Merged with the gmcs version.
7620
7621         * generic.cs (ConstructedType): New dummy class.
7622         (TypeArguments): Don't make this abstract.
7623
7624         * typemanager.cs
7625         (TypeManager.IsGenericTypeDefinition): New method.
7626         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7627
7628 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7629
7630         * expression.cs (ComposedCast): Check for arrays of TypedReference
7631         before creating the type, not after.
7632
7633 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7634
7635         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7636         after ToType change.
7637
7638         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7639         when constant must be implicitly convertible.
7640
7641         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7642
7643         * ecore.cs (NullCast): Derives from NullConstant.
7644
7645         * expression.cs (Is.DoResolve): Removed useless variables.
7646         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7647         (New.Constantify): Add enum support.
7648         (MemberAccess.DoResolve): Add warning when accessing null constant or
7649         variable.
7650
7651         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7652         property.
7653
7654         * literal.cs (NullConstant): New abstract class with common
7655         functionality for all null specializations.
7656         (NullDefault): Represents default(X) when result can be
7657         reduced to null.
7658         (NullLiteral): Updated.
7659
7660         * report.cs: Add new warning.
7661
7662 2006-09-21  Martin Baulig  <martin@ximian.com>
7663
7664         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7665
7666 2006-09-21  Martin Baulig  <martin@ximian.com>
7667
7668         * generic.cs (GenericConstraints): New dummy class.
7669         (Constraints): Likewise.
7670         (TypeParameter): Likewise.
7671         (TypeParameterName): Likewise.
7672         (GenericMethod): Likewise.
7673
7674         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7675
7676         * decl.cs: Merged with the gmcs version.
7677
7678 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7679
7680         * generic.cs (TypeParameter): Implement IMemberContainer.
7681         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7682
7683         * rootcontext.cs: Unify with gmcs version.
7684
7685         * report.cs: Unify with gmcs version.
7686         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7687         from gmcs/generics.cs.
7688         * generics.cs (TypeParameter): New dummy class.
7689
7690         * support.cs: Unify with gmcs version.
7691
7692 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7693
7694         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7695         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7696
7697         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7698         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7699         * mcs.exe.sources: Add generic.cs.
7700
7701         * codegen.cs: Unify with gmcs version.
7702
7703         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7704         (EmitContext): Add GenericDeclContainer implementation.
7705         * decl.cs (MemberCore, DeclSpace): Likewise.
7706         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7707
7708         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7709         MCS TypeManager has a corresponding dummy method.
7710
7711 2006-09-19  Martin Baulig  <martin@ximian.com>
7712
7713         * expression.cs: Completely merged with the gmcs version.
7714
7715 2006-09-19  Martin Baulig  <martin@ximian.com>
7716
7717         * expression.cs (Invocation): Merged with the gmcs version.
7718         (ArrayAccess.GetStoreOpcode): Likewise.
7719
7720 2006-09-19  Martin Baulig  <martin@ximian.com>
7721
7722         * typemanager.cs
7723         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7724         (TypeManager.IsGenericMethodDefinition): Likewise.
7725
7726 2006-09-19  Martin Baulig  <martin@ximian.com>
7727
7728         * typemanager.cs
7729         (TypeManager.IsEqual): Moved the gmcs implementation here.
7730         (TypeManager.DropGenericTypeArguments): Likewise.
7731         (TypeManager.DropGenericMethodArguments): Likewise.
7732         (TypeManager.GetTypeArguments): Moved here from gmcs.
7733         (TypeManager.HasGenericArguments): Likewise.
7734
7735 2006-09-19  Martin Baulig  <martin@ximian.com>
7736
7737         * expression.cs (Binary): Merged with the gmcs version.
7738
7739 2006-09-19  Martin Baulig  <martin@ximian.com>
7740
7741         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7742
7743 2006-09-19  Martin Baulig  <martin@ximian.com>
7744
7745         * typemanager.cs: Merged with the gmcs version.
7746
7747 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7748
7749         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7750         * driver.cs: Likewise.
7751
7752 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7753
7754         A fix for #79401
7755         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7756         only if parent type is class.
7757         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7758         update.
7759
7760 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7761
7762         * cs-parser.jay,
7763         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7764         keywords are used.
7765         * typemanager.cs(CSharpName): Converts NullType to null.
7766
7767 2006-09-15  Martin Baulig  <martin@ximian.com>
7768
7769         * typemanager.cs
7770         (TypeManager.GetMethodName): Added mcs implementation.
7771         (TypeManager.IsEqual): Likewise.
7772
7773         * ecore.cs
7774         (SimpleName.RemoveGenericArity): Added dummy implementation.
7775
7776         * pending.cs: Merged with the gmcs version.     
7777
7778 2006-09-15  Martin Baulig  <martin@ximian.com>
7779
7780         * statement.cs: Merge with the gmcs version.
7781
7782 2006-09-15  Martin Baulig  <martin@ximian.com>
7783
7784         * statement.cs (Switch): Merge with the gmcs implementation
7785         (without nullables), which is newer.
7786
7787 2006-09-15  Martin Baulig  <martin@ximian.com>
7788
7789         * statement.cs (Block.Variables): Make this public.
7790         (ToplevelBlock.Parameters): Make this a property.
7791         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7792
7793 2006-09-15  Martin Baulig  <martin@ximian.com>
7794
7795         * namespace.cs: Merge with the gmcs version.
7796
7797 2006-09-15  Martin Baulig  <martin@ximian.com>
7798
7799         * decl.cs (MemberName): Minor code cleanups.
7800
7801 2006-09-15  Martin Baulig  <martin@ximian.com>
7802
7803         * parameter.cs: Merge with the gmcs version.
7804
7805 2006-09-15  Martin Baulig  <martin@ximian.com>
7806
7807         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7808         and an error in mcs.
7809
7810 2006-09-15  Martin Baulig  <martin@ximian.com>
7811
7812         * flowanalysis.cs: Merged from GMCS; added the generics code into
7813         a `GMCS_SOURCE' conditional so we can share this file.
7814
7815 2006-09-08  Martin Baulig  <martin@ximian.com>
7816
7817         * typemanager.cs (TypeManager.interlocked_type): New public field.
7818         (TypeManager.int_interlocked_compare-exchange): New public field.
7819         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7820         enumerator types here and call InitGenericCoreTypes().
7821         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7822         after calling InitEnumUnderlyingTypes().
7823
7824         * rootcontext.cs
7825         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7826         `classes_second_stage'. 
7827
7828 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7829
7830         * assign.cs, ecore.cs, expression.cs: Share error message text.
7831         * class.cs (FieldMember.Define): Check for varible of static type.
7832         * driver.cs (LoadAssembly): Uses error output for errors.
7833         * statement.cs: Updated.
7834
7835 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7836
7837         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7838         type instance.
7839
7840 2006-09-07  Martin Baulig  <martin@ximian.com>
7841
7842         * driver.cs
7843         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7844
7845 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7846
7847         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7848         
7849 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7850
7851         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7852         #52019 and #79064, the use of the \uXXXX sequence in source code
7853         to represent unicode characters.
7854
7855 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7856
7857         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7858         support.
7859         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7860
7861 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7862
7863         * assign.cs: Catch attempts to assign to a method groups in += and
7864         report as 1656
7865
7866 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7867
7868         A fix for #79056
7869         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7870
7871 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7872
7873         * class.cs (Method.Define): Issue a warning when generic method looks like
7874         an entry point.
7875         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7876         as well.
7877
7878 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7879  
7880         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7881         looking for ctor.
7882         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7883         search all base interfaces as a member can be ambiguous.
7884         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7885         Constructor member type filter. 
7886         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
7887         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
7888         reporting for returned memberinfos.
7889         * report.cs: Updated.
7890         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
7891         version to work on all runtimes.
7892         (TypeManager.RealMemberLookup): Removed members filtering.
7893
7894 2006-08-08  Raja R Harinath  <rharinath@novell.com>
7895
7896         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
7897         (PropertyExpr.EmitAssign): Likewise.
7898         * expression.cs (Indirection.EmitAssign): Likewise.
7899         (LocalVariableReference.EmitAssign): Likewise.
7900         (ParameterReference.EmitAssign): Likewise.
7901         (Invocation.EmitArguments): Likewise.
7902         (ArrayAccess.EmitAssign): Likewise.
7903         (IndexerAccess.EmitAssign): Likewise.
7904         (This.EmitAssign): Likewise.
7905         (ConditionalLogicalOperator.Emit): Likewise.
7906
7907         Fix #79026
7908         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
7909         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
7910         leave it in after returning it.
7911         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
7912
7913 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
7914
7915         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
7916         message.
7917
7918 2006-08-03  Raja R Harinath  <rharinath@novell.com>
7919
7920         Fix cs0146-3.cs and cs0146-4.cs.
7921         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
7922         enclosing types don't depend on the current type.
7923
7924 2006-08-02  Raja R Harinath  <rharinath@novell.com>
7925
7926         Fix #77963
7927         * class.cs (TypeContainer.DoDefineMembers): Use
7928         FindBaseMemberWithSameName on Parent, since we're interested in
7929         whether we hide inherited members or not.
7930         (FindBaseMemberWithSameName): Make slightly more robust.
7931
7932         Fix the non-generic testcase from #77396
7933         * decl.cs (DeclSpace.DeclContainer): Remove override.
7934
7935         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
7936         declspaces for doppelgangers too.
7937         (UsingEntry): Implement IResolveContext.
7938         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7939         'this' as the resolve context.
7940         (LocalAliasEntry): Likewise.
7941
7942         Implement parts of #77403
7943         * roottypes.cs (RootDeclSpace): New.  Used to represent the
7944         toplevel declaration space.  Each namespace declaration introduces
7945         a "partial" root declaretion space.
7946         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
7947         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
7948         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
7949         from 'current_namespace.SlaveDeclSpace'.
7950         (namespace_declaration): Likewise.
7951         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
7952         check.  It can't happen now.
7953         * decl.cs (DeclSpace.LookupType): Likewise.
7954         * driver.cs (MainDriver): Sanity check.
7955
7956 2006-08-01  Raja R Harinath  <rharinath@novell.com>
7957
7958         * decl.cs (DeclSpace.FindNestedType): Remove.
7959         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
7960         LookupTypeContainer to get the container of the nested type.
7961         * class.cs (TypeContainer.FindNestedType): Make non-override.
7962
7963 2006-07-31  Raja R Harinath  <rharinath@novell.com>
7964
7965         * decl.cs (DeclSpace.PartialContainer): Move field from ...
7966         * class.cs (TypeContainer.PartialContainer): ... here.
7967         (TypeContainer.AddBasesForPart): New helper.
7968         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
7969         instead.
7970         * cs-parser.jay (current_class): Convert to DeclSpace.
7971         (struct_declaration, interface_declaration, class_declaration):
7972         Use AddBasesForPart instead of .Bases directly.
7973         * const.cs, iterators.cs: Update to changes.
7974
7975 2006-07-28  Raja R Harinath  <rharinath@novell.com>
7976
7977         * class.cs (TypeContainer.AddMemberType): Rename from
7978         AddToTypeContainer.
7979         (TypeContainer.AddMember): Rename from AddToMemberContainer.
7980         (AddTypeContainer): New.  Combine AddClassOrStruct and
7981         AddInterface.
7982         (AddPartial): Update.  Add 'is_partial' argument.
7983         * roottypes.cs: Update to changes.
7984         * cs-parser.jay (push_current_class): New helper for handling
7985         current_container and current_class.
7986         (struct_declaration, interface_declaration, class_declaration):
7987         Use it.
7988
7989 2006-07-26  Raja R Harinath  <rharinath@novell.com>
7990
7991         * roottypes.cs: Rename from tree.cs.
7992
7993         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
7994         * tree.cs (Tree, ITreeDump): Remove types.
7995         * rootcontext.cs (tree, Tree): Remove fields.
7996         (root, ToplevelTypes): New.
7997         * *.cs: Update to rename.
7998
7999         * tree.cs (Tree.RecordDecl): Remove.
8000         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8001         namespace here.
8002         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8003
8004 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8005
8006         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8007         DoFlowAnalysis and OmitStructFlowAnalysis here.
8008         (ec.With): Rename from WithUnsafe and generalize.
8009         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8010         (ec.WithFlowAnalyis): New.
8011         * ecore.cs, expression.cs, statement.cs: Update.
8012
8013 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8014
8015         * statement.cs (Block.ResolveMeta): Simplify slightly.
8016
8017         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8018         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8019         check_state to flags.
8020         (CheckState, ConstantCheckState): Update.
8021         (InUnsafe): New read-only property.
8022         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8023         arbitrary flags.
8024         (WithUnsafe): New helper similar to WithCheckState.
8025         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8026         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8027
8028 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8029
8030         Make comparisons use the same IL irrespective of whether they're
8031         in a 'checked' or 'unchecked' context: one of the issues in #78899
8032         * codegen.cs (EmitContext.CheckState): Make read-only property.
8033         (EmitContext.ConstantCheckState): Likewise.
8034         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8035         helper that implement a save/restore stack for CheckState
8036         values.  This is the only way to change check-state.
8037         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8038         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8039         (CheckedExpr.EmitBranchable): New forwarding method.
8040         (UnCheckedExpr): Likewise.
8041         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8042         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8043         (Checked.Resolve, checked.DoEmit): Likewise.
8044
8045 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8046
8047         * anonymous.cs: Cache the resolved anonymous delegate, and return
8048         this so that the ResolveTopBlock is only triggered once, not
8049         twice.
8050
8051         Currently we trigger ResolvetopBlock twice due to a first pass of
8052         argument check compatibility, and a second pass that does the
8053         actual resolution.   
8054         
8055 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8056
8057         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8058         modifiers.
8059         * rootcontext.cs (Reset): Add helper_classes.
8060
8061 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8062
8063         A fix for #78860
8064         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8065         correctly.
8066
8067 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8068
8069         * statement.cs (Lock): Handle expressions of type
8070         TypeManager.null_type specially.  Fixes #78770
8071
8072 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8073
8074         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8075         to an event.
8076
8077 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8078
8079         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8080         for accessors as well.
8081         * ecore.cs (EventExpr): Add AccessorTable.
8082
8083 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8084
8085         A fix for #78738
8086         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8087         for CS0122 where appropriate.
8088         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8089         level attributes.
8090         (Filter): Assembly can be null in the case of top level attributes.
8091
8092 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8093
8094         A fix for #78690
8095
8096         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8097         is done at global level.
8098
8099 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8100
8101         A fix for #77002, Implemented TypeForwarder support.
8102
8103         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8104         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8105         * typemanager.cs (): Add type_forwarder_attr_type.
8106
8107 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8108
8109         * report.cs: Add CS0469 warning.
8110
8111 2006-06-21  Martin Baulig  <martin@ximian.com>
8112
8113         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8114         the `try'-block, so we also report CS0016 etc. there.
8115
8116 2006-06-21  Martin Baulig  <martin@ximian.com>
8117
8118         * delegate.cs
8119         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8120
8121 2006-06-21  Martin Baulig  <martin@ximian.com>
8122
8123         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8124         also report CS1686 for parameters.
8125
8126 2006-06-21  Martin Baulig  <martin@ximian.com>
8127
8128         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8129         instead of an error if the value is not implicitly convertible to
8130         the switch types; fixes #77964.
8131
8132 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8133
8134         Fix #78673
8135         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8136         FieldBuilder is null.
8137
8138         Fix #78662
8139         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8140         'left' and 'right' before error-checking.
8141
8142 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8143
8144         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8145         Fixed bug #78601.
8146         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8147         (FieldExpr.DoResolve): likewise.
8148         (PropertyExpr.InstanceResolve): likewise.
8149         (EventExpr.InstanceResolve): likewise. 
8150
8151 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8152
8153         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8154         attribute applicable tests for attribute argument.
8155
8156 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8157
8158         Fix #78079
8159         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8160         (Binary.OverloadResolve_PredefinedIntegral): New.
8161         (Binary.OverloadResolve_PredefinedFloating): New.
8162         (Binary.OverloadResolve_PredefinedString): New.
8163         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8164         Follow the standard more closely, and treat numeric promotions in
8165         terms of overload resolution.
8166         (Binary.CheckShiftArguments): Simplify.
8167
8168 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8169
8170         * flowanalysis.cs (MyBitVector): Simplify representation.
8171         (MyBitVector.Clone): Avoid allocating BitArray.
8172         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8173         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8174         (*): Update.  Change all references to MyBitVector.And and
8175         MyBitVector.Or to &= and |=.
8176
8177 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8178
8179         Fix cs0231-[34].cs.
8180         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8181         to param arguments too.
8182
8183 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8184
8185         * cs-parser.jay: Catch another parsing form for arglist being
8186         followed by other arguments.  Fixes #78313.
8187
8188 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8189
8190         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8191         checking of out parameters to ...
8192         (FlowBranchingToplevel.Merge): ... here.
8193         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8194         set, propagate the origin upward, and only complain if there was
8195         no other error.
8196         (FlowBranchingException.AddContinueOrigin): Likewise.
8197         (FlowBranchingException.AddReturnOrigin): Likewise.
8198         (FlowBranchingException.AddGotoOrigin): Likewise.       
8199
8200 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8201
8202         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8203         unreachable, skip it.
8204         (FlowBranchingException.Merge): Always propagate jumps, even if
8205         the finally block renders subsequent code unreachable.
8206
8207 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8208
8209         Fix #77601
8210         * statement.cs (Goto.Resolve): Move responsibility for resolving
8211         'goto' to FlowBranching.AddGotoOrigin.
8212         (Goto.SetResolvedTarget): New.  Callback to set the
8213         LabeledStatement that's the target of the goto.
8214         (Goto.DoEmit): Use Leave instead of Br when crossing an
8215         unwind-protect boundary.
8216         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8217         LookupLabel and adjust to new semantics.
8218         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8219         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8220         Goto.SetResolvedTarget to update target.
8221         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8222         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8223         AddBreakOrigin & co.  Delay propagation until ...
8224         (FlowBranchingException.Merge): ... this.
8225
8226         * statement.cs (Block.Resolve): Always depend on flow-branching to
8227         determine unreachability.  Kill workaround that originally emitted
8228         only one statement after an "unreachable" label (see infloop in
8229         test-515.cs).
8230
8231         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8232         This is still "wrong", but anything better would probably need a
8233         multi-pass algorithm.
8234         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8235         usage vector.  Force current usage vector to be reachable, to
8236         optimistically signify backward jumps.
8237         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8238         detected.
8239         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8240         detected, return the original salted-away usage vector instead,
8241         updated with appropriate changes.  Print unreachable warning if
8242         necessary.
8243         * statement.cs (Block.Resolve): Don't print unreachable warning on
8244         a labeled statement.
8245
8246 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8247
8248         * driver.cs: Pass filename without path to AssemblyBuilder's 
8249         AddResourceFile. Fixes bug #78407.
8250
8251 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8252
8253         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8254         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8255         (FlowBranching.MergeChild): Overwrite
8256         reachability information from Labeled branchings too.
8257
8258 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8259
8260         * statement.cs (Goto.Resolve): Merge jump origins here ...
8261         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8262
8263         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8264         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8265         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8266         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8267         here, ...
8268         * statement.cs (Goto.Resolve): ... not here.
8269         (Goto.Emit): Remove CS1632 check.
8270
8271 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8272
8273         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8274         error message.
8275
8276 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8277
8278         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8279         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8280         (FlowBranchingException.Label): Likewise.
8281
8282         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8283         given value.
8284         (MyBitVector.Or): Use it to avoid losing information (Count).
8285         (FlowBranching.MergeOrigins): Likewise.
8286
8287         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8288         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8289         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8290         (UsageVector.ToString): Simplify.
8291         (UsageVector.MergeSiblings): Move here from ...
8292         (FlowBranching.Merge): ... here.
8293         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8294         not a MyBitVector.
8295
8296 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8297
8298         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8299         null bitvector is treated as all-true.
8300
8301         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8302         (MyBitVector): Rationalize invariants.  'vector != null' implies
8303         that we have our own copy of the bitvector.  Otherwise,
8304         'InheritsFrom == null' implies all inherited bits are true.
8305
8306 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8307
8308         * statement.cs (LocalInfo): Add IsConstant.
8309         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8310         local variable for constants.
8311
8312 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8313
8314         * flowanalysis.cs (MyBitVector.Empty): New.
8315         (MyBitVector): Don't allow InheritedFrom to be null.
8316         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8317         (UsageVector, FlowBranching): Update to changes.
8318
8319         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8320         recursion.  The 'Parent == null' condition isn't sufficient for
8321         anonymous methods.
8322         (FlowBranching.AddBreakOrigin): Likewise.
8323         (FlowBranching.AddContinueOrigin): Likewise.
8324         (FlowBranching.AddReturnOrigin): Likewise.
8325         (FlowBranching.StealFinallyClauses): Likewise.
8326         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8327         (FlowBranching.CheckOutParameters): Likewise.
8328         (FlowBranchingToplevel): Terminate all the above recursions here.
8329         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8330         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8331
8332         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8333         toplevel block.
8334         (FlowBranchingToplevel): New.  Empty for now.
8335         (FlowBranching.MergeTopBlock): Update.
8336         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8337         branching for the anonymous delegate.
8338         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8339
8340         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8341         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8342         information at the start of the merge.  Reorganize.
8343
8344 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8345
8346         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8347
8348 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8349
8350         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8351         to newly introduced ctor.
8352
8353         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8354         message to one place.
8355         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8356         global namespace.
8357
8358 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8359
8360         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8361
8362         * ecore.cs (Expression.ResolveAsConstant): Updated.
8363
8364         * statement.cs (ResolveMeta): Updated.
8365
8366 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8367
8368         * cs-parser.jay: __arglist cannot be used in initializer.
8369
8370 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8371
8372         A fix for #77879
8373         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8374         private types.
8375
8376 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8377
8378         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8379         (LabeledStatement): Add 'name' parameter.
8380         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8381         (Block.AddLabel): Update to changes.
8382         * cs-parser.jay (labeled_statement): Likewise.
8383
8384         * flowanalysis.cs (BranchingType.Labeled): New.
8385         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8386         (FlowBranchingLabeled): New.  Does nothing for now, but will
8387         eventually handle 'goto' flows.
8388         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8389         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8390         that's terminated ...
8391         (Block.Resolve): ... here.
8392
8393         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8394         (UsageVector.MergeFinallyOrigins): Likewise.
8395         (FlowBranching.InTryOrCatch): Likewise.
8396         (FlowBranching.AddFinallyVector): Likewise.
8397         (FlowBranchingException): Update to changes.
8398
8399         Fix #78290
8400         * statement.cs (Return.Resolve): Move error checking to ...
8401         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8402         (FlowBranchingException): Handle return origins like break and
8403         continue origins.
8404         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8405
8406 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8407
8408         A fix for #76122
8409         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8410         filter.
8411
8412 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8413
8414         A fix for #77543
8415         * class.cs (MethodData.Define): Do public accessor check only when method
8416         implements an interface.
8417
8418 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8419
8420         Remove special handling of 'break'
8421         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8422         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8423         (UsageVector.Break): Remove.
8424         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8425         reachability.
8426         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8427
8428         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8429         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8430
8431 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8432
8433         A fix for #75726
8434         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8435         be the interface member.
8436
8437 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8438
8439         A fix for #60069
8440         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8441         for emitting small (int) values.
8442
8443 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8444
8445         Fix #59427
8446         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8447         control-flow passes through the 'finally' after merging-in all the
8448         control-flows from 'try' and the 'catch' clauses.
8449
8450         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8451         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8452         always true at the only non-recursive entry point.
8453         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8454         FlowBranchingBreakable.
8455         (FlowBranchingLoop): Remove.
8456         * statement.cs (Return.DoResolve): Update to changes.
8457
8458         Fix #76471, #76665
8459         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8460         (FlowBranching.CreateBranching): Handle it: create a
8461         FlowBranchingContinuable.
8462         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8463         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8464         except that it handles the 'continue' command.
8465         (FlowBranching.UsageVector.MergeOrigins): Rename from
8466         MergeBreakOrigins.
8467         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8468         except that it overrides AddContinueOrigin.
8469         (FlowBranchingException): Override AddContinueOrigin, similar to
8470         AddBreakOrigin.
8471         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8472         Create a new branching around the embedded statement.
8473         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8474         control flow after the embedded statement.
8475         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8476
8477         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8478         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8479         FlowBranchingBreakable.
8480         (FlowBranchingSwitch): Remove.
8481
8482         Fix test-503.cs
8483         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8484         error reporting to ...
8485         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8486         Rename from 'AddBreakVector'.  Add new location argument.  Return
8487         a bool indicating whether the 'break' crosses an unwind-protect.
8488         (FlowBranchingException.AddBreakOrigin): Add.
8489         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8490         flowbranching after updating with the effects of the 'finally'
8491         clause.
8492         (FlowBranchingBreakable): New common base class for
8493         FlowBranchingLoop and FlowBranchingSwitch.
8494
8495         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8496         embedded statement.
8497         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8498
8499 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8500
8501         * statement.cs (Do.Resolve): If the loop is infinite, set the
8502         barrier.
8503         (While.Resolve, For.Resolve): Set a barrier after the embedded
8504         statement.  There's no direct control flow that goes from the end
8505         of the embedded statement to the end of the loop.
8506         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8507         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8508         above ensure that the reachability is correctly computed.
8509
8510         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8511         (UsageVector.MergeBreakOrigins): If the current path is
8512         unreachable, treat it as if all parameters/locals are initialized.
8513         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8514         infinite loops before merging-in break origins.
8515
8516         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8517         (Reachability.Reachable): Split part into ...
8518         (Reachability.Unreachable): ... this.  Simplify.
8519         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8520
8521         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8522         (Reachability.SetThrowsSometimes): Likewise.
8523         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8524         TriState.Always, use corresponding property.
8525         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8526         (Block.Resolve): Likewise.  Remove some redundant checks.
8527
8528 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8529
8530         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8531         (Reachability.Meet): Don't bother checking AlwaysThrows --
8532         barrier is always set.
8533         (FlowBranchingBlock.Merge): Likewise.
8534
8535 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8536
8537         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8538         checks for unreachable.
8539
8540 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8541
8542         A fix for #77980
8543         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8544
8545         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8546         whether field is really assigned.
8547
8548 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8549
8550         * flowanalysis.cs (Reachability): Make 4-argument constructor
8551         private.
8552         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8553         (Reachability.Always): Rename from the highly misleading
8554         'Reachability.Never'.
8555         (FlowBranching.Merge): Update to changes.  Mark an impossible
8556         situation with a 'throw'.
8557         (*): Update to changes.
8558
8559 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8560
8561         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8562         Remove 'Undefined'.
8563         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8564         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8565         (*): Update to changes.
8566         * statement.cs: Update to changes.
8567
8568 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8569
8570         A fix for #78049
8571         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8572
8573 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8574
8575         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8576         dummy UsageVector.
8577
8578         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8579         argument to two arguments: an usage-vector and a bool.  Move call
8580         to FlowBranching.Merge () ...
8581         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8582
8583         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8584         handling of loop and switch reachability to ...
8585         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8586
8587 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8588
8589         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8590         handling to FlowBranchingLoop.InLoop.
8591         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8592
8593 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8594
8595         A fix for #78115
8596         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8597         anonymous method is allowed from AnonymousContainer here.
8598
8599         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8600
8601 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8602
8603         Fix #78156
8604         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8605
8606 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8607
8608         A fix for #49011.
8609         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8610         (DoubleConstant.Reduce): Ditto.
8611
8612 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8613
8614         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8615         Remove 'lvalue_right_side' argument.  Move parts to ...
8616         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8617         (LocalVariable.DoResolveLValue): ... these.
8618
8619 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8620
8621         Fix cs1655.cs
8622         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8623         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8624         (LocalVariableReference.DoResolveBase): Use it to implement new
8625         CS1655 check.
8626         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8627         (Argument.Resolve): Simplify.  Move CS1510 check ...
8628         * ecore.cs (Expression.ResolveLValue): ... here.
8629         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8630         (PropertyExpr.DoResolveLValue): Likewise.
8631         (FieldExpr.Report_AssignToReadonly): Likewise.
8632         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8633         LValueMemberAccess or LValueMemberOutAccess on instance depending
8634         on it.
8635         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8636         DoResolve as appropriate.
8637
8638 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8639
8640         Fix #75800
8641         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8642         implicit conversions on 'out' and 'ref' arguments.
8643
8644         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8645         improve clarity.  Remove dead code.
8646
8647         Fix #66031
8648         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8649         (Catch.Resolve): Resolve VarBlock if it exists.
8650
8651 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8652
8653         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8654         twice, this was some residual code, the enumerator was emitted
8655         properly in the two branche of if later.
8656
8657 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8658
8659         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8660         cast is never an lvalue.
8661         (Cast.DoResolve, Cast.ResolveRest): Combine.
8662         (Argument.Emit): Simplify slightly.  Move 'Expr is
8663         IMemoryLocation' check ...
8664         (Argument.Resolve): ... here.
8665         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8666
8667         Simplifications.  Fix cs0191-2.cs
8668         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8669         CS1649 and CS1651 to ...
8670         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8671         the actual selection of the error code and message to a lookup
8672         table.  Add a dummy return value to simplify callsites.
8673         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8674         readonly fields of other instances of the same type.  Move CS0197
8675         warning from ...
8676         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8677         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8678         resolution of an out or ref argument.  The code simplification
8679         above uses this invariant.
8680
8681 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8682
8683         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8684         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8685         CheckMarshallByRefAccess.  Drop parameter.
8686         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8687         warning.
8688         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8689         InstanceExpression.
8690         * report.cs (AllWarnings): Add CS1690.
8691         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8692         for ref access too.
8693         (LocalVariableReference.DoResolveBase): Update.
8694
8695 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8696
8697         * class.cs (MethodOrOperator): Moved common parts from method class.
8698         detect obsolete attributes.
8699         (Method.Define): Simplified as it reuses code from base.
8700         (Constructor.ValidAttributeTargets): Fixed issue found during
8701         refactoring.
8702         (Destructor.ValidAttributeTargets): Fixed issue found during
8703         refactoring.
8704         (Operator): Finished refactoring set off by #78020. Operator class is now
8705         ordinary method class.
8706
8707         * anonymous.cs: Updated.
8708
8709         * decl.cs (DeclSpace): Add IsGeneric
8710
8711 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8712
8713         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8714
8715 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8716
8717         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8718         detect obsolete attributes.
8719         (Method.CreateEmitContext): Moved to MethodOrOperator.
8720
8721 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8722
8723         A fix for #78048.
8724         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8725         customized exception to make crash detection easier.
8726         (MethodOrOperator): Started to work on new base class for methods and
8727         operators.
8728         (Method): Derives from MethodOrOperator.
8729         (Constructor.Emit): Emits its own attributes.
8730         (AbstractPropertyEventMethod.Emit): Ditto.
8731         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8732         patch.
8733         (Operator.Emit): It's temporary more tricky than should be.
8734         
8735         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8736
8737         * report.cs (InternalErrorException): Add ctor with inner exception.
8738
8739 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8740
8741         A fix for #76744.
8742         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8743         only not visible.
8744
8745 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8746
8747         A fix for #77916.
8748         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8749         array.
8750
8751 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8752
8753         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8754         attribute is present and Guid not.
8755         (Interface.ApplyAttributeBuilder): Ditto.
8756
8757         * attribute.cs: Add error message.
8758
8759 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8760
8761         A fix for #78020.
8762
8763         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8764         sources (it's composite) so hold them in extra array as they are used in
8765         Emit phase only. It worked in the previous versions by mistake.
8766         (Attribute.Emit): Emit attribute for more owners when exist.
8767
8768         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8769         it has now different behaviour.
8770
8771 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8772
8773         * constant.cs (Constant.IsDefaultInitializer): New method.
8774
8775         * class.cs: Updated.
8776
8777         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8778         re-initialize default values. It saves KBs almost for every assembly.
8779         Thanks Zoltan for the idea.
8780         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8781         (ArrayCreation.DoResolve): Resolve only once.
8782         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8783         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8784
8785 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8786
8787         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8788         From #77961.
8789
8790 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8791
8792         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8793         in an embedded statement too.
8794
8795 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8796
8797         Fix #77958
8798         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8799
8800 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8801
8802         A fix for #77966.
8803
8804         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8805         was not specified.
8806
8807         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8808
8809 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8810
8811         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8812         phase.
8813
8814         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8815         LocalTemporary change.
8816
8817         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8818         TypeContainer.
8819         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8820         initializers optimization.
8821         (ClassOrStruct.TypeAttr): Moved from modifiers.
8822         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8823         (FieldBase.ResolveInitializer): Resolves initializer.
8824         (FieldBase.HasDefaultInitializer): New property.
8825
8826         * cs-parser.jay: Removed message.
8827
8828         * expression.cs (CompilerGeneratedThis): New specialization.
8829
8830         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8831
8832 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8833
8834         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8835
8836 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8837
8838         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8839         be now EnumConstants only.
8840
8841 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8842
8843         * attribute.cs, driver.cs: Reset more caches.
8844
8845 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8846
8847         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8848
8849 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8850
8851         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8852         for easier reuse. Updated all overrides.
8853         (IntegralConstant): New base class for all integral constants.
8854         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8855         of the constant range, report custom error.
8856         (UIntConstant.Reduce): Fixed uint conversion.
8857
8858         * ecore.cs, literal.cs: Reduce updates.
8859
8860 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8861
8862         A fix for #75813.
8863
8864         * class.cs (Constructor.Define): Removed extra if for default ctors.
8865         A patch from Atsushi Enomoto.
8866
8867 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8868
8869         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8870         GetAttributableValue.
8871
8872         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8873         when required.
8874
8875         * convert.cs (ImplicitConversionRequired): Error message moved to
8876         DoubleLiteral.
8877
8878         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8879         automatic implicit conversion of an output value.
8880         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8881
8882         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8883         conversion.
8884         (TypeOf.GetAttributableValue): Add extra handling for object type.
8885
8886         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
8887         special error message.
8888
8889 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
8890
8891         * class.cs (Constructor.Emit): Don't crash when struct ctor is
8892         InternalCall.
8893         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
8894         compatible with MS runtime.
8895
8896 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
8897
8898         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
8899         attribute arguments here.
8900
8901         * class.cs (Indexer.Define): The check was moved to attribute class.
8902
8903 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
8904
8905         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
8906         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
8907         easier.
8908
8909 2006-03-22  Raja R Harinath  <rharinath@novell.com>
8910
8911         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
8912         mcs to keep code differences small.
8913         * attribute.cs (Attribute.GetParameterDefaultValue): New.
8914         * typemanager.cs (parameter_default_value_attribute_type): New.
8915         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
8916         CS1908 check.
8917
8918 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8919
8920         * expression.cs (StringConcat.Append): Reverted back to no warning state.
8921
8922 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
8923
8924         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
8925
8926         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
8927         the blocks too.
8928
8929 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
8930
8931         * doc-bootstrap.cs : fix build.
8932
8933 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8934
8935         * expression.cs (StringConcat.Append): Issue a warning when empty string
8936         is going to append.
8937
8938 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
8939
8940         * assign.cs (CompoundAssign.ResolveSource): Removed.
8941
8942         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
8943         clean up.
8944
8945         * class.cs (TypeContainer.FindMethods): Removed.
8946         (TypeContainer.CheckMemberUsage): Made static.
8947
8948         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
8949
8950         * constant.cs (CheckRange): Removed unused type argument.
8951         (CheckUnsigned): Removed unused type argument.
8952
8953         * cs-parser.jay: Updated after MemberAccess clean up.
8954         Uses Length for empty string test.
8955
8956         * cs-tokenizer.cs: Uses Length for empty string test.
8957         (IsCastToken): Made static.
8958         (is_hex): Made static.
8959         (real_type_suffix): Made static.
8960
8961         * decl.cs (SetupCache): Made static.
8962         (OnGenerateDocComment): Removed unused ds argument.
8963
8964         * delegate.cs (VerifyDelegate): Removed unused argument.
8965
8966         * doc.cs: Uses Length for empty string test.
8967
8968         * driver.cs: Uses Length for empty string test.
8969
8970         * enum.cs (IsValidEnumType): Made static
8971
8972         * expression.cs (EnumLiftUp): Removed unused argument.
8973         (ResolveMethodGroup): Ditto.
8974         (BetterConversion): Ditto.
8975         (GetVarargsTypes): Ditto.
8976         (UpdateIndices): Ditto.
8977         (ValidateInitializers): Ditto.
8978         (MemberAccess.ctor): Ditto.
8979         (GetIndexersForType): Ditto.
8980
8981         * flowanalysis.cs: (MergeFinally): Removed unused argument.
8982
8983         * iterators.cs: Updated after MemberAccess clean up.
8984
8985         * location.cs: Uses Length for empty string test.
8986
8987         * namespace.cs: Uses Length for empty string test.
8988
8989          * report.cs (CheckWarningCode): Made static.
8990
8991         * statement.cs (LabeledStatement): Removed unused argument.
8992
8993         * typemanager.cs (FilterNone): Removed.
8994
8995 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
8996
8997         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
8998         obsolete.
8999
9000         * class.cs: Updated.
9001
9002 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9003
9004         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9005
9006 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9007
9008         A fix for #77822.
9009
9010         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9011         reporting, it's more tricky than I thought.
9012
9013 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9014
9015         A fix for #77816.
9016
9017         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9018         host container.
9019         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9020         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9021         Add more error reporting; Fixed issue with params.
9022
9023         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9024
9025         * cs-parser.jay: AnonymousMethod requires host container.
9026
9027         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9028
9029 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9030
9031         * class.cs: Change 'TypeContainer ds' constructor argument to
9032         'DeclSpace parent'.  Some classes were missed below due to
9033         different naming convention.
9034
9035         * class.cs (MemberCore.Parent): Delete.  This makes the
9036         ParentContainer changes below enforceable by the compiler.
9037
9038         Treat pointers to enclosing declaration space as 'DeclSpace', not
9039         'TypeContainer'.
9040         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9041         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9042
9043         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9044         of TypeContainer.
9045         (Block.AddThisVariable): Likewise.
9046         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9047         (AbstractPropertyEventMethod.Emit): Likewise.
9048         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9049         (GetMethod.Define, SetMethod.Define): Likewise.
9050         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9051         (DelegateMethod.EmitMethod): Likewise.
9052
9053         Fix regression test-partial-13.cs.
9054         Rationalize use of PartialContainer.  Ensure that the partial
9055         class semantics can be tied to type-correctness, i.e., any
9056         violation will cause a compile error.
9057         * class.cs, const.cs: Access all fields that belong to class
9058         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9059         Resolve()-like functions still use 'Parent'.
9060
9061         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9062         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9063         (PropertyMethod.CheckModifiers): Remove unused argument.
9064         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9065         DeclSpace.
9066
9067 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9068
9069         Make semantics of PartialContainer simpler.
9070         * decl.cs (DeclSpace.IsPartial): Remove.
9071         * class.cs (TypeContainer.IsPartial): Likewise.
9072         (TypeContainer..ctor): Set PartialContainer to point to self.
9073         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9074         (TypeContainer.FindNestedType): Likewise.
9075         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9076
9077 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9078
9079         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9080
9081 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9082
9083         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9084         classes.
9085
9086 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9087
9088         * class.cs (Operator.Define): An error for base conversion was not
9089         reported correctly.
9090
9091 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9092
9093         * iterator.cs : yield break is allowed in try statement which has
9094           catch clauses. Fixed bug #77767.
9095
9096 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9097
9098         A fix for #77593, #77574.
9099
9100         * class.cs (MethodCore.CheckBase): Another if for operator.
9101
9102 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9103
9104         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9105         were not resolved
9106
9107         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9108         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9109         conversion test.
9110         
9111         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9112         not needed.
9113
9114         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9115         Updated after another emitcontext usage was clean up. It should help us to
9116         synchronize with gmcs easier.
9117
9118 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9119
9120         A fix for #77353.
9121
9122         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9123         (Event.Define): ditto
9124         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9125
9126         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9127         Removed redundant code and set NewSlot for Invoke method too.
9128
9129         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9130         (Parameters.MergeGenerated): New method. Use this method when you merge
9131         compiler generated argument with user arguments.
9132
9133 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9134
9135         * attribute.cs (ResolveAsTypeTerminal): Removed.
9136
9137         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9138         specialization for predefined types; 30% speed up.
9139         Finally placed obsolete check to right place.
9140         (Expression.ResolveType): Removed.
9141
9142         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9143         Updated after ResolveType was removed.
9144
9145         * expression.cs (Cast.ctor): Check void cast.
9146         (Binary.ResolveAsTypeTerminal): Is never type.
9147         (Conditional.ResolveAsTypeTerminal): Is never type.
9148
9149         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9150
9151 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9152
9153         Fix #77679.
9154         * expression.cs (ParameterReference.DoResolveBase): Change return
9155         type to bool.
9156         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9157         Update.
9158
9159         Fix #77628.
9160         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9161
9162         Fix #77642.
9163         * typemanager.cs (GetFullNameSignature): Don't nullref on
9164         protected accessors.
9165
9166 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9167
9168         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9169         these two separated members to simplify the code.
9170         (Attribute.Resolve): Refactored to use new fields and methods.
9171         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9172         implemented obsolete attribute checking.
9173         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9174         implemented obsolete checking again. It look line never ending quest ;-)
9175         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9176
9177         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9178
9179         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9180
9181         *class.cs (Property.Define): Add RegisterProperty call.
9182
9183         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9184         argument groups (only 2).
9185
9186         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9187         encoding expression to arguments.
9188         (Expression.ExprClassToResolveFlags): Just turned to property.
9189
9190         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9191         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9192         optimized as well as implemented support for zero-length attributes.
9193
9194         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9195         Add caching of PropertyInfo's.
9196
9197 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9198
9199         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9200         error multiple times.
9201
9202 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9203
9204         New partial class implementation.
9205         A fix for #77027, #77029, #77403
9206
9207         * attribute.cs (Attributable): Made attributes protected.
9208
9209         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9210         the replacements of ClassPart and PartialContainer.
9211         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9212         (TypeContainer.AddInterface): Ditto.
9213         (TypeContainer.AddPartial): The main method for partial classes. It checks
9214         for errors and merges ModFlags and attributes. At the end class is added to
9215         partial_parts list.
9216         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9217         required here.
9218         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9219         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9220         from the rest of partial classes.
9221         (TypeContainer.GetClassBases): Simplified.
9222         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9223         DefineType.
9224         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9225         (TypeContainer.HasExplicitLayout): Uses Flags now.
9226         (PartialContainer): Removed.
9227         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9228         (StaticClass): Was merged with Class.
9229         (Class.GetClassBases): class and static class bases are verified here.
9230         (Class.TypeAttr): Added static attributes when class is static.
9231         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9232         (MemberBase): In some cases we need to call parent container for partial
9233         class. It should be eliminated but it's not easy now.
9234
9235         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9236
9237         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9238         partial classed to accumulate class comments.
9239         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9240
9241         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9242
9243         * driver.cs (MainDriver): Tree.GetDecl was removed.
9244
9245         * modifiers.cs (Modifiers): Add partial modifier.
9246
9247         * tree.cs (Tree.decl): Removed.
9248         (RootTypes): Started to use this class more often for root types
9249         specializations.
9250
9251 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9252
9253         A fix for #77615
9254
9255         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9256         external interface does not have an attribute.
9257
9258 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9259
9260         Another prerequisites for new partial classs implementation.
9261         
9262         * attribute.cs (Attribute.Equal): Implemented.
9263         (Attribute.Emit): Changed as attributes can be applied more than twice.
9264         (Attributes.Emit): Check for duplicate attributes here.
9265
9266         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9267         as a parameter, clean-up.
9268
9269 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9270
9271         A fix for #77485
9272
9273         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9274         contains obsolete attribute check which can in some cases look for base
9275         type of current class which is not initialized yet.
9276         (TypeContainer.BaseType): Replacement of ptype.
9277
9278         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9279
9280 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9281
9282         First of prerequisites for new partial classs implemention.
9283         
9284         * attribute.cs (Attributable): Extended by ResolveContext;
9285         Attributes finally have correct context for resolving in all cases.
9286         (AttachTo): Attribute owner is assigned here.
9287
9288         * codegen.cs (IResolveContext): Introduce new interface to hold
9289         all information needed in resolving phase.
9290         (EmitContext): Implements IResolveContext; more clean-up needed here.
9291         
9292         * decl.cs (MemberCore): Implemented IResolveContext.
9293
9294         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9295         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9296         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9297         Refactored to use new IResolveContext instead of EmitContext; cleanup
9298
9299 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9300
9301         * codegen.cs (EmitScopeInitFromBlock): check here the
9302         capture_context, there is no need to make two calls to the
9303         EmitContext. 
9304
9305         * anonymous.cs: Add some debugging messages that might help me
9306         track other instances of this problem in the future (the
9307         regression of test 467).
9308
9309         * cs-parser.jay: track the variable block, as we need to initalize
9310         any captured variables declared in this block for the "catch"
9311         portion of the "Try" statement.
9312
9313         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9314         scope initialization for captured variables. 
9315
9316         Also, move the emit for the variables after the block location has
9317         been marked.
9318
9319 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9320
9321         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9322
9323 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9324
9325         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9326         commit yesterday, the initialization for the roots is necessary.
9327         What is not necessary is the scope activation.
9328
9329 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9330
9331         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9332         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9333         CS0206 checks.
9334         (Argument.Resolve): Remove CS0206 checks.
9335
9336 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9337
9338         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9339         scopes for all the roots, the scopes will now be emitted when the
9340         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9341
9342         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9343         code.  This reduces a lot of existing cruft.
9344         
9345         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9346         that the ScopeInfo is generated as we enter the scope, not at the
9347         time of use, which is what we used to do before.
9348
9349         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9350         every time a Block is about to be emitted if we have a
9351         CaptureContext. 
9352
9353 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9354
9355         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9356         (Reset): Update.
9357         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9358
9359         * typemanager.cs (cons_param_array_attribute): Make private.
9360         (Reset): Set it to null.
9361         (InitCoreHelpers): Don't initialize it.
9362         (ConsParamArrayAttribute): New.  Initialize it as needed.
9363         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9364
9365 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9366
9367         * expression.cs: There might be errors reported during the
9368         selection of applicable methods.  If there are errors, do not
9369         continue execution as it will lead the compiler to crash.
9370
9371 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9372
9373         * expression.cs: Member access is not allowed on anonymous
9374         methods.  Fixes #77402.
9375
9376 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9377
9378         Fix #77401
9379         * cs-parser.jay (VariableDeclaration): Don't set
9380         current_array_type to null.
9381         (field_declaration, event_declaration, declaration_statement):
9382         Set it to null here.
9383
9384 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9385
9386         * typemanager.cs (GenericParameterPosition): New.
9387         * doc.cs: Use it.
9388
9389 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9390
9391         * doc.cs : To process "include" elements, first we should create
9392           another list than XmlNodeList, because it could result in node
9393           removal, which could result in that the XmlNodeList gives up
9394           yielding next node.
9395
9396           (Also made code identical to gmcs again.)
9397
9398 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9399
9400         * ecore.cs: Introduce an error report that we were not catching
9401         before, if not silent, we must report the error.  Gonzalo ran into
9402         it.
9403
9404 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9405
9406         A fix for bug: #76957
9407         
9408         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9409         ComputeMethodHost before creating the method, this is a new
9410         requirement. 
9411
9412         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9413         that this method references (RegisterScope).  The actual scope
9414         where the method is hosted is computed with the ComputeMethodHost
9415         before we create the method.
9416
9417         Moved the Deepest routine here.
9418
9419         (AnonymousContainer.ComputeMethodHost): New routine used to
9420         compute the proper ScopeInfo that will host the anonymous method.
9421
9422         (ScopeInfo): Deal with multiple roots.  The problem was that we
9423         did not have a unique root where all ScopeInfos could be hanged
9424         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9425         of roots.  
9426
9427         Remove AdjustMethodScope which is now computed at the end.  Remove
9428         LinkScope which did a partial link, instead link all ScopeInfos
9429         before code generation from the new "LinkScopes" routine. 
9430
9431         Simplify all the Add* routines as they no longer need to maintain
9432         the tree, they just need to record that they are using variables
9433         from a ScopeInfo.
9434
9435         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9436         routines to produce the forest of ScopeInfo trees.
9437
9438         * class.cs (TypeContainer.AppendMethod): This is just like
9439         AddMethod, but ensures that an interface implementation method
9440         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9441         methods, but at the end.
9442
9443         We use this functionality to ensure that the generated MoveNext
9444         method in the iterator class is resolved/emitted before the
9445         enumerator methods created.   
9446
9447         This is required because the MoveNext method computes the right
9448         ScopeInfo for the method.  And the other methods will eventually
9449         need to resolve and fetch information computed from the anonymous
9450         method. 
9451
9452 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9453             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9454
9455         Fix rest of #76995.
9456         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9457         the 'aliases' hash.
9458         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9459         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9460
9461 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9462
9463         Fix #76656, cs0231-2.cs.
9464         * cs-parser.jay (formal_parameter_list): Make error case catch
9465         more issues.
9466         (parenthesized_expression_0): Add CS1026 check.
9467         (invocation_expression): Remove unused { $$ = lexer.Location }.
9468
9469 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9470
9471         Fix #76824.
9472         * cs-parser.jay (statement_expression): Don't list out the
9473         individual statement-expressions.  Convert syntax error into
9474         CS0201 check.
9475
9476 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9477
9478         Fix #76874.
9479         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9480         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9481         CheckIntermediateModification.
9482         (FieldExpr.DoResolve): Add new two-argument version that
9483         allows us to resolve the InstanceExpression as an lvalue.
9484         The one-argument variant is now just a wrapper.
9485         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9486         Resolve the lhs as an lvalue if the it has a value type.
9487         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9488         from Assign.DoResolve.
9489         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9490         resolved as an lvalue.
9491         (PropertyExpr.DoResolve): Update.
9492         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9493         has a value type.  Move CS1612 check here from
9494         CheckIntermediateModification.
9495         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9496         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9497         'right_side' of a ResolveLValue on an 'out' argument.
9498         (EmptyExpression.LValueMemberAccess): New.  Used as the
9499         'right_side' of a propagated ResolveLValue on a value type.
9500         (LocalVariableReference.DoResolveBase): Recognize
9501         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9502         Add CS1654 check.
9503         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9504         EmptyExpression.Null.
9505
9506 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9507
9508         * typemanager.cs : added IsGenericParameter(). In mcs it always
9509           return false.
9510         * doc.cs : for generic parameters, use GenericParameterPosition,
9511           not FullName.
9512
9513 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9514
9515         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9516
9517 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9518
9519         This fixes the problem where we used ldfld instead of ldflda to
9520         load the "THIS" pointer on captured parameters, when THIS is a
9521         value type.  See bug #77205.
9522         
9523         * iterators.cs (CapturedThisReference.Emit): Pass false to
9524         EmitThis (we do not need the address).
9525
9526         * codegen.cs (EmitThis): it needs to know whether we need the
9527         address of `this' or not.  This is used by value types.  
9528
9529         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9530         every other call passes false.
9531
9532 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9533
9534         Fix #77221.
9535         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9536         GetOverride.
9537         * expression.cs (Invocation.OverloadResolve): Update.
9538         (Invocation.DoResolve): Avoid double resolution of invocation.
9539
9540 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9541
9542         Fix #77180.
9543         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9544         unary negation of floating point types as 0-expr; negation cannot
9545         overflow in floating point types.
9546
9547         Fix #77204.
9548         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9549         on operands of 'void' type.
9550
9551         Fix #77200.
9552         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9553         and ExclusiveOr for boolean constants too.
9554
9555 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9556
9557         Fix #75636.
9558         * expression.cs (Invocation.OverloadResolve): Replace reflected
9559         override methods with their base virtual methods, rather than
9560         skipping over them.
9561         * typemanager.cs (TypeManager.GetOverride): New.
9562
9563 2006-01-05  Jb Evain  <jbevain@gmail.com>
9564
9565         * class.cs (Property.Define, Indexer.Define): do not tag the
9566         properties as SpecialName | RTSpecialName.
9567
9568 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9569
9570         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9571         doing a low-level comparission of parameter types.  It was lacking
9572         a check for __argslist. 
9573
9574 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9575
9576         * expression.cs (ParameterReference.DoResolveBase): Allow
9577         reference parameters if they are local to this block. 
9578
9579         This allows the ref and out parameters of a delegate to be used in
9580         an anonymous method, for example:
9581
9582         delegate void set (out int x);
9583
9584         set s = delegate (out int x){
9585                 x = 0;
9586         };
9587
9588         This is used by functionality introduced late in the C# language.
9589         
9590         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9591         method that take ref and out parameters. 
9592
9593         Fixes #77119 which was a late change in the spec.
9594
9595 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9596
9597         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9598         parent if its the same scope.  Fixes #77060.
9599
9600 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9601
9602         * driver.cs: Report the case of no source files and no -out:
9603         argument provided.
9604
9605 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9606
9607         Fix #77035.
9608         * expression.cs (ComposedCast.GetSignatureForError): Define.
9609
9610 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9611
9612         Fix #76995
9613
9614         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9615         ListDictionary, to contain the ExternAliasEntry entries (in
9616         addition to the NamespaceEntry.aliases hashtable). This field is
9617         shared between the original entry and its doppelganger (bodyless 
9618         copy of it).
9619         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9620         extern_aliases field.
9621         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9622         lookup in extern_aliases.
9623
9624 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9625
9626         Fix #77006.
9627         * class.cs (TypeContainer.Mark_HasEquals): New.
9628         (TypeContainer.Mark_HasGetHashCode): New.
9629         (ClassPart): Override them.
9630         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9631
9632         Fix #77008.
9633         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9634         'parent' argument to the base constructor.
9635
9636         Remove all mention of TypeContainer from decl.cs.
9637         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9638         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9639         (DeclSpace.DeclSpace): Likewise.
9640         (DeclSpace.DefineMembers): Remove unused argument.
9641         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9642         debugging check -- we don't care if the debug code throws an
9643         InvalidCastException instead of an InternalErrorException.
9644         * class.cs (TypeContainer.DefineMembers): Update to changes.
9645         (TypeContainer.DoDefineMembers): Likewise.
9646         (TypeContainer.GetMethods): Likewise.
9647         (PropertyMember.Define): Likewise.
9648         (MemberBase.Parent): New property that forwards to
9649         MemberCore.Parent, but ensures that we get a TypeContainer.
9650         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9651         (RootContext.PopulateTypes): Likewise.  Remove special case code
9652         for !RootContext.StdLib: DefineMembers is idempotent.
9653
9654 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9655
9656         * convert.cs (ExplicitConversionCore): Check the return value from
9657         ExplicitConversionCore which can return null on failure.  Fixes #76914
9658
9659 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9660
9661         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9662
9663 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9664
9665         * doc.cs : The search for referenced namespace was insufficient to
9666           get global one as it used to do. Fixed bug #76965.
9667
9668 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9669
9670         * doc.cs : check name in cref in the last phase that whether it is
9671           namespace or not.
9672
9673 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9674
9675         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9676           Mono.C5.
9677
9678 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9679
9680         * doc.cs : so it turned out that we cannot skip override check for 
9681           interface members. Fixed bug #76954.
9682
9683 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9684
9685         * cs-tokenizer.cs : fixed bug #75984:
9686           - #warning and #error should not be handled when the source line
9687             is disabled.
9688           - #line is not checked strictly when the source line is disabled.
9689           - #define and #undef is on the other hand checked strictly at any
9690             state.
9691
9692 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9693
9694         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9695           CS1027 report.
9696
9697 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9698
9699         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9700
9701         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9702         event initializers.
9703         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9704         (FieldBase.Initializer): Initializer is now optional.
9705         (EventField.Define): Only event field can have initializer.
9706
9707         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9708
9709         * const.cs (Const): Reuse initializer.
9710
9711         * cs-parser.jay: Updated after FieldBase changes.
9712         Added current_array_type to simplify array initializers.
9713
9714         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9715
9716         * expression.cs, iterators.cs: Updated.
9717
9718         * namespace.cs (NamespaceEntry): Made UsingFound private.
9719
9720 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9721
9722         * parameterCollection.cs: Obsolete, removed.
9723         * parser.cs: Obsolete, removed.
9724
9725 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9726
9727         Fix #76849.
9728         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9729
9730         * enum.cs (Enum.Define): Set obsolete context here.
9731
9732 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9733
9734         * doc.cs :
9735           - FindDocumentedMember() now expects 1) paramList as null
9736             when "we don't have to check the number of parameters" and
9737             2) Type.EmptyTypes when "there is no arguments".
9738           - Introduced FoundMember struct to hold the exact type which was
9739             used to find the documented member (the above change broke
9740             test-xml-044; it might be better just to use DeclaringType than
9741             what MS does, like this change does, but it depends on usage.)
9742
9743 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9744
9745         * doc.cs : documented member might be from DeclaringType for nested
9746           types. Fixed bug #76782.
9747
9748 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9749
9750         * anonymous.cs: Have the param code handle leaving copies on the
9751         stack etc. Allows anonymous params to take part in the assignment
9752         code (++, +=, etc). Fixes bug #76550
9753
9754         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9755         it down to the anon code.
9756
9757         * iterators.cs: Use dummy var here
9758
9759         * codegen.cs: Handle new vars
9760
9761 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9762
9763         Fix #76849.
9764         * class.cs (MethodData.Define): Set proper Obsolete context.
9765
9766         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9767         obsolete context.
9768         (FieldExpr.DoResolve): Ditto.
9769
9770 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9771
9772         Fix #76849.
9773         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9774         parent is not obsolete.
9775
9776 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9777
9778         * doc.cs : (FindDocumentedMember) find parameterless members first
9779           and get CS0419 in the early stage. Fixed first case of bug #76727.
9780
9781 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9782
9783         Fix #76859.
9784         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9785         no error was reported.
9786
9787         *expression.cs (Binary.DoResolve): left can be null.
9788
9789 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9790
9791         Fix #76783.
9792         * class.cs (MethodData.Emit): Parameters should be labeled first.
9793
9794 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9795
9796         Fix #76761.
9797         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9798
9799 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9800
9801         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9802
9803         * class.cs (MethodCore): Parameter clean up.
9804         (IMethodData): Added ParameterInfo.
9805         (MethodData): Parameter clean up.
9806         (Indexer.Define): Parameter clean up.
9807
9808         * anonymous.cs,
9809         * codegen.cs,
9810         * cs-parser.jay,
9811         * decl.cs,
9812         * doc.cs,
9813         * ecore.cs,
9814         * flowanalysis.cs,
9815         * iterators.cs,
9816         * pending.cs,
9817         * statement.cs,
9818         * typemanager.cs: Parameter clean up.
9819
9820         * delegate.cs (Define): Get rid of duplicated code.
9821
9822         * expression.cs (ParameterReference): Removed useless parameters
9823         and simplified.
9824         (Invocation): Ditto.
9825
9826         * parameter.cs (ParamsParameter): New class, params specialization.
9827         (ArglistParameter): Attemp to separate arglist.
9828         (Parameter): Refactored to be reusable and faster.
9829         (Parameter.Modifier): Made understandable.
9830         (Parameters): Changed to be used as a class for `this' assembly
9831         parameters. Refactored to use new specialized classes.
9832
9833         * support.cs (ParameterData): Added Types property.
9834         (InternalParameters): Deleted.
9835
9836 2005-08-20  Martin Baulig  <martin@ximian.com>
9837
9838         Merging this patch from GMCS to fix #75867.
9839
9840         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9841         scope if we don't already have it.
9842
9843 2005-11-17  Martin Baulig  <martin@ximian.com>
9844
9845         * anonymous.cs
9846         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9847         inherit the scope from our parent.  Fixes #76653.
9848
9849 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9850
9851         * doc.cs : the previous patch does not actually fix the bug.
9852           PropertyInfo override check is now implemented and really fixed it.
9853         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9854
9855 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9856
9857         * doc.cs : apply "override filter" also to properties.
9858           Fixed bug #76730.
9859
9860 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9861
9862         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9863           no need to check overrides. For classes, omit those results from 
9864           interfaces since they must exist in the class. Fixed bug #76726.
9865
9866 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9867
9868         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9869           with different parameters. Fixed the second problem in #76685.
9870
9871 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9872
9873         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9874           get expected 'protected' access in CheckValidFamilyAccess()).
9875           Fixed bug #76692.
9876
9877 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9878
9879         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9880           Fixed bug #76705.  CS1569 was incorrectly commented out.
9881
9882 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9883
9884         * doc.cs : use Invocation.IsOverride() to do real override check.
9885         * expression.cs : made Invocation.IsOverride() internal.
9886
9887 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9888
9889         * doc.cs : use TypeManager.FindMembers() instead of (possible)
9890           TypeBuilder.FindMembers() and filter overriden base members out.
9891           Fixed bug #76990.
9892
9893 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9894
9895         * doc.cs : ref/out parameters are represented as '@' (instead of
9896           '&' in type FullName). Fixed bug #76630 (additionally crefs).
9897
9898 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9899
9900         * doc.cs : when there was no '.' in cref to methods in doc comment,
9901           then parameters were missing in the output. Fixed bug #76691.
9902
9903 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9904
9905         * driver.cs : don't output docs when there is an error.
9906           Fixed bug #76693.
9907
9908 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9909
9910         * doc.cs :
9911           Now it should detect indexers. Fixed primary concern in bug #76685.
9912           Fixed CS0419 message to not show the identical member signature in
9913           the message.
9914
9915 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
9916
9917         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
9918           instead of Type.FindMembers() since it does not handle events.
9919           Fixed bug #71604.
9920
9921 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
9922
9923         * codegen.cs: Fixed typo (speficied -> specified).
9924
9925 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9926
9927         Fix #76369.
9928         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
9929
9930 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
9931
9932         * attribute.cs: Changed error message.
9933
9934         * cs-tokenizer.cs: One more check.
9935
9936 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9937
9938         * statement.cs (Block.Resolve): Ignore empty statement.
9939
9940 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
9941
9942         * report.cs: Made error/warning methods more strict to avoid
9943         their misuse.
9944
9945         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
9946         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
9947         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
9948         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
9949
9950 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
9951
9952         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
9953         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
9954
9955         * class.cs (TypeContainer.IsComImport): New property.
9956         (Constructor.Define): Create proper ctor for ComImport types.
9957
9958         * expression.cs (New.CheckComImport): Fixed.
9959
9960 2005-11-07  Miguel de Icaza  <miguel@novell.com>
9961
9962         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
9963         that a parameter has been captured does not mean that we do not
9964         have to do the rest of the processing.  This fixes the second part
9965         of #76592.  If there was another anonymous method capturing
9966         values in the past, the Scope would never be set for the second
9967         method that captured the same parameter.
9968
9969         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
9970         properly manipulate the stack.   Second part of fix for #76592.
9971
9972         * expression.cs (New): Add support for invoking "new" on
9973         interfaces that have been flagged with the ComImport attribute and
9974         the CoClass.  Fixes #76637 
9975
9976         * statement.cs (Try.DoEmit): When a variable is captured, do not
9977         try to emit the vi.LocalBuilder variable as it has been captured.
9978         Create a temporary variable and store the results on the
9979         FieldBuilder.  Fixes #76642
9980
9981 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
9982
9983         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
9984
9985         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
9986
9987         * expression.cs (Binary.DoResolve): Added && optimalization.
9988     
9989         * typemanager.cs (AddUserType): Removed useless argument.
9990
9991 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
9992
9993         * statement.cs (Block.variables): Uses ListDictionary.
9994
9995 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
9996
9997         Fix #75969.
9998         * class.cs (PartialContainer.EmitType): Customized to emit
9999         security attributes.
10000         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10001         for partial classes.
10002
10003 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10004
10005         Fix #76599.
10006         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10007         access has to be fixed.
10008         
10009         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10010
10011 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10012
10013         Fix #76590.
10014         * ecore.cs (NullCast.Reduce): Implemented.
10015
10016         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10017         constant type.
10018         
10019         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10020         properly.
10021         (Foreach.Resolve): Catch null properly.
10022
10023 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10024  
10025         * cs-tokenizer.cs: Warning text fix.
10026
10027         * driver.cs: AllWarningNumbers exposed on public interface.
10028
10029         * report.cs (): Reviewed warning numbers.
10030         (IsValidWarning): Use binary search.
10031
10032 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10033  
10034         * driver.cs: Implemeted resource visibility.
10035         (Resources): New class for code sharing between /res: and
10036         /linkres:
10037  
10038 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10039
10040         Fix #76568.
10041         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10042         folding.
10043         
10044         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10045         contants only.
10046         
10047         * ecore.cs (NullCast): Child is contant only.
10048         
10049         * literal.cs (NullLiteral.Reduce): null can be converted to any
10050         reference type.
10051
10052 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10053
10054         * driver.cs: Use Encoding.Default as default code page instead
10055           of ISO-28591.
10056
10057 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10058
10059         Fix #76085.
10060         * expression.cs (Invocation.Error_InvalidArguments): Handle
10061         __arglist parameters.
10062         (Invocation.VerifyArgumentsCompat): Likewise.
10063         * support.cs (ReflectionParameters.GetSignatureForError): Print
10064         __arglist parameters.
10065         (InternalParamters.GetSignatureForError): Likewise.
10066         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10067
10068 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10069
10070         * attribute.cs (GetPropertyValue): Made public.
10071
10072         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10073         Resolve.
10074         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10075         attribute.
10076         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10077         is not defined.
10078         
10079         * driver.cs: Reflect method name change.
10080         
10081         * statement.cs (Try.Resolve): Warn when try has both general
10082         exception handlers.
10083         
10084         * typemanager.cs: runtime_compatibility_attr_type new predefined
10085         type.
10086
10087 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10088
10089         Fix #76419.
10090         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10091         treat it as an empty parameter list.
10092
10093 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10094
10095         Fix #76271.     
10096         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10097         ResolveAsTypeStep silent.
10098         * statement.cs (Block.AddConstant): Mark block as used.
10099         (Block.ResolveMeta): Avoid piling on error messages
10100         if a constant initializer resolution fails.
10101
10102 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10103
10104         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10105         Remove.
10106         (NamespaceEntry.VerifyAllUsing): New.
10107         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10108         behaviour.  Delegates actual resolution of alias to ...
10109         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10110         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10111         Update.
10112         * driver.cs (Driver.MainDriver): Update.
10113         
10114         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10115         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10116         property.
10117         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10118         Remove.
10119         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10120         RootNamespace.DefineNamespacesForAll.
10121
10122 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10123
10124         * typemanager.cs (assemblies, external_aliases, modules)
10125         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10126         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10127         overhead.  Move resposibility ...
10128         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10129         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10130
10131 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10132
10133         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10134         cached_namespaces.  Improve usage.
10135         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10136         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10137         Move from GlobalRootNamespace and simplify.
10138         (RootNamespace.Global): Make instance variable.
10139         (RootNamespace.RootNamespace): Add "alias name" parameter.
10140         (GlobalRootNamespace): Simplify drastically.
10141         (Namespace.Lookup): Don't use GetNamespace.
10142         * typemanager.cs (GetRootNamespace): Rename from
10143         ComputeNamespaceForAlias.
10144         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10145
10146 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10147
10148         * anonymous.cs (AnonymousContainer): Don't crash when container
10149         doesn't exist.
10150
10151 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10152
10153         * expression.cs (Binary.DoResolve): Warn when comparing same
10154         values.
10155
10156 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10157
10158         Fix #76486.
10159         * expression.cs (Binary.DoResolve): It looks like there are no
10160         convetsion rules in enum context.
10161
10162 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10163
10164         Add support for extern alias qualifiers.
10165         * typemanager.cs: Move some LookupTypeReflection code
10166         to namespace.cs, to have cleaner code. Added some methods
10167         to help us keep track of the extern aliased references.
10168         * driver.cs: Add suport for extern alias assemblies on command
10169         line and check for their warnings/errors. Also keep track of the
10170         extern aliased assemblies.
10171         * namespace.cs: Move the global functionality of Namespace
10172         to GlobalRootNamespace/RootNamespace. Now the global namespace
10173         is GlobalRootNamespace.Globa. Also the code moved from 
10174         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10175         Finally added LocalAliasEntry (AliasEntry before) and
10176         ExternAliasEntry, to handle alias statements.
10177         * cs-parser.jay: Add support in the grammar for extern alias
10178         statement.
10179         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10180         Update callings to Namespace (now in GlobalRootNamespace).
10181
10182 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10183
10184         Fix #76371.
10185         * class.cs (TypeContainer.DefineType): Move updating of
10186         topological sort earlier in the code.
10187         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10188
10189 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10190
10191         Fix #76273.
10192         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10193         
10194         * constant.cs (Constant.TryReduce): Moved from Cast class.
10195         (Reduce): Made little bit more OO and fixed missing conversions.
10196         
10197         * ecore.cs (Reduce): Implemented.
10198         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10199         
10200         * literal.cs (Reduce): Implemented.
10201         
10202         * class.cs: Reverted Miguel's wrong commit.
10203
10204 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10205
10206         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10207
10208 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10209
10210         * cs-parser.jay, expression.cs : CS0214 was missing error location
10211           for constants. Fixed bug #76404.
10212
10213 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10214
10215         Fix #76370.
10216         * convert.cs (ExplicitConversionCore): Fixed object->enum
10217         conversion.
10218
10219 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10220
10221         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10222         InstanceExpression.
10223         (PropertyExpr.EmitCall): Likewise.
10224         * expression.cs (Invocation.EmitArguments): Handle case where
10225         arguments == null.
10226         (Invocation.EmitCall): Avoid allocating temporary variable if
10227         there are no arguments.
10228
10229 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10230
10231         Fix #76323.
10232         * convert.cs (ImplicitConversionStandard): Move conversion of
10233         void* to arbitrary pointer types ...
10234         (ExplicitConversionStandard): .. here.
10235         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10236         error to always print typenames.
10237
10238 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10239
10240         * convert.cs (GetConversionOperator): Rename from
10241         GetConversionOperators.  Move operator selection code from ...
10242         (UserDefinedConversion): ... here.
10243
10244 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10245
10246         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10247         conversion.
10248
10249 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10250
10251         * assign.cs (Assign.DoResolve): Error method changed.
10252
10253         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10254         
10255         * const.cs (ResolveValue): Reset in_transit immediately.
10256         
10257         * constant.cs: Error method changed.
10258         
10259         * convert.cs: Removed useless location parameter.
10260         (ExplicitNumericConversion): Don't do double enum check.
10261         (ExplicitConversionCore): Renamed from ExplicitConversion.
10262         (ExplicitUnsafe): Extracted from ExplicitConversion.
10263         (ExplicitConversion): Uses for error reporting.
10264         
10265         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10266         error messages.
10267         (ResolveBoolean): Uses common error method.
10268         (CastToDecimal): Get rid of ec.
10269         (CastFromDecimal): Optimized.
10270         (ConvCast): Get rid of ec.
10271         
10272         * enum.cs (ResolveValue): Reset in_transit immediately.
10273         (Emit): Return after first error.
10274         
10275         * expression.cs: Convert changes.
10276         
10277         * literal.cs: Error method changed.
10278         
10279         * statement.cs: Error method changed.
10280
10281 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10282
10283         * support.cs (SeekableStreamReader.Position): Don't error out when
10284         the requested position is just beyond the end of the current
10285         buffered data.
10286
10287 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10288
10289         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10290         try to keep in sync with the byte count of the underlying Stream.
10291         However, this limits us to a window size of 2048 characters: i.e.,
10292         the maximum lookahead of our lexer/parser can be 2048 characters.
10293
10294 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10295
10296         Fix #76255.
10297         * driver.cs: Fix compilation files with full root path.
10298
10299 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10300
10301         * report.cs (SymbolRelatedToPreviousError): Format the output so
10302         it does not use an open parenthesis that is never closed. 
10303
10304         * driver.cs: Follow coding guidelines
10305
10306 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10307
10308         Fix #72930.
10309         * const.cs (Const.ResolveValue): Check for assigning non-null
10310         value to reference type.
10311
10312 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10313
10314         * anonymous.cs: Implemented ExprClassName.
10315         
10316         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10317         delegate.
10318         
10319         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10320         check.
10321         
10322         * class.cs (StaticClass.DefineContainerMembers): Report protected
10323         members as error.
10324         
10325         * codegen.cs: if(ed) PRODUCTION.
10326         
10327         * convert.cs (Error_CannotImplicitConversion): Better error
10328         distinction.
10329         
10330         * cs-parser.jay: More error checks.
10331         
10332         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10333         
10334         * driver.cs (CSCParseOption): Enabled wrong option check.
10335         
10336         * ecore.cs (Expression.ExprClassName): Turned to property.
10337         (MemberExpr.CheckIntermediateModification): For checking boxed
10338         value types     modification.
10339         
10340         * statement.cs (Fixed.Resolve): Expression type must be
10341         convertible to fixed type.
10342         (CollectionForeach.GetEnumeratorFilter,TryType):
10343         Small refactoring for easier error checking.
10344
10345 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10346
10347         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10348         attributes.
10349         
10350         * class.cs (GeneratedBaseInitializer): New class for customization
10351         compiler generated initializers.
10352         (MemberBase.DoDefine): Check Obsolete attribute here.
10353         (FieldMember.DoDefine): Ditto.
10354         
10355         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10356         constants.
10357         
10358         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10359         (MemberCore.GetObsoleteAttribute): Removed argument.
10360         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10361         (MemberCore.CheckObsoleteType): New helper.
10362         
10363         * delegate.cs,
10364         * enum.cs,
10365         * statement.cs: Updates after MemberCore changes.
10366         
10367         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10368         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10369         
10370         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10371         obsolete attribute for compiler construct.
10372         (As.DoResolve): Cache result.
10373         
10374         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10375
10376 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10377
10378         Fix #76133.
10379         * expression.cs (This.VerifyFixed): In a value type T, the type of
10380         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10381         value type R, 'this' is treated as a value parameter.
10382
10383 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10384
10385         * statement.cs (Lock): Use the TemporaryVariable class instead of
10386         manually using local variables as those do not work when variables
10387         are captured.
10388
10389         * ecore.cs: Moved the TemporaryVariable class from being a nested
10390         class inside Foreach to be a public class that can be employed in
10391         other places. 
10392
10393 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10394
10395         * cs-parser.jay: interface_accessors replaced by
10396         accessor_declarations.
10397
10398         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10399         location.
10400         
10401         * statement.cs (GotoCase.Resolve): Convert null constant to
10402         null case.
10403         (SwitchLabel.ResolveAndReduce): Ditto.
10404         (SwitchLabel.NullStringCase): Custom null stamp.
10405         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10406         
10407         typemanager.cs (CSharpSignature): Don't skip first argument
10408         for full names.
10409
10410 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10411
10412         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10413
10414         * location.cs (InEmacs): in this mode, do not report column
10415         location as it confuses Emacs.
10416
10417 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10418
10419         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10420         expression.cs, iterators.cs, literal.cs: Store constants and
10421         literals location.
10422         
10423         * class.cs (MemberBase.ShortName): Pass location.
10424         
10425         * cs-parser.jay: Some location fixes.
10426         
10427         * ecore.cs (Expression.Location): Made virtual.
10428
10429 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10430
10431         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10432         if the underlying types are the same, otherwise we need to produce
10433         code that will do the proper cast.
10434
10435         This was exposed by Marek's constant rewrite which produced
10436         invalid code for the call site:
10437
10438         enum X : long { a }
10439         void Method (X v) {}
10440
10441         Method ((X) 5)
10442
10443         This fixes test-49.cs
10444
10445 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10446
10447         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10448           Type/Object should be allowed as well. Fixed bug #75968.
10449
10450 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10451
10452         * expression.cs : (Binary.DoResolve): when one is enum constant and
10453           another is constant 0, then return enum one *as enum type*.
10454           Fixed bug 74846.
10455
10456 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10457
10458         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10459         internal.
10460
10461         Fix #75941.
10462         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10463         flow-branching for LocalVariableReferences in case we were invoked
10464         from a MemberAccess.
10465         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10466         Carved out of ...
10467         (LocalVariableReference.DoResolveBase): ... this.
10468         (MemberAccess.Resolve): Do the check that was disabled during
10469         SimpleNameResolve.
10470
10471 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10472
10473         * class.cs :
10474           (PartialContainer.Create): check abstract/sealed/static strictly
10475           but abstract/sealed can exist only at one side. Fixed bug #75883.
10476
10477 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10478
10479         Fix #75945.
10480         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10481         specified, don't default to UnmanagedType.I4.
10482
10483 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10484
10485         * expression.cs : conditional operator should check possibly
10486           incorrect assign expression. Fixed bug #75946.
10487
10488 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10489
10490         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10491           Reverting the change. gmcs is much complex than mcs on this matter.
10492
10493 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10494
10495         * cs-tokenizer.cs : To read another token ahead of the actual 
10496           consumption, use new SavedToken and cache token instead of moving
10497           back the stream with SeekableStreamReader (it seemed problematic).
10498         * cs-parser.jay,
10499           driver.cs : Thus use StreamReader directly.
10500         * support.cs : Thus removed SeekableStreamReader.
10501
10502 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10503
10504         Fix #75934.
10505         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10506         (ScopeInfo.EmitScopeType): Use it to construct field names from
10507         names of captured locals.
10508
10509         Fix #75929.
10510         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10511         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10512         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10513         (ExplicitConversion): Remove enum cases already handled by
10514         implicit conversion.  Move implicit conversion check to the beginning.
10515         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10516         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10517         Don't treat System.Enum as a struct.
10518
10519 2005-08-30  Jb Evain  <jbevain@gmail.com>
10520
10521         * attribute.cs: handles as expression in parameters.
10522
10523 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10524
10525         Fix #75802.
10526         * class.cs (TypeContainer.VerifyClsName): Don't use a
10527         PartialContainer when verifying CLS compliance.
10528         (AbstractPropertyEventMethod): Set Parent here, ...
10529         (PropertyMethod): ... not here.
10530
10531 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10532
10533         * attribute.cs : escaped attribute name should not be allowed to be
10534           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10535
10536 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10537
10538         Fix #75927.
10539         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10540         when converting a long constant to unsigned long.
10541         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10542         detect where IsApplicable and VerifyArgumentsCompat disagree.
10543
10544 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10545         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10546
10547         Fix #75848.
10548         * class.cs (TypeContainer.CanElideInitializer): New helper.
10549         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10550         can safely emitting the initializer of a field.
10551
10552 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10553
10554         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10555           allowed inside a switch (without loop). Fixed bug #75433.
10556
10557 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10558
10559         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10560         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10561
10562 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10563
10564         * driver.cs : kinda reverting the default encoding changes (not exact 
10565           revert since I noticed that "codepage:reset" might not work fine).
10566
10567 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10568
10569         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10570           Location. Now getter and setter store location correctly.
10571           (errors/cs0111-12.cs now reports the expected location.)
10572
10573 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10574
10575         * driver.cs : Use default encoding on the environment.
10576           Removed (now that) extra parameter for SeekableStreamReader.
10577         * support.cs : (SeekableStreamReader) third .ctor() argument for
10578           StreamReader is not required (always true). preamble size could
10579           be acquired in simpler and safe way.
10580
10581 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10582
10583         * cs-parser.jay: report CS0642 at warning level 3
10584           and report CS0642 for an if else statement also
10585           fixes bug #74745. Patch by John Luke (and a bit
10586           modified by me).
10587           Removed extra CS0642 warning check for "while",
10588           "for" and "fixed".
10589         * statement.cs: In Block.Resolve(), CS0642 check
10590           is reimplemented to check a sequence of an empty
10591           statement and a block.
10592
10593           Both fix bug #66777.
10594
10595 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10596
10597         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10598         detection until I fix it.
10599         
10600         * cs-tokenizer.cs: Changed error message.
10601         
10602         * cs-parser.jay: Fixed 2 error locations.
10603         
10604         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10605         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10606         properties.
10607         
10608         * enum.cs (GetSignatureForError): Fixed.
10609         
10610         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10611         method detection.
10612         
10613         * class.cs,
10614         * typemanager.cs (RegisterProperty): Removed.
10615         
10616         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10617
10618 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10619
10620         Fix #75874.
10621         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10622         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10623
10624 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10625
10626         * expression.cs : tiny fix is required for not warning positive ulong.
10627           See test-441.cs.
10628
10629 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10630
10631         * expression.cs : add CS0652 check for constant and integral
10632           expression. Fixed bug #53974.
10633
10634 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10635
10636         * expression.cs : in DoNumericPromotions(), check if there is implicit
10637           conversion overload for string (to check CS0034). Fixed bug #52492.
10638
10639 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10640
10641         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10642
10643 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10644
10645         * ecore.cs : report location when it is *not* Null.
10646
10647 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10648
10649         * codegen.cs,
10650           ecore.cs,
10651           flowanalysis.cs,
10652           expression.cs:
10653           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10654           correctly. Fixed bug #75721.
10655
10656 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10657
10658         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10659         loop that performs 'min (pos, char_count)'.
10660
10661         Fix #75862.
10662         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10663         converted value in Operator.OnesComplement.
10664
10665 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10666
10667         * anonymous.cs: If the anon method is pulled into a helper class,
10668         it needs to be `internal' not `private'. Fixes runtime behavior on
10669         msft. bug #75704
10670
10671 2005-08-20  Martin Baulig  <martin@ximian.com>
10672
10673         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10674         scope if we don't already have it.
10675
10676         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10677         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10678         fixes #75867.
10679
10680 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10681
10682         Fix #75803
10683         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10684         is a partial class.
10685
10686 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10687
10688         The big constants rewrite
10689         Fix #75746, #75685 and more
10690         As a side effect saved 1MB for MWF ;-)
10691         
10692         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10693         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10694         enum based for corlib compilation.
10695         
10696         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10697         subtractions.
10698         
10699         * class.cs (FixedField.Define): Use ResolveAsConstant.
10700         
10701         * const.cs (IConstant): Interface constants and enums.
10702         (Const.ResolveValue): New method for constant resolvning.
10703         (ExternalConstant): Constants from imported assemblies.
10704         
10705         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10706         conversion; like enums.
10707         (Constant.ToType): Converts this constant to different type.
10708         (Constant.Increment): Adds 1.
10709         
10710         * convert.cs (ImplicitConversionRequired): Simplified.
10711         
10712         * cs-parser.jay: Create EnumMember directly.
10713         
10714         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10715         
10716         * doc.cs (GenerateEnumDocComment): Removed.
10717         
10718         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10719         (ConvertIntLiteral): Removed.
10720         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10721         
10722         * enum.cs (EnumMember): Implement IConstant.
10723         (Enum.IsValidEnumConstant): Removed.
10724         (Enum.GetNextDefaultValue): Removed.
10725         (Enum.FindMembers): Updated.
10726         (Enum.GenerateDocComment): Iterate enum members.
10727         
10728         * expression.cs (Cast.TryReduce): Handle enums correctly.
10729         (New.Constantify): Made public.
10730         (MemberAccess.DoResolve): Removed contant specific if(s).
10731         
10732         * literal.cs (NullLiteral): Implement new abstract methods.
10733         
10734         * statement.cs (GotoCase.Resolve): Use new constant methods.
10735         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10736         
10737         * typemanager.cs (LookupEnum): Removed.
10738         (IsEnumType): Fixed to work with corlib.
10739         (RegisterConstant): Removed.
10740         (LookupConstant): Removed.
10741         (GetConstant): Changed to work with IConstant.
10742
10743 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10744
10745         * location.cs : Fixed overflown (>255) column number.
10746
10747 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10748
10749         First cut of the qualified-alias-member feature.
10750         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10751         token.
10752         * cs-parser.jay (DOUBLE_COLON): New token.
10753         (namespace_or_type_name): Add rule for recognizing
10754         qualified-alias-members.
10755         (primary_expression): Likewise.
10756         (element_access): Allow QualifiedAliasMember as a possible
10757         type-bearing expression.
10758         (local_variable_type, local_variable_pointer_type): Likewise.
10759         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10760         aliases in the current and enclosing namespace declarations.
10761         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10762         * decl.cs (MemberName.is_double_colon): New.
10763         (MemberName.MemberName): Add new constructor for alias-member.
10764         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10765         * expression.cs (QualifiedAliasMember): New expression type.
10766
10767 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10768
10769         * location.cs : it borked when no argument was specified.
10770
10771 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10772
10773         * location.cs : tiny ToString() format fix.
10774
10775 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10776
10777         * statement.cs : oops, it was missing.
10778
10779 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10780
10781         A set of fixes for precise line/column location.
10782
10783         * location.cs :
10784           "token" field now holds a file/line "delta", a line number offset 
10785           from the segment, and a column number. See also:
10786           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10787           December/009508.html
10788           Removed static IsNull. Use instance IsNull property instead.
10789         * cs-tokenizer.cs :
10790           For some tokens it stores Location. For Identifier it stores
10791           LocatedToken which is a pair of string name and location.
10792           Column numbers are adjusted only at getChar().
10793         * report.cs :
10794           Use Location.ToString() for reporting (it now contains column).
10795         * cs-parser.jay :
10796           Largely modified to use LocatedToken instead of
10797           string (IDENTIFIER), and to acquire Location from some tokens.
10798         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10799           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10800           codegen.cs :
10801           Now MemberName holds Location. DeclSpace.ctor() receives Location
10802           as a parameter. Removed extra parameters to all derived classes.
10803           Replaced Location.IsNull() with instance property.
10804         * assign.cs, expression.cs :
10805           Added .ctor() overload that omits Location.
10806         * attribute.cs :
10807           Added "nameEscaped" flag that indicates the identifier was escaped
10808           in the source file. This fixes bug #57047.
10809
10810 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10811
10812         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10813         New method, looking for lo-case imported cls type.
10814
10815         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10816         here.
10817
10818         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10819
10820         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10821
10822         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10823         all_imported_types.
10824         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10825
10826         Optimized to save 3.5 MB for SWF compilation.
10827
10828 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10829
10830         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10831         (PartialContainer.Create): Moved logic AddToContainer.
10832         (PartialContainer.MarkForDuplicationCheck): Shares name.
10833         
10834         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10835         place.
10836         
10837         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10838         initialization.
10839         (Namespace.GetSignatureForError): New method.
10840         
10841         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10842         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10843
10844 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10845
10846         Fix #75669.
10847         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10848         member lookup rather than qualifier_type, since qualifier_type can
10849         be null.
10850
10851 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10852
10853         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10854         enum member.
10855
10856 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10857
10858         * statement.cs: Copy the local exception into the exception
10859         captured local.  Fixes 75674
10860
10861 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10862
10863         Fix #75658.
10864         * expression.cs (Invocation.OverloadResolve): Don't report error
10865         CS1501 if error CS1502 has been reported.
10866         (New.DoResolve): Delegate CS1501 reporting to
10867         Invocation.OverloadResolve.
10868
10869         Fix #75656.
10870         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10871         invariant-meaning-in-block property in an enclosing block if
10872         necessary.
10873
10874 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10875
10876         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10877         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10878         (Switch.CheckSwitch): Just save 50kb for SWF.
10879
10880 2005-07-27  Martin Baulig  <martin@ximian.com>
10881
10882         * anonymous.cs (CaptureContext.AddField): Added
10883         `AnonymousContainer am' argument; compute its toplevel scope if
10884         it's not already computed.  Fixes #75649.
10885
10886 2005-07-26  Raja R Harinath  <rharinath@novell.com>
10887
10888         Fix #75628.
10889         * class.cs (Constructor.Emit): Reset block to null if the block
10890         resolve fails.
10891
10892 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10893
10894         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
10895
10896 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
10897
10898         * class.cs (MethodData.Define): Check whether accessor implementing
10899         interface is public.
10900
10901         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
10902
10903 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
10904
10905         Fix #57245
10906         * namespace.cs (LookupType): Moved same type check to...
10907         
10908         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
10909         with the same name.
10910
10911 2005-07-21  Raja R Harinath  <rharinath@novell.com>
10912
10913         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
10914         already found a typebuilder.
10915         * class.cs (MethodCore.IsDuplicateImplementation): Compare
10916         MemberNames, not strings.
10917
10918         * const.cs (Error_ExpressionMustBeConst): 
10919         Rename from Error_EpressionMustBeConst.
10920         * const.cs, class.cs, statement.cd: Update.
10921
10922 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
10923
10924         Fix #65573
10925
10926         * const.cs (Const.LookupConstantValue): Report missing contant expression
10927         everytime.
10928         (Error_EpressionMustBeConstant): Only one error method.
10929
10930         * class.cs, statement.c: Updated.
10931
10932 2005-07-20  Raja R Harinath  <rharinath@novell.com>
10933
10934         * statement.cs (Block.Flags): Add back HasVarargs.
10935         (Block.flags): Make protected.
10936         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
10937
10938         * typemanager.cs (types, typecontainers, user_types): Remove.
10939         (UserTypes, TypeContainers): Likewise.
10940         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
10941         (CleanUp, Reset): Update.
10942         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
10943         (GetNestedType): Use Type.GetNestedType.
10944         (CoreLookupType): Take two arguments, the namespace and the
10945         basename of the type.  Update to use the Namespace.Lookup
10946         mechanism.
10947         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
10948         (RealMemberLookup): Use IsNestedChildOf instead of playing with
10949         string concatenation and substring matches.
10950         * class.cs, enum.cs, delegate.cs: Update to changes.
10951
10952 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
10953
10954         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
10955         Expression and made virtual.
10956
10957         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
10958         (ImplicitStandardConversionExists): Fixed `byte' typo ?
10959
10960         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
10961
10962         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
10963         error message.
10964
10965         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
10966         change.
10967
10968 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
10969
10970         Fix #57707
10971         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
10972         AssemblyCultureAttribute is not used on executable.
10973
10974         * rootcontext.cs,
10975         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
10976
10977 2005-07-16  Raja R Harinath  <rharinath@novell.com>
10978
10979         Fix #60638.
10980         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
10981         New.  Reports CS0252/CS0253.
10982         Mostly taken from preliminary patch by Duncak Mak.
10983         (Binary.DoResolveOperator): Store results of operator lookup.
10984         Use them to detect if we need to warn about unintended reference
10985         comparisons.
10986
10987 2005-07-15  Raja R Harinath  <rharinath@novell.com>
10988
10989         Fix #72969.
10990         * namespace.cs (Namespace.Lookup): Add back location parameter.
10991         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
10992         * delegate.cs, ecore.cs, expression.cs: Update to changes.
10993
10994         * codegen.cs (EmitContext.DeclSpace): Make readonly.
10995         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
10996         (Namespace.LookupType): ... this.
10997         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
10998         of namespaces.
10999         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11000         purported to handle pointers.
11001         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11002         CoreLookupType.
11003
11004 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11005
11006         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11007         type as namespace.
11008
11009 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11010
11011         * namespace.cs (Namespace.Lookup): Drop location parameter.
11012         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11013         (NamespaceEntry.Lookup): ... this.
11014         (NamespaceEntry.Error_AmbiguousTypeReference):
11015         Move here from DeclSpace.
11016         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11017         names ...
11018         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11019         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11020         Move to NamespaceEntry.
11021         * delegate.cs, expression.cs: Update to changes.
11022
11023 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11024
11025         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11026         CheckAttributeType and refactored.
11027         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11028         ResolveAsTypeTerminal error handling.
11029         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11030         handling.
11031         (GetSignatureForError): Print errors in same way.
11032
11033         * class.cs,
11034         * codegen.cs: Reflect attribute GetSignatureForError change.
11035
11036         * ecore.cs,
11037         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11038
11039         * namespace.cs (UsingEntry): Refactored to make fields private.
11040
11041         * assign.cs,
11042         statement.cs: Error_UnexpectedKind has extra parameter.
11043
11044 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11045
11046         * ecore.cs (IAlias): Remove.
11047         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11048         that implement the interface.
11049         * namespace.cs (Namespace): Likewise.
11050         (Namespace.declspaces): Renamed from 'defined_names'.
11051         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11052         DeclSpace instead of an IAlias.
11053         * tree.cs (Tree.AddDecl): Update.
11054
11055 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11056
11057         * statement.cs (Block.Flags); Remove HasVarargs.
11058         (Block.HasVarargs): Move to ToplevelBlock.
11059         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11060         (Block.Variables): Make protected.  Initialize variable hashtable
11061         if necessary.
11062         (Block.AddVariable): Update.
11063         (Block.Resolve): Update to changes.
11064         (ToplevelBlock.HasVarargs): New boolean.
11065         (ToplevelBlock.ThisVariable): Move here from Block.
11066         (ToplevelBlock.AddThisVariable): Likewise.
11067         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11068         * expression.cs (This.ResolveBase): Update to changes.
11069         (ArglistAccess.DoResolve): Likewise.
11070
11071 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11072
11073         Fix #75321
11074         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11075
11076         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11077         not used and not used & assigned.
11078         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11079
11080 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11081
11082         Fix #75053
11083         * expression.cs (Is.DoResolve): null is never provided type.
11084
11085 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11086
11087         Fix #52496
11088         * cs-parser.jay: Less strict event error rule to catch more errors.
11089
11090 2005-07-08  Martin Baulig  <martin@ximian.com>
11091
11092         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11093         gettter (allowed) or setter (not allowed).
11094
11095         * class.cs (Accessor): Implement IIteratorContainer.
11096         (Accessor.Yields): New public field.
11097         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11098         per-accessor basis.
11099
11100         * cs-parser.jay
11101         (get_accessor_declaration, set_accessor_declaration): Set the
11102         `yields' flag on the accessor, not the property.
11103         (property_declaration): Do the iterators check on a per-accessor
11104         basis and not for the whole property.
11105
11106 2005-07-08  Martin Baulig  <martin@ximian.com>
11107
11108         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11109         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11110
11111 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11112
11113         Fix #74975
11114         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11115         (ExtractSecurityPermissionSet): Cope with self referencing security
11116         attributes properly.
11117
11118         * driver.cs (SetOutputFile): Made public property OutputFile.
11119
11120 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11121
11122         Fix #75486.
11123         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11124         has_nonstatic_fields.  Make into a FieldBase pointer.
11125         (TypeContainer.AddField): Add CS0282 check.
11126         (TypeContainer.EmitType): Update.
11127
11128 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11129
11130         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11131         compare if they start with __.
11132
11133 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11134
11135         * statement.cs (Switch.SwitchGoverningType): Only look at
11136         UserCasts that don't need implicit standard conversions to one of
11137         the allowed switch types (Fixes test-322.cs).
11138         (LocalInfo.Resolve): Re-enable sanity-test.
11139
11140 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11141
11142         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11143         
11144         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11145         
11146         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11147
11148 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11149
11150         Fix #75472.
11151         * ecore.cs (SimpleName.GetSignatureForError): Add.
11152         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11153         (MemberAccess.GetSignatureForError): Add.
11154
11155 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11156  
11157         The big error and warning messages review.
11158         
11159         * anonymous.cs,
11160         * assign.cs,
11161         * attribute.cs,
11162         * class.cs,
11163         * codegen.cs,
11164         * convert.cs,
11165         * cs-parser.jay,
11166         * cs-tokenizer.cs,
11167         * decl.cs,
11168         * delegate.cs,
11169         * doc.cs,
11170         * driver.cs,
11171         * ecore.cs,
11172         * enum.cs,
11173         * expression.cs,
11174         * flowanalysis.cs,
11175         * iterators.cs,
11176         * literal.cs,
11177         * location.cs,
11178         * modifiers.cs,
11179         * namespace.cs,
11180         * parameter.cs,
11181         * pending.cs,
11182         * report.cs,
11183         * rootcontext.cs,
11184         * statement.cs,
11185         * support.cs,
11186         * tree.cs,
11187         * typemanager.cs: Updated.
11188         
11189         * class.cs: (MethodCore.SetYields): Moved here to share.
11190         (PropertyMethod.Define): Moved iterator setup here.
11191         
11192         * iterators.cs: Add orig_method to have full access to parent
11193         container.
11194
11195 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11196
11197         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11198         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11199         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11200         variable of struct type.
11201         * expression.cs (Unary.ResolveOperator): Update to change.
11202         (Indirection.VerifyFixed): Likewise.
11203         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11204         (ParameterReference.VerifyFixed): Value parameters are fixed.
11205         (This.VerifyFixed): Treat 'this' as a value parameter.
11206         * statement.cs (LocalInfo.IsFixed): Remove.
11207
11208 2005-07-01  Martin Baulig  <martin@ximian.com>
11209
11210         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11211         `ec.EmitThis ()' to get the correct scope.
11212
11213 2005-07-01  Martin Baulig  <martin@ximian.com>
11214
11215         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11216         instance is a ParameterReference; fixes #75299.
11217
11218 2005-07-01  Martin Baulig  <martin@ximian.com>
11219
11220         Reverted Marek's latest patch (r46725):
11221         - it contains structural changes which are neither mentioned in
11222           the ChangeLog nor explained anywhere; for example the additional
11223           argument of EmitContext's and Iterator's .ctor's and the
11224           TypeContainer.DefineMembers() change.
11225         - structural changes like this should go in in seperate patches
11226           and not be hidden in a huge patch which just seems to affect
11227           warnings and errors.
11228           a big and hard to understand patch.
11229         - it breaks iterators and causes regressions, for instance in
11230           test-iter-03.cs.      
11231
11232 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11233
11234         Fix #75412.
11235         * expression.cs (Indexers.map): Remove.
11236         (Indexers.Append): Filter out inaccessible setters and getters.
11237         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11238
11239         Fix #75283.
11240         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11241         Refactored from ...
11242         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11243         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11244         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11245         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11246
11247 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11248
11249         Fix #75322
11250         * class.cs (FieldBase.GetInitializerExpression): One more field
11251         for backup.
11252
11253 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11254
11255         * pending.cs: Do not define a proxy if the base method is virtual,
11256         it will be picked up by the runtime (bug 75270).
11257
11258 2005-06-08  Martin Baulig  <martin@ximian.com>
11259
11260         The big Iterators rewrite :-)
11261
11262         * iterators.cs: Rewrite this to use the anonymous methods framework.
11263
11264         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11265         before the TypeContainers; see 2test-21.cs.
11266
11267         * class.cs
11268         (TypeContainer.DefineType): Don't create a new EmitContext if we
11269         already have one (this only happens if we're an Iterator).
11270         (TypeContainer.Define): Also call Define() on all our iterators.
11271         (Method.CreateEmitContext): Added support for iterators.
11272
11273         * anonymous.cs
11274         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11275         (AnonymousContainer.CreateMethodHost): Moved here from
11276         AnonymousMethod and made abstract.
11277         (AnonymousContainer.CreateScopeType): New abstract method.
11278         (AnonymousContainer.IsIterator): New public property.
11279         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11280         get the ScopeTypeBuilder rather than manually defining it here. 
11281         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11282         iterators here.
11283
11284         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11285         before RootContext.DefineTypes().
11286
11287         * codegen.cs (EmitContext.RemapToProxy): Removed.
11288         (EmitContext.CurrentAnonymousMethod): Changed type from
11289         AnonymousMethod -> AnonymousContainer.
11290         (EmitContext.ResolveTopBlock): Protect from being called twice.
11291         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11292         (EmitContext.EmitThis): Removed the iterators hacks; use the
11293         anonymous methods framework for that.
11294
11295         * statement.cs
11296         (ToplevelBlock.Container): Make this a property, not a field.
11297         (ToplevelBlock.ReParent): New public method; move the
11298         ToplevelBlock into a new container.
11299         (Foreach.TemporaryVariable): Simplify.
11300
11301 2005-06-05  Martin Baulig  <martin@ximian.com>
11302
11303         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11304         (Block.AddTemporaryVariable): New public method; creates a new
11305         `LocalInfo' for a temporary variable.
11306         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11307         variables here.
11308         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11309         non-iterator variables.
11310
11311 2005-06-05  Martin Baulig  <martin@ximian.com>
11312
11313         * statement.cs (Foreach.TemporaryVariable): Create the
11314         LocalBuilder in the Emit phase and not in Resolve since in some
11315         situations, we don't have an ILGenerator during Resolve; see
11316         2test-19.cs for an example.
11317
11318 2005-06-04  Martin Baulig  <martin@ximian.com>
11319
11320         **** Merged r45395 from GCS ****
11321
11322         The big Foreach rewrite - Part II.
11323
11324         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11325         with `PropertyInfo ienumerator_getcurrent'.
11326
11327         * codegen.cs (VariableStorage): Removed.
11328
11329         * statement.cs
11330         (Foreach): Derive from Statement, not ExceptionStatement.
11331         (Foreach.CollectionForeach): New nested class.  Moved all the code
11332         dealing with collection foreach here.
11333         (Foreach.ForeachHelperMethods): Removed.
11334         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11335
11336 2005-05-23  Martin Baulig  <martin@ximian.com>
11337
11338         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11339         don't need to.  Fix #75014.
11340
11341 2005-05-20  Martin Baulig  <martin@ximian.com>
11342
11343         Merged r44808 from GMCS.
11344
11345         * class.cs (TypeContainer.CircularDepException): Removed.
11346         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11347         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11348         (CS0146) and interface (CS0529) dependencies here.
11349
11350 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11351
11352         * expression.cs (Invocation.EmitCall): Fix initialization
11353         'this_call' to reflect current behaviour.  Fix indentation.
11354
11355         * convert.cs (FindMostEncompassedType): Add two trivial special
11356         cases (number_of_types == 0 || number_of_types == 1).
11357         (FindMostEncompasingType): Likewise.
11358
11359 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11360
11361         Some cleanups preparing for the fix of #75283.
11362         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11363         error testing.
11364         (EventExpr.InstanceResolve): Likewise.
11365         (EventExpr.DoResolve): Remove redundant checks.
11366
11367 2005-06-10  Duncan Mak  <duncan@novell.com>
11368
11369         * cs-tokenizer.cs (process_directives): New flag for controlling
11370         the processing of preprocessor directives.
11371         (x_token): After seeing a '#', return Token.NONE instead of going
11372         to handle_preprocessing_directive() when not processing
11373         directives. This avoids unnecessary processing during the token peek in
11374         is_punct().
11375
11376         This fixes #74939.
11377
11378         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11379         the existing error reporting methods instead of Report.Error.
11380
11381         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11382         after Raja's rewrite.
11383
11384 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11385
11386         * class.cs: Small fix.
11387
11388 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11389
11390         Fix #75160.
11391         * class.cs (GetPartialBases): Fix return value check of
11392         part.GetClassBases.
11393
11394 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11395
11396         Ensure that partial classes are registered in their enclosing
11397         namespace.  Initial part of fix of #75160.
11398         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11399         Register declspace with namespace here, not in
11400         DeclSpace.RecordDecl.
11401         * cs-parser.jay: Pass namespace to RecordDecl.
11402         * class.cs (PartialContainer.Create): Likewise.
11403         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11404         called.
11405         * decl.cs (Declspace.RecordDecl): Remove.
11406         * namespace.cs (NamespaceEntry.DefineName): Remove.
11407
11408 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11409
11410         * rootcontext.cs: Reset TargetExt as well.
11411
11412 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11413
11414         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11415         -langversion:ISO-1.
11416
11417 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11418
11419         Fix #75080, cs0119.cs.
11420         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11421         of ...
11422         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11423         allowing ExprClass.Type and ExprClass.Namespace for
11424         ResolveFlags.VariableOrValue.
11425         (Expression.Resolve) [1-argument variant]: Change default resolve
11426         flags based on language version.
11427         (Expression.Error_UnexpectedKind): Use a simple string array
11428         rather than an ArrayList.
11429         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11430         not ExprClass.Type.
11431         (TypeOfVoid.DoResolve): Likewise.
11432         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11433         flags argument -- it always has the same value.
11434
11435 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11436
11437         Fix #75081.
11438         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11439         Use it in the error message.
11440         * assign.cs, expression.cs, statement.cs: Update.
11441
11442 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11443
11444         Fix #75088.
11445         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11446         the "almostMatchedMember" case too.
11447         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11448         that failed the accessibility checks to 'almost_match'.
11449
11450 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11451
11452         * attribute.cs: Use internal MethodBuilder methods to set
11453         ExactSpelling and SetLastError on PInvoke methods, instead
11454         of passing them via charset.  Fixes #75060.
11455
11456 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11457
11458         * parameter.cs (Parameter): Remove TODO comment.
11459         (Parameter.DefineParameter): Remove Location parameter.
11460         (Parameters.LabelParameters): Likewise.
11461         * class.cs (Constructor.Emit): Update to change.
11462         (MethodData.Emit): Likewise.
11463         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11464         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11465
11466 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11467
11468         * parameter.cs,
11469           Removed Parameters.Location and added Parameter.Location instead.
11470           Removed Location parameter from Emit() and GetSignature().
11471         * anonymous.cs,
11472           class.cs,
11473           cs-parser.jay,
11474           delegate.cs,
11475           iterators.cs,
11476           statement.cs :
11477           Modified all related calls.
11478
11479 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11480
11481         Improve user-defined conversion handling.
11482         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11483         applicable operators.
11484         (AddConversionOperators): New.  Helper for GetConversionOperators.
11485         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11486         there is only one most encompassed/encompassing type.
11487         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11488         "applicable operator" handling.
11489         (UserConversion): Move cache here from GetConversionOperators.
11490         Directly cache the chosen operator, rather than the whole
11491         MethodGroup.
11492         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11493         case.  Allow conversion of decimal to sbyte and byte too.
11494         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11495         New static methods.  Used to avoid allocating EmptyExpressions in
11496         convert.cs.
11497
11498 2005-05-24  Duncan Mak  <duncan@novell.com>
11499
11500         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11501         another class, used in Convert.ExplicitNumericConversion.
11502         (CastToDecimal): New class, similar to above, but casts to
11503         System.Decimal, used in Convert.ImplicitNumericConversion and also
11504         in explicit convesion from double/float to decimal.
11505
11506         * convert.cs (ImplicitNumericConversion): Handle implicit
11507         conversions to System.Decimal.
11508         (ExplicitNumericConversion): handle explicit conversions to
11509         System.Decimal.
11510
11511         This fixes #68711.
11512         
11513 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11514
11515         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11516         know the type at this stage, just break through.   Fixes #75008 
11517
11518 2005-05-19  Martin Baulig  <martin@ximian.com>
11519
11520         * delegate.cs
11521         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11522         to disable error reporting.
11523
11524         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11525         here since we don't want to report an error; see the new test-336.cs.
11526
11527 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11528
11529         * statement.cs (ToplevelBlock.GetParameterReference)
11530         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11531         Move here from class Block.
11532         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11533         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11534
11535 2005-05-18  Martin Baulig  <martin@ximian.com>
11536
11537         Fix #74978.
11538
11539         * flowanalysis.cs
11540         (FlowBranching.Reachability): Add non-static public And() and Or()
11541         methods.
11542         (FlowBranchingSwitch): New class; do the `break_origins' thing
11543         like in FlowBranchingLoop.
11544         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11545         reachability, not just locals and parameters.
11546         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11547         switch; MergeBreakOrigins() now takes care of that.
11548
11549 2005-05-18  Martin Baulig  <martin@ximian.com>
11550
11551         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11552         a loop and may leave it, reset the barrier; fixes #74974.
11553
11554 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11555         
11556         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11557         is back.
11558         
11559         * cs-parser.jay: Catch more lexical errors.
11560         
11561         * report.cs: Add one more Error method.
11562         
11563         * rootcontext.cs,
11564         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11565
11566 2005-05-17  Martin Baulig  <martin@ximian.com>
11567
11568         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11569         #70970. 
11570
11571 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11572
11573         Fix test-382.cs.  Emit values of decimal constants.
11574         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11575         Carved out of ...
11576         (TypeContainer.AddField): ... this.
11577         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11578         with initializers to include 'Const's.
11579         (ClassPart.RegisterFieldForInitialization): Forward to
11580         PartialContainer.
11581         * const.cs (Const.Const): Pass initializer to base class.
11582         (Const.Define): In case of decimal constants, register them for
11583         initialization in a static constructor.
11584
11585 2005-05-14  Martin Baulig  <martin@ximian.com>
11586
11587         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11588         do not call ResolveUnreachable() on unreachable statements in
11589         here, see the comment in the source code.
11590
11591 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11592
11593         Fix #74934.
11594         * expression.cs (BinaryResolveOperator): If one of the operands of
11595         an equality comparison is 'null' and the other is a pointer type,
11596         convert the null to a NullPointer.
11597         * convert.cs (ImplicitReferenceConversion): If the expression is a
11598         NullLiteral and the target type is a pointer type, return a
11599         NullPointer instead.
11600         (ImplicitConversionStandard): Likewise.
11601
11602 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11603         
11604         * cs-parser.jay: Set readonly context based on special constructs.
11605         
11606         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11607         readonly variable error handling.
11608         
11609         * rootcontext.cs (EmitCode): Don't verify members when error
11610         occurred.
11611         
11612         * statement.cs (LocalInfo): Add reaodnly context information.
11613         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11614
11615 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11616
11617         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11618         for #74041 to initialize 'resolved' to false only for explicit
11619         blocks.  Fixes #74873.
11620
11621 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11622
11623         Fix #74920.
11624         * typemanager.cs (unmanaged_enclosing_types): New.
11625         (IsUnmanagedType): Avoid infloops by using
11626         'unmanaged_enclosing_types' to talk with recursive invocations.
11627
11628 2005-05-13  Martin Baulig  <martin@ximian.com>
11629
11630         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11631         instance variable, not a local.  Fix #74873.
11632         (Block.ResolveUnreachable): Set it to true here.
11633
11634 2005-05-11  Duncan Mak  <duncan@novell.com>
11635
11636         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11637         continuing to process for 'arg'.
11638         (handle_preprocessing_directive): Check the argument of the #endif
11639         directive and report error CS1025 if there are any trailing
11640         characters.
11641
11642         According to the C# spec, having even whitespace after the #endif
11643         directive is illegal; however, because we call arg.TrimEnd ()
11644         beforehand, we have the same behavior as csc, allowing whitespace
11645         after the directive.
11646
11647         Fixes #74892.
11648
11649 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11650
11651         Fix #74863.
11652         
11653         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11654         (Constructor.GetObsoleteAttribute): Implemented correctly.
11655
11656 2005-05-10  Martin Baulig  <martin@ximian.com>
11657
11658         * support.cs (ReflectionParameters.ParameterModifier): Use
11659         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11660         and `ParameterAttributes.In'.  Fixes #74884.
11661
11662 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11663
11664         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11665         
11666         * expression.cs (Argument.GetParameterModifier): Turned to property.
11667         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11668         
11669         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11670         its C# equivalent.
11671         
11672 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11673
11674         Fix #74852.
11675         * decl.cs (MemberCache.AddMethods): Register override methods,
11676         rather than non-override methods.
11677         * typemanager.cs (RegisterOverride): New.
11678         (IsOverride): Update.
11679
11680 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11681
11682         Fix #73105.
11683         
11684         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11685         recursive declaration.
11686         
11687         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11688         
11689 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11690
11691         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11692         
11693         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11694
11695 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11696
11697         Fix #74797.
11698         * decl.cs (DeclSpace.FamilyAccessible): 
11699         Use TypeManager.IsNestedFamilyAccessible.
11700
11701         Fix reopened #64812.
11702         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11703         internal'.
11704
11705 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11706             Abin Thomas  <projectmonokochi@rediffmail.com>
11707             Anoob V E  <projectmonokochi@rediffmail.com>
11708             Harilal P R  <projectmonokochi@rediffmail.com>
11709
11710         Fix #64812.
11711         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11712         allow access to all static members.
11713
11714 2005-05-04  Martin Baulig  <martin@ximian.com>
11715
11716         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11717
11718 2005-05-04  Martin Baulig  <martin@ximian.com>
11719
11720         Fix #74655.
11721
11722         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11723         section at the end; make things work if `default' is not the last
11724         section.        
11725
11726 2005-05-04  Martin Baulig  <martin@ximian.com>
11727
11728         Fix #70400.
11729
11730         * statement.cs (Switch): Replaced the `got_default' field with a
11731         `default_section' one.
11732         (Switch.CheckSwitch): Set `default_section' here.
11733         (Switch.Resolve): If we're a constant switch and the constant is
11734         not found, use the default section.
11735
11736 2005-05-03  Martin Baulig  <martin@ximian.com>
11737
11738         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11739
11740         * statement.cs (Foreach.ArrayForeach): New nested class.
11741         (Foreach.TemporaryVariable): New nested class.
11742         (Foreach.EmitArrayForeach): Removed; this is now in the new
11743         ArrayForeach class.
11744
11745 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11746
11747         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11748         more conservative.
11749         (VerifyPendingMethods): Revert change below.
11750
11751         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11752         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11753         that used to trigger warning -28.  Remove warning -28.
11754         * expression.cs (Invocation.OverloadResolve): Use
11755         TypeManager.IsOverride to distinguish override methods.
11756
11757         Fix #74773.
11758         * pending.cs (VerifyPendingMethods): If a base type implements the
11759         requested interface, don't bother checking individual methods of
11760         the base type.  As a side-effect, this prevents the creation of
11761         unnecessary proxies.
11762
11763 2005-05-02  Martin Baulig  <martin@ximian.com>
11764
11765         Fix #70182.
11766
11767         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11768         Also `And' the locals if the old vector is null.
11769         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11770         null; in this case we basically reset all the variables.        
11771
11772 2005-05-02  Martin Baulig  <martin@ximian.com>
11773
11774         Fix #74529.
11775
11776         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11777         Added `FlowBranching branching' argument; always `and' the
11778         variables instead of `or'ing them unless we're an infinite loop.
11779
11780         * statement.cs (While.Resolve): Create a new sibling unless we're
11781         infinite.       
11782
11783 2005-05-02  Martin Baulig  <martin@ximian.com>
11784
11785         Fix #70140.
11786
11787         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11788         arguments; use it instead of creating a new TopLevelBlock.
11789         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11790         our ConstructorInitializer.
11791
11792         * statement.cs
11793         (TopLevelBlock.TopLevelBranching): New public property.
11794         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11795         and create our `TopLevelBranching'.
11796
11797         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11798         anonymous method host, use `block.TopLevelBranching' rather than
11799         creating a new branching.
11800
11801 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11802
11803         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11804         a ScopeInfo, if any of the current children is a child of the new
11805         entry, move those children there.
11806
11807 2005-04-30  Martin Baulig  <martin@ximian.com>
11808
11809         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11810         at the beginning of a SwitchSection.  Fix #73335.
11811
11812 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11813
11814         Fix #74378
11815         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11816         
11817         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11818         (FieldExpr.DoResolve): Obsolete members are ignored for field
11819         initializers.
11820         
11821 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11822
11823         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11824         of arrays detection.
11825
11826         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11827         verification.
11828         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11829
11830         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11831         arrays report.
11832
11833 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11834
11835         * cs-parser.jay: Use the prefered version of -unsafe in error
11836         message.
11837
11838 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11839
11840         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11841         circumstances.
11842
11843 2005-04-20  John Luke  <john.luke@gmail.com>
11844
11845         * driver.cs: fix typo in error message, --outout to --output
11846
11847 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11848
11849         * codegen.cs (InRefOutArgumentResolving): New field.
11850         
11851         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11852         fields outside contructor.
11853         
11854         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11855         
11856 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11857
11858         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11859         parameter code was not completed ever, so it was not as up-to-date
11860         as local variables.  Must finish it.
11861
11862         The bug fix was to compare the Toplevel of the block, not the
11863         current block.  Thanks for Ben for pointing this out. 
11864
11865 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11866
11867         * decl.cs (AddMethods): Use the declaring type of the problem
11868         method to determine if we want to squash a warning.
11869
11870 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11871
11872         * attribute.cs: Removed debug output.
11873
11874         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11875         
11876         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11877         Report.Stderr.
11878         
11879 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11880
11881         Fix #74481.
11882         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11883         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11884         all null comparisons against reference types.
11885
11886 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
11887
11888         Fix# 74565
11889         * class.cs (TypeContainer.CircularDepException) New nested
11890         exception class.
11891         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
11892         (TypeContainer.DefineType): Removed error, reset InTransit before
11893         exit.
11894         (Class.DefineType): Throw exception when is in Transit.
11895         Catch exception and report error.
11896         (Struct.DefineType): Throw exception when is in Transit.
11897         Catch exception and report error.
11898         (Interface.DefineType): Throw exception when is in Transit.
11899         Catch exception and report error.
11900
11901         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
11902         handle nested exception handlers.
11903
11904         * flowanalysis.cs (InTryWithCatch): New method, search for try with
11905         a catch.
11906
11907         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
11908         InFinally and InCatch storage.
11909
11910         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
11911         (Catch.Resolve): Set and Restore ec.InCatch.
11912         (Try.Resolve): Set and Restore ec.InFinally.
11913         (Try.HasCatch): True when try has catch.
11914
11915 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
11916
11917         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
11918           for the same event member, so exclude such cases from warning 419.
11919           Fixed bug #74633.
11920
11921 2005-04-16  Miguel de Icaza  <miguel@novell.com>
11922
11923         * expression.cs (Binary.ResolveOperator): Apply patch from John
11924         Luke to fix bug 59864: operators &, | and ^ on enumerations
11925         require that the same enum type on both sides.
11926
11927         * driver.cs: Add warnings to old flag usage, this is to assist
11928         people who produce Makefiles and hope that the Makefiles will be
11929         used on Windows.
11930
11931         * class.cs (TypeContainer.EmitType): Moved the definition of the
11932         special $PRIVATE$ field from the resolve phase to the Emit phase.
11933         During resolve we do not know if we are a struct with
11934         HasExplicitLayout, we know this only after the attributes for the
11935         type are emitted.
11936
11937         Set the FieldOffset to zero on the dummy field that we create for
11938         the class.   Fixes 74590.
11939
11940 2005-04-16  Raja R Harinath  <rharinath@novell.com>
11941
11942         Fix #73834.
11943         * ecore.cs (PropertyExpr.resolved): New.
11944         (DoResolve): Use it to handle a case of double resolution here.
11945         Handle a case of identical-name-and-type-name.
11946         * expression.cs (ArrayCreation.CheckIndices): Avoid double
11947         resolution by storing the results of expression resolution back
11948         into the "probes" array.
11949
11950 2005-04-15  Raja R Harinath  <rharinath@novell.com>
11951
11952         Fix cs0208-7.cs and cs0208-8.cs.
11953         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
11954         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
11955         error reporting to point out the reason a struct is not unmanaged.
11956
11957 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
11958
11959         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
11960           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
11961
11962 2005-04-13  Raja R Harinath  <rharinath@novell.com>
11963
11964         Fix #74528.
11965         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
11966         IdenticalNameAndTypeName here.
11967         (EventExpr.InstanceResolve): Likewise.
11968
11969 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
11970
11971         C# 2.0 DefaultCharSetAttribute implementation
11972         
11973         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
11974         which allows us to set GlobalNamespace for every resolve.
11975         (Attribute.ResolveArguments): Cut from Resolve.
11976         (Attribute.GetCharSetValue): Returns CharSet named argument.
11977         (Attribute.DefinePInvokeMethod): Gets default charset from
11978         module settings.
11979         (GlobalAttribute.ResolveAsTypeStep): Override.
11980         (GlobalAttribute.ResolveArguments): Override.
11981         
11982         * class.cs (TypeAttr): Is protected.
11983         
11984         * codegen.cs (ModuleClass.DefaultCharSet): New member.
11985         (ModuleClass.DefaultCharSetType): New memeber.
11986         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
11987         
11988         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
11989         charset from module.
11990         
11991         * delegate.cs (TypeAttr): Override.
11992         (Delegate.DefineType): Use this TypeAttr.
11993         
11994         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
11995         at very early stage (before types are defined) to resolve model
11996         module attributes. It will probably not work with corlib but it
11997         should be ok.
11998         
11999         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12000         charset from module.
12001         
12002         * typemanager.cs (default_charset_type): New type.
12003
12004 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12005
12006         * decl.cs (MemberCache.AddMethods): Don't warn if
12007         System.Object.Finalize has buggy MethodAttributes.
12008
12009         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12010         removed below.
12011
12012 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12013
12014         * doc.cs : detect ambiguous reference to overloaded members.
12015           Fixed bug #71603. MS 1.1 csc does not detect it.
12016
12017 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12018
12019         * doc.cs : delegates must not be referenced with parameters.
12020           Fixed bug #71605.
12021
12022 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12023
12024         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12025
12026 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12027
12028         * driver.cs (MainDriver): Stop processing if the CLS stage found
12029         errors. 
12030
12031         (CompilerCallableEntryPoint.InvokeCompiler): Always
12032         reset after execution;   Take a TextWriter argument for the
12033         output.
12034
12035         * report.cs: Use the error stream instead of hardcoding stderr. 
12036
12037 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12038
12039         * class.cs: Reduce code paths to test, too small of an
12040         optimization to make it worth the extra testing.  Always perform
12041         it. 
12042
12043 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12044
12045         Fix #74510.
12046         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12047         operators that had errors reported on them.
12048
12049 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12050
12051         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12052         argument types.
12053         (Attribute.Resolve): Add named argument type checking.
12054         
12055         * class.cs (FixedField.Define): Use IsPrimitiveType
12056         
12057         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12058         
12059         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12060         unsafe parameter types.
12061         
12062         * statement.cs (Using.ResolveExpression): Add better error description.
12063         
12064         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12065         
12066 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12067
12068         Fix #74484.
12069         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12070         AttributeUsageAttribute in the emitcontext of the attribute class,
12071         not in the emitcontext of the attributable entity it was attached to.
12072         * cs-parser.jay: Use 'current_class', not 'current_container',
12073         when creating a GlobalAttribute.
12074
12075 2005-04-08  Alp Toker  <alp@atoker.com>
12076
12077         * pending.cs: The fix to #58413 failed to compile methods implementing
12078         interfaces with/without params modifiers and vice versa, even though
12079         params modifiers aren't part of the signature. Make the modifier check
12080         less strict as in csc.
12081
12082 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12083             Anoob V E  <projectmonokochi@rediffmail.com>
12084             Harilal P R  <projectmonokochi@rediffmail.com>
12085
12086         Fix #58413.
12087         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12088         modifiers of pending methods.
12089         (PendingImplementation.PendingImplementation): Initialize it.
12090         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12091         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12092         with ParameterData.  Add check for modifiers.
12093         * class.cs (MethodData.Define): Update to changes.
12094
12095 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12096
12097         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12098
12099 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12100
12101         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12102         property.
12103         
12104         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12105         
12106         * rootcontext.cs,
12107         * typemanager.cs: Registered RequiredAttributeAttribute.
12108         
12109 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12110
12111         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12112         Warning CS0169 is back at level 3.
12113         (IMethodData.SetMemberIsUsed): New method.
12114         
12115         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12116         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12117         
12118         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12119
12120         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12121         contants.
12122         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12123         is used.
12124         
12125         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12126         is used.
12127         
12128         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12129         to avoid the problems with nested types.
12130
12131 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12132             Anoob V.E  <projectmonokochi@rediffmail.com>
12133             Harilal P.R  <projectmonokochi@rediffmail.com>
12134             Raja R Harinath  <rharinath@novell.com>
12135
12136         Fix #73820.
12137         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12138         attribute.
12139         * typemanager (GetConstructor): Make public.
12140
12141 2005-04-05  John Luke  <john.luke@gmail.com>
12142             Raja R Harinath  <rharinath@novell.com>
12143
12144         Fix #62232.
12145         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12146         struct too.  Return false quicker in a few cases.
12147         (VerifyUnManaged): Use it.
12148
12149 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12150
12151         Fix #74041.
12152         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12153         not 'unreachable_seen'.
12154
12155 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12156
12157         * attribute.cs (Attribute.GetValue): Removed unused.
12158         
12159         * codegen.cs (CodeGen.TrimExt): Removed unused.
12160         
12161         * cs-parser.jay (output): Removed unused.
12162         
12163         * cs-tokenizer.cs (hex_digits): Removed unused.
12164         
12165         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12166         
12167         * expression.cs (Indirection.LoadExprValue): Removed unused.
12168         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12169         
12170         * iterators.cs (Iterator.param_types): Removed unused.
12171         
12172         * statement.cs (Goto.block): Removed unused.
12173         (ToplevelBlock.did): Removed unused.
12174         (Switch.ResolveConstantSwitch): Removed unused.
12175
12176 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12177
12178         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12179         resetting thingy.
12180
12181 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12182
12183         Fix #74232 and cs0208-3.cs.
12184         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12185         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12186         unmanaged type.  Don't use FieldBuilders when 't' is a
12187         TypeBuilder.  Use ModFlags and MemberType fields.
12188         * class.cs (MemberBase.member_type): Rename from MemberType.
12189         (MemberBase.MemberType): New property.  Determines member_type on
12190         demand.
12191         (MemberBase.DoDefine): Don't initialize MemberType here.
12192         (FieldMember.Define): Likewise.
12193
12194 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12195
12196         Fix #74241
12197         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12198         Attributes are emitted there.
12199         
12200 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12201
12202         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12203         keyword in 'partial enum' too.
12204         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12205         is not allowed).
12206         Report from Kamil Skalski <nazgul@omega.pl>.
12207
12208         Fix #74309.
12209         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12210         have partial containers too.
12211
12212         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12213         in block' checks to Block.CheckInvariantMeaningInBlock.
12214         * statement.cs (Block.GetKnownVariableInfo): Make private.
12215         (Block.IsVariableUsedInChildBlock): Remove.
12216         (Block.IsVariableUsedInBlock): Likewise.
12217         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12218         conflicting declaration.
12219         (Block.AddVariable): Make error messages less long-winded and more
12220         specific.  Show location of conflicting declaration.
12221         * parameter.cs (Parameters.Location): New readonly property.
12222
12223 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12224
12225         Clean up semantics of invoking ResolveMemberAccess.
12226         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12227         can have an instance, ensure that we pass in a non-TypeExpression
12228         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12229         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12230         argument.  Update to changes and simplify.
12231         (FieldExpr.Emitinstance): Remove CS0120 check.
12232         (PropertyExpr.EmitInstance): Likewise.
12233         * expression.cs (Argument.Resolve): Likewise.
12234         (Invocation.DoResolve): Update to changes in semantics of
12235         InstanceExpression.
12236
12237 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12238
12239         Fix #74241
12240         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12241         customization.
12242         
12243         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12244
12245 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12246
12247         Fix difference in behaviour with commandline invocation.
12248         * driver.cs (Driver.Reset): New.
12249         (CompilerCallableEntryPoint): Call it.
12250
12251         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12252         variable" warnings if the boolean expression failed to resolve.
12253
12254 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12255
12256         * attribute.cs: Fix the union of several permissions when some of them
12257         are unrestricted (so the result isn't an unrestricted permission set).
12258         Fix #74036.
12259
12260 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12261
12262         * ecore.cs (MemberExpr): New class.  Convert from interface
12263         IMemberExpr.
12264         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12265         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12266         error checks.
12267         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12268         (MethodGroupExpr.IsExplicitImpl): Remove.
12269         (Expression.GetFieldFromEvent): Remove.
12270         (SimpleName.MemberStaticCheck): Remove.
12271         (SimpleName.DoSimpleNameResolve): Update to changes.
12272         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12273         (MemberAccess.IdenticalNameAndTypeName): Remove.
12274         (MemberAccess.error176): Move to MemberExpr.
12275         (MemberAccess.DoResolve): Update to changes.
12276         (BaseAccess.DoResolve): Likewise.
12277
12278 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12279
12280         C# 2.0 Conditional attribute class implementation
12281         
12282         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12283         Analyzes class whether it has attribute which has ConditionalAttribute
12284         and its condition is not defined.
12285         
12286         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12287         (Class.IsExcluded): New method. Search for at least one defined
12288         condition in ConditionalAttribute of attribute class.
12289
12290 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12291
12292         * ecore.cs (PropertyExpr): Derive from Expression, not
12293         ExpressionStatement.
12294         (PropertyExpr.EmitStatement): Remove.
12295
12296 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12297
12298         Fix #74060.
12299         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12300         internal field "value__" of an enum be private.  The examples for
12301         "value__" that I found on MSDN all used FieldAttributes.Private.
12302
12303         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12304         Don't mention IL method attribute names.
12305
12306         Fix #47991.  Remove a TODO.
12307         * statement.cs (Block.Toplevel): Make into a field.
12308         (Block.Parameters): Move into ToplevelBlock.
12309         (Block.known_variables): Rename from child_variable_names.
12310         (Block.Block): Remove variants that take Parameters.  Initialize
12311         'Toplevel' with the immediately surrounding toplevel block.
12312         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12313         LocalInfo parameter.
12314         (Block.GetKnownVariableInfo): New.
12315         (Block.IsVariableNameUsedInChildBlock): Update.
12316         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12317         the block, even though it may not be in scope.
12318         (Block.AddVariable): Remove Parameters parameter.  Use
12319         Toplevel.Parameters instead.
12320         (Block.AddConstant): Remove Parameters parameter.
12321         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12322         (Block.IsParamaterReference): Likewise.
12323         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12324         (ToplevelBlock.Parameters): New.  Moved from Block.
12325         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12326         initialize Parameters to a non-null value.
12327         * cs-parser.jay: Update to changes.
12328         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12329         simple names that mean different things in the same block.  Use
12330         Block.IsVariableNameUsedInBlock.
12331
12332 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12333
12334         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12335         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12336         GetTypeHandle.  It is possible for a reflected type to derive from
12337         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12338         System.Array during mscorlib compilation).
12339         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12340         contain a method_hash, don't create one either.  Don't create a
12341         deep copy of the base cache's method_hash.
12342         (MemberCache.SetupCache): Rename back from DeepCopy.
12343         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12344         already initialized.  If we see an override function, add its
12345         underlying base virtual function to the member_hash too.
12346
12347         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12348
12349 2005-03-26  Raja R Harinath  <harinath@acm.org>
12350
12351         Fix #73038.
12352         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12353         fails to resolve, ensure that the LHS is still resolved as an
12354         lvalue.
12355
12356 2005-03-25  Raja R Harinath  <harinath@acm.org>
12357
12358         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12359         ec.ContainerType.
12360         (Enum.current_ec): Remove.
12361         (Enum.LookupEnumValue): Remove EmitContext argument.
12362         Just uses the one created during DefineType.
12363         (Enum.FindMembers): Update.
12364         * expression.cs (MemberAccess.DoResolve): Update.
12365
12366 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12367
12368         * assign.cs (Assign.DoResolve): Check for CS1717 when
12369         source and target are same (uses Equals).
12370
12371         * expression.cs (LocalVariableReference, ParameterReference,
12372         This): Implemented Equals, GetHashCode.
12373
12374         * statement.cs (Block.GetParameterReference): Removed useless
12375         local variable.
12376
12377 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12378
12379         Fix cs0128.cs
12380         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12381         blocks before deciding whether the error is cs0136 or cs0128.
12382
12383         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12384         (using_alias_directive, using_namespace_directive): Pass
12385         MemberName, not an expression to Namespace.UsingAlias and
12386         Namespace.Using.
12387         (MakeName): Use the MemberName of the namespace.
12388         * namespace.cs (Namespace.MemberName): New.
12389         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12390         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12391         Likewise.
12392         * decl.cs (MemberName.Name): Make readonly.
12393         (MemberName.FromDotted): New "constructor".
12394         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12395         (MemberCore.Name): Compute from MemberName on demand.
12396         (MemberCore.SetMemberName): Provide a way to change the
12397         MemberName.
12398         (MemberCore.AddToContainer): Don't take a fullname parameter.
12399         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12400         fully qualified name of the container to the member name.
12401         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12402         only if the type is a member of the root container.
12403         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12404         MemberName.Left rather than searching for an embedded ".".
12405         (PartialContainer.CreatePart): Update to changes in RootContext.
12406         (MemberBase.ShortName): Turn into a property.  Use
12407         MemberCore.SetMemberName.
12408         (MemberBase.ExplicitInterfaceName): Remove.
12409         (MemberBase.UpdateMemberName): Remove.
12410         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12411         (PropertyBase.SetMemberName): New override.
12412         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12413         (Tree.GetDecl): New.
12414         (Tree.AllDecls): Rename from Decls.
12415         * attribute.cs, enum.cs, report.cs: Update to changes.
12416         * driver.cs (MainDriver): Use MemberName.FromDotted on
12417         RootContext.MainClass.
12418
12419 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12420
12421         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12422         checks.
12423
12424         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12425
12426 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12427
12428         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12429         property accessor modifiers.
12430
12431         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12432         fixed buffer attribute (CS1716).
12433         (PropertyMethod.HasCustomAccessModifier): When property accessor
12434         has custom modifier.
12435
12436         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12437         modifiers.
12438         (PropertyExpr.DoResolveLValue): Add CS0272.
12439
12440 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12441
12442         * convert.cs: When converting to a pointer, use the proper Conv.U
12443         or Conv.I depending on the source data type.
12444
12445         * cs-tokenizer.cs: Make the size for large decimal constants,
12446         fixes #72957.
12447
12448 2005-03-17  Martin Baulig  <martin@ximian.com>
12449
12450         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12451         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12452
12453 2005-03-17  Martin Baulig  <martin@ximian.com>
12454
12455         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12456         to bool so we can return an error condition.
12457         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12458         returned an error.
12459
12460 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12461
12462         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12463         attributes.
12464
12465 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12466
12467         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12468         Refactor to avoid traversing the list of assemblies, and to avoid
12469         string concatenation.
12470         * typemanager.cs (guid_attr_type): Remove.
12471         (negative_hits, pointers, references): Remove hashes.
12472         (type_hash): New.
12473         (GetConstructedType): New.  Uses type_hash to handle constructed
12474         types (arrays, references, pointers).
12475         (GetReferenceType, GetPointerType): Use it.
12476         (GetNestedType): New.  Uses type_hash to handle nested types of
12477         reflected types.
12478         (LookupType, LookupTypeDirect): Remove.
12479         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12480         'types' hash and LookupTypeReflection directly.
12481         (params_string, params_object): Use GetConstructedType.
12482         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12483         top-level types.
12484         (Namespace.Lookup): Use cached_types.
12485         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12486         provided by old TypeManager.LookupType.
12487         * rootcontext.cs (MakeFQN): Remove.
12488         * decl.cs (DeclSpace.MakeFQN): Likewise.
12489         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12490         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12491         TypeManager.GetConstructedType.
12492         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12493
12494 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12495
12496         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12497         indexers.
12498
12499         * cs-parser.jay: Reports CS1527 for any namespace element.
12500
12501         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12502         Added CS0407.
12503
12504         * expression.cs (ParameterReference.IsAssigned): Changed error to
12505         CS0269.
12506         (Error_WrongNumArguments): Moved CS0245 detection here.
12507
12508         * statement.cs (Return.Resolve): Add CS1622 report.
12509
12510 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12511
12512         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12513
12514 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12515
12516         * attribute.cs expression.cs: Get rid of some allocations.
12517
12518 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12519
12520         * doc.cs : just eliminate the latest change.
12521
12522 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12523
12524         * doc.cs : commented out the latest change. It breaks xml-030.cs
12525
12526 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12527
12528         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12529           fail. So invoke CreateType() in FindDocumentedType().
12530
12531 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12532
12533         * cs-tokenizer.cs : added IsKeyword().
12534         * doc.cs : Detect keyword incorrectly used as identifier.
12535           Allow identifiers prefixed by @.
12536
12537 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12538
12539         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12540         It caused exception in namespace resolving (again!).
12541         
12542         * class.cs (Class.ctor): Removed exit.
12543         (PropertyMethod.ctor): ditto.
12544         
12545         * codegen.cs (Codegen.Reset): Reset static data.
12546         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12547         
12548         * cs-tokenizer.cs (Cleanup): Removed.
12549         
12550         * driver.cs (GetSystemDir): Rewrote to one line command.
12551         It caused problem with unloaded dynamic modules.
12552         (UnixParseOption): Removed Exit.
12553         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12554         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12555         Now can be mcs used as library.
12556         
12557         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12558         empty location.
12559         
12560         * location.cs (Reset): Reset static data.
12561         
12562         * namespace.cs (Reset): Reset static data.
12563         
12564         * report.cs (Report.Reset): Reset static data.
12565         
12566         * rootcontext.cs (RootContext.Reset): Reset static data.
12567         
12568         * tree.cs (RootTypes.ctor): Use Location.Null
12569         
12570         * typemanager.cs (TypeManager.Reset): Reset static data.
12571         (CoreLookupType): Removed Exit.
12572         (TypeHandle.Reset): Reset static data.
12573         
12574 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12575
12576         Fix #73516.
12577         * typemanager.cs (ComputeNamespaces): Import namespaces from
12578         referenced modules too.
12579
12580 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12581
12582         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12583         than '.'.
12584
12585 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12586
12587         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12588         enclosing DeclSpace.  This ensures that a name-lookup populates
12589         more caches and there are fewer 'TypeExpression's.  Carve out
12590         nested type lookup into ...
12591         (LookupNestedTypeInHierarchy): ... this.
12592
12593 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12594
12595         Clean up a few partial-class semantics.  
12596         Fixes test-357.cs and cs1618-2.cs.
12597         * cs-parser.jay (struct_declaration): Use 'current_class' as
12598         parent of newly-created struct.  Remove call to Register ().
12599         Use 'pop_current_class' to complete handing the current struct.
12600         (interface_declaration): Likewise.
12601         (class_declaration): Likewise.
12602         (enum_declaration): Use 'current_class' as parent of newly created
12603         enum.
12604         (delegate_declaration): Likewise.
12605         (pop_current_class): New function.  This is used to handle closing
12606         up the 'current_class' and 'current_container', and pointing them
12607         to the enclosing class/container.
12608         (CSharpParser): Initialize 'current_class' too.
12609         * decl.cs (MemberCore): Add check for invariant: a partial
12610         container is not a parsed entity, and thus does not enclose any
12611         parsed members.
12612         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12613         (DeclSpace.BaseTypeExpr): Use it.
12614         (DeclSpace.LookupType): Add check for invariant.
12615         * class.cs (TypeContainer): Add check for invariant: a nested
12616         class should have the same NamespaceEntry as its enclosing class.
12617         (TypeContainer.EmitFieldInitializers): Make virtual.
12618         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12619         MemberCore.
12620         (TypeContainer.Register): Remove.
12621         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12622         null.  Use TypeResolveEmitContext for resolving base types and
12623         interfaces.  Move initialization of Parts.TypeBuilder here from
12624         ...
12625         (TypeContainer.DefineNestedTypes): ... here.
12626         (PartialContainer): Take a Namespace not a NamespaceEntry.
12627         (PartialContainer.Create): Don't use Register.  Call the
12628         appropriate Add... function directly.
12629         (ClassPart): Take both the PartialContainer and the enclosing
12630         class as constructor arguments.
12631         (ClassPart.EmitFieldInitializers): Override.
12632         (ClassPart.PartFindNestedTypes): Remove.
12633         (FieldBase.GetInitializerExpression): Resolve the initializer
12634         expression in the emit context of the enclosing class.
12635         * tree.cs (RootTypes): Remove Register ().
12636         
12637 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12638
12639         * cs-parser.jay: Removed CS0134.
12640         
12641         * driver.cs: Removed CS1901.
12642         
12643         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12644         for predefined types.
12645
12646 2005-03-07  Duncan Mak  <duncan@novell.com>
12647
12648         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12649         well. Fixes bug #73454.
12650
12651 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12652
12653         * cs-tokenizer.cs (xtoken): Add CS1035.
12654         
12655         * class.cs (MethodData.Define): Add CS0683.
12656         (FieldMember.ctor): Add CS0681.
12657
12658 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12659
12660         * ecore.cs (SimpleName.DoResolve): Rename from
12661         SimpleName.DoResolveAllowStatic.
12662         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12663         Pass 'intermediate' flag to MemberStaticCheck.
12664         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12665         of "intermediate" lookups via MemberAccess.
12666         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12667         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12668
12669 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12670
12671         Fix #73394.
12672         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12673         slipped in because of variable names that are identical to a
12674         builtin type's BCL equivalent ('string String;', 'int Int32;').
12675         (PropertyExpr.EmitInstance): Likewise.
12676
12677 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12678
12679         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12680         
12681         * report.cs (warning_ignore_table): Made public.
12682
12683 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12684
12685         Fix #73282.
12686         * class.cs (MethodData.Emit): Pass 'container' to
12687         container.GetObsoleteAttribute instead of 'container.Parent'.
12688
12689 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12690
12691         * cs-parser.jay: Add 1534 error test.
12692
12693         * iterators.cs (Yield.CheckContext): Add error 1629.
12694         (Iterator.ctor): Save unsafe modifier.
12695         (MoveNextMethod.DoEmit): Restore unsafe context.
12696
12697         * namespace.cs (UsingAlias): Better error message.
12698
12699 2005-03-03  Dan Winship  <danw@novell.com>
12700
12701         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12702         the warning message [#73219]
12703
12704 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12705
12706         Fix compile with MCS 1.0.0.0.
12707         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12708         w_restore to not depend on string constant folding.
12709
12710 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12711
12712         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12713         CS0246 check to users who passed 'silent = false'.
12714         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12715         check.
12716         (SimpleName.SimpleNameResolve): Update.
12717         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12718         (MemberAccess.IdenticalNameAndTypeName): Update.
12719         * doc.cs (FindDocumentedTypeNonArray): Update.
12720
12721 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12722
12723         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12724         * parameters.cs (ComputeAndDefineParameters): Remove.
12725         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12726         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12727         Use GetParameterInfo.
12728
12729 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12730
12731         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12732
12733 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12734
12735         Unify DeclSpace.LookupType and DeclSpace.FindType.
12736         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12737         is in charge of defining nested types on demand.
12738         (DeclSpace.LookupType): Use it when the current_type is a
12739         TypeBuilder.  Use LookupTypeDirect for reflected types.
12740         (DeclSpace.FindType): Remove.
12741         (DeclSpace.LookupInterfaceOrClass): Likewise.
12742         (DeclSpace.DefineTypeAndParents): Likewise.
12743         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12744         DeclSpace.LookupType.
12745         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12746         * typemanager.cs (LookupType): Simplify.
12747         (AddUserType): Remove type from negative_hits.
12748         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12749         * class.cs (TypeContainer.FindMembers): Move handling of nested
12750         types ...
12751         (TypeContainer.FindMembers_NestedTypes): ... here.
12752         (TypeContainer.FindNestedType): Implement override.
12753         (ClassPart.FindNestedType): Delegate to PartialContainer.
12754         (ClassPart.PartFindNestedType): Looks up the nested types of the
12755         part alone.
12756
12757 2005-03-02  Martin Baulig  <martin@ximian.com>
12758
12759         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12760         static constructor in static classes.
12761
12762 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12763
12764         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12765         sizeParamIndex is not specified.
12766
12767 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12768
12769         Fix #73117
12770         * report.cs (WarningMessage.IsEnabled): Missing null check.
12771
12772 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12773
12774         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12775         in the fields and not in the properties.
12776
12777 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12778
12779         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12780         fields as well.
12781
12782 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12783
12784         * attribute.cs: Small refactoring (improved robustness).
12785         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12786         (ValidateGuid): Removed.
12787         (Resolve): Removed referenced to above mentioned.
12788         (GetAttributeUsage): Made private and changed to work without
12789         class assistance.
12790         (GetIndexerAttributeValue): Don't crash.
12791         (GetConditionalAttributeValue): Ditto.
12792         (GetClsCompliantAttributeValue): Ditto.
12793         (ExtractSecurityPermissionSet): All attributes exceptions are
12794         error 648.
12795         (GetPropertyValue): New helper.
12796         (GetMethodImplOptions): New method.
12797         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12798         some missing properties.
12799         
12800         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12801         (Method.ApplyAttributeBuilder): Updated.
12802         
12803         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12804         exception.
12805
12806 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12807
12808         Fix #73052.
12809         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12810         non-simple types (array, pointer, reference).
12811
12812 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12813
12814         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12815
12816         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12817         for operators.
12818         (Method.CheckBase): Catch wrong destructor here.
12819         (MethodData.Define): Add errors 550, 668.
12820
12821         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12822
12823         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12824
12825         * pending.cs (VerifyPendingMethods): Add error 551.
12826
12827         * typemanager.cs (CSharpName): Next error report helper.
12828
12829 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12830
12831         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12832         attributes. Removed useless attribute double check.
12833         It saves almost 2MBs for corlib.
12834
12835 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12836
12837         Fix #72924.
12838         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12839         called twice in case of error.
12840
12841 2005-02-23  Chris Toshok  <toshok@ximian.com>
12842
12843         Fix compiler portions of #72827.
12844         * statement.cs (Block.Emit): call Begin/EndScope on the
12845         EmitContext instead of the ILGenerator.
12846
12847         * codegen.cs (EmitContext.BeginScope): new method, call
12848         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12849         we have one.)
12850         (EmitContext.BeginScope): same, but EndScope and CloseScope
12851
12852         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12853         offset and call the superclass's OpenScope(int) with it.
12854         (SymbolWriter.CloseScope): get the current il
12855         offset and call superclass's CloseScope(int) with it.
12856
12857 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12858
12859         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12860         CS1677 for out and ref as well.
12861
12862         * class.cs (Method.Define): Add error CS1599 detection.
12863         
12864         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12865         
12866         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12867         
12868         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12869         
12870         * support.cs.cs (ModifierDesc): New helper method.
12871
12872 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12873             Abin Thomas  <projectmonokochi@rediffmail.com>
12874             Anoob V E  <projectmonokochi@rediffmail.com>
12875             Harilal P R  <projectmonokochi@rediffmail.com>
12876
12877         Fix #57851, #72718.
12878         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12879         MemberLookup (used for error reporting) actually returns a result.
12880         Fix error report number (122, not 112).
12881
12882 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12883             Anoob V E  <projectmonokochi@rediffmail.com>
12884             Harilal P R  <projectmonokochi@rediffmail.com>
12885
12886         Fix #71134.
12887         * pending.cs (PendingImplementation.GetAbstractMethods):
12888         Find NonPublic members too.
12889
12890 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
12891
12892         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
12893         Fixed error 217.
12894         
12895         * class.cs (MethodCore.CheckMethodAgainstBase):
12896         Add error 239 report.
12897
12898 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12899
12900         Fix #68955.
12901         * expression.cs (Invocation.IsApplicable): Make public.
12902         (Invocation.IsParamsMethodApplicable): Likewise.
12903         * delegate.cs (Delegate.VerifyApplicability): Don't use
12904         Invocation.VerifyArgumentCompat for parameter applicability
12905         testing.  Use Invocation.IsApplicable and
12906         Invocation.IsParamsMethodApplicable.
12907
12908 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12909
12910         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
12911         
12912         * class.cs (Operator.Define): Add error 217 report.
12913         
12914 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12915
12916         * namespace.cs (UsingEntry.Resolve): Undo change below.
12917
12918 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12919
12920         Fix #72756.
12921         * ecore.cs (Expression.MemberLookupFailed): Add argument to
12922         disable the error message when the extended MemberLookup also
12923         fails.
12924         (Expression.MemberLookupFinal): Update.
12925         (SimpleName.DoSimpleNameResolve): Update.
12926         * expression.cs (MemberAccess.ResolveNamespaceOrType):
12927         Don't use MemberLookupFinal.
12928         (New.DoResolve): Update.
12929         (BaseAccess.CommonResolve): Update.
12930
12931 2005-02-21  Raja R Harinath  <rharinath@novell.com>
12932
12933         Fix #72732.
12934         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
12935         occured previously, don't resolve again.
12936
12937 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
12938
12939         Fix #69949
12940         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
12941         argument. Call ResolveAttributeUsage for unresolved.
12942         when types doesn't match ctor arguments.
12943         
12944         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
12945         for nested attribute classes.
12946         (Class.attribute_usage): Removed.
12947         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
12948         for attribute class.
12949         
12950         * ecore.cs (IsAttribute): Removed.
12951         
12952         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
12953         
12954         * rootcontext.cs (RegisterAttribute): Removed, attributes are
12955         now normal types.
12956         (attribute_types): Removed.
12957         (EmitCode): Global attributes are emited as the latest.
12958
12959 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
12960
12961         * class.cs (EmitFieldInitializers): Don't emit field initializer
12962         for default values when optimilization is on.
12963         
12964         * constant.cs (Constant.IsDefaultValue): New property.
12965         
12966         * driver.cs: Add /optimize handling.
12967         
12968         * constant.cs,
12969         * ecore.cs,
12970         * literal.cs: Implement new IsDefaultValue property.
12971         
12972         * rootcontext.cs (Optimize): New field, holds /optimize option.
12973
12974 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12975
12976         Fix crasher in re-opened #72347.
12977         * namespace.cs (Namespace.Lookup): Return null if
12978         DeclSpace.DefineType returns null.
12979
12980         Fix #72678.
12981         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
12982
12983 2005-02-18  Raja R Harinath  <rharinath@novell.com>
12984
12985         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
12986         now returns null if it cannot resolve to an lvalue.
12987         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
12988         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
12989         returned null.  Remove check for SimpleName.
12990         (EventExpr.DoResolveLValue): New.
12991         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
12992         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
12993         error from ...
12994         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
12995         avoid CS0131 error.
12996         (Unary.ResolveOperator): Move CS0211 check ...
12997         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
12998         CS0131 error.
12999         (Unary.DoResolveLValue): Simplify.
13000         (AddressOf.DoResolveLValue): New.
13001         (ArrayAccess.DoResolveLValue): New.
13002
13003 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13004
13005         * attribute.cs (Attribute.Resolve): Add arguments casting for
13006         when types doesn't match ctor arguments.
13007
13008 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13009
13010         Fix parts of #63202.
13011         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13012         lookup of operator in base type.  Ensure that all checks happen
13013         when the operator resolves to an "op_..." method.
13014
13015 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13016
13017         Fix #71992.
13018         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13019         'ignore_cs0104' parameter.  Pass it to ...
13020         (NamespaceEntry.Lookup): ... this.
13021         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13022         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13023         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13024         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13025         Update.  Request that cs0104 errors be ignored.
13026         (ComposedCast.ResolveAsTypeStep): Update.
13027
13028 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13029
13030         Fix #59209.
13031         * expression.cs (Invocation.BetterFunction): Remove support for
13032         comparing virtual functions and their overrides.
13033         (Invocation.IsOverride): New.
13034         (Invocation.OverloadResolve): Don't consider 'override' functions
13035         during candidate selection.  Store them in a lookaside list.
13036         If the selected method is a 'virtual' function, use the list to
13037         find any overrides that are closer to the LHS type.
13038
13039 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13040
13041         * expression.cs (New.DoResolve): Add complex core type reduction.
13042         (New.Constantify): Converts complex core type syntax like 'new int ()'
13043         to simple constant.
13044         
13045 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13046
13047         * decl.cs (EntryType.EntryType): New constructor to create an
13048         updated copy of a cache entry.
13049         (MemberCache.AddMethods): Use it.
13050         (MemberCache.ClearDeclaredOnly): Remove.
13051         (MemberCache.MemberCache): Update.
13052
13053 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13054
13055         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13056         variable.  This one is represents the actual low-level declaration
13057         of the method, as opposed to the semantic level `IsStatic'.   
13058
13059         An anonymous method which is hosted into a static method might be
13060         actually an instance method.  IsStatic would reflect the
13061         container, while MethodIsStatic represents the actual code
13062         generated.
13063
13064         * expression.cs (ParameterReference): Use the new MethodIsStatic
13065         instead of IsStatic.
13066
13067         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13068         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13069         set on the current EmitContext. 
13070
13071         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13072         resolve our casted expression as an LValue.  This triggers the
13073         proper LValue processing that is later required by Assign.
13074
13075         This fixes 72347.
13076
13077         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13078
13079 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13080
13081         C# 2.0 Fixed buffer implementation
13082
13083         * anonymous.cs: Update after RegisterHelperClass renaming.
13084
13085         * attribute.cs (AttributeTester.fixed_buffer_cache):
13086         Cache of external fixed buffers.
13087         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13088         implementation if field is fixed buffer else null.
13089
13090         * class.cs
13091         (TypeContainer.AddField): Accept FieldMember instead of Field.
13092         (FieldBase.IsFieldClsCompliant): Extracted code from
13093         VerifyClsCompliance descendant customization.
13094         (FixedField): New class handles fixed buffer fields.
13095         (FixedFieldExternal): Keeps information about imported fixed
13096         buffer.
13097         (IFixedField): Make access to internal or external fixed buffer
13098         same.
13099
13100         * cs-parser.jay: Add fixed buffer parsing.
13101
13102         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13103         buffer.
13104
13105         * expression.cs (Indirection): Extended implementation to accept
13106         fixed buffer field.
13107         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13108         (ElementAccess.MakePointerAccess): Get type as parameter.
13109         (DoResolve): Add fixed buffer field expression conversion.
13110         (DoResolveLValue): Ditto.
13111         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13112         (ArrayPtr): Derives from FixedBufferPtr.
13113         (ArrayPtr.Emit): Add extra emit for array elements.
13114
13115         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13116
13117         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13118         for compiler generated types.
13119         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13120
13121         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13122         and consume less memory.
13123         (Fixed.Resolve): Add fixed buffer case.
13124
13125         * typemanager.cs (compiler_generated_attr_ctor,
13126         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13127         (HasElementType): Add our own implementation to work on every
13128         runtime.
13129
13130 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13131
13132         * anonymous.cs (CaptureContext): Track whether `this' has been
13133         referenced.   
13134
13135         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13136         only captured `this' if it was implicitly done (instance
13137         methods/variables were used). 
13138
13139         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13140         `this' must be captured.
13141
13142 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13143  
13144         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13145         is null it means that there has been no need to capture anything,
13146         so we just create a sibling.
13147
13148         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13149
13150         Just a partial fix.  The other half is fairly elusive.
13151         
13152 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13153
13154         Fix #52586, cs0121-4.cs.
13155         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13156         and return a hashtable.
13157         (MemberCache.ClearDeclaredOnly): New.
13158         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13159         the method_hash of a base type too.
13160         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13161         type methods.  Overwrite entries with the same MethodHandle so
13162         that the ReflectedType is correct.  The process leaves in base
13163         virtual functions and their overrides as distinct entries.
13164         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13165         matters since it was boxed in a ArrayList before.
13166         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13167         modifier.
13168         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13169         case of a virtual function and its override (choose the overload
13170         as better).
13171         (Invocation.OverloadResolve): Avoid 'override' members during
13172         'applicable_type' calculation.
13173
13174 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13175
13176         Combine two near-redundant caches.
13177         * typemanager.cs (method_params): Rename from method_internal_params.
13178         (TypeManager.GetParameterData): New.  Replace
13179         Invocation.GetParameterData.
13180         (TypeManager.LookupParametersByBuilder): Remove.
13181         * expression.cs (Invocation.method_parameter_cache): Remove.
13182         (Invocation.GetParameterData): Remove.
13183         Update to changes.
13184         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13185         Update to changes.
13186
13187 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13188
13189         Fix #72015.
13190         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13191         TypeManager.multicast_delegate_type is null, resolve it by looking
13192         up "System.MulticastDelegate".
13193         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13194
13195 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13196             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13197             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13198
13199         Fix cs0164.cs.
13200         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13201         (LabeledStatement.AddReference): New.  Set 'referenced'.
13202         (Goto.Resolve): Use it.
13203
13204 2005-02-05  John Luke  <john.luke@gmail.com>
13205
13206         * driver.cs: remove duplicate -doc line in Usage ()
13207
13208 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13209
13210         * location.cs (Location.AddFile): Fix CS2002 error report.
13211
13212 2005-02-02  Martin Baulig  <martin@ximian.com>
13213
13214         * delegate.cs (Delegate.DefineType): Report an internal error if
13215         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13216         details.        
13217
13218 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13219
13220         Fix a crasher in a variant of #31984.
13221         * const.cs (Constant.CheckBase): New override that defers the
13222         new-or-override check in case the base type hasn't been populated
13223         yet.
13224         (Constant.Define): Ensure the new-or-override check is performed.
13225
13226 2005-02-01  Duncan Mak  <duncan@ximian.com>
13227
13228         * const.cs (LookupConstantValue): Check that `ce' is not null
13229         before calling GetValue ().
13230
13231 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13232
13233         Fix test-334.cs (#69519).
13234         * cs-parser.jay (using_alias_directive): Pass in an expression to
13235         NamespaceEntry.UsingAlias.
13236         (using_namespace_directive): Pass in an expression to
13237         NamespaceEntry.Using.
13238         (namespace_name): Don't flatten to a string.
13239         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13240         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13241         ResolveAsTypeStep.
13242         (NamespaceEntry.UsingEntry): Likewise.
13243         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13244         changes.
13245         (NamespaceEntry.LookupForUsing): Remove.
13246         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13247         names.
13248         (NamespaceEntry.Lookup): Remove support for dotted names.
13249
13250 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13251
13252         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13253         split into two.
13254         (NamespaceEntry.ImplicitParent): Compute on demand.
13255         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13256         parallels the current.
13257         (NamespaceEntry.LookupForUsing): Use it.
13258         (NamespaceEntry.Lookup): If the current namespace-entry is
13259         implicit, don't search aliases and using tables.
13260
13261 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13262
13263         Fix #31984.
13264         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13265         BaseCache here.
13266         (TypeContainer.BaseCache): Compute on demand.
13267         (TypeContainer.FindMembers): Define constants and types if they're
13268         not already created.
13269         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13270         check.
13271         * const.cs (Constant.Define): Make idempotent.
13272
13273 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13274
13275         * pending.cs: Produce better code (no nops produced by using Ldarg
13276         + value).
13277         
13278         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13279         i - 1' it should be arg + 1.
13280
13281         Fixes bug #71819.
13282
13283 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13284
13285         * attribute.cs (Attribute.CheckAttributeType): Make private
13286         non-virtual.
13287         (Attribute.ResolveType): Make virtual.
13288         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13289         handling of RootContext.Tree.Types.
13290
13291 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13292
13293         Update attribute-handling to use the SimpleName/MemberAccess
13294         mechanisms.
13295         * cs-parser.jay (attribute): Pass in an expression to the
13296         constructors of Attribute and GlobalAttribute.
13297         * attribute.cs (Attribute): Take an expression for the name.
13298         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13299         passed in attribute name expression.
13300         (Attribute.CheckAttributeType): Use it.
13301         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13302         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13303         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13304         argument to prevent error messages if the lookup fails.
13305
13306 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13307
13308         * expression.cs (Indirection): Implemented IVariable interface
13309         to support indirection in AddressOf operator.
13310         (PointerArithmetic.Emit): Add optimalization for case where
13311         result can be precomputed.
13312
13313 2005-01-26  Martin Baulig  <martin@ximian.com>
13314
13315         * class.cs (TypeContainer.AttributeTargets): Return the correct
13316         AttributeTargets depending on our `Kind' instead of throwing an
13317         exception; fixes #71632.
13318
13319 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13320
13321         Fix #71257
13322         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13323         constant members.
13324
13325 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13326
13327         Fix #71602.
13328         * expression.cs (MemberAccess.DoResolve): Don't complain with
13329         cs0572 when the LHS of a member access has identical name and type
13330         name.
13331
13332 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13333
13334         Fix #71651, #71675
13335         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13336         CreatePermission.
13337         Create custom PermissionSet only for PermissionSetAttribute.
13338
13339 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13340
13341         Fix #71649
13342         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13343         delegates in static class.
13344
13345 2005-01-24  Martin Baulig  <martin@ximian.com>
13346
13347         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13348         merging an implicit block, just use its reachability.
13349
13350         * statement.cs (Block.Resolve): Make the unreachable code check
13351         work wrt. implicit blocks; see test-337 from #63842.
13352
13353 2005-01-21  Alp Toker  <alp@atoker.com>
13354  
13355         * cs-parser.jay: destructor_declaration's container is PartialContainer
13356         not Class when partial types are used, so use Kind prop instead of
13357         'is'.
13358         
13359 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13360
13361         * cs-parser.jay: Improve error reporting when an interface
13362         declares new types.
13363
13364 2005-01-20  Dick Porter  <dick@ximian.com>
13365
13366         * support.cs: SeekableStreamReader fix from Sandor Dobos
13367         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13368         chars are read.  Fixes bug 70369.
13369
13370 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13371
13372         * cs-parser.jay (catch_clause): Simplify current_block handling
13373         somewhat.
13374
13375 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13378         code with ImplicitStandardConversion to handle the implicit
13379         conversion of method groups into valid delegate invocations. 
13380
13381         The problem is that in parameter handling we were using this code
13382         path.  Fixes bug #64698
13383
13384 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13385
13386         * cs-parser.jay: Fix several infelicities.
13387         - Avoid assigning to the parser value stack.  Code like 
13388           '$3 = null' is unclean.  Synthesize a value for the code block
13389           instead. 
13390         - Avoid using oob_stack for storing location information.  Use ...
13391         (_mark_): ... this.  New (empty) rule.  Saves the current location
13392         in $$.
13393         (foreach_statement): Avoid using oob_stack for current_block
13394         handling.  Use technique used in for_statement and
13395         using_statement.  Synthesize a value for the code block to store
13396         additional intermediate information.
13397
13398 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13401         of a different type is only allowed to private fields of a
13402         containing type, not on fields of a base class.
13403
13404         See test-174.cs and error cs0122-9.cs
13405
13406 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13407
13408         Fix test-335.cs (bug #58126).
13409         * cs-parser.jay (argument): Split out non-expression parts of the
13410         rule into 'non_simple_argument'.
13411         (invocation_expression): Support parenthesized invocations with
13412         multiple arguments, and with single non-simple arguments.
13413
13414 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13415
13416         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13417         places.
13418
13419 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13420
13421         Fix cs0038-1.cs, cs1640-6.cs.
13422         * ecore.cs (Expression.Resolve): Remove special-case for
13423         SimpleName in error-handling.
13424         (Expression.almostMatchedMembers): Relax access permission to
13425         protected.
13426         (Expression.MemberLookupFailed): Handle duplicates in
13427         almostMatchedMembers list.
13428         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13429         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13430         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13431         overload if the passed in MemberInfo is a MethodBase.
13432
13433 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13434
13435         Fix #70749
13436         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13437         for non-CAS & merge permission sets properly.
13438
13439 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13440
13441         Improve standard-compliance of simple name and member access 
13442         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13443         * ecore.cs (FullNamedExpression): New abstract base class 
13444         for Namespaces and TypeExpressions.
13445         (ResolveFlags.SimpleName): Remove.
13446         (SimpleName): Remove support for dotted names.
13447         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13448         DeclSpace.FindType and DeclSpace.LookupType.
13449         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13450         (Expression.ExprClassName): Make member function.
13451         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13452         a namespace.  Remove creation of dotted "SimpleName"s.
13453         (MemberAccess.DoResolve): Likewise.
13454         * decl.cs (DeclSpace.Cache): Make private.
13455         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13456         (DeclSpace.FindType): Update.
13457         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13458         FullNamedExpression.
13459         * namespace.cs (Namespace): Derive from FullNamedExpression
13460         so that it can be part of expression resolution.
13461         (Namespace.Lookup): Return an FullNamedExpression.
13462         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13463         namespace.
13464         * rootcontext.cs (NamespaceLookup): Remove.
13465         (LookupType): Move to DeclSpace.
13466         * attribute.cs (CheckAttributeType): Update.
13467         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13468         (FindDocumentedTypeNonArray): Likewise.
13469
13470 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13471
13472         Fix cs0509.cs, cs1632.cs.
13473         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13474         is the same as IsInterface.
13475         (TypeContainer.GetClassBases): Likewise.
13476         * statement.cs (LabeledStatement.ig): New field.
13477         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13478         label.
13479         (LabeledStatement.DoEmit): Check that the label was created with
13480         the same ILGenerator.
13481
13482 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13483
13484         Fix #71058
13485         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13486         accessors to its properties.
13487
13488         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13489         from accessors to property.
13490         
13491 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13492
13493         Fix #70722
13494         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13495         only for overrides.
13496         
13497 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * attribute.cs: Check for null and empty strings.  
13500
13501         I have lost another battle to Paolo.
13502
13503 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13504
13505         Fix #70942
13506         * class.cs (PropertyMethod): Set Parent field in ctors.
13507         (SetMethod.InternalParameters): Add unsafe switch hack.
13508         Override MarkForDuplicationCheck where it is appropriate.
13509
13510         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13511         It says whether container allows members with the same name.
13512         Base default is no.
13513         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13514         Removed is_method parameter.
13515
13516 2005-01-06  Duncan Mak  <duncan@ximian.com>
13517
13518         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13519         because the previous change led to incorrect reporting of CS1032
13520         ("Cannot define/undefine preprocessor symbols after first token in
13521         file"). Instead of using `tokens_seen' as the only flag that
13522         triggers CS1040, introduce `comments_seen'. This new flag is used
13523         to signify having seen comments on the current line, so it is
13524         unset after a newline.
13525
13526 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13527
13528         * doc.cs : When searching for a type, find nested type too.
13529           This fixes bug #71040.
13530
13531 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13532
13533         * doc.cs :
13534           - Warn missing member comment on those classes which also does not
13535             have doc comments. Fixed bug #71041.
13536           - Don't warn missing doc comment on default constructor.
13537             Fixed bug #71042.
13538
13539 2005-01-06  Duncan Mak  <duncan@ximian.com>
13540
13541         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13542         comments, set `tokens_seen' to true. This allows us to detect
13543         misplaced preprocessor directives (i.e. not at the beginning of
13544         the a line, nor after whitespaces). In that case, report error
13545         CS1040. This fixes bug #56460.
13546
13547         * cs-parser.jay (interface_member_declaration): Add checks for
13548         IsExplicitImpl, and report CS0541 error if an interface member is
13549         defined as an explicit interface declaration.
13550
13551 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13552
13553         Fix #70817
13554         * class.cs (PropertyMethod): Set Parent field in ctors.
13555         (SetMethod.InternalParameters): Add unsafe switch hack.
13556         
13557         * decl.cs (MemberCore.Parent): Cannot be readonly.
13558
13559 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13560
13561         * decl.cs (DeclSpace.ResolveType): Remove.
13562         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13563         Merge in code from ...
13564         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13565         * class.cs, enum.cs: Update to changes.
13566
13567 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13568
13569         * anonymous.cs: Ensure that we init the scope of our parent if it
13570         has not been initialized yet.
13571
13572 2004-12-30  Duncan Mak  <duncan@ximian.com>
13573
13574         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13575         if field.FieldBuilder is null. Fixes #70758.
13576
13577         * convert.cs: Fixed some typos and updated some of the comments.
13578         (ImplicitStandardConversionExists):
13579         (TryImplicitIntConversion): If `target_type' is an interface and
13580         the type of `ic' implements this interface, return true or a new
13581         BoxedCast instead of null. This fixes #70468.
13582
13583 2004-12-29  Duncan Mak  <duncan@ximian.com>
13584
13585         * expression.cs (Argument.Emit): Check that Expr is
13586         IMemoryLocation before casting to it, and report CS1510 otherwise.
13587
13588         This fixes #70402.
13589
13590 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13591
13592         * statement.cs (Block.ThisVariable): remove the recursion here, to
13593         make the --profile more sane.
13594
13595 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13596
13597         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13598         assembly, by JB Evain.
13599
13600 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13601
13602         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13603           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13604         "parent" refers to enclosing type/class.  "base" refers to superclass.
13605
13606 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13607
13608         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13609         Ensure that we only have GlobalAttributes.
13610         * attribute.cs (Attribute.Emit): Make non-virtual.
13611         (GlobalAttribute.Emit): Remove.
13612         (Attribute.Resolve): Make virtual.
13613         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13614         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13615         the argument. Don't create one.
13616         (Attribute.GetObsoleteAttribute): Likewise.
13617         (Attribute.GetClsCompliantAttributeValue): Likewise.
13618         * class.cs, decl.cs: Update to changes.
13619
13620 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13621
13622         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13623         
13624         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13625         
13626         * statement.cs (Foreach.Resolve): Add error 186 report.
13627
13628 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13629
13630         * expression.cs (Conditional.DoResolve): Add warning 429.
13631         
13632         * statement.cs (If.Resolve): Add warning 665.
13633
13634 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13635
13636         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13637         except when in the parser, and in GlobalAttribute.
13638         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13639         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13640         RootContext.Tree.Types.NamespaceEntry once work is done.
13641         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13642         and resets RootContext.Tree.Types.NamespaceEntry.
13643
13644 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13645
13646         * cs-parser.jay: Don't create a block for every variable.
13647
13648 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13649
13650         * location.cs: Provide extra information.
13651
13652         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13653         variables from the captured environment, it is the ldarg_0.
13654
13655 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13656
13657         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13658         find a conclusion.
13659         
13660         * class.cs: Changed warning level for 169 to avoid developer
13661         displeasure from warning flooding. It will be changed back when they
13662         fix most of current BCL warnings.
13663         
13664         * RootContext.cs: Pushed default WarningLevel to 3.
13665         
13666         * statement.cs: Removed unused variable.
13667
13668 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13669
13670         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13671         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13672         Add error 502 report.
13673         (StaticClass.DefineType): Add error 441 report.
13674         (Class.AllowedModifiersProp): New virtual property as temporary
13675         extension to AllowedModifiers.
13676         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13677         to share implementation with StaticClass and don't call virtual
13678         methods from ctor.
13679         
13680         * driver.cs (MainDriver): Add error 1558 test.
13681
13682         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13683         report. Moved error 36 test here.
13684
13685         * statement.cs (Throw.Resolve): Add error 724 report.
13686
13687         * typemanager.cs: Add out_attribute_type core type.
13688         
13689 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13690
13691         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13692         3018 report.
13693         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13694
13695         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13696         3017 report.
13697         
13698         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13699
13700         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13701         Add error 3023 report.
13702         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13703
13704         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13705         implementation.
13706
13707 2004-12-12  John Luke  <john.luke@gmail.com>
13708
13709         * driver.cs (AddArgs): take -- into account when
13710         adding arguments, fixes bug 65710 
13711
13712 2004-12-12  Martin Baulig  <martin@ximian.com>
13713
13714         * expression.cs (Unary.TryReduceNegative): Added support for
13715         SByteConstant and ByteConstant.
13716         (Unary.Reduce): Check error values from TryReduceNegative().
13717
13718 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13719
13720         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13721         and report exception as error 182.
13722
13723 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13724
13725         * driver.cs (Main): Fix message when there are warnings.
13726
13727 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13728
13729         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13730
13731 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13732
13733         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13734         Reduced number of warnings.
13735         
13736         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13737
13738 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * driver.cs: Removed message.
13741
13742         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13743
13744 2004-12-08    <vargaz@freemail.hu>
13745
13746         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13747
13748 2004-12-08  Martin Baulig  <martin@ximian.com>
13749
13750         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13751         instead of a CS3002 for properties and indexer.
13752
13753 2004-12-08  Martin Baulig  <martin@ximian.com>
13754
13755         * decl.cs (MemberName.ToString): Make this work again.
13756
13757 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13758
13759         * attribute.cs (Resolve): Add error 591 detection.
13760
13761         * class.cs (FieldMember.Define): Add error 1547 detection.
13762         (Indexer.Define): Add error 620 detection.
13763         (Operator.Define): Add error 590 detection.
13764
13765         * ecore.cs: Missing argument for error 79.
13766
13767         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13768         detection.
13769
13770 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13771
13772         Fix #70106
13773         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13774         only.
13775
13776 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13777
13778         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13779           Some operator comments were suppressed.
13780         * doc.cs : Implicit/explicit operator name in doc comments are like
13781           "op_Explicit(type)~returnType", so added suffix handling.
13782
13783 2004-12-07  Martin Baulig  <martin@ximian.com>
13784
13785         * decl.cs
13786         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13787         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13788         (DeclSpace.ec): New protected field; store the EmitContext here.
13789         (DeclSpace.EmitContext): New public property; moved here from
13790         `TypeContainer'.
13791         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13792         EmitContext.
13793
13794         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13795         (Enum.Emit): Don't create a new EmitContext.
13796
13797         * delegate.cs (Delegate.DefineType): Always create the
13798         EmitContext.
13799
13800         * iterators.cs (Iterators.DefineIterator): Create a new
13801         EmitContext and store it in `ec'.
13802
13803 2004-08-24  Martin Baulig  <martin@ximian.com>
13804
13805         * typemanager.cs
13806         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13807         this for accessibility checks.
13808         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13809         IsNestedFamilyAccessible.
13810         (TypeManager.IsSubclassOf): New method, do what the name actually
13811         says.   
13812
13813 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13814
13815         Fix crash on cs0657-17.cs.
13816         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13817         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13818         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13819         the case where the NamespaceEntry gets overwritten.
13820
13821 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13822
13823         Fixed #69195, #56821
13824         * ecore.cs (ResolveBoolean): Tiny refactoring.
13825
13826         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13827         of right expression resolving when left is false constant and
13828         operator is LogicalAnd OR true constant and operator is LogicalOr.
13829
13830         * statement.cs (ResolveUnreachable): Always reports warning.
13831
13832 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13833
13834         * class.cs: Distinguish between 1721 and 1722 (just a little help
13835         for the programmer).
13836
13837 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13838
13839         * delegate.cs: Only allow this on new versions of the language. 
13840
13841 2004-12-02  Duncan Mak  <duncan@ximian.com>
13842
13843         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13844         Expression class.
13845         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13846         here as a static method. Take an additional bool out parameter
13847         `must_do_cs1540_check' for signaling to InstanceResolve.
13848         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13849         member field from PropertyExpr class and made it an argument of
13850         the method instead.
13851         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13852         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13853         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13854         and `remove_accessor' as well as InstanceResolve: report CS0122
13855         where applicable.
13856
13857         Fixes #70129.
13858
13859 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13860
13861         Fix test-327.cs, test-328.cs, and put in early infrastructure
13862         for eventually fixing #52697.
13863         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13864         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13865         from other methods.
13866         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13867         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13868         (VerifyUsing, error246): Update.
13869         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13870         'NamespaceEntry.LookupNamespaceOrType'.
13871
13872 2004-12-03  Martin Baulig  <martin@ximian.com>
13873
13874         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13875         method as our child, call AnonymousMethod.Compatible() on it.
13876
13877 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13878
13879         Disable XML documentation support in 'basic' profile.
13880         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13881         Redirect XmlElement to System.Object.
13882         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13883         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13884         * mcs.exe.sources: Add doc-bootstrap.cs.
13885         * doc-bootstrap.cs: New file.  Contains empty stub implementation
13886         of doc.cs.
13887
13888 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
13889
13890         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
13891           comments are allowed.
13892
13893 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13894
13895         * delegate.cs: Add checks for subtypes in paramaters and return values
13896         in VerifyMethod () to add support for Covariance/Contravariance
13897         in delegates.
13898         
13899 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * report.cs: Remove extra closing parenthesis.
13902
13903         * convert.cs (Error_CannotImplicitConversion): If the name of the
13904         types are the same, provide some extra information.
13905
13906         * class.cs (FieldBase): Use an unused bit field from the field to
13907         encode the `has_offset' property from the FieldMember.  This saves
13908         a couple of Ks on bootstrap compilation.
13909
13910         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13911         method as our child, return the AnonymousMethod resolved
13912         expression.
13913
13914         * expression.cs (New.DoResolve): Allow return values from
13915         NewDelegate to also include AnonymousMethods.
13916
13917         Fixes #70150.
13918
13919 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
13920
13921         Fix bug #70102
13922         * attribute.cs (Resolve): Improved implementation of params
13923         attribute arguments.
13924
13925         * support.cs (ParameterData): Add HasParams to be faster.
13926
13927 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
13928
13929         all things are for /doc support:
13930
13931         * doc.cs: new file that supports XML documentation generation.
13932         * mcs.exe.sources: added doc.cs.
13933         * driver.cs:
13934           Handle /doc command line option.
13935           Report error 2006 instead of 5 for missing file name for /doc.
13936           Generate XML documentation when required, after type resolution.
13937         * cs-tokenizer.cs:
13938           Added support for picking up documentation (/// and /** ... */),
13939           including a new XmlCommentState enumeration.
13940         * cs-parser.jay:
13941           Added lines to fill Documentation element for field, constant,
13942           property, indexer, method, constructor, destructor, operator, event
13943           and class, struct, interface, delegate, enum.
13944           Added lines to warn incorrect comment.
13945         * rootcontext.cs :
13946           Added Documentation field (passed only when /doc was specified).
13947         * decl.cs:
13948           Added DocComment, DocCommentHeader, GenerateDocComment() and
13949           OnGenerateDocComment() and some supporting private members for
13950           /doc feature to MemberCore.
13951         * class.cs:
13952           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
13953         * delegate.cs:
13954           Added overriden DocCommentHeader.
13955         * enum.cs:
13956           Added overriden DocCommentHeader and GenerateDocComment().
13957
13958 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
13961         unwrapping the enumeration values, chain to
13962         DoConstantNumericPromotions again, so we can promote things to the
13963         fundamental types (takes care of enums that are bytes, sbytes).
13964
13965         Fixes bug #62054.
13966
13967 2004-12-01  Raja R Harinath  <rharinath@novell.com>
13968
13969         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
13970         Fix long-standing bug in type-lookup.  Use FindType instead of
13971         LookupType when ec.ResolvingTypeTree.
13972         (Attribute.ResolveType, Attribute.Resolve)
13973         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
13974         Update to changes.
13975         (Attributes.Search): Remove internal version.  Update.
13976         (Attributes.SearchMulti): Update.
13977         (Attributes.GetClsCompliantAttribute): Remove.
13978         (Attributes.GetIndexerNameAttribute): Remove.
13979         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
13980         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
13981         * class.cs (Indexer.Define): Likewise.
13982
13983 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
13984
13985         Fix bug #68790
13986         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
13987         MarshallByReference members access.
13988
13989         * expression.cs: Use CheckMarshallByRefAccess;
13990         Better error CS0197 message.
13991
13992         * report.cs: Print whole related error message.
13993
13994 2004-11-30  Raja R Harinath  <rharinath@novell.com>
13995
13996         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
13997         the current directory to help debugging.
13998
13999 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14000
14001         * class (GetClassBases): Better error 60 report.
14002         (EventProperty): Disabled warning 67 detection.
14003
14004 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14005
14006         Fix bug #60324
14007         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14008
14009         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14010         precise values.
14011
14012 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14013
14014         Fix bug #49488
14015         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14016
14017         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14018
14019 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14020
14021         * attribute.cs (Attribute.Resolve): Refine error reporting and
14022         report a cs0117 if the identifier does not exist, to distinguish
14023         from 0617 which is a miss-use of the actual identifier.
14024
14025         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14026         between cs0070 and cs0079.
14027
14028         * class.cs (MemberBase.DoDefine): When reporting a wrong
14029         accessibility level, we use MethodCore to compare instead of
14030         Method (this was a regression in some refactoring effort).
14031
14032         So now we correctly report cs0056 again.
14033
14034         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14035         testing the target_type (which was known to be object_type) and
14036         not the source type (which is anonymous_method).
14037
14038         Fixed reporting of error cs1660.
14039
14040         * expression.cs (UserCast.Source): Expose the underlying cast.
14041
14042         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14043         allowed types to find a match to int32 first (most common).
14044
14045         In addition, it ignores any ImplicitUserConversions that did an
14046         internal implicit conversion (as the switch statement allows only
14047         one integral conversion to exist).
14048
14049         * class.cs (PartialContainer.Create): rename `name' to
14050         `member_name' for clarity.  Then replace the string calls with a
14051         call to MemberName.GetPartialName, as now using
14052         MemberName.ToString is an error (this is due to the side effects
14053         it had, that were fixed in the past).
14054
14055         This will restore the error reporting on a number of partial class
14056         errors that were missusing this (and getting an exception as a
14057         results, which is now just a plain textual warning, because
14058         yyparse debug output would crash otherwise).
14059
14060 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14061
14062         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14063
14064 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14065
14066         * rootcontext.cs (LookupType): Make sure to cache lookups that
14067         don't give us a negative result. This saves about 5% of corlib
14068         compilation time.
14069
14070 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14071
14072         * report.cs (AbstractMessage.Print): messages are sent to stderr
14073
14074         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14075         non-interface in the list of interfaces (at this point, either
14076         parent was properly set, or a base class is being listed in the
14077         interfaces section).
14078
14079         This flags error 1722, and resolves the crash from bug 69259.
14080
14081 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14082
14083         * statement.cs (Using.EmitExpressionFinally): make this work right
14084         for valuetypes. Fixes 69926.
14085
14086 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14089         converted to an enum" here, before we try to change the underlying
14090         type.  This code exists, but it is a different code path than the
14091         one used while encoding constants.
14092
14093         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14094         old bug: when converting from the null literal to a pointer,
14095         return an EmptyCast, not the NullLiteral.
14096
14097         This fixes #69921, the recent null_type changes probably made this
14098         bug more prominent.
14099
14100         (ImplicitReferenceConversionExists): In addition, resynchronized
14101         the code here, so it matches the same code in
14102         ImplicitReferenceConversionExists for the `from any class-type S
14103         to any interface-type T'.
14104         
14105
14106 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14107
14108         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14109
14110 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14111
14112         * cs-parser.jay: Use verbosity accordingly. 
14113
14114 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14115
14116         * expression.cs (Unary.ResolveOperator): Do not report warning;
14117         AddressOf reads from variable.
14118         
14119         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14120
14121 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14122
14123         Fix bug #69462
14124
14125         * attribute.cs (Attributable): Removed CheckTargets.
14126         (Attributes.Emit): Explicit attribute targets are tested here.
14127
14128         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14129         not enabled for interfaces.
14130
14131         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14132         (GetAssemblyName): Ouch next bug there.
14133
14134 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14135
14136         * expression.cs: Error 275 added.
14137         
14138 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14139
14140         Fix bug #69177 (Implemented decimal constant support)
14141
14142         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14143         (BinaryFold): Add DecimalConstant.
14144
14145         * const.cs (Define): Decimal constant 
14146         (is not constant.
14147         (ChangeType): Add decimal type handling.
14148         (LookupConstantValue): Don't set value for decimal type but
14149         emit DecimalConstantAttribute. Needed for constant optimization.
14150
14151         * constant.cs (ToDecimal): New method.
14152         (ConvertToDecimal): New method.
14153         (IntConstant): Implemented ConvertToDecimal.
14154         (DecimalConstant.Emit): Emit optimized version for decimals in
14155         int range.
14156
14157         * expression.cs (ResolveOperator): Changed order of constant
14158         reduction to work correctly with native types which have
14159         overloaded operators.
14160         (ResolveMemberAccess): Extract constant value from attribute
14161         for decimal type.
14162
14163         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14164
14165         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14166         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14167         (ChangeType): Decimal is special.
14168         (TypeToCoreType): Add decimal type.
14169
14170 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14171
14172         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14173         decimal types.
14174
14175 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14176
14177         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14178         test cs1667-5.cs.
14179
14180 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14181
14182         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14183
14184         * pending.cs (PendingImplementation): Grab only interfaces.
14185
14186 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14187
14188         * statement.cs (ForeachHelperMethods): Add location member and
14189         error 202 detection.
14190
14191 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14192
14193         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14194         automatically handled by executable.make.
14195         (PROGRAM): Make profile-specific.
14196
14197 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14198
14199         * expression.cs (DoResolveBase): Fixed wrong warning for out
14200         variables.
14201
14202 2004-11-18  Martin Baulig  <martin@ximian.com>
14203
14204         Merged latest changes into gmcs.  Please keep this comment in
14205         here, it makes it easier for me to see what changed in MCS since
14206         the last time I merged.
14207
14208 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14209
14210         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14211         (TypeHandle.GetMemberCache): New.
14212         (TypeHandle.TypeHandle): Update.
14213         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14214         (TypeManager.LookupParentInterfacesCache):
14215         Rename from LookupInterfaceCache.  Optimize slightly.
14216         (TypeManager.MemberLookup_FindMembers): Update.
14217         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14218         multi-type variant.
14219         (AddCacheContents): Rename from AddHashtable.
14220         * class.cs (TypeContainer.parent_container): Remove.
14221         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14222         (TypeContainer.DoDefineMembers): Don't initialize it.
14223         Update to name changes.
14224         
14225 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14226
14227         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14228         that factors the code to check access modifiers on override.  
14229
14230         (PropertyBase): Use the code here.
14231
14232         Patch from Lluis S'anchez, fixes bug #69361.
14233
14234 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14237         routine that is used to report the use of a captured variable
14238         whose address has been taken.
14239
14240         There are two checks: one when variables are being captured and
14241         the other check is when the address of a variable is taken. 
14242         
14243         (because an anonymous methods might be resolved before *or* after
14244         the address has been taken) and 
14245
14246         * expression.cs (Conditional.DoResolve): Remove the special
14247         casing that Martin added to trueExpr and falseExpr being both
14248         NullLiteral.  We get the right behavior now just by introducing
14249         the null_type into the compiler. 
14250
14251         * convert.cs (ExplicitConversion): Change the code to use
14252         null_type instead of testing `expr is NullLiteral'.
14253         (ImplicitConversionStandard): use null_type too.
14254         (ImplicitReferenceConversionExists): use null_type too.
14255         (ImplicitReferenceConversion): use null_type too.
14256
14257         * literal.cs: The type of `NullLiteral' is now null_type instead
14258         of object_type. 
14259         (Resolve): Set the type here.
14260
14261         * typemanager.cs: Introduce null_type.
14262
14263 2004-11-17  Martin Baulig  <martin@ximian.com>
14264
14265         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14266         direction, like FindMembers() does.  Fixes #69546, testcase is in
14267         test-315.cs.    
14268
14269 2004-11-16  Martin Baulig  <martin@ximian.com>
14270
14271         This is based on a patch from Marek Safar, see bug #69082.
14272         Fixes bugs #63705 and #67130.
14273
14274         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14275         method; create a MemberCache for an interface type and cache the
14276         result.
14277
14278         * decl.cs (IMemberContainer.ParentContainer): Removed.
14279         (IMemberContainer.ParentCache): New property.
14280         (MemberCache.SetupCacheForInterface): Removed.
14281         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14282         to create a cache for an interface's "parent".
14283
14284         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14285         interfaces too.
14286
14287 2004-11-16  Martin Baulig  <martin@ximian.com>
14288
14289         Merged back from gmcs; these changes already went into gmcs a
14290         couple of weeks ago.
14291
14292         * typemanager.cs
14293         (TypeManager.AddUserType): Removed the `ifaces' argument.
14294         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14295         `TypeExpr []'.
14296         (TypeManager.AddUserInterface): Removed.
14297         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14298         `TypeExpr []'.
14299         (TypeManager.GetInterfaces): Likewise.
14300         (TypeManager.GetExplicitInterfaces): Likewise.
14301
14302         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14303
14304         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14305         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14306
14307 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14308
14309         * statement.cs: Avoid adding bools to a hashtable.
14310
14311 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14312
14313         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14314         calling an unsafe method from a safe location.
14315
14316 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14317
14318         Fix #69167
14319         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14320
14321 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14322
14323         * namespace.cs (VerifyUsing): use GetPartialName instead of
14324         ToString. 
14325
14326 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14327
14328         * statement.cs (Return.Resolve): Fix regression in typo: if
14329         `in_exc', we have to request a NeedReturnLabel, this was a typo
14330         introduced in the anonymous method check-in.  Fixes #69131.
14331
14332         * Indexers were using the ShortName when defining themselves,
14333         causing a regression in the compiler bootstrap when applying the
14334         patch from 2004-11-02 (first part), now they use their full name
14335         and the bug is gone.
14336
14337 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14338
14339         * driver.cs: Strip the path from the names of embedded resources. Fixes
14340         #68519.
14341
14342 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14343
14344         Fix error message regression: cs0104-2.cs.
14345         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14346         (AliasEntry.Resolve): Update.
14347         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14348         'silent' flag.
14349         (RootContext.LookupType): Update.
14350
14351 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14352
14353         * cs-parser.jay: Add support for handling accessor modifiers
14354         * class: Add support port accessor modifiers and error checking,
14355         define PropertyMethod.Define as virtual (not abstract anymore)
14356         * ecore.cs: Add checking for proeprties access with access modifiers
14357         * iterators.cs: Modify Accessor constructor call based in the modified
14358         constructor
14359 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14360
14361         * expression.cs (StringConcat): Handle being called twice,
14362         as when we have a concat in a field init with more than two
14363         ctors in the class
14364
14365 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14366
14367         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14368         special case explicit implementations, we should always produce
14369         the .property or .event declaration.
14370         
14371         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14372         since it will not return correct data if people use this
14373         unresolved in the presence of using statements (see test-313).
14374
14375         * class.cs (MethodData.Define): If we are an explicit interface
14376         implementation, set the method name to the full name of the
14377         interface plus the name of the method.  
14378
14379         Notice that using the method.MethodName.GetFullName() does not
14380         work, as it will only contain the name as declared on the source
14381         file (it can be a shorthand in the presence of using statements)
14382         and not the fully qualifed type name, for example:
14383
14384         using System;
14385
14386         class D : ICloneable {
14387                 object ICloneable.Clone ()  {
14388                 }
14389         }
14390
14391         Would produce a method called `ICloneable.Clone' instead of
14392         `System.ICloneable.Clone'.
14393
14394         * namespace.cs (Alias.Resolve): Use GetPartialName.
14395         
14396 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14397
14398         * cs-parser.jay: Add error 1055 report.
14399
14400 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14401
14402         * assign.cs (Assign.DoResolve): Only do the transform of
14403         assignment into a New if the types are compatible, if not, fall
14404         through and let the implicit code deal with the errors and with
14405         the necessary conversions. 
14406
14407 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14408
14409         * cs-parser.jay: Add error 1031 report.
14410
14411         * cs-tokenizer.cs: Add location for error 1038.
14412
14413 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14414
14415         * cs-parser.jay: Add error 1016 report.
14416
14417 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14418
14419         * cs-parser.jay: Add errors 1575,1611 report.
14420
14421 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14422
14423         * cs-parser.jay: Add error 1001 report.
14424
14425 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14426
14427         Fix #68850
14428         * attribute.cs (GetMarshal): Add method argument for
14429         caller identification.
14430
14431         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14432         agument for GetMarshal and RuntimeMissingSupport.
14433
14434 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14435
14436         * attribute.cs (ExtractSecurityPermissionSet): Removed
14437         TypeManager.code_access_permission_type.
14438
14439         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14440
14441 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14442
14443         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14444         for obsolete use of a variable here.   Fixes regression on errors
14445         cs0619-25 and cs0619-26.
14446
14447 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14448
14449         Fix #62358, implemented security attribute encoding.
14450
14451         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14452         Tests permitted SecurityAction for assembly or other types.
14453         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14454         data from SecurityPermissionAttribute to PermisionSet class.
14455
14456         * class.cs (ApplyAttributeBuilder): Added special handling
14457         for System.Security.Permissions.SecurityAttribute based types.
14458
14459         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14460         special handling for System.Security.Permissions.SecurityAttribute
14461         based types.
14462
14463         * enum.cs (ApplyAttributeBuilder): Added special handling
14464         for System.Security.Permissions.SecurityAttribute based types.
14465
14466         * parameter.cs (ApplyAttributeBuilder): Added special handling
14467         for System.Security.Permissions.SecurityAttribute based types.
14468
14469         * rootcontext.cs: Next 2 core types.
14470
14471         * typemanager.cs (TypeManager.security_permission_attr_type):
14472         Built in type for the SecurityPermission Attribute.
14473         (code_access_permission_type): Build in type.
14474
14475 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14476
14477         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14478         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14479         all of this information into
14480         EmitContext.EmitCapturedVariableInstance.
14481         
14482         * codegen.cs (EmitCapturedVariableInstance): move here the
14483         funcionality of emitting an ldarg.0 in the presence of a
14484         remapping.   This centralizes the instance emit code.
14485
14486         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14487         then emit a load of this: it means that we have reached the
14488         topmost ScopeInfo: the one that contains the pointer to the
14489         instance of the class hosting the anonymous method.
14490
14491         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14492         captures to the topmost CaptureContext.
14493
14494 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14495
14496         * expression.cs (LocalVariableReference): Move the knowledge about
14497         the iterators into codegen's EmitCapturedVariableInstance.
14498
14499 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14500
14501         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14502         all code paths return a value from an anonymous method (it is the
14503         same as the 161 error, but for anonymous methods).
14504
14505 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14506
14507         The introduction of anonymous methods in the compiler changed
14508         various ways of doing things in the compiler.  The most
14509         significant one is the hard split between the resolution phase
14510         and the emission phases of the compiler.
14511
14512         For instance, routines that referenced local variables no
14513         longer can safely create temporary variables during the
14514         resolution phase: they must do so from the emission phase,
14515         since the variable might have been "captured", hence access to
14516         it can not be done with the local-variable operations from the runtime.
14517         
14518         * statement.cs 
14519
14520         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14521         is a toplevel block.
14522
14523         (ToplevelBlock): A new kind of Block, these are the blocks that
14524         are created by the parser for all toplevel method bodies.  These
14525         include methods, accessors and anonymous methods.
14526
14527         These contain some extra information not found in regular blocks:
14528         A pointer to an optional CaptureContext (for tracking captured
14529         local variables and parameters).  A pointer to the parent
14530         ToplevelBlock.
14531         
14532         (Return.Resolve): Catch missmatches when returning a value from an
14533         anonymous method (error 1662).
14534         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14535         phase.
14536
14537         (Break.Resolve): ditto.
14538
14539         (SwitchLabel): instead of defining the labels during the
14540         resolution phase, we now turned the public ILLabel and ILLabelCode
14541         labels into methods called GetILLabelCode() and GetILLabel() that
14542         only define the label during the Emit phase.
14543
14544         (GotoCase): Track the SwitchLabel instead of the computed label
14545         (its contained therein).  Emit the code by using
14546         SwitchLabel.GetILLabelCode ().
14547
14548         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14549         whether the Local has been captured or not.
14550
14551         (LocalInfo.IsCaptured): New property, used to tell whether the
14552         local has been captured.
14553         
14554         * anonymous.cs: Vastly updated to contain the anonymous method
14555         support.
14556
14557         The main classes here are: CaptureContext which tracks any
14558         captured information for a toplevel block and ScopeInfo used to
14559         track the activation frames for various local variables.   
14560
14561         Each toplevel block has an optional capture context associated
14562         with it.  When a method contains an anonymous method both the
14563         toplevel method and the anonymous method will create a capture
14564         context.   When variables or parameters are captured, they are
14565         recorded on the CaptureContext that owns them, for example:
14566
14567         void Demo () {
14568              int a;
14569              MyDelegate d = delegate {
14570                  a = 1;
14571              }
14572         }
14573
14574         Here `a' will be recorded as captured on the toplevel
14575         CapturedContext, the inner captured context will not have anything
14576         (it will only have data if local variables or parameters from it
14577         are captured in a nested anonymous method.
14578
14579         The ScopeInfo is used to track the activation frames for local
14580         variables, for example:
14581
14582         for (int i = 0; i < 10; i++)
14583                 for (int j = 0; j < 10; j++){
14584                    MyDelegate d = delegate {
14585                         call (i, j);
14586                    }
14587                 }
14588
14589         At runtime this captures a single captured variable `i', but it
14590         captures 10 different versions of the variable `j'.  The variable
14591         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14592         recorded on a child.  
14593
14594         The toplevel ScopeInfo will also track information like the `this'
14595         pointer if instance variables were referenced (this is necessary
14596         as the anonymous method lives inside a nested class in the host
14597         type of the method). 
14598
14599         (AnonymousMethod): Expanded to track the Toplevel, implement
14600         `AnonymousMethod.Compatible' to tell whether an anonymous method
14601         can be converted to a target delegate type. 
14602
14603         The routine now also produces the anonymous method content
14604
14605         (AnonymousDelegate): A helper class that derives from
14606         DelegateCreation, this is used to generate the code necessary to
14607         produce the delegate for the anonymous method that was created. 
14608
14609         * assign.cs: API adjustments for new changes in
14610         Convert.ImplicitStandardConversionExists.
14611
14612         * class.cs: Adjustments to cope with the fact that now toplevel
14613         blocks are of type `ToplevelBlock'. 
14614
14615         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14616         insteda of standard blocks.
14617
14618         Flag errors if params arguments are passed to anonymous methods.
14619
14620         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14621         `CurrentAnonymousMethod' which points to the current Anonymous
14622         Method.  The variable points to the AnonymousMethod class that
14623         holds the code being compiled.  It is set in the new EmitContext
14624         created for the anonymous method.
14625
14626         (EmitContext.Phase): Introduce a variable and an enumeration to
14627         assist in enforcing some rules about when and where we are allowed
14628         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14629         only one that enfonces this right now).
14630
14631         (EmitContext.HaveCaptureInfo): new helper method that returns
14632         whether we have a CapturedContext initialized.
14633
14634         (EmitContext.CaptureVariable): New method used to register that a
14635         LocalInfo must be flagged for capturing. 
14636
14637         (EmitContext.CapturedParameter): New method used to register that a
14638         parameters must be flagged for capturing. 
14639         
14640         (EmitContext.CapturedField): New method used to register that a
14641         field must be flagged for capturing. 
14642
14643         (EmitContext.HaveCapturedVariables,
14644         EmitContext.HaveCapturedFields): Return whether there are captured
14645         variables or fields. 
14646
14647         (EmitContext.EmitMethodHostInstance): This is used to emit the
14648         instance for the anonymous method.  The instance might be null
14649         (static methods), this (for anonymous methods that capture nothing
14650         and happen to live side-by-side with the current method body) or a
14651         more complicated expression if the method has a CaptureContext.
14652
14653         (EmitContext.EmitTopBlock): Routine that drives the emission of
14654         code: it will first resolve the top block, then emit any metadata
14655         and then emit the code.  The split is done so that we can extract
14656         any anonymous methods and flag any captured variables/parameters.
14657         
14658         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14659         during this phase, the ILGenerator should not be used as labels
14660         and local variables declared here might not be accessible to any
14661         code that is part of an anonymous method.  
14662
14663         Exceptions to this include the temporary variables that are
14664         created by some statements internally for holding temporary
14665         variables. 
14666         
14667         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14668         metadata for a cb
14669
14670         (EmitContext.TemporaryReturn): This method is typically called
14671         from the Emit phase, and its the only place where we allow the
14672         ReturnLabel to be defined other than the EmitMeta.  The reason is
14673         that otherwise we would have to duplicate a lot of logic in the
14674         Resolve phases of various methods that today is on the Emit
14675         phase. 
14676
14677         (EmitContext.NeedReturnLabel): This no longer creates the label,
14678         as the ILGenerator is not valid during the resolve phase.
14679
14680         (EmitContext.EmitThis): Extended the knowledge in this class to
14681         work in anonymous methods in addition to iterators. 
14682
14683         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14684         code is necessary on the stack to access the instance to a local
14685         variable (the variable will be accessed as a field).
14686
14687         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14688         EmitContext.EmitAddressOfParameter): Routines to support
14689         parameters (not completed at this point). 
14690         
14691         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14692         will also remove the parameters.
14693
14694         * convert.cs (Convert): Define a `ConstantEC' which points to a
14695         null.  This is just to prefity some code that uses
14696         ImplicitStandardConversion code and do not have an EmitContext
14697         handy.
14698
14699         The idea is to flag explicitly that at that point in time, it is
14700         known that the conversion will not trigger the delegate checking
14701         code in implicit conversions (which requires a valid
14702         EmitContext). 
14703
14704         Everywhere: pass new EmitContext parameter since
14705         ImplicitStandardConversionExists now requires it to check for
14706         anonymous method conversions. 
14707
14708         (Convert.ImplicitStandardConversionExists): If the type of an
14709         expression is the anonymous_method_type, and the type is a
14710         delegate, we invoke the AnonymousMethod.Compatible method to check
14711         whether an implicit conversion is possible. 
14712
14713         (Convert.ImplicitConversionStandard): Only do implicit method
14714         group conversions if the language level is not ISO_1.
14715
14716         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14717         MethodInfo for the Invoke method.  used by Delegate and
14718         AnonymousDelegate.
14719
14720         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14721         method conversions if the target type is a delegate.
14722
14723         Removed extra debugging nops.
14724
14725         (LocalVariableReference): Turn the `local_info' into a public
14726         field. 
14727
14728         Add `prepared' field, the same hack used for FieldExprs to cope
14729         with composed assignments, as Local variables do not necessarily
14730         operate purely on the stack as they used to: they can be captured
14731         fields. 
14732
14733         Add `temp' for a temporary result, like fields.
14734
14735         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14736
14737         It now copes with Local variables that are captured and emits the
14738         proper instance variable to load it from a field in the captured
14739         case. 
14740
14741         (ParameterReference.DoResolveBase): During the resolve phase,
14742         capture parameters if we are in an anonymous method.
14743
14744         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14745         anonymous method, use the EmitContext helper routines to emit the
14746         parameter reference.
14747
14748         * iterators.cs: Set RemapToProxy to true/false during the
14749         EmitDispose class.
14750
14751         * parameters.cs (GetParameterByName): New helper method. 
14752
14753         * typemanager.cs (anonymous_method_type) a new type that
14754         represents an anonyous method.  This is always an internal type,
14755         used as a fencepost to test against the anonymous-methodness of an
14756         expression. 
14757         
14758 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14759
14760         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14761         561 report.
14762         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14763
14764 2004-10-18  Martin Baulig  <martin@ximian.com>
14765
14766         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14767         `Type' directly, but call ResolveType() on it.
14768         (Catch.Resolve): Likewise.
14769         (Foreach.Resolve): Likewise.
14770
14771 2004-10-18  Martin Baulig  <martin@ximian.com>
14772
14773         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14774         `Type' directly, but call ResolveType() on it.
14775         (Probe.DoResolve): Likewise.
14776         (ArrayCreation.LookupType): Likewise.
14777         (TypeOf.DoResolve): Likewise.
14778         (SizeOf.DoResolve): Likewise.
14779
14780 2004-10-18  Martin Baulig  <martin@ximian.com>
14781
14782         * expression.cs (Invocation.BetterFunction): Put back
14783         TypeManager.TypeToCoreType().
14784
14785 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14786
14787         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14788         the ResolveType.
14789
14790 2004-10-18  Martin Baulig  <martin@ximian.com>
14791
14792         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14793         `Type' directly, but call ResolveType() on it.
14794
14795 2004-10-18  Martin Baulig  <martin@ximian.com>
14796
14797         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14798         `Type' directly, but call ResolveType() on it.
14799         (MemberBase.DoDefine): Likewise.
14800
14801         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14802         `Type' directly, but call ResolveType() on it.
14803         (ComposedCast.DoResolveAsTypeStep): Likewise.
14804
14805         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14806         `Type' directly, but call ResolveType() on it.
14807
14808 2004-10-17  John Luke  <john.luke@gmail.com>
14809
14810         * class.cs (Operator.GetSignatureForError): use CSharpName
14811
14812         * parameter.cs (Parameter.GetSignatureForError): Returns
14813         correct name even if was not defined.
14814
14815 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14816
14817         Fix #65816.
14818         * class.cs (TypeContainer.EmitContext): New property.
14819         (DefineNestedTypes): Create an emitcontext for each part.
14820         (MethodCore.DoDefineParameters): Use container's emitcontext.
14821         Pass type array to InternalParameters.
14822         (MemberBase.DoDefine): Use container's emitcontext.
14823         (FieldMember.Define): Likewise.
14824         (Event.Define): Likewise.
14825         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14826         Pass type array to InternalParameters.
14827         (SetIndexerMethod.GetParameterInfo): Likewise.
14828         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14829         * delegate.cs (Define): Pass emitcontext to
14830         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14831         array to InternalParameters.
14832         * expression.cs (ParameterReference.DoResolveBase): Pass
14833         emitcontext to GetParameterInfo.
14834         (ComposedCast.DoResolveAsTypeStep): Remove check on
14835         ec.ResolvingTypeTree.
14836         * parameter.cs (Parameter.Resolve): Change argument to
14837         EmitContext.  Use ResolveAsTypeTerminal.
14838         (Parameter.GetSignature): Change argument to EmitContext.
14839         (Parameters.ComputeSignature): Likewise.
14840         (Parameters.ComputeParameterTypes): Likewise.
14841         (Parameters.GetParameterInfo): Likewise.
14842         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14843         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14844         * support.cs (InternalParameters..ctor): Remove variant that takes
14845         a DeclSpace.
14846         * typemanager.cs (system_intptr_expr): New.
14847         (InitExpressionTypes): Initialize it.
14848
14849 2004-10-12  Chris Toshok  <toshok@ximian.com>
14850
14851         * cs-parser.jay: fix location for try_statement and catch_clause.
14852
14853 2004-10-11  Martin Baulig  <martin@ximian.com>
14854
14855         * report.cs: Don't make --fatal abort on warnings, we have
14856         -warnaserror for that.
14857
14858 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14859
14860         More DeclSpace.ResolveType avoidance.
14861         * decl.cs (MemberCore.InUnsafe): New property.
14862         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14863         with newly created EmitContext.
14864         (FieldMember.Define): Likewise.
14865         * delegate.cs (Delegate.Define): Likewise.
14866         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14867         only if normal name-lookup fails.
14868         (TypeExpr.DoResolve): Enable error-checking.
14869         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14870         (SizeOf.DoResolve): Likewise.
14871         (ComposedCast.DoResolveAsTypeStep): Likewise.
14872         (StackAlloc.DoResolve): Likewise.
14873         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14874         (Block.Unsafe): New property.
14875         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14876         (Unsafe): Set 'unsafe' flag of contained block.
14877         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14878         (Fixed.Resolve): Likewise.
14879         (Catch.Resolve): Likewise.
14880         (Using.ResolveLocalVariableDecls): Likewise.
14881         (Foreach.Resolve): Likewise.
14882
14883 2004-10-05  John Luke <john.luke@gmail.com>
14884
14885         * cs-parser.jay: add location to error CS0175
14886
14887 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * ecore.cs (Expression.Constantity): Add support for turning null
14890         into a constant.
14891
14892         * const.cs (Const.Define): Allow constants to be reference types
14893         as long as the value is Null.
14894
14895 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
14896
14897         * namespace.cs (NamespaceEntry.Using): No matter which warning
14898         level is set, check if this namespace name has already been added.
14899
14900 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
14901
14902         * expression.cs: reftype [!=]= null should always use br[true,false].
14903         # 67410
14904
14905 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
14906
14907         Fix #67108
14908         * attribute.cs: Enum conversion moved to 
14909         GetAttributeArgumentExpression to be applied to the all
14910         expressions.
14911
14912 2004-10-01  Raja R Harinath  <rharinath@novell.com>
14913
14914         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
14915         * class.c (TypeContainer.DefineType): Flag error if
14916         base types aren't accessible due to access permissions.
14917         * decl.cs (DeclSpace.ResolveType): Move logic to
14918         Expression.ResolveAsTypeTerminal.
14919         (DeclSpace.ResolveTypeExpr): Thin layer over
14920         Expression.ResolveAsTypeTerminal.
14921         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
14922         Refactor code into NestedAccess.  Use it.
14923         (DeclSpace.NestedAccess): New.
14924         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
14925         argument to silence errors.  Check access permissions.
14926         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
14927         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
14928         (Cast.DoResolve): Likewise.
14929         (New.DoResolve): Likewise.
14930         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
14931         (TypeOf.DoResolve): Likewise.
14932
14933         * expression.cs (Invocation.BetterConversion): Return the Type of
14934         the better conversion.  Implement section 14.4.2.3 more faithfully.
14935         (Invocation.BetterFunction): Make boolean.  Make correspondence to
14936         section 14.4.2.2 explicit.
14937         (Invocation.OverloadResolve): Update.
14938         (Invocation): Remove is_base field.
14939         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
14940         (Invocation.Emit): Likewise.
14941
14942 2004-09-27  Raja R Harinath  <rharinath@novell.com>
14943
14944         * README: Update to changes.
14945
14946 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
14947
14948         * cs-parser.jay: Reverted 642 warning fix.
14949
14950 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14951
14952         Fix bug #66615
14953         * decl.cs (FindMemberWithSameName): Indexer can have more than
14954         1 argument.
14955
14956 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14957
14958         * expression.cs (LocalVariableReference.DoResolveLValue):
14959         Do not report warning 219 for out values.
14960         (EmptyExpression.Null): New member to avoid extra allocations.
14961
14962 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14963
14964         * cs-parser.jay: Fix wrong warning 642 report.
14965
14966         * cs-tokenizer.cs (CheckNextToken): New helper;
14967         Inspect next character if is same as expected.
14968
14969 2004-09-23  Martin Baulig  <martin@ximian.com>
14970
14971         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
14972         (Convert.ImplicitReferenceConversionExists): Likewise.
14973
14974 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
14975
14976         * class.cs (Operator.Define): Add error 448 and 559 report.
14977
14978 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14979
14980         * class.cs (MemberBase.IsTypePermitted): New protected
14981         method for checking error CS0610.
14982
14983 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
14984
14985         * class.cs (TypeContainer.HasExplicitLayout): New property
14986         Returns whether container has StructLayout attribute set Explicit.
14987         (FieldMember): New abstract class for consts and fields.
14988         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
14989         (Field): Reuse FieldMember.
14990
14991         * const.cs (Const): Reuse FieldMember.
14992
14993         * rootcontext.cs: EmitConstants call moved to class.
14994
14995 2004-09-22  Martin Baulig  <martin@ximian.com>
14996
14997         Thanks to Peter Sestoft for this bug report.
14998
14999         * expression.cs (Conditional): If both the `trueExpr' and the
15000         `falseExpr' is a NullLiteral, return a NullLiteral.
15001
15002 2004-09-22  Martin Baulig  <martin@ximian.com>
15003
15004         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15005         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15006         for the "get_Current" call.
15007
15008 2004-09-22  Martin Baulig  <martin@ximian.com>
15009
15010         Marek and me just fixed one of our oldest bugs: #28562 :-)
15011
15012         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15013
15014         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15015         we're an EnumConstant, just return that.
15016         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15017         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15018         to get the value which'll actually be written into the attribute.
15019         However, we have to use GetValue() to access the attribute's value
15020         in the compiler.        
15021
15022 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15023
15024         * constant.cs (Constant.IsNegative): New abstract property
15025         IsNegative.
15026
15027         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15028         (StackAlloc.DoResolve): Reused IsNegative.
15029
15030 2004-09-21  Martin Baulig  <martin@ximian.com>
15031
15032         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15033         if we're used in an iterator, we may be called from different
15034         methods.
15035
15036         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15037         we actually have an exception block.
15038
15039 2004-09-20  John Luke <jluke@cfl.rr.com>
15040
15041         * class.cs, cs-parser.jay: Improve the error report for 1520:
15042         report the actual line where the error happens, not where the
15043         class was declared.
15044
15045         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15046         Pass location information that was available elsewhere.
15047
15048 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15049
15050         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15051         runtime to delay sign assemblies.
15052
15053 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * cs-parser.jay: Do not report the stack trace, this is barely
15056         used nowadays.
15057
15058 2004-08-22  John Luke  <john.luke@gmail.com>
15059  
15060         * driver.cs : check that a resource id is not already used
15061         before adding it, report CS1508 if it is, bug #63637
15062
15063 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * ecore.cs: Removed dead code.
15066
15067 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15068
15069         * class.cs: Do not report warning CS0067 on the interfaces.
15070
15071 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15072
15073         * cs-parser.jay: Add error 504 report.
15074
15075 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15076
15077         * rootcontext.cs: WarningLevel is 4 by default now.
15078
15079         * statement.cs (Fixed.Resolve): Do not null
15080         VariableInfo.
15081
15082 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15083
15084         Fixed bug #55780
15085         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15086         deep search when property is not virtual.
15087         (PropertyExpr.ResolveAccessors): Make one call for both
15088         accessors.
15089
15090 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15091
15092         Fixed bug #65766
15093         * statement.cs: Error 152 report constains also location.
15094
15095 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15096
15097         Fixed bug #65766
15098         * const.cs: Explicitly set constant as static.
15099
15100 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15101
15102         Fixed bug #64226
15103         * cs-parser.jay: Add error 1017 report.
15104
15105 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15106
15107         Fixed bug #59980, #64224
15108         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15109
15110         * typemanager.cs (IsSpecialMethod): Simplified
15111
15112 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15113
15114         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15115         condition with better params.
15116
15117 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15118
15119         Fixed bug #65238
15120         * attribute.cs (Resolve): Property has to have both
15121         accessors.
15122
15123 2004-09-14  Martin Baulig  <martin@ximian.com>
15124
15125         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15126
15127 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15128
15129         Fixed bug #61902
15130         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15131         called and is obsolete then this member suppress message
15132         when call is inside next [Obsolete] method or type.
15133
15134         * expression.cs: Use TestObsoleteMethodUsage member.
15135
15136 2004-09-14  Martin Baulig  <martin@ximian.com>
15137
15138         * cs-parser.jay: Sync a bit with the GMCS version.
15139
15140 2004-09-14  Martin Baulig  <martin@ximian.com>
15141
15142         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15143         (CSharpParser.yacc_verbose_flag): New public field.
15144
15145         * genericparser.cs: Removed.
15146
15147 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15148
15149         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15150
15151 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15152
15153         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15154
15155 2004-09-10  Martin Baulig  <martin@ximian.com>
15156
15157         Backported my MemberName changes from GMCS into MCS.
15158
15159         - we are now using a special `MemberName' class instead of using
15160         strings; in GMCS, the `MemberName' also contains the type
15161         arguments.
15162
15163         - changed the grammar rules a bit:
15164           * the old `member_name' is now a `namespace_or_type_name':
15165             The rule is that we use `namespace_or_type_name' everywhere
15166             where we expect either a "member name" (GetEnumerator) or a
15167             "member name" with an explicit interface name
15168             (IEnumerable.GetEnumerator).
15169             In GMCS, the explicit interface name may include type arguments
15170             (IEnumerable<T>.GetEnumerator).
15171           * we use `member_name' instead of just `IDENTIFIER' for
15172             "member names":
15173             The rule is that we use `member_name' wherever a member may
15174             have type parameters in GMCS.       
15175
15176         * decl.cs (MemberName): New public class.
15177         (MemberCore.MemberName): New public readonly field.
15178         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15179         (DeclSpace): Likewise.
15180
15181         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15182         * enum.cs (Enum.ctor): Likewise.
15183
15184         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15185         MemberName.     
15186         (AliasEntry.ctor): Take a MemberName, not an Expression.
15187         (AliasEntry.UsingAlias): Likewise.
15188
15189         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15190         (IMethodData.MemberName): Changed type from string to MemberName.
15191         (MemberBase.ExplicitInterfaceName): Likewise.
15192         (AbstractPropertyEventMethod.SetupName): Make this private.
15193         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15194         argument; compute the member name here.
15195         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15196         on the `member.MemberName' and the `prefix'.
15197
15198         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15199         not `type_name'.
15200         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15201         thus, we get a `MemberName' instead of a `string'.  These
15202         declarations may have type parameters in GMCS.
15203         (interface_method_declaration, delegate_declaration): Likewise.
15204         (class_declaration, interface_declaration): Likewise.
15205         (method_header): Use `namespace_or_type_name' instead of
15206         `member_name'.  We may be an explicit interface implementation.
15207         (property_declaration, event_declaration): Likewise.
15208         (member_name): This is now just an `IDENTIFIER', not a
15209         `namespace_or_type_name'.
15210         (type_name, interface_type): Removed.
15211         (namespace_or_type_name): Return a MemberName, not an Expression.
15212         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15213         call GetTypeExpression() on the MemberName to get an expression.
15214         (IndexerDeclaration.interface_type): Changed type from string to
15215         MemberName.
15216         (MakeName): Operate on MemberName's instead of string's.
15217
15218 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15219
15220         Fix bug #55770.
15221         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15222         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15223         lookup to avoid symbols introduced by 'using'.
15224         * rootcontext.cs (NamespaceLookup): Update.
15225
15226 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15227
15228         * class.cs (TypeContainer.DoDefineMembers): Do not call
15229         DefineDefaultConstructor for static classes.
15230
15231 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15232
15233         * attribute.cs (Attribute.Resolve): Add error 653 report.
15234
15235         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15236         report.
15237         (Method.ApplyAttributeBuilder): Add error 685 report.
15238         (Operator.Define): Add error 564 report.
15239
15240         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15241
15242         * expression.cs (Invocation.DoResolve): Add error
15243         245 and 250 report.
15244
15245         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15246         error 674 report.
15247
15248 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15249
15250         * class.cs (ConstructorInitializer.Resolve):
15251         Wrong error number (515->516).
15252
15253 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15254
15255         * class.cs (Indexer.Define): Add error 631 report.
15256
15257 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15258
15259         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15260
15261 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15262
15263         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15264
15265 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15266
15267         * cs-parser.jay: Added error CS0241 report.
15268
15269 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15270
15271         * cs-parser.jay (fixed_statement): Introduce a scope for the
15272         declaration in the 'fixed' statement.
15273
15274 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15275
15276         * cs-parser.jay: Added CS0230 error report.
15277
15278 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15279
15280         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15281
15282 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15283
15284         * expression.cs (Argument.Resolve): Added error CS0192 and
15285         CS0199 report.
15286
15287 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15288
15289         C# 2.0 #pragma warning feature
15290
15291         * cs-tokenizer.cs (PreProcessPragma): New method; 
15292         Handles #pragma directive.
15293
15294         * report.cs (WarningRegions): New class; Support
15295         class for #pragma warning directive. It tests whether
15296         warning is enabled for a given line.
15297
15298 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * const.cs: Add more descriptive error report, tahnks to
15301         Sebastien. 
15302
15303 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15304
15305         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15306
15307 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15308
15309         * expression.cs: Apply patch from Ben: Remove dead code from
15310         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15311         as that code just threw an exception anwyays.
15312
15313         * const.cs: Remove the call to the turnintoconstant, for details
15314         see bug: #63144
15315         
15316         * literal.cs: The type of the null-literal is the null type;  So
15317         we use a placeholder type (literal.cs:System.Null, defined here)
15318         for it.
15319
15320         * expression.cs (Conditional.DoResolve): Remove some old code that
15321         is no longer needed, conversions have been fixed.
15322
15323         (ArrayCreationExpression.DoResolve): Return false if we fail to
15324         resolve the inner expression.
15325
15326 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15327
15328         Fix test-290.cs.
15329         * cs-parser.jay (delegate_declaration): Record a delegate
15330         declaration as a type declaration.
15331         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15332
15333 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15334
15335         * parameter.cs: Do not crash if the type can not be resolved. 
15336
15337         * expression.cs: Report errors with unsafe pointers, fixes #64896
15338
15339 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15340
15341         * expression.cs: Pointer arith always needs to do a conv.i
15342         if the operand is a long. fix 65320
15343
15344 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15345
15346         Fixed cs0619-37.cs, cs0619-38.cs
15347
15348         * enum.cs (GetObsoleteAttribute): Removed.
15349
15350         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15351         on Enum member is double staged. The first is tested member
15352         and then enum.
15353
15354 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15355
15356         Fixed #56986, #63631, #65231
15357
15358         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15359         adds member to name container.
15360         (TypeContainer.AddToTypeContainer): New method, adds type to
15361         name container.
15362         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15363         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15364         AddOperator): Simplified by reusing AddToMemberContainer.
15365         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15366         instead of field.
15367         (Method.CheckForDuplications): Fixed implementation to test all
15368         possibilities.
15369         (MemberBase): Detection whether member is explicit interface
15370         implementation is now in constructor.
15371         (MemberBase.UpdateMemberName): Handles IndexerName.
15372         (Accessor): Changed to keep also location information.
15373         (AbstractPropertyEventMethod): Is derived from MemberCore.
15374         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15375         will be emited or not.
15376         (PropertyBase.AreAccessorsDuplicateImplementation):
15377         Tests whether accessors are not in collision with some method.
15378         (Operator): Is derived from MethodCore to simplify common
15379         operations.
15380
15381         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15382         must be performed.
15383         (DeclSpace.AddToContainer): Adds the member to defined_names
15384         table. It tests for duplications and enclosing name conflicts.
15385
15386         * enum.cs (EnumMember): Clean up to reuse the base structures
15387
15388 2004-09-03  Martin Baulig  <martin@ximian.com>
15389
15390         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15391         into TypeContainer, to make partial classes work again.
15392
15393 2004-09-03  Martin Baulig  <martin@ximian.com>
15394
15395         * rootcontext.cs (RootContext.V2): Removed.
15396
15397 2004-03-23  Martin Baulig  <martin@ximian.com>
15398
15399         * expression.cs (Invocation.OverloadResolve): Added `bool
15400         may_fail' argument and use it instead of the Location.IsNull() hack.
15401
15402 2004-09-03  Martin Baulig  <martin@ximian.com>
15403
15404         Merged latest changes into gmcs.  Please keep this comment in
15405         here, it makes it easier for me to see what changed in MCS since
15406         the last time I merged.
15407
15408 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15409
15410         Fix #61128.
15411         * expression.cs (BetterConversion): Don't allow either conversion 
15412         to be null.  Remove redundant implicit conversion test when 'q ==
15413         null' -- when this function is invoked, we already know that the
15414         implicit conversion exists.
15415         (BetterFunction): Assume that 'best' is non-null.  Remove
15416         redundant reimplementation of IsApplicable when 'best' is null.
15417         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15418         number of arguments.
15419         (IsAncestralType): Extract from OverloadResolve.
15420         (OverloadResolve): Make robust to the MethodGroupExpr being
15421         unsorted.  Implement all the logic of Section 14.5.5.1, and
15422         support overloading of methods from multiple applicable types.
15423         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15424
15425         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15426         (RealError, Warning): Append type of report to related symbol.
15427
15428 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15429
15430         * enum.cs: Fixed CLS-Compliance checks for enum members.
15431         Error tests cs3008-8.cs, cs3014-8.cs
15432
15433 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15434
15435         Fixed bug #62342, #63102
15436         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15437         like ImplementMethod.
15438
15439 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15440
15441         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15442         Fixed bug #65170.
15443
15444 2004-09-02  Martin Baulig  <martin@ximian.com>
15445
15446         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15447         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15448         on the MethodBase.
15449
15450 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15451
15452         C# 2.0 Static classes implemented
15453
15454         * class.cs (TypeContainer): instance_constructors,
15455         initialized_fields, initialized_static_fields,
15456         default_constructor, base_inteface_types are protected to be
15457         accessible from StaticClass.
15458         (TypeContainer.DefineDefaultConstructor): New virtual method
15459         for custom default constructor generating
15460         (StaticClass): New class to handle "Static classes" feature.
15461
15462         * cs-parser.jay: Handle static keyword on class like instance
15463         of StaticClass.
15464
15465         * driver.cs: Added "/langversion" command line switch with two
15466         options (iso-1, default).
15467
15468 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15469
15470         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15471
15472 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15473
15474         * delegate.cs: Style.
15475
15476 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15477
15478         * delegate.cs: Add seperate instance expr field for miguel.
15479
15480 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15481
15482         * PointerArithmetic (Resolve): make sure we are not doing
15483         pointer arith on void*. Also, make sure we are resolved
15484         by not setting eclass until resolve.
15485
15486         All callers: Make sure that PointerArithmetic gets resolved.
15487
15488 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15489
15490         * ArrayCreation (LookupType): If the type does not resolve 
15491         to an array, give an error.
15492
15493 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15494
15495         * statement.cs (Try.Resolve): Fixed bug #64222
15496
15497 2004-08-27  Martin Baulig  <martin@ximian.com>
15498
15499         * class.cs
15500         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15501         crash here.     
15502
15503 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15504
15505         * ecore.cs (Constantify): Get underlying type via
15506         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15507         Windows in special cases.
15508
15509 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15510
15511         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15512         for obtaining also private methods.
15513         (GetRemoveMethod): Used GetRemoveMethod (true)
15514         for obtaining also private methods.
15515
15516 2004-08-24  Martin Baulig  <martin@ximian.com>
15517
15518         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15519         MethodAttributes.HideBySig for operators.
15520
15521 2004-08-23  Martin Baulig  <martin@ximian.com>
15522
15523         Back to the old error reporting system :-)
15524
15525         * report.cs (Message): Removed.
15526         (Report.MessageData, ErrorData, WarningData): Removed.
15527         (Report.Error, Warning): Back to the old system.
15528
15529 2004-08-23  Martin Baulig  <martin@ximian.com>
15530
15531         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15532
15533         * class.cs (TypeContainer.ParentContainer): New public virtual
15534         method; replaces the explicit interface implementation.
15535         (ClassPart.ParentContainer): Override.
15536
15537 2004-08-23  Martin Baulig  <martin@ximian.com>
15538
15539         * statement.cs (Switch): Added support for constant switches; see
15540         #59428 or test-285.cs.
15541
15542 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15543
15544         Fixed bug #62740.
15545         * statement.cs (GetEnumeratorFilter): Removed useless
15546         logic because C# specs is strict. GetEnumerator must be
15547         public.
15548
15549 2004-08-22  Martin Baulig  <martin@ximian.com>
15550
15551         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15552         a switch and may break, reset the barrier.  Fixes #59867.
15553
15554 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15555
15556         CLS-Compliance speed up (~5% for corlib)
15557
15558         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15559         New method. Tests container for CLS-Compliant names
15560
15561         * class.cs (TypeContainer.VerifyClsName): New method.
15562         Checks whether container name is CLS Compliant.
15563         (Constructor): Implements IMethodData.
15564
15565         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15566         low-case table for CLS Compliance test.
15567         (MemberCache.VerifyClsParameterConflict): New method.
15568         Checks method parameters for CS3006 error.
15569
15570         * enum.cs (EnumMember): Is derived from MemberCore.
15571         (Enum.VerifyClsName): Optimized for better performance.
15572
15573 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15574
15575         * report.cs: Renamed Error_T to Error and changed all
15576         references.
15577
15578 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15579
15580         * class.cs (TypeContainer.IndexerArrayList): New inner class
15581         container for indexers.
15582         (TypeContainer.DefaultIndexerName): New constant for default
15583         indexer name. Replaced all "Item" with this constant.
15584         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15585
15586         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15587         DefaultMemberAttribute constructor.
15588
15589 2004-08-05  Martin Baulig  <martin@ximian.com>
15590
15591         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15592         Fix bug #59429.
15593
15594 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15595
15596         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15597         multi platforms problem.
15598
15599         * compiler.csproj: Included shared files.
15600
15601 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15602
15603         Fix bug 60333, 55971 in the more general way
15604         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15605         Added arg_type argument for constant conversion.
15606         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15607
15608 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15609
15610         Fix bug #59760
15611         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15612         OperatorArrayList, MethodCoreArrayList for typecontainer
15613         containers. Changed class member types to these new types.
15614         (MethodArrayList.DefineMembers): Added test for CS0659.
15615
15616 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15617
15618         * cfold.cs: Synchronize the folding with the code in expression.cs
15619         Binary.DoNumericPromotions for uint operands.
15620
15621         * attribute.cs: Revert patch from Raja, it introduced a regression
15622         while building Blam-1.2.1 (hard to isolate a test case).
15623
15624 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15625
15626         Fix for #55382
15627         * class.cs:
15628         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15629         name collision.
15630         (MethodCore.parent_method): New member. The method we're overriding
15631         if this is an override method.
15632         (MethodCore.CheckBase): Moved from Method class and made common.
15633         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15634         private.
15635         (MethodCore.CheckForDuplications): New abstract method. For custom
15636         member duplication search in a container
15637         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15638         method and its return type.
15639         (Event.conflict_symbol): New member. Symbol with same name in the
15640         parent class.
15641
15642         * decl.cs:
15643         (MemberCache.FindMemberWithSameName): New method. The method
15644         is looking for conflict with inherited symbols.
15645
15646 2004-08-04  Martin Baulig  <martin@ximian.com>
15647
15648         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15649
15650         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15651
15652 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15653
15654         * report.cs (Message): New enum for better error, warning reference in
15655         the code.
15656         (MessageData): New inner abstract class. It generally handles printing of
15657         error and warning messages.
15658         Removed unused Error, Warning, Message methods.
15659
15660 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15661
15662         Fix for cs0592-8.cs test
15663         * attribute.cs
15664         (Attributable.ValidAttributeTargets): Made public.
15665         (Attribute.ExplicitTarget): New member for explicit target value.
15666         (Attribute.CheckTargets): Now we translate explicit attribute
15667         target to Target here.
15668
15669 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15670
15671         * ecore.cs (MethodGroupExpr): new IsBase property.
15672
15673         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15674
15675         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15676         rather than an instance expr.
15677
15678         (DelegateCreation.Emit): Use the method group rather than
15679         the instance expression. Also, if you have base.Foo as the
15680         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15681
15682         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15683
15684         (NewDelegate.DoResolve): Only check for the existance of Invoke
15685         if the method is going to be needed. Use MethodGroupExpr.
15686
15687         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15688
15689         * expression.cs: For pointer arith., make sure to use
15690         the size of the type, not the size of the pointer to
15691         the type.
15692
15693 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15694
15695         Fix for #60722
15696         * class.cs (Class): Added error CS0502 test.
15697
15698 2004-08-03  John Luke  <jluke@cfl.rr.com>
15699             Raja R Harinath  <rharinath@novell.com>
15700
15701         Fix for #60997.
15702         * attribute.cs (Attribute.complained_before): New flag.
15703         (Attribute.ResolveType, Attribute.Resolve),
15704         (Attribute.DefinePInvokeMethod): Set it.
15705         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15706         
15707 2004-08-03  Martin Baulig  <martin@ximian.com>
15708
15709         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15710         use a user-defined operator; we still need to do numeric
15711         promotions in case one argument is a builtin type and the other
15712         one has an implicit conversion to that type.  Fixes #62322.
15713
15714 2004-08-02  Martin Baulig  <martin@ximian.com>
15715
15716         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15717         (LocalInfo.IsThis): New public property.
15718         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15719
15720 2004-08-01  Martin Baulig  <martin@ximian.com>
15721
15722         * class.cs (TypeContainer.GetClassBases): Don't set the default
15723         here since we may get called from GetPartialBases().
15724         (TypeContainer.DefineType): If GetClassBases() didn't return a
15725         parent, use the default one.
15726
15727 2004-07-30  Duncan Mak  <duncan@ximian.com>
15728
15729         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15730
15731 2004-07-30  Martin Baulig  <martin@ximian.com>
15732
15733         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15734
15735         * class.cs (SourceMethod): New public class, derive from the
15736         symbol writer's ISourceMethod.
15737         (Method): Use the new symbol writer API.
15738
15739         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15740         as argument and use the new symbol writer.
15741
15742         * location.cs
15743         (SourceFile): Implement the symbol writer's ISourceFile.
15744         (Location.SymbolDocument): Removed.
15745         (Location.SourceFile): New public property.
15746
15747         * symbolwriter.cs: Use the new symbol writer API.
15748
15749 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15750
15751         * Makefile (install-local): Remove.  Functionality moved to
15752         executable.make.
15753
15754 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15755
15756         * Makefile: Install mcs.exe.config file together with mcs.exe.
15757         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15758         correct runtime version.
15759         
15760 2004-07-25  Martin Baulig  <martin@ximian.com>
15761
15762         * class.cs
15763         (TypeContainer.RegisterOrder): Removed, this was unused.
15764         (TypeContainer, interface_order): Removed.
15765         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15766         TypeContainer as argument since we can also be called with a
15767         `PartialContainer' for a partial class/struct/interface.
15768         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15769         of checking whether we're an `Interface' - we could be a
15770         `PartialContainer'.
15771         (PartialContainer.Register): Override; call
15772         AddClass()/AddStruct()/AddInterface() on our parent.
15773
15774         * cs-parser.jay (interface_member_declaration): Add things to the
15775         `current_container', not the `current_class'.
15776
15777         * rootcontext.cs (RegisterOrder): The overloaded version which
15778         takes an `Interface' was unused, removed.
15779
15780         * typemanager.cs (TypeManager.LookupInterface): Return a
15781         `TypeContainer', not an `Interface'.
15782         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15783         contain a `PartialContainer' for an interface, so check it's
15784         `Kind' to figure out what it is.
15785
15786 2004-07-25  Martin Baulig  <martin@ximian.com>
15787
15788         * class.cs (Class.DefaultTypeAttributes): New public constant.
15789         (Struct.DefaultTypeAttributes): Likewise.
15790         (Interface.DefaultTypeAttributes): Likewise.
15791         (PartialContainer.TypeAttr): Override this and add the
15792         DefaultTypeAttributes.
15793
15794 2004-07-25  Martin Baulig  <martin@ximian.com>
15795
15796         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15797         we can just use the `Parent' field instead.
15798
15799 2004-07-25  Martin Baulig  <martin@ximian.com>
15800
15801         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15802
15803 2004-07-25  Martin Baulig  <martin@ximian.com>
15804
15805         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15806         our parts before defining any methods.
15807         (TypeContainer.VerifyImplements): Make this virtual.
15808         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15809         on our PartialContainer.
15810
15811 2004-07-25  Martin Baulig  <martin@ximian.com>
15812
15813         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15814
15815         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15816         argument, we can just use the `Parent' field instead.
15817
15818         * class.cs
15819         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15820         (MemberBase.DoDefine): Likewise.
15821
15822 2004-07-24  Martin Baulig  <martin@ximian.com>
15823
15824         * decl.cs (MemberCore.Parent): New public field.
15825         (DeclSpace.Parent): Moved to MemberCore.
15826
15827         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15828         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15829         parent's .ctor.
15830         (FieldBase, Field, Operator): Likewise.
15831         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15832         (EventField, Event): Likewise.
15833
15834 2004-07-23  Martin Baulig  <martin@ximian.com>
15835
15836         * class.cs (PartialContainer): New public class.
15837         (ClassPart): New public class.
15838         (TypeContainer): Added support for partial classes.
15839         (TypeContainer.GetClassBases): Splitted some of the functionality
15840         out into GetNormalBases() and GetPartialBases().
15841
15842         * cs-tokenizer.cs (Token.PARTIAL): New token.
15843         (Tokenizer.consume_identifier): Added some hacks to recognize
15844         `partial', but only if it's immediately followed by `class',
15845         `struct' or `interface'.
15846
15847         * cs-parser.jay: Added support for partial clases.
15848
15849 2004-07-23  Martin Baulig  <martin@ximian.com>
15850
15851         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15852         a `DeclSpace' and also made it readonly.
15853         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15854         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15855         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15856
15857         * cs-parser.jay: Pass the `current_class', not the
15858         `current_container' (at the moment, this is still the same thing)
15859         to a new Method, Property, Event, Indexer or Constructor.
15860
15861 2004-07-23  Martin Baulig  <martin@ximian.com>
15862
15863         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15864         and removed the `current_interface' one.
15865         (struct_declaration, class_declaration, interface_declaration):
15866         Set `current_class' to the newly created class/struct/interface;
15867         set their `Bases' and call Register() before parsing their body.
15868
15869 2004-07-23  Martin Baulig  <martin@ximian.com>
15870
15871         * class.cs (Kind): New public enum.
15872         (TypeContainer): Made this class abstract.
15873         (TypeContainer.Kind): New public readonly field.
15874         (TypeContainer.CheckDef): New public method; moved here from
15875         cs-parser.jay.
15876         (TypeContainer.Register): New public abstract method.
15877         (TypeContainer.GetPendingImplementations): New public abstract
15878         method.
15879         (TypeContainer.GetClassBases): Removed the `is_class' and
15880         `is_iface' parameters.
15881         (TypeContainer.DefineNestedTypes): Formerly known as
15882         DoDefineType().
15883         (ClassOrStruct): Made this class abstract.
15884
15885         * tree.cs (RootTypes): New public type. 
15886
15887 2004-07-20  Martin Baulig  <martin@ximian.com>
15888
15889         * tree.cs (Tree.RecordNamespace): Removed.
15890         (Tree.Namespaces): Removed.
15891
15892         * rootcontext.cs (RootContext.IsNamespace): Removed.
15893
15894         * cs-parser.jay (namespace_declaration): Just create a new
15895         NamespaceEntry here.
15896
15897 2004-07-20  Martin Baulig  <martin@ximian.com>
15898
15899         * statement.cs (ExceptionStatement): New abstract class.  This is
15900         now used as a base class for everyone who's using `finally'.
15901         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
15902         our local variables before using them.
15903
15904         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
15905         virtual method.  This is used by Yield.Resolve() to "steal" an
15906         outer block's `finally' clauses.
15907         (FlowBranchingException): The .ctor now takes an ExceptionStatement
15908         argument.
15909
15910         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
15911         version which takes an ExceptionStatement.  This version must be
15912         used to create exception branchings.
15913
15914         * iterator.cs
15915         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
15916         (Iterator.EmitMoveNext): Added exception support; protect the
15917         block with a `fault' clause, properly handle 'finally' clauses.
15918         (Iterator.EmitDispose): Run all the `finally' clauses here.
15919
15920 2004-07-20  Martin Baulig  <martin@ximian.com>
15921
15922         * iterator.cs: This is the first of a set of changes in the
15923         iterator code.  Match the spec more closely: if we're an
15924         IEnumerable, then GetEnumerator() must be called.  The first time
15925         GetEnumerator() is called, it returns the current instance; all
15926         subsequent invocations (if any) must create a copy.
15927
15928 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
15929
15930         * expression.cs: Resolve the constant expression before returning
15931         it. 
15932
15933 2004-07-19  Martin Baulig  <martin@ximian.com>
15934
15935         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
15936         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
15937         the return type of the new EmitContext.
15938
15939 2004-07-18  Martin Baulig  <martin@ximian.com>
15940
15941         * class.cs (Property.Define): Fix iterators.
15942
15943         * iterators.cs (Iterator.Define): Moved the
15944         `container.AddInterator (this)' call here from the .ctor; only do
15945         it if we resolved successfully.
15946
15947 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
15950         `true' for preprocessing directives that we parse.  The return
15951         value indicates whether we should return to regular tokenizing or
15952         not, not whether it was parsed successfully.
15953
15954         In the past if we were in: #if false ... #line #endif, we would
15955         resume parsing after `#line'.  See bug 61604.
15956
15957         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
15958         building: IsEnumType should return true only for enums, not for
15959         enums or System.Enum itself.  This fixes #61593.
15960
15961         Likely what happened is that corlib was wrong: mcs depended on
15962         this bug in some places.  The bug got fixed, we had to add the
15963         hack, which caused bug 61593.
15964
15965         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
15966         that was a workaround for the older conditions.
15967
15968 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
15969
15970         * assign.cs: IAssignMethod has a new interface, as documented
15971         inline. All assignment code now uses this new api.
15972
15973         * ecore.cs, expression.cs: All classes which implement
15974         IAssignMethod now use the new interface.
15975
15976         * expression.cs (Invocation): add a hack to EmitCall so that
15977         IndexerAccess can be the target of a compound assignment without
15978         evaluating its arguments twice.
15979
15980         * statement.cs: Handle changes in Invocation api.
15981
15982 2004-07-16  Martin Baulig  <martin@ximian.com>
15983
15984         * iterators.cs: Rewrote this.  We're now using one single Proxy
15985         class for both the IEnumerable and the IEnumerator interface and
15986         `Iterator' derives from Class so we can use the high-level API.
15987
15988         * class.cs (TypeContainer.AddIterator): New method.
15989         (TypeContainer.DoDefineType): New protected virtual method, which
15990         is called from DefineType().
15991         (TypeContainer.DoDefineMembers): Call DefineType() and
15992         DefineMembers() on all our iterators.
15993         (TypeContainer.Emit): Call Emit() on all our iterators.
15994         (TypeContainer.CloseType): Call CloseType() on all our iterators.
15995
15996         * codegen.cs (EmitContext.CurrentIterator): New public field.
15997
15998 2004-07-15  Martin Baulig  <martin@ximian.com>
15999
16000         * typemanager.cs
16001         (TypeManager.not_supported_exception_type): New type.   
16002
16003 2004-07-14  Martin Baulig  <martin@ximian.com>
16004
16005         * iterators.cs: Use real error numbers.
16006
16007 2004-07-14  Martin Baulig  <martin@ximian.com>
16008
16009         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16010         requires this to be a System.Collection.IEnumerable and not a
16011         class implementing that interface.
16012         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16013
16014 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16015
16016         * class.cs: Fixed previous fix, it broke some error tests.
16017
16018 2004-07-12  Martin Baulig  <martin@ximian.com>
16019
16020         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16021         Fixes #61293.
16022
16023 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16024
16025         * assign.cs (LocalTemporary): Add new argument: is_address,If
16026         `is_address' is true, then the value that we store is the address
16027         to the real value, and not the value itself.
16028         
16029         * ecore.cs (PropertyExpr): use the new local temporary
16030         stuff to allow us to handle X.Y += z (where X is a struct)
16031
16032 2004-07-08  Martin Baulig  <martin@ximian.com>
16033
16034         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16035         not always return, just like we're doing in Using.Resolve().
16036
16037 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * cs-parser.jay (fixed_statement): flag this as Pinned.
16040
16041 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16042
16043         * typemanager.cs (TypeManager): Removed MakePinned method, this
16044         mechanism is replaced with the .NET 2.x compatible mechanism of
16045         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16046
16047         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16048         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16049         `IsFixed' property which has a different meaning.
16050
16051 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16052
16053         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16054         visible from inside a nested class, not just the names of the
16055         immediately enclosing class.
16056         Fix for bug #60730.
16057
16058 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16059
16060         * expression.cs (BetterConversion): Remove buggy special-case
16061         handling of "implicit constant expression conversions".  At this
16062         point, we already know that the conversion is possible -- we're
16063         only checking to see which is better.
16064
16065 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16066
16067         * cs-parser.jay: Added error CS0210 test.
16068
16069 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16070
16071         * cs-parser.jay: Added error CS0134 test.
16072
16073 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16074
16075         Fix bug #52507
16076         * cs-parser.jay: Added error CS0145 test.
16077
16078 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16079
16080         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16081
16082 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16083         
16084         * expression.cs (StackAlloc.Resolve): The argument may not
16085         be a constant; deal with this case.
16086         
16087 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16088
16089         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16090         GetIndexerAttributeValue.
16091         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16092
16093         * class.cs (Indexer.Define): Added error tests for CS0415,
16094         CS0609.
16095
16096 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16099         property code.
16100
16101 2004-06-23  Martin Baulig  <martin@ximian.com>
16102
16103         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16104         neither return nor throw, reset the barrier as well.  Fixes #60457.
16105
16106 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16107
16108         * class.cs : EventAttributes is now set to None by default.
16109           This fixes bug #60459.
16110
16111 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16112
16113         Fix bug #60219
16114         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16115         Don't throw exception but return null (it's sufficient now).
16116
16117 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16118
16119         * typemanager.cs (GetArgumentTypes): Faster implementation.
16120
16121 2004-06-18  Martin Baulig  <martin@ximian.com>
16122
16123         * attribute.cs (Attribute.Resolve): Check whether we're an
16124         EmptyCast which a Constant child.  Fixes #60333.
16125
16126 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16127
16128         * statement.cs (EmitCollectionForeach): Account for the fact that
16129         not all valuetypes are in areas which we can take the address of.
16130         For these variables, we store to a temporary variable. Also, make
16131         sure that we dont emit a `callvirt' on a valuetype method.
16132
16133 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16134
16135         * expression.cs (StackAlloc.DoReSolve): Added test for
16136         negative parameter (CS0247).
16137
16138 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16139
16140         Fix bug #59792
16141         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16142
16143 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16144
16145         Fix bug #59781
16146         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16147         ulong.
16148
16149 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16150
16151         Fix bug #58254 & cs1555.cs, cs1556.cs
16152         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16153
16154 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16155
16156         * cs-parser.jay: Added error CS1669 test for indexers.
16157
16158 2004-06-11  Martin Baulig  <martin@ximian.com>
16159
16160         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16161         call this twice: for params and varargs methods.
16162
16163 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16164
16165         * class.cs:
16166         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16167
16168 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16169
16170         * attribute.cs (Attribute.GetValidTargets): Made public.
16171
16172         * class.cs: 
16173         (AbstractPropertyEventMethod): New class for better code sharing.
16174         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16175         CS1667 report.
16176         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16177
16178 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16179
16180         Fix bug #59477.
16181         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16182         that the call to Resolve is part of a MemberAccess.
16183         (Expression.Resolve): Use it for SimpleName resolution.
16184         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16185         Add 'intermediate' boolean argument.
16186         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16187         error message when the SimpleName can be resolved ambiguously
16188         between an expression and a type.
16189         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16190         public.
16191         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16192         call on the left-side.
16193
16194 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16195
16196         * class.cs:
16197         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16198
16199 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16200
16201         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16202
16203 2004-06-11  Martin Baulig  <martin@ximian.com>
16204
16205         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16206         varargs methods if applicable.
16207
16208 2004-06-11  Martin Baulig  <martin@ximian.com>
16209
16210         * expression.cs (Invocation.EmitCall): Don't use
16211         `method.CallingConvention == CallingConventions.VarArgs' since the
16212         method could also have `CallingConventions.HasThis'.
16213
16214 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16215
16216         * class.cs (Event.GetSignatureForError): Implemented.
16217         Fixed crash in error test cs3010.cs
16218
16219 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * cs-tokenizer.cs: Change the way we track __arglist to be
16222         consistent with the other keywords.
16223
16224 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16227         tomorrow.
16228
16229 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16230
16231         * codegen.cs: Check that all referenced assemblies have a strongname
16232         before strongnaming the compiled assembly. If not report error CS1577.
16233         Fix bug #56563. Patch by Jackson Harper.
16234         * typemanager.cs: Added a method to return all referenced assemblies.
16235         Fix bug #56563. Patch by Jackson Harper.
16236
16237 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16238
16239         * class.cs:
16240         (Method.ApplyAttributeBuilder): Moved and added conditional
16241         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16242
16243         * delegate.cs:
16244         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16245
16246 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16247
16248         Fixed #59640
16249         * class.cs: (EventField.attribute_targets): Changed default target.
16250
16251 2004-06-08  Martin Baulig  <martin@ximian.com>
16252
16253         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16254
16255 2004-06-08  Martin Baulig  <martin@ximian.com>
16256
16257         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16258
16259 2004-06-07  Martin Baulig  <martin@ximian.com>
16260
16261         Added support for varargs methods.
16262
16263         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16264         keyword.
16265
16266         * cs-parser.jay: Added support for `__arglist'.
16267
16268         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16269
16270         * expression.cs (Argument.AType): Added `ArgList'.
16271         (Invocation): Added support for varargs methods.
16272         (ArglistAccess): New public class.
16273         (Arglist): New public class.
16274
16275         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16276
16277         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16278         a method's top-level block if the method has varargs.
16279
16280         * support.cs (ReflectionParameters, InternalParameters): Added
16281         support for varargs methods.    
16282
16283 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * class.cs: Provide location in indexer error report.
16286
16287         * driver.cs: Use standard names.
16288
16289         * namespace.cs: Catch the use of using after a namespace has been
16290         declared also on using aliases.
16291
16292 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16293
16294         Bug #50820.
16295         * typemanager.cs (closure_private_ok, closure_invocation_type)
16296         (closure_qualifier_type, closure_invocation_assembly)
16297         (FilterWithClosure): Move to ...
16298         (Closure): New internal nested class.
16299         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16300         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16301         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16302         (MemberLookup, MemberLookupFailed): Use it.
16303         * expression.cs (New.DoResolve): Treat the lookup for the
16304         constructor as being qualified by the 'new'ed type.
16305         (Indexers.GetIndexersForTypeOrInterface): Update.
16306
16307 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16308
16309         * attribute.cs
16310         (GetConditionalAttributeValue): New method. Returns
16311         condition of ConditionalAttribute.
16312         (SearchMulti): New method.  Returns all attributes of type 't'.
16313         Use it when attribute is AllowMultiple = true.
16314         (IsConditionalMethodExcluded): New method.
16315
16316         * class.cs
16317         (Method.IsExcluded): Implemented. Returns true if method has conditional
16318         attribute and the conditions is not defined (method is excluded).
16319         (IMethodData): Extended interface for ConditionalAttribute support.
16320         (PropertyMethod.IsExcluded): Implemented.
16321
16322         * decl.cs
16323         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16324
16325         * expression.cs
16326         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16327         on the method.
16328
16329 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16330
16331         * expression.cs (ArrayCreationExpression): Make this just an
16332         `expression'. It can't be a statement, so the code here was
16333         dead.
16334
16335 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16336
16337         Fixed #59072
16338         * typemanager.cs (GetFullNameSignature): New method for
16339         MethodBase types.
16340
16341 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16342
16343         Fixed #56452
16344         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16345         Use this method when MethodBuilder is null.
16346         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16347         Added test for error CS0626 (MONO reports error for this situation).
16348         (IMethodData.GetSignatureForError): Extended interface.
16349
16350 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16351
16352         * attribute.cs
16353         (AttributeTester.GetObsoleteAttribute): Returns instance of
16354         ObsoleteAttribute when type is obsolete.
16355
16356         * class.cs
16357         (TypeContainer.VerifyObsoleteAttribute): Override.
16358         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16359         (MethodCode.VerifyObsoleteAttribute): Override.
16360         (MemberBase.VerifyObsoleteAttribute): Override.
16361
16362         * decl.cs
16363         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16364         and report proper error.
16365
16366         *delegate.cs
16367         Delegate.VerifyObsoleteAttribute): Override.
16368
16369         * ecore.cs
16370         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16371         and report proper error.
16372         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16373
16374         * enum.cs
16375         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16376         and enum member.
16377
16378         * expression.cs
16379         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16380         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16381         Added test for ObsoleteAttribute.
16382
16383         * statement.cs
16384         (Catch): Derived from Statement.
16385
16386 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16387  
16388         Fixed bug #59071 & cs0160.cs
16389  
16390         * statement.cs (Try.Resolve): Check here whether order of catch
16391         clauses matches their dependencies.
16392
16393 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16396         caused a regression: #59343.  Referencing nested classes from an
16397         assembly stopped working.
16398
16399 2004-05-31  Martin Baulig  <martin@ximian.com>
16400
16401         MCS is now frozen for beta 2.
16402
16403 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16404
16405         * convert.cs: add a trivial cache for overload operator resolution.
16406
16407 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16408
16409         * decl.cs: If possible, use lookuptypedirect here. We can only do
16410         this if there is no `.' after the namespace. Avoids using
16411         LookupType, which does lots of slow processing.
16412         (FindNestedType) New method, does what it says :-).
16413         * namespace.cs: use LookupTypeDirect.
16414         * rootcontext.cs: use membercache, if possible.
16415         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16416
16417 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16418
16419         * expression.cs:
16420         According to the spec, 
16421
16422         In a member access of the form E.I, if E is a single identifier,
16423         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16424         field, property, localvariable, or parameter with the same type as
16425         the meaning of E as a type-name (§3.8), then both possible
16426         meanings of E are permitted.
16427
16428         We did not check that E as a simple-name had the same type as E as
16429         a type name.
16430
16431         This trivial check gives us 5-7% on bootstrap time.
16432
16433 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16434
16435         * expression.cs (Invocation.OverloadResolve): Avoid the
16436         use of hashtables and boxing here by allocating on demand.
16437
16438 2004-05-30  Martin Baulig  <martin@ximian.com>
16439
16440         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16441         we're doing a silent lookup.  Don't try to lookup nested types in
16442         TypeManager.object_type (thanks to Ben Maurer).
16443
16444 2004-05-30  Martin Baulig  <martin@ximian.com>
16445
16446         Committing a patch from Ben Maurer.
16447
16448         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16449
16450 2004-05-29  Martin Baulig  <martin@ximian.com>
16451
16452         * class.cs (IMethodData.ShouldIgnore): New method.
16453
16454         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16455         `Location' argument, we don't need it anywhere.  Use
16456         `IMethodData.ShouldIgnore ()' instead of
16457         `MethodData.GetMethodFlags ()'.
16458         (TypeManager.AddMethod): Removed.
16459         (TypeManager.AddMethod2): Renamed to AddMethod.
16460
16461 2004-05-29  Martin Baulig  <martin@ximian.com>
16462
16463         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16464
16465         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16466         converting from a class type S to an interface type and we already
16467         have an object on the stack, don't box it again.  Fixes #52578.
16468
16469 2004-05-29  Martin Baulig  <martin@ximian.com>
16470
16471         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16472         Added support for `params' parameters.  Fixes #59267.
16473
16474 2004-05-29  Martin Baulig  <martin@ximian.com>
16475
16476         * literal.cs (NullPointer): Provide a private .ctor which sets
16477         `type' to TypeManager.object_type.  Fixes #59048.
16478
16479 2004-05-29  Martin Baulig  <martin@ximian.com>
16480
16481         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16482         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16483
16484         * ecore.cs (EventExpr.instance_expr): Make the field private.
16485
16486 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16487
16488         Fixed bug #50080 & cs0214-2.cs
16489         * expression.cs (Cast.DoResolve): Check unsafe context here.
16490         
16491         * statement.cs (Resolve.DoResolve): Likewise.
16492
16493 2004-05-26  Martin Baulig  <martin@ximian.com>
16494
16495         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16496
16497         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16498         (RootContext.LookupType): Pass down the `silent' flag.
16499
16500 2004-05-25  Martin Baulig  <martin@ximian.com>
16501
16502         * expression.cs
16503         (MethodGroupExpr.IdenticalTypeName): New public property.
16504         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16505         expression actually refers to a type.
16506
16507 2004-05-25  Martin Baulig  <martin@ximian.com>
16508
16509         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16510         for #56176 and made it actually work.
16511
16512 2004-05-25  Martin Baulig  <martin@ximian.com>
16513
16514         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16515         (FieldExpr, PropertyExpr): Override and implement
16516         CacheTemporaries.  Fixes #52279.
16517
16518 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * location.cs: In the new compiler listing a file twice is a
16521         warning, not an error.
16522
16523 2004-05-24  Martin Baulig  <martin@ximian.com>
16524
16525         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16526         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16527
16528 2004-05-24  Martin Baulig  <martin@ximian.com>
16529
16530         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16531         walking the `using' list.  Fixes #53921.
16532
16533 2004-05-24  Martin Baulig  <martin@ximian.com>
16534
16535         * const.cs (Const.LookupConstantValue): Added support for
16536         EmptyCast's; fixes #55251.
16537
16538 2004-05-24  Martin Baulig  <martin@ximian.com>
16539
16540         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16541         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16542         which does the CS0135 check.  The reason is that we first need to
16543         check whether the variable actually exists.
16544
16545 2004-05-24  Martin Baulig  <martin@ximian.com>
16546
16547         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16548         than RootContext.LookupType() to find the explicit interface
16549         type.  Fixes #58584.
16550
16551 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16552
16553         * Makefile: Simplify.  Use executable.make.
16554         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16555
16556 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16557
16558         * decl.cs:
16559         * enum.cs:
16560         Use the invariant culture when doing String.Compare for CLS case
16561         sensitivity.
16562         
16563 2004-05-23  Martin Baulig  <martin@ximian.com>
16564
16565         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16566         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16567
16568         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16569         
16570 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16571
16572         * class.cs (MemberBase.Define): Reuse MemberType member for 
16573         resolved type. Other methods can use it too.
16574
16575 2004-05-23  Martin Baulig  <martin@ximian.com>
16576
16577         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16578         the variable also exists in the current block (otherwise, we need
16579         to report a CS0103).  Fixes #58670.
16580
16581 2004-05-23  Martin Baulig  <martin@ximian.com>
16582
16583         * flowanalysis.cs (Reachability.Reachable): Compute this
16584         on-the-fly rather than storing it as a field.
16585
16586 2004-05-23  Martin Baulig  <martin@ximian.com>
16587
16588         * flowanalysis.cs (Reachability.And): Manually compute the
16589         resulting `barrier' from the reachability.      
16590        
16591 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16592
16593         Fix bug #57835
16594         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16595         instance of ObsoleteAttribute when symbol is obsolete.
16596
16597         * class.cs
16598         (IMethodData): Extended interface for ObsoleteAttribute support.
16599
16600 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16601
16602         * attribute.cs: Fix bug #55970
16603
16604 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16605
16606         Fix bug #52705
16607         * attribute.cs
16608         (GetObsoleteAttribute): New method. Creates the instance of
16609         ObsoleteAttribute.
16610         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16611         ObsoleteAttribute when member is obsolete.
16612         (AttributeTester.Report_ObsoleteMessage): Common method for
16613         Obsolete error/warning reporting.
16614
16615         * class.cs
16616         (TypeContainer.base_classs_type): New member for storing parent type.
16617
16618         * decl.cs
16619         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16620         for this MemberCore.
16621
16622 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16623
16624         * attribute.cs, const.cs: Fix bug #58590
16625
16626 2004-05-21  Martin Baulig  <martin@ximian.com>
16627
16628         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16629         out parameters if the end of the method is unreachable.  Fixes
16630         #58098. 
16631
16632 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16633
16634         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16635         Hari was right, why extra method.
16636
16637 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16638
16639         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16640
16641 2004-05-20  Martin Baulig  <martin@ximian.com>
16642
16643         Merged this back from gmcs to keep the differences to a minumum.
16644
16645         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16646         instead of a Declspace.
16647         (Attribute.ResolveType): Likewise.
16648         (Attributes.Search): Likewise.
16649         (Attributes.Contains): Likewise.
16650         (Attributes.GetClsCompliantAttribute): Likewise.
16651
16652         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16653         argument.
16654         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16655         DeclSpace.
16656
16657 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16658
16659         Fix bug #58688 (MCS does not report error when the same attribute
16660         is assigned twice)
16661
16662         * attribute.cs (Attribute.Emit): Distinction between null and default.
16663
16664 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16665
16666         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16667         of a top-level attribute without an attribute target.
16668         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16669         Make non-static.
16670         (Attribute.Conditional_GetConditionName), 
16671         (Attribute.Obsolete_GetObsoleteMessage): Update.
16672         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16673         part of ScanForIndexerName.
16674         (Attribute.CanIgnoreInvalidAttribute): New function.
16675         (Attribute.ScanForIndexerName): Move to ...
16676         (Attributes.ScanForIndexerName): ... here.
16677         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16678         (Attributes.Search): New internal variant that can choose not to
16679         complain if types aren't resolved.  The original signature now
16680         complains.
16681         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16682         complaints suppressed.
16683         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16684         only if it not useful.
16685         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16686         top-level for attributes that are shared between the assembly
16687         and a top-level class.
16688         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16689         * class.cs: Update to reflect changes.
16690         (DefineIndexers): Fuse loops.
16691         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16692         a couple more variants of attribute names.
16693
16694 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16695
16696         Fix bug #52585 (Implemented explicit attribute declaration)
16697
16698         * attribute.cs:
16699         (Attributable.ValidAttributeTargets): New abstract method. It gets
16700         list of valid attribute targets for explicit target declaration.
16701         (Attribute.Target): It holds target itself.
16702         (AttributeSection): Removed.
16703         (Attribute.CheckTargets): New method. It checks whether attribute
16704         target is valid for the current element.
16705
16706         * class.cs:
16707         (EventProperty): New class. For events that are declared like
16708         property (with add and remove accessors).
16709         (EventField): New class. For events that are declared like field.
16710         class.cs
16711
16712         * cs-parser.jay: Implemented explicit attribute target declaration.
16713
16714         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16715         Override ValidAttributeTargets.
16716
16717         * parameter.cs:
16718         (ReturnParameter): Class for applying custom attributes on 
16719         the return type.
16720         (ParameterAtribute): New class. Class for applying custom
16721         attributes on the parameter type.
16722
16723 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16726         definitions. 
16727
16728         (Method): Allow UNSAFE here.
16729
16730         * modifiers.cs: Support unsafe reporting.
16731
16732 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16733
16734         * decl.cs: Fix bug #58478.
16735
16736 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16737
16738         * statement.cs: When checking for unreachable code on an EmptyStatement,
16739         set the location. Fixes bug #58488.
16740
16741 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16742
16743         * driver.cs: Add -pkg handling.
16744
16745         From Gonzalo: UseShelLExecute=false
16746
16747 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16748
16749         * attribute.cs:
16750         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16751         for attribute.
16752         (Attribute.IsClsCompliaceRequired): Moved to base for better
16753         accesibility.
16754         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16755         when attribute is AttributeUsageAttribute.
16756         (Attribute.GetValidTargets): Simplified.
16757         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16758         attribute for this type.
16759         (Attribute.ApplyAttributes): Method renamed to Emit and make
16760         non-static.
16761         (GlobalAttributeSection): New class for special handling of global
16762         attributes (assembly, module).
16763         (AttributeSection.Emit): New method.
16764
16765         * class.cs: Implemented Attributable abstract methods.
16766         (MethodCore.LabelParameters): Moved to Parameter class.
16767         (Accessor): Is back simple class.
16768         (PropertyMethod): Implemented Attributable abstract class.
16769         (DelegateMethod): Implemented Attributable abstract class.
16770         (Event): New constructor for disctintion between normal Event
16771         and Event with accessors.
16772
16773         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16774
16775         * codegen.cs, const.cs, decl.cs, delegate.cs:
16776         (CommonAssemblyModulClass): Implemented Attributable abstract class
16777         and simplified.
16778
16779         * enum.cs: Implement IAttributeSupport interface.
16780         (EnumMember): New class for emum members. Implemented Attributable
16781         abstract class
16782
16783         * parameter.cs:
16784         (ParameterBase): Is abstract.
16785         (ReturnParameter): New class for easier [return:] attribute handling.
16786
16787         * typemanager.cs: Removed builder_to_attr.
16788
16789 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16790
16791         Fix bug #57151.
16792         * attribute.cs (Attribute.GetPositionalValue): New function.
16793         * class.cs (TypeContainer.VerifyMembers): New function.
16794         (TypeContainer.Emit): Use it.
16795         (ClassOrStruct): New base class for Class and Struct.
16796         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16797         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16798         class.
16799         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16800         then each non-static field should have a FieldOffset attribute.
16801         Otherwise, none of the fields should have a FieldOffset attribute.
16802         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16803         and FieldOffset attributes.
16804         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16805         (TypeManager.field_offset_attribute_type): New core types.
16806         (TypeManager.InitCoreTypes): Initialize them.
16807
16808 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16809
16810         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16811         Return correct type.
16812         From bug #58270.
16813
16814 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16815
16816         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16817         be implicitly converted to ulong.
16818         
16819         * expression.cs: The logic for allowing operator &, | and ^ worked
16820         was wrong, it worked before because we did not report an error in
16821         an else branch.  Fixes 57895.
16822
16823         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16824         allow volatile fields to be reference types.
16825
16826 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * driver.cs: Add support for /debug-
16829
16830 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16831
16832         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16833         Add a 'complain' parameter to silence errors.
16834         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16835         silently overlooked type-resolutions.
16836         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16837         to reflect changes.
16838         (Attributes.Search): New function.
16839         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16840         (Attributes.GetAttributeFullName): Remove hack.
16841         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16842         Update to reflect changes.
16843         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16844         Use Attributes.Search instead of nested loops.
16845
16846 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16847
16848         * decl.cs:
16849         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16850         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16851         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16852
16853         * report.cs: (Report.Warning): Renamed to Warning_T because of
16854         parameter collision.
16855
16856 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16857
16858         * expression.cs (MemberAccess.ResolveMemberAccess):
16859         Exit with non-zero status after Report.Error.
16860         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16861         Likewise.
16862         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16863
16864 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16865
16866         * support.cs: Don't hang when the file is empty.
16867
16868 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16869
16870         * support.cs: In SeekableStreamReader, compute the preamble size of the
16871           underlying stream. Position changes should take into account that initial
16872           count of bytes.
16873
16874 2004-05-03  Todd Berman  <tberman@sevenl.net>
16875
16876         * driver.cs: remove unused GetSysVersion function.
16877
16878 2004-05-03  Todd Berman  <tberman@sevenl.net>
16879
16880         * driver.cs: Remove the hack from saturday, as well as the hack
16881         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16882         link_paths to get that bit proper.
16883
16884 2004-05-01  Todd Berman  <tberman@sevenl.net>
16885
16886         * driver.cs: Try a LoadFrom before a Load, this checks the current
16887         path. This is currently a bug in mono that is be fixed, however, this
16888         provides a workaround for now. This will be removed when the bug
16889         is fixed.
16890
16891 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
16892
16893         * CryptoConvert.cs: Updated to latest version. Fix issue with 
16894         incomplete key pairs (#57941).
16895
16896 2004-05-01  Todd Berman  <tberman@sevenl.net>
16897
16898         * driver.cs: Remove '.' from path_chars, now System.* loads properly
16899         from the GAC
16900
16901 2004-04-30  Jackson Harper  <jackson@ximian.com>
16902
16903         * codegen.cs: Open keys readonly.
16904         
16905 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16906
16907         * typemanager.cs: don't report cyclic struct layout when a struct
16908         contains 2 or more fields of the same type. Failed for Pango.AttrShape
16909         which has 2 Pango.Rectangle fields.
16910
16911 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
16912
16913         * expression.cs: Handle IntPtr comparisons with IL code
16914         rather than a method call.
16915
16916 2004-04-29  Martin Baulig  <martin@ximian.com>
16917
16918         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
16919         the list of PropertyInfo's in class hierarchy and find the
16920         accessor.  Fixes #56013.
16921
16922 2004-04-29  Martin Baulig  <martin@ximian.com>
16923
16924         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
16925
16926 2004-04-29  Martin Baulig  <martin@ximian.com>
16927
16928         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16929
16930         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
16931
16932 2004-04-29  Martin Baulig  <martin@ximian.com>
16933
16934         * class.cs (ConstructorInitializer.Resolve): Check whether the
16935         parent .ctor is accessible.  Fixes #52146.
16936
16937 2004-04-29  Martin Baulig  <martin@ximian.com>
16938
16939         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
16940
16941         * statement.cs (Using.EmitLocalVariableDecls): Use
16942         TypeManager.idisposable_type, not typeof (IDisposable).
16943         (Foreach.EmitCollectionForeach): Added support for valuetypes.
16944
16945 2004-04-29  Martin Baulig  <martin@ximian.com>
16946
16947         * class.cs (Event.Define): Don't emit the field and don't set
16948         RTSpecialName and SpecialName for events on interfaces.  Fixes
16949         #57703. 
16950
16951 2004-04-29  Raja R Harinath  <rharinath@novell.com>
16952
16953         Refactor Attribute.ApplyAttributes.
16954         * attribute.cs (Attributable): New base class for objects that can
16955         have Attributes applied on them.
16956         (Attribute): Make AttributeUsage fields public.
16957         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
16958         (Attribute.IsInternalCall): New property.
16959         (Attribute.UsageAttr): Convert to a public read-only property.
16960         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
16961         (Attribute.ResolveType, Attribute.Resolve)
16962         (Attribute.ScanForIndexerName): Update to reflect changes.
16963         (Attribute.CheckAttributeTarget): Re-format.
16964         (Attribute.ApplyAttributes): Refactor, to various
16965         Attributable.ApplyAttributeBuilder methods.
16966         * decl.cs (MemberCore): Make Attributable.
16967         * class.cs (Accessor): Make Attributable.
16968         (MethodData.ApplyAttributes): Use proper attribute types, not
16969         attribute names.
16970         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
16971         (TypeContainer.ApplyAttributeBuilder)
16972         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
16973         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
16974         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
16975         (Operator.ApplyAttributeBuilder): New factored-out methods.
16976         * const.cs (Const.ApplyAttributeBuilder): Likewise.
16977         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
16978         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
16979         * parameter.cs (ParameterBase): New Attributable base class
16980         that can also represent Return types.
16981         (Parameter): Update to the changes.
16982
16983 2004-04-29  Jackson Harper  <jackson@ximian.com>
16984
16985         * driver.cs: Prefer the corlib system version when looking for
16986         assemblies in the GAC. This is still a hack, but its a better hack
16987         now.
16988         
16989 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
16990
16991         * decl.cs, enum.cs: Improved error 3005 reporting.
16992   
16993         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
16994         (related_symbols): New private member for list of symbols
16995         related to reported error/warning.
16996         
16997         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
16998
16999 2004-04-29  Martin Baulig  <martin@ximian.com>
17000
17001         * ecore.cs (Expression.Constantify): If we're an enum and
17002         TypeManager.TypeToCoreType() doesn't give us another type, use
17003         t.UnderlyingSystemType.  Fixes #56178.  
17004
17005 2004-04-29  Martin Baulig  <martin@ximian.com>
17006
17007         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17008         interfaces and for each interface, only add members directly
17009         declared in that interface.  Fixes #53255.
17010
17011 2004-04-28  Martin Baulig  <martin@ximian.com>
17012
17013         * expression.cs (ConditionalLogicalOperator): Use a temporary
17014         variable for `left' to avoid that we evaluate it more than once;
17015         bug #52588.
17016
17017 2004-04-28  Martin Baulig  <martin@ximian.com>
17018
17019         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17020         `void[]' (CS1547).
17021
17022 2004-04-28  Martin Baulig  <martin@ximian.com>
17023
17024         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17025         void (CS1547).
17026
17027         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17028         whether the type is not void (CS1547).
17029
17030 2004-04-28  Martin Baulig  <martin@ximian.com>
17031
17032         * expression.cs (Unary.DoResolveLValue): Override this and report
17033         CS0131 for anything but Operator.Indirection.
17034
17035 2004-04-28  Martin Baulig  <martin@ximian.com>
17036
17037         Committing a patch from Ben Maurer; see bug #50820.
17038
17039         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17040         check for classes.
17041
17042         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17043         classes.        
17044
17045 2004-04-28  Martin Baulig  <martin@ximian.com>
17046
17047         Committing a patch from Ben Maurer; see bug #50820.
17048
17049         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17050         check for classes.
17051
17052         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17053         classes.        
17054
17055 2004-04-28  Martin Baulig  <martin@ximian.com>
17056
17057         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17058         (Block.AddLabel): Call DoLookupLabel() to only search in the
17059         current block.
17060
17061 2004-04-28  Martin Baulig  <martin@ximian.com>
17062
17063         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17064         comparing StringConstants and NullLiterals in Equality and Inequality.
17065
17066 2004-04-28  Jackson Harper  <jackson@ximian.com>
17067
17068         * driver.cs: Attempt to load referenced assemblies from the
17069         GAC. This is the quick and dirty version of this method that
17070         doesnt take into account versions and just takes the first
17071         canidate found. Will be good enough for now as we will not have more
17072         then one version installed into the GAC until I update this method.
17073
17074 2004-04-28  Martin Baulig  <martin@ximian.com>
17075
17076         * typemanager.cs (TypeManager.CheckStructCycles): New public
17077         static method to check for cycles in the struct layout.
17078
17079         * rootcontext.cs (RootContext.PopulateTypes): Call
17080         TypeManager.CheckStructCycles() for each TypeContainer.
17081         [Note: We only need to visit each type once.]
17082
17083 2004-04-28  Martin Baulig  <martin@ximian.com>
17084
17085         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17086
17087         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17088         success and added `out object value'.  Use a `bool resolved' field
17089         to check whether we've already been called rather than
17090         `ConstantValue != null' since this breaks for NullLiterals.
17091
17092 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17093
17094         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17095         setting of this flag, since the 'set' method may be non-public.
17096
17097 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17098
17099         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17100         check on current_vector.Block.
17101
17102 2004-04-27  Martin Baulig  <martin@ximian.com>
17103
17104         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17105         a field initializer.  Fixes #56459.
17106
17107 2004-04-27  Martin Baulig  <martin@ximian.com>
17108
17109         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17110         we're not attempting to use an indexer.  Fixes #52154.
17111
17112 2004-04-27  Martin Baulig  <martin@ximian.com>
17113
17114         * statement.cs (Return): Don't create a return label if we don't
17115         need it; reverts my change from January 20th.  Thanks to Ben
17116         Maurer for this.
17117
17118 2004-04-27  Martin Baulig  <martin@ximian.com>
17119
17120         According to the spec, `goto' can only leave a nested scope, but
17121         never enter it.
17122
17123         * statement.cs (Block.LookupLabel): Only lookup in the current
17124         block, don't recurse into parent or child blocks.
17125         (Block.AddLabel): Check in parent and child blocks, report
17126         CS0140/CS0158 if we find a duplicate.
17127         (Block): Removed this indexer for label lookups.
17128         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17129         this already does the error reporting for us.
17130
17131         * flowanalysis.cs
17132         (FlowBranching.UsageVector.Block): New public variable; may be null.
17133         (FlowBranching.CreateSibling): Added `Block' argument.
17134         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17135         label for the target of a `goto' and check whether we're not
17136         leaving a `finally'.
17137
17138 2004-04-27  Martin Baulig  <martin@ximian.com>
17139
17140         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17141         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17142         just for returns).
17143
17144 2004-04-27  Martin Baulig  <martin@ximian.com>
17145
17146         * statement.cs (Block.AddLabel): Also check for implicit blocks
17147         and added a CS0158 check.
17148
17149 2004-04-27  Martin Baulig  <martin@ximian.com>
17150
17151         * flowanalysis.cs (FlowBranchingLoop): New class.
17152         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17153         UsageVector's instead of an ArrayList.
17154         (FlowBranching.Label): Likewise.
17155         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17156         (FlowBranching.AddBreakVector): New method.
17157
17158 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17159
17160         * attribute.cs: Small regression fix: only convert the type if we
17161         the type is different, fixes System.Drawing build.
17162
17163 2004-04-27  Martin Baulig  <martin@ximian.com>
17164
17165         * attribute.cs (Attribute.Resolve): If we have a constant value
17166         for a named field or property, implicity convert it to the correct
17167         type.
17168
17169 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17170
17171         * statement.cs (Block.Block): Implicit blocks share
17172         'child_variable_names' fields with parent blocks.
17173         (Block.AddChildVariableNames): Remove.
17174         (Block.AddVariable): Mark variable as "used by a child block" in
17175         every surrounding block.
17176         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17177         been used in a child block, complain about violation of "Invariant
17178         meaning in blocks" rule.
17179         * cs-parser.jay (declare_local_variables): Don't use
17180         AddChildVariableNames.
17181         (foreach_statement): Don't create an implicit block: 'foreach'
17182         introduces a scope.
17183
17184 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17185
17186         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17187         converting from 0L to ulong.  Fixes 57522.
17188
17189 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17190
17191         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17192         derived class hides via 'new' keyword field from base class (test-242.cs).
17193         TODO: Handle this in the more general way.
17194         
17195         * class.cs (CheckBase): Ditto.
17196
17197 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17198
17199         * decl.cs (caching_flags): New member for storing cached values
17200         as bit flags.
17201         (MemberCore.Flags): New enum where bit flags for caching_flags
17202         are defined.
17203         (MemberCore.cls_compliance): Moved to caching_flags.
17204         (DeclSpace.Created): Moved to caching_flags.
17205
17206         * class.cs: Use caching_flags instead of DeclSpace.Created
17207         
17208 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17209
17210         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17211         if we are only a derived class, not a nested class.
17212
17213         * typemanager.cs: Same as above, but do this at the MemberLookup
17214         level (used by field and methods, properties are handled in
17215         PropertyExpr).   Allow for the qualified access if we are a nested
17216         method. 
17217
17218 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17219
17220         * class.cs: Refactoring.
17221         (IMethodData): New inteface; Holds links to parent members
17222         to avoid member duplication (reduced memory allocation).
17223         (Method): Implemented IMethodData interface.
17224         (PropertyBase): New inner classes for get/set methods.
17225         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17226         (Event): New inner classes for add/remove methods.
17227         (Event.DelegateMethod): Implemented IMethodData interface.
17228
17229         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17230         EmitContext (related to class.cs refactoring).
17231
17232 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17233
17234         * delegate.cs (Delegate.VerifyApplicability): If the number of
17235         arguments are the same as the number of parameters, first try to
17236         verify applicability ignoring  any 'params' modifier on the last
17237         parameter.
17238         Fixes #56442.
17239
17240 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17241
17242         * class.cs (TypeContainer.AddIndexer): Use
17243         'ExplicitInterfaceName' to determine if interface name was
17244         explicitly specified.  'InterfaceType' is not initialized at this time.
17245         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17246         Indexers array is already in the required order.  Initialize
17247         'IndexerName' only if there are normal indexers.
17248         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17249         (TypeContainer.Emit): Emit DefaultMember attribute only if
17250         IndexerName is initialized.
17251         Fixes #56300.
17252
17253 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17254
17255         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17256         Fixes #57007
17257
17258 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17259
17260         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17261         attributes.
17262         Fix for #56456.
17263
17264         * attribute.cs (Attribute.Resolve): Check for duplicate named
17265         attributes.
17266         Fix for #56463.
17267
17268 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * iterators.cs (MarkYield): track whether we are in an exception,
17271         and generate code accordingly.  Use a temporary value to store the
17272         result for our state.
17273
17274         I had ignored a bit the interaction of try/catch with iterators
17275         since their behavior was not entirely obvious, but now it is
17276         possible to verify that our behavior is the same as MS .NET 2.0
17277
17278         Fixes 54814
17279
17280 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * iterators.cs: Avoid creating temporaries if there is no work to
17283         do. 
17284
17285         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17286         Enumerations, use TypeManager.EnumToUnderlying and call
17287         recursively. 
17288
17289         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17290         bug #57013
17291
17292         (This.Emit): Use EmitContext.EmitThis to emit our
17293         instance variable.
17294
17295         (This.EmitAssign): Ditto.
17296
17297         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17298         codepaths, we will move all the functionality into
17299         Mono.CSharp.This 
17300
17301         (FieldExpr.EmitAssign): Ditto.
17302
17303         This fixes several hidden bugs that I uncovered while doing a code
17304         review of this today.
17305
17306         * codegen.cs (EmitThis): reworked so the semantics are more clear
17307         and also support value types "this" instances.
17308
17309         * iterators.cs: Changed so that for iterators in value types, we
17310         do not pass the value type as a parameter.  
17311
17312         Initialization of the enumerator helpers is now done in the caller
17313         instead of passing the parameters to the constructors and having
17314         the constructor set the fields.
17315
17316         The fields have now `assembly' visibility instead of private.
17317
17318 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17319
17320         * expression.cs (Argument.Resolve): Check if fields passed as ref
17321         or out are contained in a MarshalByRefObject.
17322
17323         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17324         another compiler type.
17325
17326 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17327
17328         * class.cs (Indexer.Define): use the new name checking method.
17329         Also, return false on an error.
17330         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17331         (is_identifier_[start/part]_character): make static.
17332
17333 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17334
17335         * expression.cs (Binary.ResolveOperator): Do no append strings
17336         twice: since we can be invoked more than once (array evaluation)
17337         on the same concatenation, take care of this here.  Based on a fix
17338         from Ben (bug #56454)
17339
17340 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17341
17342         * codegen.cs: Fix another case where CS1548 must be reported (when 
17343         delay-sign isn't specified and no private is available #56564). Fix
17344         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17345         error when MCS is used on the MS runtime and we need to delay-sign 
17346         (which seems unsupported by AssemblyBuilder - see #56621).
17347
17348 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17349
17350         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17351         (TypeManager.ComputeNamespaces): Faster implementation for
17352         Microsoft runtime.
17353
17354         * compiler.csproj: Updated AssemblyName to mcs.
17355
17356 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17357
17358         * rootcontext.cs: Add new types to the boot resolution.
17359
17360         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17361         MulticastDelegate is not allowed.
17362
17363         * typemanager.cs: Add new types to lookup: System.TypedReference
17364         and ArgIterator.
17365
17366         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17367         check for TypedReference or ArgIterator, they are not allowed. 
17368
17369         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17370         makes us properly catch 1510 in some conditions (see bug 56016 for
17371         details). 
17372
17373 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17374
17375         * CryptoConvert.cs: update from corlib version
17376         with endian fixes.
17377
17378 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17379
17380         * class.cs (Indexer.Define): Check indexername declaration
17381
17382 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17383
17384         * attribute.cs (IsClsCompliant): Fixed problem with handling
17385         all three states (compliant, not-compliant, undetected).
17386
17387 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17388
17389         * attribute.cs (Attribute): Location is now public.
17390         (Resolve): Store resolved arguments (pos_values) in attribute class.
17391         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17392         (GetClsCompliantAttributeValue): New method that gets
17393         CLSCompliantAttribute value.
17394         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17395         if exists else null.
17396         (AttributeTester): New class for CLS-Compliant verification routines.
17397
17398         * class.cs (Emit): Add CLS-Compliant verification.
17399         (Method.GetSignatureForError): Implemented.
17400         (Constructor.GetSignatureForError): Implemented
17401         (Constructor.HasCompliantArgs): Returns if constructor has
17402         CLS-Compliant arguments.
17403         (Constructor.Emit): Override.
17404         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17405         is needed to test only parameters.
17406         (FieldBase.GetSignatureForError): Implemented.
17407         (TypeContainer): New member for storing base interfaces.
17408         (TypeContainer.FindMembers): Search in base interfaces too.
17409
17410         * codegen.cs (GetClsComplianceAttribute): New method that gets
17411         assembly or module CLSCompliantAttribute value.
17412         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17413         for assembly.
17414         (ModuleClass.Emit): Add error 3012 test.
17415
17416         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17417
17418         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17419         state for all decl types.
17420         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17421         if CLS-Compliant tests are required.
17422         (IsClsCompliaceRequired): New method. Analyze whether code
17423         must be CLS-Compliant.
17424         (IsExposedFromAssembly): New method. Returns true when MemberCore
17425         is exposed from assembly.
17426         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17427         value or gets cached value.
17428         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17429         is explicitly marked with CLSCompliantAttribute.
17430         (IsIdentifierClsCompliant): New abstract method. This method is
17431         used to testing error 3005.
17432         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17433         for identifier and parameters CLS-Compliant testing.
17434         (VerifyClsCompliance): New method. The main virtual method for
17435         CLS-Compliant verifications.
17436         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17437         null. I don't know why is null (too many public members !).
17438         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17439         and get value of first CLSCompliantAttribute that found.
17440
17441         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17442         (VerifyClsCompliance): Override and add extra tests.
17443
17444         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17445         clscheck- disable CLS-Compliant verification event if assembly is has
17446         CLSCompliantAttribute(true).
17447
17448         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17449         ApllyAttribute is now called in emit section as in the other cases.
17450         Possible future Emit integration.
17451         (IsIdentifierClsCompliant): New override.
17452         (VerifyClsCompliance): New override.
17453         (GetEnumeratorName): Returns full enum name.
17454
17455         * parameter.cs (GetSignatureForError): Implemented.
17456
17457         * report.cs (WarningData): New struct for Warning message information.
17458         (LocationOfPreviousError): New method.
17459         (Warning): New method. Reports warning based on the warning table.
17460         (Error_T): New method. Reports error based on the error table.
17461
17462         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17463         verifications are done here.
17464
17465         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17466
17467         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17468         CLSCompliantAttribute.
17469         (all_imported_types): New member holds all imported types from other
17470         assemblies.
17471         (LoadAllImportedTypes): New method fills static table with exported types
17472         from all referenced assemblies.
17473         (Modules): New property returns all assembly modules.
17474
17475 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17476
17477         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17478         throwing a parser error.
17479
17480         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17481         which removes the hardcoded get_/set_ prefixes for properties, as
17482         IL allows for the properties to be named something else.  
17483
17484         Bug #56013
17485
17486         * expression.cs: Do not override operand before we know if it is
17487         non-null.  Fix 56207
17488
17489 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17490
17491         * typemanager.cs: support for pinned variables.
17492
17493 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17494
17495         * decl.cs, typemanager.cs: Avoid using an arraylist
17496         as a buffer if there is only one result set.
17497
17498 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17499
17500         * expression.cs: Make sure you cant call a static method
17501         with an instance expression, bug #56174.
17502
17503 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17504
17505         * class.cs (IsDuplicateImplementation): Improve error reporting to
17506         flag 663 (method only differs in parameter modifier).
17507
17508         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17509         in preprocessor directives.
17510
17511         * location.cs (LookupFile): Allow for the empty path.
17512
17513         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17514         better approach for some of that patch, but its failing with the
17515         CharSet enumeration.  For now try/catch will do.
17516
17517         * typemanager.cs: Do not crash if a struct does not have fields.
17518         Fixes 56150.
17519
17520 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17521
17522         * expression.cs: cs0213, cant fix a fixed expression.
17523         fixes 50231.
17524
17525 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17526
17527         * cs-parser.jay: detect invalid embeded statements gracefully.
17528         bug #51113.
17529
17530 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17531
17532         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17533         As a regex:
17534         s/
17535         the invocation type may not be a subclass of the tye of the item/
17536         The type of the item must be a subclass of the invocation item.
17537         /g
17538
17539         Fixes bug #50820.
17540
17541 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17542
17543         * attribute.cs: Added methods to get a string and a bool from an
17544         attribute. Required to information from AssemblyKeyFileAttribute,
17545         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17546         * codegen.cs: Modified AssemblyName creation to include support for
17547         strongnames. Catch additional exceptions to report them as CS1548.
17548         * compiler.csproj: Updated include CryptoConvert.cs.
17549         * compiler.csproj.user: Removed file - user specific configuration.
17550         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17551         Mono.Security assembly. The original class is maintained and tested in
17552         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17553         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17554         like CSC 8.0 (C# v2) supports.
17555         * Makefile: Added CryptoConvert.cs to mcs sources.
17556         * rootcontext.cs: Added new options for strongnames.
17557
17558 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17559
17560         * driver.cs: For --expect-error, report error code `2'
17561         if the program compiled with no errors, error code `1' if
17562         it compiled with an error other than the one expected.
17563
17564 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17565
17566         * compiler.csproj: Updated for Visual Studio .NET 2003.
17567         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17568         * compiler.sln: Updated for Visual Studio .NET 2003.
17569
17570 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17571
17572         * expression.cs: Fix bug #47234. We basically need to apply the
17573         rule that we prefer the conversion of null to a reference type
17574         when faced with a conversion to 'object' (csc behaviour).
17575
17576 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17577
17578         * statement.cs: Shorter form for foreach, eliminates
17579         a local variable. r=Martin.
17580
17581 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17582
17583         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17584         checks if we can use brtrue/brfalse to test for 0.
17585         * expression.cs: use the above in the test for using brtrue/brfalse.
17586         cleanup code a bit.
17587
17588 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17589
17590         * expression.cs: Rewrite string concat stuff. Benefits:
17591
17592         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17593         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17594         rather than a concat chain.
17595
17596         * typemanager.cs: Add lookups for more concat overloads.
17597
17598 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17599
17600         * expression.cs: Emit shorter il code for array init.
17601
17602         newarr
17603         dup
17604         // set 1
17605
17606         // set 2
17607
17608         newarr
17609         stloc.x
17610
17611         ldloc.x
17612         // set 1
17613
17614         ldloc.x
17615         // set 2
17616
17617 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17618
17619         * statement.cs: Before, two switch blocks would be merged if the
17620         total size of the blocks (end_item - begin_item + 1) was less than
17621         two times the combined sizes of the blocks.
17622
17623         Now, it will only merge if after the merge at least half of the
17624         slots are filled.
17625
17626         fixes 55885.
17627
17628 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17629
17630         * class.cs : csc build fix for GetMethods(). See bug #52503.
17631
17632 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17633
17634         * expression.cs: Make sure fp comparisons work with NaN.
17635         This fixes bug #54303. Mig approved this patch a long
17636         time ago, but we were not able to test b/c the runtime
17637         had a related bug.
17638
17639 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17642
17643 2004-03-19  Martin Baulig  <martin@ximian.com>
17644
17645         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17646         error here and not in our caller.
17647
17648 2004-03-19  Martin Baulig  <martin@ximian.com>
17649
17650         * interface.cs: Completely killed this file.
17651         (Interface): We're now a TypeContainer and live in class.cs.
17652
17653         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17654         argument; we're now also called for interfaces.
17655         (TypeContainer.DefineMembers): Allow this method being called
17656         multiple times.
17657         (TypeContainer.GetMethods): New public method; formerly known as
17658         Interface.GetMethod().  This is used by PendingImplementation.
17659         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17660         it's now private and non-static.
17661         (Interface): Moved this here; it's now implemented similar to
17662         Class and Struct.
17663         (Method, Property, Event, Indexer): Added `bool is_interface'
17664         argument to their .ctor's.
17665         (MemberBase.IsInterface): New public field.
17666
17667         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17668         instances instead of InterfaceMethod, InterfaceProperty, etc.
17669         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17670         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17671
17672 2004-03-19  Martin Baulig  <martin@ximian.com>
17673
17674         * class.cs (MethodCore.IsDuplicateImplementation): New private
17675         method which does the CS0111 checking.
17676         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17677         Use IsDuplicateImplementation().
17678
17679 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17680
17681         * decl.cs (FindMemberToOverride): New method to find the correct
17682         method or property to override in the base class.
17683         * class.cs
17684             - Make Method/Property use the above method to find the
17685               version in the base class.
17686             - Remove the InheritableMemberSignatureCompare as it is now
17687               dead code.
17688
17689         This patch makes large code bases much faster to compile, as it is
17690         O(n) rather than O(n^2) to do this validation.
17691
17692         Also, it fixes bug 52458 which is that nested classes are not
17693         taken into account when finding the base class member.
17694
17695         Reviewed/Approved by Martin.
17696
17697 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17698
17699         * interface.cs: In all interface classes removed redundant
17700         member initialization.
17701
17702 2004-03-16  Martin Baulig  <martin@ximian.com>
17703
17704         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17705
17706 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17707
17708         * decl.cs (DefineTypeAndParents): New helper method to define a
17709         type's containers before the type itself is defined;  This is a
17710         bug exposed by the recent changes to Windows.Forms when an
17711         implemented interface was defined inside a class that had not been
17712         built yet.   
17713
17714         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17715
17716         (Check): Loop correctly to report errors modifiers
17717         (UNSAFE was not in the loop, since it was the same as TOP).
17718
17719         * interface.cs: Every interface member now takes a ModFlags,
17720         instead of a "is_new" bool, which we set on the base MemberCore. 
17721
17722         Every place where we called "UnsafeOk" in the interface, now we
17723         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17724         the unsafe settings from the member declaration instead of the
17725         container interface. 
17726
17727         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17728
17729         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17730         `set_indexer_name' to the pending bits (one per type).
17731
17732         We fixed a bug today that was picking the wrong method to
17733         override, since for properties the existing InterfaceMethod code
17734         basically ignored the method name.  Now we make sure that the
17735         method name is one of the valid indexer names.
17736
17737 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17738  
17739         * support.cs (SeekableStreamReader): Keep track of stream byte
17740         positions and don't mix them with character offsets to the buffer.
17741
17742         Patch from Gustavo Giráldez
17743
17744 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17745
17746         * interface.cs (InterfaceSetGetBase): Removed double member
17747         initialization, base class does it as well.
17748
17749 2004-03-13  Martin Baulig  <martin@ximian.com>
17750
17751         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17752         when compiling corlib.
17753
17754 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17755
17756         * convert.cs (ExplicitConversion): We were reporting an error on
17757         certain conversions (object_type source to a value type, when the
17758         expression was `null') before we had a chance to pass it through
17759         the user defined conversions.
17760
17761         * driver.cs: Replace / and \ in resource specifications to dots.
17762         Fixes 50752
17763
17764         * class.cs: Add check for duplicate operators.  Fixes 52477
17765
17766 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17767
17768         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17769         that are in the middle of the statements, not only at the end.
17770         Fixes #54987
17771
17772         * class.cs (TypeContainer.AddField): No longer set the
17773         `HaveStaticConstructor' flag, now we call it
17774         `UserDefineStaticConstructor' to diferentiate the slightly
17775         semantic difference.
17776
17777         The situation is that we were not adding BeforeFieldInit (from
17778         Modifiers.TypeAttr) to classes that could have it.
17779         BeforeFieldInit should be set to classes that have no static
17780         constructor. 
17781
17782         See:
17783
17784         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17785
17786         And most importantly Zoltan's comment:
17787
17788         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17789
17790         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17791          before its static fields are used', i.e. initialization does not need
17792          to be triggered by the first access to the type. Setting this flag
17793          helps the JIT to compile better code, since it can run the static
17794          constructor at JIT time, and does not need to generate code to call it
17795          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17796          this flag for lots of classes like String. 
17797          
17798          csc sets this flag if the type does not have an explicit static 
17799          constructor. The reasoning seems to be that if there are only static
17800          initalizers for a type, and no static constructor, then the programmer
17801          does not care when this initialization happens, so beforefieldinit
17802          can be used.
17803          
17804          This bug prevents the AOT compiler from being usable, since it 
17805          generates so many calls to mono_runtime_class_init that the AOT code
17806          is much slower than the JITted code. The JITted code is faster, 
17807          because it does not generate these calls if the vtable is type is
17808          already initialized, which is true in the majority of cases. But the
17809          AOT compiler can't do this."
17810
17811 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17812
17813         * class.cs (MethodData.Emit): Refactor the code so symbolic
17814         information is generated for destructors;  For some reasons we
17815         were taking a code path that did not generate symbolic information
17816         before. 
17817
17818 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17819
17820         * class.cs: Create a Constructor.CheckBase method that
17821         takes care of all validation type code. The method
17822         contains some code that was moved from Define.
17823
17824         It also includes new code that checks for duplicate ctors.
17825         This fixes bug #55148.
17826
17827 2004-03-09  Joshua Tauberer <tauberer@for.net>
17828
17829         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17830         a { ... }-style array creation invokes EmitStaticInitializers
17831         which is not good for reference-type arrays.  String, decimal
17832         and now null constants (NullCast) are not counted toward
17833         static initializers.
17834
17835 2004-03-05  Martin Baulig  <martin@ximian.com>
17836
17837         * location.cs (SourceFile.HasLineDirective): New public field;
17838         specifies whether the file contains or is referenced by a "#line"
17839         directive.
17840         (Location.DefineSymbolDocuments): Ignore source files which
17841         either contain or are referenced by a "#line" directive.        
17842
17843 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17844
17845         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17846         direct access to our parent, so check the method inline there.
17847
17848 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17849
17850         * expression.cs (Invocation.EmitCall): Miguel's last commit
17851         caused a regression. If you had:
17852
17853             T t = null;
17854             t.Foo ();
17855
17856         In Foo the implict this would be null.
17857
17858 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17859
17860         * expression.cs (Invocation.EmitCall): If the method is not
17861         virtual, do not emit a CallVirt to it, use Call.
17862
17863         * typemanager.cs (GetFullNameSignature): Improve the method to
17864         cope with ".ctor" and replace it with the type name.
17865
17866         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17867         as an argument the ConstructorBuilder where it is being defined,
17868         to catch the recursive constructor invocations.
17869
17870 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17871
17872         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17873         routines to check if a type is an enumerable/enumerator allow
17874         classes that implement the IEnumerable or IEnumerator interfaces.
17875
17876         * class.cs (Property, Operator): Implement IIteratorContainer, and
17877         implement SetYields.
17878
17879         (Property.Define): Do the block swapping for get_methods in the
17880         context of iterators.   We need to check if Properties also
17881         include indexers or not.
17882
17883         (Operator): Assign the Block before invoking the
17884         OperatorMethod.Define, so we can trigger the Iterator code
17885         replacement. 
17886
17887         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
17888         Property and Operator classes are not created when we parse the
17889         declarator but until we have the block completed, so we use a
17890         singleton SimpleIteratorContainer.Simple to flag whether the
17891         SetYields has been invoked.
17892
17893         We propagate this setting then to the Property or the Operator to
17894         allow the `yield' to function.
17895
17896 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
17897
17898         * codegen.cs: Implemented attribute support for modules.
17899         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
17900         Assembly/Module functionality.
17901
17902         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
17903         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
17904         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
17905
17906 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
17907
17908         * interface.cs (FindMembers): The operation is performed on all base
17909         interfaces and not only on the first. It is required for future CLS Compliance patch.
17910
17911 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
17912
17913         * statement.cs, codegen.cs:
17914         This patch deals with patterns such as:
17915
17916         public class List : IEnumerable {
17917
17918                 public MyEnumerator GetEnumerator () {
17919                         return new MyEnumerator(this);
17920                 }
17921
17922                 IEnumerator IEnumerable.GetEnumerator () {
17923                         ...
17924                 }
17925                 
17926                 public struct MyEnumerator : IEnumerator {
17927                         ...
17928                 }
17929         }
17930
17931         Before, there were a few things we did wrong:
17932         1) we would emit callvirt on a struct, which is illegal
17933         2) we emited ldarg when we needed to emit ldarga
17934         3) we would mistakenly call the interface methods on an enumerator
17935         type that derived from IEnumerator and was in another assembly. For example:
17936
17937         public class MyEnumerator : IEnumerator
17938
17939         Would have the interface methods called, even if there were public impls of the
17940         method. In a struct, this lead to invalid IL code.
17941
17942 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
17943
17944         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
17945           renamed to Emit.
17946
17947         * delegate.cs (Define): Fixed crash when delegate type is undefined.
17948
17949 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
17950
17951         * cs-parser.jay: Fix small regression: we were not testing V2
17952         compiler features correctly.
17953
17954         * interface.cs: If the emit context is null, then create one
17955
17956 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
17957
17958         * decl.cs (GetSignatureForError): New virtual method to get full name
17959           for error messages.
17960
17961         * attribute.cs (IAttributeSupport): New interface for attribute setting.
17962           Now it is possible to rewrite ApplyAttributes method to be less if/else.
17963
17964         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
17965           Duplicated members and code in these classes has been removed.
17966           Better encapsulation in these classes.
17967
17968 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
17969
17970         * assign.cs (Assign.DoResolve): When dealing with compound
17971         assignments, there is a new rule in ECMA C# 2.4 (might have been
17972         there before, but it is documented here) that states that in:
17973
17974         a op= b;
17975
17976         If b is of type int, and the `op' is a shift-operator, then the
17977         above is evaluated as:
17978
17979         a = (int) a op b 
17980
17981         * expression.cs (Binary.ResolveOperator): Instead of testing for
17982         int/uint/long/ulong, try to implicitly convert to any of those
17983         types and use that in pointer arithmetic.
17984
17985         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
17986         method to print information for from the type, not from the
17987         null-method we were given.
17988
17989 2004-02-01  Duncan Mak  <duncan@ximian.com>
17990
17991         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
17992         parsing for cmd, fixes bug #53694.
17993
17994 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
17995
17996         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
17997         in the member name duplication tests. Property and operator name duplication
17998         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
17999
18000 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18001
18002         * interface.cs (PopulateMethod): Fixed crash when interface method
18003         returns not existing type (error test cs0246-3.cs).
18004
18005 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18006
18007         * cs-parser.jay (interface_accessors): Re-write actions to also
18008         store attributes attached to get and set methods. Fix spelling
18009         while at it.
18010
18011         (inteface_property_declaration): Modify accordingly.
18012
18013         (InterfaceAccessorInfo): New helper class to store information to pass
18014         around between rules that use interface_accessors.
18015
18016         * interface.cs (Emit): Apply attributes on the get and set
18017         accessors of properties and indexers too.
18018
18019         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18020         right MethodBuilder when applying attributes to the get and set accessors.
18021
18022 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18023
18024         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18025
18026 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18027
18028         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18029
18030 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18033         changes that treat `yield' specially when present before `break'
18034         or `return' tokens.
18035
18036         * cs-tokenizer.cs: yield is no longer a keyword.
18037
18038 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18039
18040         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18041         setting for default constructors.
18042         For default constructors are almost every time set wrong Modifier. The
18043         generated IL code has been alright. But inside mcs this values was
18044         wrong and this was reason why several of my CLS Compliance tests
18045         failed.
18046
18047 2004-01-22  Martin Baulig  <martin@ximian.com>
18048
18049         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18050         not a QualifiedIdentifier.  This is what `type_name_expression'
18051         was previously doing.
18052         (type_name_expression): Removed; the code is now in
18053         `namespace_or_type_name'.
18054         (qualified_identifier): Removed, use `namespace_or_type_name'
18055         instead.
18056         (QualifiedIdentifier): Removed this class.      
18057
18058 2004-01-22  Martin Baulig  <martin@ximian.com>
18059
18060         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18061         not a string as alias name.
18062
18063 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18064
18065         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18066         #52730 bug, and instead compute correctly the need to use a
18067         temporary variable when requesting an address based on the
18068         static/instace modified of the field and the constructor.
18069  
18070 2004-01-21  Martin Baulig  <martin@ximian.com>
18071
18072         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18073         class and namespace before looking up aliases.  Fixes #52517.
18074
18075 2004-01-21  Martin Baulig  <martin@ximian.com>
18076
18077         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18078         assinged in a 'try'; fixes exception4.cs.
18079
18080 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18081         * class.cs : Implemented parameter-less constructor for TypeContainer
18082
18083         * decl.cs: Attributes are now stored here. New property OptAttributes
18084
18085         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18086
18087         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18088
18089 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18090
18091         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18092           (CSharpSignature): New method for indexer and property signature.
18093
18094 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18095
18096         * pending.cs (IsVirtualFilter): Faster implementation.
18097
18098 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18099
18100         * typemanager.cs: Avoid inclusion of same assembly more than once.
18101
18102 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18103
18104         * cs-parser.jay: Fixed problem where the last assembly attribute
18105           has been applied also to following declaration (class, struct, etc.)
18106           
18107 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18108
18109         * class.cs: Added error CS0538, CS0539 reporting.
18110         Fixed crash on Microsoft runtime when field type is void.
18111
18112         * cs-parser.jay: Added error CS0537 reporting.
18113
18114         * pending.cs: Added error CS0535 reporting.
18115         Improved error report for errors CS0536, CS0534.
18116
18117 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18118
18119         Merge a few bits from the Anonymous Method MCS tree.
18120
18121         * statement.cs (ToplevelBlock): New class for toplevel methods,
18122         will hold anonymous methods, lifted variables.
18123
18124         * cs-parser.jay: Create toplevel blocks for delegates and for
18125         regular blocks of code. 
18126
18127 2004-01-20  Martin Baulig  <martin@ximian.com>
18128
18129         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18130         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18131         and `NeedExplicitReturn'; added `IsLastStatement'.
18132         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18133         have a `ReturnLabel' or we're not unreachable.
18134
18135         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18136         child's reachability; don't just override ours with it.  Fixes
18137         #58058 (lluis's example).
18138         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18139         InFinally(), InLoop(), InSwitch() and
18140         BreakCrossesTryCatchBoundary() methods.
18141
18142         * statement.cs (Return): Do all error checking in Resolve().
18143         Unless we are the last statement in a top-level block, always
18144         create a return label and jump to it.
18145         (Break, Continue): Do all error checking in Resolve(); also make
18146         sure we aren't leaving a `finally'.
18147         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18148         statement in a top-level block.
18149         (Block.Flags): Added `IsDestructor'.
18150         (Block.IsDestructor): New public property.
18151
18152 2004-01-20  Martin Baulig  <martin@ximian.com>
18153
18154         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18155
18156 2004-01-20  Martin Baulig  <martin@ximian.com>
18157
18158         * statement.cs (Statement.ResolveUnreachable): New public method.
18159         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18160         (Block.Resolve): Resolve unreachable statements.
18161
18162 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18163
18164         * expression.cs: We need to fix the case where we do
18165         not have a temp variable here.
18166
18167         * assign.cs: Only expression compound assignments need
18168         temporary variables.
18169
18170 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18171
18172         * flowanalysis.cs: Reduce memory allocation in a few ways:
18173           - A block with no variables should not allocate a bit
18174             vector for itself.
18175           - A method with no out parameters does not need any tracking
18176             for assignment of the parameters, so we need not allocate
18177             any data for it.
18178           - The arrays:
18179                 public readonly Type[] VariableTypes;
18180                 public readonly string[] VariableNames;
18181             Are redundant. The data is already stored in the variable
18182             map, so we need not allocate another array for it.
18183           - We need to add alot of checks for if (params | locals) == null
18184             due to the first two changes.
18185
18186 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18189         implement IMemoryLocation, we store a copy on a local variable and
18190         take the address of it.  Patch from Benjamin Jemlich
18191
18192         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18193         to use a special "type_name_expression" rule which reduces the
18194         number of "QualifiedIdentifier" classes created, and instead
18195         directly creates MemberAccess expressions.
18196
18197 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18200         that fixes #52853.  Null literal assignment to ValueType
18201
18202         * class.cs (MethodData.Emit): Instead of checking the name of the
18203         method to determine if its a destructor, create a new derived
18204         class from Method called Destructor, and test for that.  
18205
18206         * cs-parser.jay: Create a Destructor object instead of a Method.  
18207
18208         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18209
18210         Fixes: 52933
18211
18212 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18213
18214         * expression.cs (Binary.ResolveOperator): Perform an implicit
18215         conversion from MethodGroups to their delegate types on the
18216         Addition operation.
18217
18218         * delegate.cs: Introduce a new class DelegateCreation that is the
18219         base class for `NewDelegate' and `ImplicitDelegateCreation',
18220         factor some code in here.
18221
18222         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18223         conversion from MethodGroups to compatible delegate types. 
18224
18225         * ecore.cs (Expression.Resolve): Do not flag error 654
18226         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18227         we allow conversions from MethodGroups to delegate types now.
18228
18229         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18230         assignments in v2 either.
18231
18232 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18235         static read-only fields in ctors.
18236
18237         Applied patch from Benjamin Jemlich 
18238
18239         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18240
18241 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18244         here to return true, as they can be used like this:
18245
18246                 (XXX) int.MEMBER ()
18247
18248         Fixed 49836 and all the other dups
18249
18250 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18251
18252         * driver.cs: Implement /win32res and /win32icon.
18253
18254 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * cs-parser.jay: Add a rule to improve error handling for the
18257         common mistake of placing modifiers after the type.
18258
18259 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * cs-parser.jay (interface_event_declaration): Catch
18262         initialization of events on interfaces, and report cs0068
18263
18264         * cs-parser.jay (interface_event_declaration): Catch
18265         initialization of events. 
18266
18267         * ecore.cs: Better report missing constructors.
18268
18269         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18270         the error reporting done in the wrong place.  Fix.
18271
18272         * expression.cs (Binary.ResolveOperator): Catch the 
18273         operator + (E x, E y) error earlier, and later allow for implicit
18274         conversions in operator +/- (E e, U x) from U to the underlying
18275         type of E.
18276
18277         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18278         52596, if the container class is abstract, the default constructor
18279         is protected otherwise its public (before, we were always public).
18280
18281         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18282         fixed statement.
18283
18284         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18285         Jemlich that fixes bug #52597, MCS was generating invalid code for
18286         idisposable structs.   Thanks to Ben for following up with this
18287         bug as well.
18288
18289 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18290
18291         * driver.cs: Allow assemblies without code to be generated, fixes
18292         52230.
18293
18294 2004-01-07  Nick Drochak <ndrochak@gol.com>
18295
18296         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18297
18298 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18299
18300         * cs-parser.jay: Add rules to improve error reporting if fields or
18301         methods are declared at the namespace level (error 116)
18302
18303         * Add rules to catch event add/remove
18304
18305 2004-01-04  David Sheldon <dave-mono@earth.li>
18306
18307   * expression.cs: Added matching ")" to error message for 
18308   CS0077
18309
18310 2004-01-03 Todd Berman <tberman@gentoo.org>
18311
18312         * ecore.cs, attribute.cs:
18313         Applying fix from #52429.
18314
18315 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18316
18317         * ecore.cs, expression.cs, statement.cs:
18318         Total rewrite of how we handle branching. We
18319         now handle complex boolean expressions with fewer
18320         jumps. As well if (x == 0) no longer emits a ceq.
18321
18322         if (x is Foo) is much faster now, because we generate
18323         better code.
18324
18325         Overall, we get a pretty big improvement on our benchmark
18326         tests. The code we generate is smaller and more readable.
18327
18328         I did a full two-stage bootstrap. The patch was reviewed
18329         by Martin and Miguel.
18330
18331 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18332
18333         * cs-parser.jay: Make primary_expression not take a QI.
18334         we dont need this because the member_access rule covers
18335         us here. So we replace the rule with just IDENTIFIER.
18336
18337         This has two good effects. First, we remove a s/r conflict.
18338         Second, we allocate many fewer QualifiedIdentifier objects.
18339
18340 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18341
18342         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18343         set the correct information via SRE. This prevents
18344         hanging on the MS runtime. Fixes #29374.
18345
18346 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18347
18348         * convert.cs: correctly handle conversions to value types
18349         from Enum and ValueType as unboxing conversions.
18350
18351         Fixes bug #52569. Patch by Benjamin Jemlich.
18352
18353 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18354
18355         * expression.cs (BetterConversion): Prefer int -> uint
18356         over int -> ulong (csc's behaviour). This fixed bug #52046.
18357
18358 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18359
18360         * decl.cs (MemberCache.FindMembers): now returns a
18361         MemberInfo [].
18362
18363         * typemanager.cs: In general, go with with ^^.
18364         (CopyNewMethods): take an IList.
18365         (RealMemberLookup): Only allocate an arraylist
18366         if we copy from two sets of methods.
18367
18368         This change basically does two things:
18369         1) Fewer array lists allocated due to CopyNewMethods.
18370         2) the explicit cast in MemberList costed ALOT.
18371
18372 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18373
18374         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18375         a hashtable to avoid needless string allocations when an identifier is
18376         used more than once (the common case).
18377
18378 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18379
18380         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18381         is broken, it will not return anything. So, we
18382         have to use the information we have in mcs to
18383         do the task.
18384
18385         * typemanager.cs: Add a cache for GetInterfaces,
18386         since this will now be used more often (due to ^^)
18387
18388         (GetExplicitInterfaces) New method that gets the
18389         declared, not effective, interfaces on a type
18390         builder (eg, if you have interface IFoo, interface
18391         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18392         { IBar }.
18393
18394         This patch makes MCS able to bootstrap itself on
18395         Windows again.
18396
18397 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18398
18399         * expression.cs: Remove the Nop's that Miguel put
18400         in by mistake.
18401
18402 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18403
18404         * report.cs, codegen.cs: Give the real stack trace to
18405         the error when an exception is thrown.
18406
18407 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18408
18409         * decl.cs: only allocate hashtables for ifaces if 
18410         it is an iface!
18411
18412 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18413
18414         * expression.cs: fix the error from cs0121-2.cs
18415         (a parent interface has two child interfaces that
18416         have a function with the same name and 0 params
18417         and the function is called through the parent).
18418
18419 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18420
18421         * class.cs, rootcontext.cs, typmanager.cs: do not
18422         leak pointers.
18423
18424 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18425
18426         * codegen.cs: remove stack for the ec flow branching.
18427         It is already a linked list, so no need.
18428
18429 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18430
18431         * Makefile: Allow custom profiler here.
18432
18433 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18434
18435         * typemanager.cs (LookupType):
18436           - Use a static char [], because split takes
18437             a param array for args, so it was allocating
18438             every time.
18439           - Do not store true in a hashtable, it boxes.
18440
18441 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18442
18443         * flowanalysis.cs: bytify common enums.
18444
18445 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18446
18447         * modifiers.cs: Add a new set of flags for the
18448         flags allowed on explicit interface impls.
18449         * cs-parser.jay: catch the use of modifiers in
18450         interfaces correctly.
18451         * class.cs: catch private void IFoo.Blah ().
18452
18453         All related to bug #50572.
18454
18455 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18456
18457         * decl.cs: Rewrite the consistant accessability checking.
18458         Accessability is not linear, it must be implemented in
18459         a tableish way. Fixes #49704.
18460
18461 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18462
18463         * expression.cs: Handle negation in a checked context.
18464         We must use subtraction from zero. Fixes #38674.
18465
18466 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18467
18468         * class.cs: Ignore static void main in DLLs.
18469         * rootcontext.cs: Handle the target type here,
18470         since we are have to access it from class.cs
18471         * driver.cs: account for the above.
18472
18473 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18474
18475         * report.cs: Give line numbers and files if available.
18476
18477 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18478
18479         * driver.cs: Implement /addmodule.
18480
18481         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18482         ModuleBuilders.
18483
18484 2003-12-20  Martin Baulig  <martin@ximian.com>
18485
18486         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18487         (FieldBase.IsAssigned): Removed this field.
18488         (FieldBase.SetAssigned): New public method.
18489         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18490
18491 2003-12-20  Martin Baulig  <martin@ximian.com>
18492
18493         * expression.cs (LocalVariableReference.DoResolve): Don't set
18494         `vi.Used' if we're called from DoResolveLValue().
18495
18496         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18497         returns the usage vector it just merged into the current one -
18498         pass this one to UsageWarning().
18499         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18500         of the `EmitContext', don't call this recursively on our children.
18501
18502 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18503
18504         * driver.cs: Implement /target:module.
18505
18506 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18507
18508         * support.cs (CharArrayHashtable): New helper class.
18509
18510         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18511         char arrays, not strings, so we can avoid creating a string in
18512         consume_identifier if the identifier is a keyword.
18513
18514 2003-12-16  Martin Baulig  <martin@ximian.com>
18515
18516         * statement.cs (LocalInfo.Assigned): Removed this property.
18517         (LocalInfo.Flags): Removed `Assigned'.
18518         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18519         and uses flow analysis.
18520         (Block.UsageWarning): Made this method private.
18521         (Block.Resolve): Call UsageWarning() if appropriate.
18522
18523         * expression.cs (LocalVariableReference.DoResolve): Always set
18524         LocalInfo.Used here.
18525
18526 2003-12-13  Martin Baulig  <martin@ximian.com>
18527
18528         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18529         any value here; we're now using flow analysis to figure out
18530         whether a statement/block returns a value.
18531
18532 2003-12-13  Martin Baulig  <martin@ximian.com>
18533
18534         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18535         working again.
18536         (FlowBranching.MergeFinally): Don't call
18537         `branching.CheckOutParameters()' here, this is called in
18538         MergeTopBlock().
18539         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18540         when adding the `finally' vector.       
18541
18542 2003-12-13  Martin Baulig  <martin@ximian.com>
18543
18544         * flowanalysis.cs
18545         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18546         actually work and also fix #48962.
18547
18548 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18549
18550         * decl.cs: Do not check System.Object for nested types,
18551         since we know it does not have any. Big bang for buck:
18552
18553         BEFORE:
18554            Run 1:   8.35 seconds
18555            Run 2:   8.32 seconds
18556            corlib:  17.99 seconds
18557         AFTER:
18558            Run 1:   8.17 seconds
18559            Run 2:   8.17 seconds
18560            corlib:  17.39 seconds
18561
18562 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18563
18564         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18565         time we are returning 0 members, so we save alot here.
18566
18567 2003-12-11  Martin Baulig  <martin@ximian.com>
18568
18569         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18570         `MergeChild()', also just take the `FlowBranching' as argument;
18571         call Merge() on it and return the result.
18572         (FlowBranching.Merge): We don't need to do anything if we just
18573         have one sibling.
18574
18575 2003-12-11  Martin Baulig  <martin@ximian.com>
18576
18577         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18578         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18579         Maurer for this idea.
18580
18581 2003-12-11  Martin Baulig  <martin@ximian.com>
18582
18583         * flowanalysis.cs (MergeResult): This class is now gone; we now
18584         use the `UsageVector' for this.  The reason for this is that if a
18585         branching just has one sibling, we don't need to "merge" them at
18586         all - that's the next step to do.
18587         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18588         `MergeResult'.
18589
18590 2003-12-11  Martin Baulig  <martin@ximian.com>
18591
18592         Reworked flow analyis and made it more precise and bug-free.  The
18593         most important change is that we're now using a special `Reachability'
18594         class instead of having "magic" meanings of `FlowReturns'.  I'll
18595         do some more cleanups and optimizations and also add some more
18596         documentation this week.
18597
18598         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18599         largely reworked this class.
18600         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18601         the new `Reachability' class instead of having "magic" values here.
18602         (FlowBranching): We're now using an instance of `Reachability'
18603         instead of having separate `Returns', `Breaks' etc. fields.
18604
18605         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18606         based on flow analysis; ignore the return value of block.Emit ().
18607
18608 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18609
18610         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18611         if they are private.
18612
18613 2003-12-09  Martin Baulig  <martin@ximian.com>
18614
18615         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18616         call them directly on the UsageVector.
18617
18618 2003-12-09  Martin Baulig  <martin@ximian.com>
18619
18620         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18621         Changed return type from `FlowReturns' to `Reachability'.
18622
18623 2003-12-09  Martin Baulig  <martin@ximian.com>
18624
18625         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18626         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18627         `Reachable' fields with a single `Reachability' one.
18628
18629 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18630
18631         * class.cs (FindMembers): Remove foreach's.
18632
18633         Bootstrap times:
18634
18635         BEFORE
18636                 Run 1:   8.74 seconds
18637                 Run 2:   8.71 seconds
18638
18639         AFTER
18640                 Run 1:   8.64 seconds
18641                 Run 2:   8.58 seconds
18642
18643
18644 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18645
18646         * cs-parser.jay:
18647         * gen-treedump.cs:
18648         * statement.cs:
18649         This patch does a few things:
18650                 1. EmptyStatement is now a singleton, so it is never reallocated.
18651                 2. All blah is EmptyStatement constructs have been changed to
18652                    blah == EmptyStatement.Value, which is much faster and valid
18653                    now that EmptyStatement is a singleton.
18654                 3. When resolving a block, rather than allocating a new array for
18655                    the non-empty statements, empty statements are replaced with
18656                    EmptyStatement.Value
18657                 4. Some recursive functions have been made non-recursive.
18658         Mainly the performance impact is from (3), however (1) and (2) are needed for
18659         this to work. (4) does not make a big difference in normal situations, however
18660         it makes the profile look saner.
18661
18662         Bootstrap times:
18663
18664         BEFORE
18665         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18666         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18667         Total memory allocated: 56397 KB
18668
18669         AFTER
18670         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18671         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18672         Total memory allocated: 55666 KB
18673
18674 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18675
18676         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18677         than the hashtable in a hashtable version
18678
18679         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18680         we always end up concating a string. This results in a huge perf
18681         loss, because many strings have to be tracked by the GC. In this
18682         patch, we first use a hashtable that works with two keys, so that
18683         the strings do not need to be concat'ed.
18684
18685         Bootstrap times:
18686         BEFORE
18687                 Run 1:   8.74 seconds
18688                 Run 2:   8.71 seconds
18689
18690         AFTER
18691                 Run 1:   8.65 seconds
18692                 Run 2:   8.56 seconds
18693
18694 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18695
18696         * Makefile: Add a new target `do-time' that does a quick and simple
18697         profile, leaving easy to parse output.
18698
18699 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18700
18701         * codegen.cs (Init): Create the dynamic assembly with 
18702         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18703
18704 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18705
18706         * support.cs: Make the PtrHashtable use only one
18707         instance of its comparer.
18708
18709 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18710
18711         * typemanager.cs: Fix lookup of GetNamespaces.
18712
18713 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18714
18715         * expression.cs: Removed redundant line.
18716
18717         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18718         ArrayLists, use for loops with bounds.  
18719
18720         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18721         arraylist.
18722
18723         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18724         arraylists, use for loop with bounds.
18725
18726         The above three changes give us a 0.071 second performance
18727         improvement out of 3.294 seconds down to 3.223.  On my machine
18728         the above changes reduced the memory usage by 1,387 KB during
18729         compiler bootstrap.
18730
18731         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18732         QualifiedIdentifiers.  Before we created a new string through
18733         concatenation, and mostly later on, the result would be
18734         manipulated by DecomposeQI through string manipulation.
18735
18736         This reduced the compiler memory usage for bootstrapping from
18737         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18738         compile times in 0.05 seconds.
18739
18740 2003-11-28  Dick Porter  <dick@ximian.com>
18741
18742         * support.cs: Do string compares with the Invariant culture.
18743
18744         * rootcontext.cs: 
18745         * gen-treedump.cs: 
18746         * expression.cs: 
18747         * driver.cs: 
18748         * decl.cs: 
18749         * codegen.cs: 
18750         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18751         the comparison is done with the Invariant culture.
18752
18753 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18756         GetEnumerator method.
18757
18758         (ProbeCollectionType): Iterate starting at the most specific type
18759         upwards looking for a GetEnumerator
18760
18761         * expression.cs: Shift count can be up to 31 for int/uint and 63
18762         for long/ulong.
18763
18764 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18765
18766         * statement.cs (Block.LookupLabel): Also look for the label on the
18767         children blocks.  Use a hash table to keep track of visited
18768         nodes. 
18769
18770         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18771         we actually did transform the other operand, otherwise fall back
18772         to the common codepath that casts to long.
18773
18774         * cs-tokenizer.cs: Use the same code pattern as the int case.
18775         Maybe I should do the parsing myself, and avoid depending on the
18776         Parse routines to get this done.
18777
18778 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18781         which fixes bug 51347.  This time test it.
18782
18783         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18784         attributes for example can not tell the difference between these.
18785         The difference was only a syntax feature of the language. 
18786
18787         * attribute.cs: Apply attributes to delegates.
18788
18789         * delegate.cs: Call the apply attributes method.
18790
18791 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18792
18793         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18794         comparing 0 vs Byte.MinValue, not the value
18795
18796         (ImplicitConversionRequired): When reporting a conversion error,
18797         use error 31 to print out the constant error instead of the
18798         simpler 29.
18799
18800         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18801         which fixes bug 51347.
18802
18803 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18804
18805         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18806         which fixes the -warnaserror command line option.
18807
18808 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * cfold.cs (DoNumericPromotions): During constant folding of
18811         additions on UIntConstant, special case intconstants with
18812         IntConstants like we do on the expression binary operator. 
18813
18814 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * convert.cs (ImplicitReferenceConversion): We were missing a case
18817         (System.Enum are not value types or class types, so we need to
18818         classify them separatedly).
18819
18820         * driver.cs: We do not support error 2007.
18821
18822 2003-11-12 Jackson Harper <jackson@ximian.com>
18823
18824         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18825         system directory. Also use the full file name so users can
18826         libraries names mscorlib-o-tron.dll in a non system dir.
18827
18828 2003-11-10  Martin Baulig  <martin@ximian.com>
18829
18830         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18831         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18832         calling `ResolveType()' on them, directly assign their `Type'.
18833
18834 2003-11-08  Martin Baulig  <martin@ximian.com>
18835
18836         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18837         return value and the `out parent' parameter.
18838         (TypeContainer.DefineType): Moved the CS0644 check into
18839         GetClassBases().  Don't pass the interface types to the
18840         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18841         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18842
18843         * ecore.cs (TypeExpr.IsAttribute): New property.
18844         (TypeExpr.GetInterfaces): New method.
18845
18846         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18847         TypeExpr instead of a Type.
18848         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18849         (Interface.DefineType): Don't pass the interface types to the
18850         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18851         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18852
18853         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18854         instead of a `Type[]'.
18855         (TypeManager.RegisterBuilder): Likewise.
18856         (TypeManager.AddUserInterface): Likewise.
18857         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18858         `Type[]' and also return a `TypeExpr[]'.
18859         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18860
18861 2003-11-08  Martin Baulig  <martin@ximian.com>
18862
18863         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18864         Expression.     
18865
18866 2003-11-08  Martin Baulig  <martin@ximian.com>
18867
18868         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18869         TypeManager.ResolveExpressionTypes().
18870
18871         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18872         instead of an Expression.
18873         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18874         (TypeExpression): New public class; formerly known as `TypeExpr'.
18875
18876         * expression.cs (ComposedCast): Derive from TypeExpr.
18877
18878         * typemanager.cs (TypeManager.system_*_expr): These are now
18879         TypExpr's instead of Expression's.
18880         (TypeManager.ResolveExpressionTypes): New public static function;
18881         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18882         of them.        
18883
18884 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * expression.cs (New.DoResolve): Do not dereference value that
18887         might be a null return.
18888
18889         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
18890         sure that the constant value has the right type.  Fixes an
18891         unreported bug, similar to 50425.
18892
18893         * const.cs (Const.LookupConstantValue): Call
18894         ImplicitStandardConversionExists before doing a conversion to
18895         avoid havng the TypeManager.ChangeType do conversions.
18896
18897         Reduced the number of casts used
18898
18899         (Const.ChangeType): New routine to enable reuse of the constant
18900         type changing code from statement.
18901
18902         * typemanager.cs (ChangeType): Move common initialization to
18903         static global variables.
18904
18905         Fixes #50425.
18906
18907         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
18908         every value type to go through, even if it was void.  Fix that. 
18909
18910         * cs-tokenizer.cs: Use is_identifier_start_character on the start
18911         character of the define, and the is_identifier_part_character for
18912         the rest of the string.
18913
18914 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
18915
18916         * expression.cs (UnaryMutator.EmitCode): When I updated
18917         LocalVariableReference.DoResolve, I overdid it, and dropped an
18918         optimization done on local variable references.
18919
18920 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
18921
18922         * ecore.cs: Convert the return from Ldlen into an int.
18923
18924 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
18927         the accessibility, this is a special case for toplevel non-public
18928         classes (internal for instance).
18929
18930 2003-10-20  Nick Drochak <ndrochak@gol.com>
18931
18932         * ecore.cs: Fix typo and build.  Needed another right paren.
18933
18934 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
18935
18936         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
18937         `internal' case regular and protected, but not allowing protected
18938         to be evaluated later.  Bug 49840
18939
18940 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
18943         to kb.Nlast, and not the kb.nFirst to isolate the switch
18944         statement.
18945
18946         Extract the underlying type, so enumerations of long/ulong are
18947         treated like long/ulong.
18948
18949 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
18950
18951         * expression.cs (New): Overload the meaning of RequestedType to
18952         track the possible creation of the NewDelegate type, since
18953         DoResolve is invoked more than once for new constructors on field
18954         initialization.
18955
18956         See bugs: #48800 and #37014
18957
18958         * cs-parser.jay (declare_local_constants): Take an arraylist
18959         instead of a single constant.
18960
18961         (local_constant_declaration): It should take a
18962         constant_declarators, not a constant_declarator.  Fixes 49487
18963
18964         * convert.cs: Fix error report.
18965
18966 2003-10-13 Jackson Harper <jackson@ximian.com>
18967
18968         * typemanager.cs (TypeToCoreType): Add float and double this fixes
18969         bug #49611
18970
18971 2003-10-09  Martin Baulig  <martin@ximian.com>
18972
18973         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
18974         to the .ctor.
18975         (MethodCore.DoDefineParameters): Removed the TypeContainer
18976         argument; use the DeclSpace which was passed to the .ctor instead.
18977         (MethodCore.CheckParameter): Take a DeclSpace instead of a
18978         TypeContainer; we only need a DeclSpace here.
18979
18980 2003-10-09  Martin Baulig  <martin@ximian.com>
18981
18982         * class.cs (MethodData): Added additional `DeclSpace ds' argument
18983         to the .ctor.
18984         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
18985         EmitContext's .ctor.    
18986
18987 2003-10-09  Martin Baulig  <martin@ximian.com>
18988
18989         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
18990         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
18991         AsAccessible(), moved them as well.
18992
18993         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
18994
18995 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
18996
18997         * cs-parser.jay : Renamed yyName to yyNames related to jay.
18998
18999 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19002         generation for >=, as spotted by Paolo, bug 48679.  
19003         Patch from David Waite.
19004
19005         * cs-tokenizer.cs: Add handling for #pragma.
19006
19007         * cs-parser.jay: Allow for both yield and yield return in the
19008         syntax.  The anti-cobolization of C# fight will go on!
19009
19010         * class.cs (TypeBuilder.DefineType): Catch error condition here
19011         (Parent.DefineType erroring out and returning null).
19012
19013         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19014         coping with enumerations variables, we were mistakenly processing
19015         them as a regular value type instead of built-in types.  Fixes the
19016         bug #48063
19017
19018         * typemanager.cs (IsBuiltinOrEnum): New method.
19019
19020 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19021
19022         * cs-parser.jay: Upgrade: yield now needs the return clause.
19023
19024 2003-09-19  Martin Baulig  <martin@ximian.com>
19025
19026         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19027         `MemberCache parent' argument.  Normally, an interface doesn't
19028         have a parent type except System.Object, but we use this in gmcs
19029         for generic type parameters.
19030
19031 2003-09-18  Martin Baulig  <martin@ximian.com>
19032
19033         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19034         on `type.IsInterface'; don't check whether the type has a parent
19035         to determine whether it's an interface.
19036
19037 2003-09-15  Martin Baulig  <martin@ximian.com>
19038
19039         * class.cs (TypeContainer.DefineType): Added an error flag to
19040         avoid reporting duplicate CS0146's ("class definition is
19041         circular.").
19042
19043         * driver.cs (Driver.MainDriver): Abort if
19044         RootContext.ResolveTree() reported any errors.
19045
19046 2003-09-07  Martin Baulig  <martin@ximian.com>
19047
19048         * report.cs (Error, Warning): Added overloaded versions which take
19049         a `params object[] args' and call String.Format().
19050
19051 2003-09-07  Martin Baulig  <martin@ximian.com>
19052
19053         * decl.cs (DeclSpace..ctor): Don't call
19054         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19055         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19056         (DeclSpace.RecordDecl): New method.
19057
19058         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19059
19060 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19061
19062         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19063         value attributes to be applied to ParameterBuilders.
19064
19065         * class.cs (MethodCore.LabelParameters): Make static and more
19066         generic so that it can be used from other places - like interface
19067         methods, for instance.
19068
19069         * interface.cs (Interface.Emit): Call LabelParameters before
19070         emitting attributes on the InterfaceMethod.
19071
19072 2003-08-26  Martin Baulig  <martin@ximian.com>
19073
19074         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19075         resolving aliases; fixes #47927.
19076
19077 2003-08-26  Martin Baulig  <martin@ximian.com>
19078
19079         * statement.cs (Using.DoResolve): This is internally emitting a
19080         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19081         do not always return.  Fixes #47681.
19082
19083 2003-08-26  Martin Baulig  <martin@ximian.com>
19084
19085         * decl.cs (MemberCore): Moved WarningNotHiding(),
19086         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19087         into MemberBase.
19088         (AdditionResult): Make this nested in DeclSpace.
19089         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19090         argument; call NamespaceEntry.Define() unless we're nested in a
19091         class or struct.
19092
19093         * namespace.cs (Namespace.DefineName): New public function.  This
19094         is called from DeclSpace's .ctor to add 
19095         (Namespace.Lookup): Include DeclSpaces in the lookup.
19096
19097         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19098
19099         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19100
19101 2003-08-25  Martin Baulig  <martin@ximian.com>
19102
19103         * convert.cs (Convert.ExplicitReferenceConversion): When
19104         converting from an interface type to a class, unbox if the target
19105         type is a struct type.  Fixes #47822.
19106
19107 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19108
19109         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19110         #47854.
19111
19112 2003-08-22  Martin Baulig  <martin@ximian.com>
19113
19114         * class.cs (TypeManager.DefineType): When defining a nested type,
19115         call DefineType() on our parent; fixes #47801.
19116
19117 2003-08-22  Martin Baulig  <martin@ximian.com>
19118
19119         * class.cs (MethodData.Define): While checking if a method is an
19120         interface implementation, improve the test a bit more to fix #47654.
19121
19122 2003-08-22  Martin Baulig  <martin@ximian.com>
19123
19124         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19125         correctly; fixes #47722.
19126
19127 2003-08-22  Martin Baulig  <martin@ximian.com>
19128
19129         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19130         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19131
19132         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19133
19134 2003-08-22  Martin Baulig  <martin@ximian.com>
19135
19136         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19137         can only be assigned in static constructors.  Fixes #47161.
19138
19139 2003-08-22  Martin Baulig  <martin@ximian.com>
19140
19141         Rewrote and improved the flow analysis code.
19142
19143         * flowbranching.cs (FlowBranching): Make this class abstract.
19144         (FlowBranching.CreateBranching): New static function to create a
19145         new flow branching.
19146         (FlowBranchingBlock, FlowBranchingException): New classes.
19147         (FlowBranching.UsageVector.Type): New public readonly field.
19148         (FlowBranching.UsageVector.Breaks): Removed the setter.
19149         (FlowBranching.UsageVector.Returns): Removed the setter.
19150         (FlowBranching.UsageVector): Added Break(), Return(),
19151         NeverReachable() and Throw() methods to modify the reachability.
19152         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19153         done by FlowBranching.Merge().
19154         (FlowBranching.UsageVector.MergeChild): New method; merges the
19155         merge result into the current vector.
19156         (FlowBranching.Merge): New abstract method to merge a branching.
19157
19158 2003-08-12  Martin Baulig  <martin@ximian.com>
19159
19160         * expression.cs (Indirection.CacheTemporaries): Create the
19161         LocalTemporary with the pointer type, not its element type.
19162
19163 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19164
19165         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19166         token was a keyword or not.
19167
19168         Add `error' options where an IDENTIFIER was expected;  Provide
19169         CheckToken and CheckIdentifierToken convenience error reporting
19170         functions. 
19171
19172         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19173
19174         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19175         NameSpaceEntry NameSpaceEntry.
19176
19177         (LookupInterfaceOrClass): Avoid creating a full qualified name
19178         from namespace and name: avoid doing lookups when we know the
19179         namespace is non-existant.   Use new Tree.LookupByNamespace which
19180         looks up DeclSpaces based on their namespace, name pair.
19181
19182         * driver.cs: Provide a new `parser verbose' to display the
19183         exception thrown during parsing.  This is turned off by default
19184         now, so the output of a failure from mcs is more graceful.
19185
19186         * namespace.cs: Track all the namespaces defined in a hashtable
19187         for quick lookup.
19188
19189         (IsNamespace): New method
19190
19191 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19192
19193         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19194         we know that we need to concatenate (full typename can never be
19195         null). 
19196
19197         * class.cs: ditto.
19198
19199         * statement.cs: Use a bitfield;  Do not initialize to null things
19200         which are done by the constructor by default.
19201
19202         * cs-parser.jay: bug fix, parameter was 4, not 3.
19203
19204         * expression.cs: Just use the property;
19205
19206         * statement.cs: No need for GetVariableInfo method.
19207
19208 2003-08-08  Martin Baulig  <martin@ximian.com>
19209
19210         * flowanalysis.cs (FlowReturns): This is now nested in the
19211         `FlowBranching' class.
19212         (MyBitVector): Moved this here from statement.cs.
19213         (FlowBranching.SiblingType): New enum type.
19214         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19215
19216 2003-08-07  Martin Baulig  <martin@ximian.com>
19217
19218         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19219         `FlowBranching' class and called `BranchingType'.
19220
19221 2003-08-07  Martin Baulig  <martin@ximian.com>
19222
19223         * flowanalysis.cs: Moved all the control flow analysis code into
19224         its own file.
19225
19226 2003-08-07  Martin Baulig  <martin@ximian.com>
19227
19228         * assign.cs (Assign.DoResolve): `target' must either be an
19229         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19230         #37319.
19231
19232 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19233
19234         * expression.cs (BinaryMethod): This kind of expression is created by the
19235         Binary class if it determines that the operator has to be handled
19236         by a method.
19237
19238         (BinaryDelegate): This kind of expression is created if we are
19239         dealing with a + or - operator on delegates.
19240
19241         (Binary): remove method, argumetns, and DelegateOperator: when
19242         dealing with methods, 
19243
19244         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19245
19246         * statement.cs (Block): use bitfields for the three extra booleans
19247         we had in use.   Remove unused topblock parameter.
19248
19249         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19250
19251         * assign.cs: Drop extra unneeded tests.
19252
19253 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19254
19255         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19256
19257         * statement.cs (Foreach): Use VariableStorage instead of
19258         LocalBuilders.   
19259
19260         * codegen.cs (VariableStorage): New class used by clients that
19261         require a variable stored: locals or fields for variables that
19262         need to live across yield.
19263
19264         Maybe provide a convenience api for EmitThis+EmitLoad?
19265
19266         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19267         these bad boys.
19268
19269 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19272         RemapParameterLValue): New methods that are used to turn a
19273         precomputed FieldInfo into an expression like this:
19274
19275                 instance.FieldInfo
19276
19277         The idea is to use this instead of making LocalVariableReference
19278         have more than one meaning.
19279
19280         * cs-parser.jay: Add error production to BASE.
19281
19282         * ecore.cs: Deal with TypeManager.GetField returning null, which
19283         is now a valid return value.
19284
19285         (FieldExprNoAddress): New expression for Fields whose address can
19286         not be taken.
19287
19288         * expression.cs (LocalVariableReference): During the resolve
19289         phases, create new expressions if we are in a remapping context.
19290         Remove code that dealt with remapping here.
19291
19292         (ParameterReference): same.
19293
19294         (ProxyInstance): New expression, like the `This' expression, but
19295         it is born fully resolved.  We know what we are doing, so remove
19296         the errors that are targeted to user-provided uses of `this'.
19297
19298         * statement.cs (Foreach): our variable is now stored as an
19299         Expression;  During resolution, follow the protocol, dont just
19300         assume it will return this.
19301
19302 2003-08-06  Martin Baulig  <martin@ximian.com>
19303
19304         * support.cs (SeekableStreamReader.cs): New public class.
19305
19306         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19307         SeekableStreamReader instead of the normal StreamReader.
19308
19309 2003-08-04  Martin Baulig  <martin@ximian.com>
19310
19311         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19312         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19313         deambiguate casts and delegate invocations.
19314         (parenthesized_expression): Use the new tokens to ensure this is
19315         not a cast of method invocation.
19316
19317         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19318         when reading a `)' and Deambiguate_CloseParens () was previously
19319         called.
19320
19321         * expression.cs (ParenthesizedExpression): New class.  This is
19322         just used for the CS0075 test.
19323         (Binary.DoResolve): Check for CS0075.   
19324
19325 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19326
19327         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19328         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19329         reference comparison.
19330
19331         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19332         examine the ReturnType for equality - this is necessary in the
19333         cases of implicit and explicit operators whose signature also
19334         includes the return type.
19335
19336 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * namespace.cs: Cache the result of the namespace computation,
19339         instead of computing it every time.
19340
19341 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * decl.cs: Use a global arraylist that we reuse over invocations
19344         to avoid excesive memory consumption.  Reduces memory usage on an
19345         mcs compile by one meg (45 average).
19346
19347         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19348         private, work around that.
19349
19350 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * literal.cs (IntLiteral): Define Zero and One static literals. 
19353
19354         * cs-parser.jay (integer_literal): use static literals to reduce
19355         memory usage for the most used literals (0, 1 and -1).  211kb
19356         reduced in memory usage.
19357
19358         Replace all calls to `new ArrayList' with `new
19359         ArrayList(4)' which is a good average number for most allocations,
19360         and also requires only 16 bytes of memory for its buffer by
19361         default. 
19362
19363         This reduced MCS memory usage in seven megabytes for the RSS after
19364         bootstrapping.
19365
19366 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19367
19368         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19369         handle params methods the correct way by forming only one
19370         applicable set with params and normal methods in them. Earlier we
19371         were looking at params methods only if we found no normal methods
19372         which was not the correct thing to do.
19373
19374         (Invocation.BetterFunction): Take separate arguments indicating
19375         when candidate and the best method are params methods in their
19376         expanded form.
19377
19378         This fixes bugs #43367 and #46199.
19379
19380         * attribute.cs: Documentation updates.
19381
19382         (CheckAttribute): Rename to CheckAttributeTarget.
19383         (GetValidPlaces): Rename to GetValidTargets.
19384
19385         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19386         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19387
19388         Fixes bug #44468.
19389
19390 2003-07-28  Martin Baulig  <martin@ximian.com>
19391
19392         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19393         name when looking up the base class of a nested class.  Fixes #46977.
19394
19395 2003-07-26  Martin Baulig  <martin@ximian.com>
19396
19397         * expression.cs (Indexers.Indexer): New nested struct; contains
19398         getter, setter and the indexer's type.
19399         (Indexers.Properties): This is now an ArrayList of
19400         Indexers.Indexer's.
19401         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19402         indexer doesn't have any getters.
19403
19404         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19405         for embedded property and indexer assignments.
19406
19407 2003-07-26  Martin Baulig  <martin@ximian.com>
19408
19409         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19410         preprocessor directive is not the first non-whitespace character
19411         on a line.
19412
19413 2003-07-26  Martin Baulig  <martin@ximian.com>
19414
19415         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19416         namespace parsing, follow the spec more closely.
19417
19418         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19419         NamespaceEntry.Lookup().
19420
19421 2003-07-25  Martin Baulig  <martin@ximian.com>
19422
19423         * MethodCore.cs (OverridesSomething): New public field; it's set
19424         from TypeContainer.DefineMembers if this method overrides
19425         something (which doesn't need to be a method).  Fix #39462.
19426
19427 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19428
19429         * typemanager.cs (GetMembers): Ensure that the list of members is
19430         reversed. This keeps things in sync.
19431
19432         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19433         find an AttributeUsage attribute.
19434
19435         * expression.cs (Invocation.OverloadResolve): Perform the check
19436         which disallows Invoke to be directly called on a Delegate.
19437
19438         (Error_InvokeOnDelegate): Report error cs1533.
19439
19440 2003-07-25  Martin Baulig  <martin@ximian.com>
19441
19442         * expression.cs (Indexers.GetIndexersForType): Only look in the
19443         interface hierarchy if the requested type is already an
19444         interface.  Fixes #46788 while keeping #46502 fixed.
19445
19446 2003-07-25  Martin Baulig  <martin@ximian.com>
19447
19448         * class.cs (TypeContainer.DefineMembers): Check whether all
19449         readonly fields have been assigned and report warning CS0649 if
19450         not.
19451
19452         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19453         a valuetype.
19454
19455 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19456
19457         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19458         returned from GetMethods to make things consistent with the
19459         assumptions MCS makes about ordering of methods.
19460
19461         This should comprehensively fix bug #45127 and it does :-)
19462
19463         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19464         ordering is actually reverse.
19465
19466         * Clean up some debug messages I left lying around.
19467
19468         * interface.cs (Populate*): Get rid of code which emits attributes
19469         since the stage in which we emit attributes is the 'Emit' stage,
19470         not the define stage.
19471
19472         (Emit): Move attribute emission for interface members here.
19473
19474 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19475
19476         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19477         closely: we eliminate methods in base types when we have an
19478         applicable method in a top-level type.
19479
19480         Please see section 14.5.5.1 for an exact description of what goes
19481         on. 
19482
19483         This fixes bug #45127 and a host of other related to corlib compilation.
19484
19485         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19486         array is the method corresponding to the top-level type (this is
19487         because of the changes made to icall.c) so we change this
19488         accordingly.
19489
19490         (MethodGroupExpr.Name): This too.
19491
19492         * typemanager.cs (GetElementType): New method which does the right
19493         thing when compiling corlib. 
19494
19495         * everywhere: Make use of the above in the relevant places.
19496
19497 2003-07-22  Martin Baulig  <martin@ximian.com>
19498
19499         * cs-parser.jay (invocation_expression): Moved
19500         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19501         `cast_expression', but create a InvocationOrCast which later
19502         resolves to either an Invocation or a Cast.
19503
19504         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19505         method; call this before EmitStatement() to make sure that this
19506         expression can be used as a statement.
19507
19508         * expression.cs (InvocationOrCast): New class; resolves to either
19509         an Invocation or a Cast.
19510
19511         * statement.cs (StatementExpression): Call ResolveStatement() on
19512         the ExpressionStatement before emitting it.
19513
19514 2003-07-21  Martin Baulig  <martin@ximian.com>
19515
19516         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19517         `ref' and `out' attributes match; fixes #46220.
19518         (MemberAccess.ResolveMemberAccess): You can't reference a type
19519         through an expression; fixes #33180.
19520         (Indexers.GetIndexersForType): Don't return the indexers from
19521         interfaces the class implements; fixes #46502.
19522
19523 2003-07-21  Martin Baulig  <martin@ximian.com>
19524
19525         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19526         CS0661 checks; fixes bug #30442.
19527
19528 2003-07-21  Martin Baulig  <martin@ximian.com>
19529
19530         * decl.cs (AdditionResult): Added `Error'.
19531
19532         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19533
19534         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19535         makes cs0031.cs actually work.
19536
19537 2003-07-20  Martin Baulig  <martin@ximian.com>
19538
19539         * namespace.cs: Fixed that bug which caused a crash when compiling
19540         the debugger's GUI.
19541
19542 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * typemanager.cs (LookupTypeReflection): Never expose types which
19545         are NotPublic, NestedPrivate, NestedAssembly, or
19546         NestedFamANDAssem.  We used to return these, and later do a check
19547         that would report a meaningful error, but the problem is that we
19548         would not get the real match, if there was a name override.
19549
19550 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19551
19552         * namespace.cs (Namespace, Name): Do not compute the namespace
19553         name dynamically, compute it in the constructor.  This reduced
19554         memory usage by 1697 KB.
19555
19556         * driver.cs: Use --pause to pause at the end.
19557
19558 2003-07-17  Peter Williams  <peter@newton.cx>
19559
19560         * Makefile: Change the name of the test target so that it doesn't
19561         conflict with the recursive test target.
19562
19563 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19566         AddressOf): Do not use EmitThis, that was wrong, use the actual
19567         this pointer.
19568
19569 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19570
19571         * class.cs (MethodData.Define): While checking if a method is an
19572         interface implementation, improve the test: If we are not public
19573         (use new test here: use the computed MethodAttributes directly,
19574         instead of the parsed modifier flags) check if the `implementing'
19575         method comes from an interface or not.
19576
19577         * pending.cs (VerifyPendingMethods): Slightly better error
19578         message.
19579
19580         * makefile: add test target that does the mcs bootstrap.
19581
19582 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19583
19584         * interface.cs (Define): Do nothing here since there are no
19585         members to populate etc. Move the attribute emission out of here
19586         since this was just totally the wrong place to put it. Attribute
19587         application happens during the 'Emit' phase, not in the 'Define'
19588         phase.
19589
19590         (Emit): Add this method and move the attribute emission here
19591
19592         * rootcontext.cs (EmitCode): Call the Emit method on interface
19593         types too.
19594
19595 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19596
19597         * expression.cs (OverloadResolve): Report error only if Location
19598         is not 'Null' which means that there was a probe going on.
19599
19600 2003-07-14  Martin Baulig  <martin@ximian.com>
19601
19602         * expression.cs (ConditionalLogicalOperator): New public class to
19603         implement user defined conditional logical operators.
19604         This is section 14.11.2 in the spec and bug #40505.
19605
19606 2003-07-14  Martin Baulig  <martin@ximian.com>
19607
19608         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19609
19610 2003-07-14  Martin Baulig  <martin@ximian.com>
19611
19612         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19613
19614         * ecore.cs (IVariable.VerifyFixed): New interface method.
19615
19616         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19617         operator, check whether the variable is actually fixed.  Fixes bug
19618         #36055.  Set a variable definitely assigned when taking its
19619         address as required by the spec.
19620
19621         * statement.cs (LocalInfo.IsFixed): New field.
19622         (LocalInfo.MakePinned): Set `IsFixed' to true.
19623
19624 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19625
19626         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19627         for .ctors, ensure that we only ask for members declared in the
19628         attribute type (BindingFlags.DeclaredOnly).
19629
19630         Fixes bug #43632.
19631
19632         * expression.cs (Error_WrongNumArguments): Report error 1501
19633         correctly the way CSC does.
19634
19635 2003-07-13  Martin Baulig  <martin@ximian.com>
19636
19637         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19638         lookup on the fully qualified name, to make things like "X.X" work
19639         where "X.X" is a fully qualified type name, but we also have a
19640         namespace "X" in the using list.  Fixes #41975.
19641
19642 2003-07-13  Martin Baulig  <martin@ximian.com>
19643
19644         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19645         function. If we're a CompoundAssign, we need to create an embedded
19646         CompoundAssign, not an embedded Assign.
19647         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19648         Fixes #45854.
19649
19650 2003-07-13  Martin Baulig  <martin@ximian.com>
19651
19652         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19653         work to fix bug #46088.
19654
19655 2003-07-13  Ravi Pratap <ravi@ximian.com>
19656
19657         * class.cs (Operator.Emit): Do not emit attributes here - it is
19658         taken care of by the Method class that we delegate too. This takes
19659         care of bug #45876.
19660
19661 2003-07-10  Martin Baulig  <martin@ximian.com>
19662
19663         * expression.cs (TypeOfVoid): New class.
19664         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19665
19666 2003-07-10  Martin Baulig  <martin@ximian.com>
19667
19668         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19669         bug #35957.
19670
19671 2003-07-10  Martin Baulig  <martin@ximian.com>
19672
19673         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19674         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19675
19676         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19677
19678         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19679
19680 2003-07-10  Martin Baulig  <martin@ximian.com>
19681
19682         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19683         of decimal.  Fixes #42850.
19684
19685         NOTE: I also fixed the created byte blob, but this doesn't work on
19686         the MS runtime and csc never produces any byte blobs for decimal
19687         arrays.
19688
19689 2003-07-10  Martin Baulig  <martin@ximian.com>
19690
19691         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19692         structs; fixes #32068.
19693         (Block.AddChildVariableNames): Fixed #44302.
19694
19695 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19696
19697         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19698
19699 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * attribute.cs: And this test is onger needed.
19702
19703 2003-07-08  Martin Baulig  <martin@ximian.com>
19704
19705         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19706         inaccessible types.  Fixes #36313.
19707
19708         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19709
19710         * namespace.cs (NamespaceEntry): Create implicit entries for all
19711         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19712         implicit entries for N1.N2 and N1.
19713
19714 2003-07-08  Martin Baulig  <martin@ximian.com>
19715
19716         Rewrote the handling of namespaces to fix a lot of the issues
19717         wrt. `using' aliases etc.
19718
19719         * namespace.cs (Namespace): Splitted this class into a
19720         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19721
19722         * typemanager.cs (TypeManager.IsNamespace): Removed.
19723         (TypeManager.ComputeNamespaces): Only compute namespaces from
19724         loaded assemblies here, not the namespaces from the assembly we're
19725         currently compiling.
19726
19727 2003-07-08  Martin Baulig  <martin@ximian.com>
19728
19729         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19730
19731 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19734         already fixed it.  
19735
19736         I thought about the memory savings here, but LookupTypeReflection
19737         is used under already very constrained scenarios.  Compiling
19738         corlib or mcs only exposes one hit, so it would not really reduce
19739         any memory consumption.
19740
19741 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19742
19743         * typemanager.cs: fixes bug #45889 by only adding public types from
19744         other assemblies to the list of known types.
19745
19746 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19747
19748         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19749         on the type we resolved.
19750
19751 2003-07-05  Martin Baulig  <martin@ximian.com>
19752
19753         * pending.cs (PendingImplementation.ParentImplements): Don't
19754         create the proxy if the parent is abstract.
19755
19756         * class.cs (TypeContainer.DefineIndexers): Process explicit
19757         interface implementations first.  Fixes #37714.
19758
19759 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19760
19761         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19762         defined recursively;  but since we modify the input parameters
19763         (left is set to `this' temporarily), we reset this value if the
19764         left_is_explicit is false, which gives the original semantics to
19765         the code.  
19766
19767         * literal.cs (NullPointer): new class used to represent a null
19768         literal in a pointer context.
19769
19770         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19771         type is a pointer, use a NullPointer object instead of a
19772         NullLiteral.   Closes 43687
19773
19774         (ExplicitConversion): Convert pointer values using
19775         the conv opcode to the proper type.
19776
19777         * ecore.cs (New): change ValueTypeVariable property into a method,
19778         that returns whether the valuetype is suitable for being used.
19779
19780         * expression.cs (Binary.DoNumericPromotions): Only return if we
19781         the int constant was a valid uint, and we can return both left and
19782         right as uints.  If not, we continue processing, to trigger the
19783         type conversion.  This fixes 39018.
19784
19785         * statement.cs (Block.EmitMeta): During constant resolution, set
19786         the CurrentBlock property on the emitcontext, so that we resolve
19787         constants propertly.
19788
19789 2003-07-02  Martin Baulig  <martin@ximian.com>
19790
19791         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19792         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19793
19794         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19795         than emitting it here.
19796
19797         * statement.cs: Fixed some more flow analysis bugs.
19798
19799 2003-07-02  Martin Baulig  <martin@ximian.com>
19800
19801         * class.cs (MethodData.Define): When implementing interface
19802         methods, set Final unless we're Virtual.
19803
19804         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19805         check work for interface methods.
19806
19807 2003-07-01  Martin Baulig  <martin@ximian.com>
19808
19809         * ecore.cs (EmitContext.This): Replaced this property with a
19810         GetThis() method which takes a Location argument.  This ensures
19811         that we get the correct error location for a CS0188.
19812
19813 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19814
19815         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19816         ImplicitStandardConversion.
19817
19818         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19819
19820 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19821
19822         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19823         optimization.
19824
19825 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19828         constructors.
19829
19830         (MethodData.Define): Turn off initlocals for unsafe methods.
19831
19832 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19833
19834         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19835         complete;  Fixes #37521.
19836
19837         * delegate.cs: Use Modifiers.TypeAttr to compute the
19838         TypeAttributes, instead of rolling our own.  This makes the flags
19839         correct for the delegates.
19840
19841 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19842
19843         * class.cs (Constructor.Define): Set the private flag for static
19844         constructors as well.
19845
19846         * cs-parser.jay (statement_expression): Set the return value to
19847         null, to avoid a crash when we catch an error.
19848
19849 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * cs-parser.jay: Applied patch from Jackson that adds support for
19852         extern and unsafe modifiers to destructor declarations.
19853
19854         * expression.cs: Report error 21 if the user is trying to index a
19855         System.Array.
19856
19857         * driver.cs: Add an error message, suggested by the bug report.
19858
19859         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19860         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19861
19862 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * namespace.cs: Add some information to reduce FAQs.
19865
19866 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19869         underlying enumeration types.  Fixes #43915.
19870
19871         * expression.cs: Treat ushort/short as legal values to be used in
19872         bitwise operations.
19873
19874 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19875
19876         * delegate.cs: transfer custom attributes for paramenters from
19877         the delegate declaration to Invoke and BeginInvoke.
19878
19879 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19880
19881         * attribute.cs: handle custom marshalers and emit marshal info
19882         for fields, too.
19883
19884 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
19885
19886         * makefile.gnu: Added anonymous.cs to the compiler sources.
19887
19888 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
19889
19890         * iterators.cs: Change the name of the proxy class to include two
19891         underscores.
19892
19893         * cs-parser.jay: Update grammar to include anonymous methods.
19894
19895         * anonymous.cs: new file.
19896
19897 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
19898
19899         * class.cs (Field.Define): Add missing test for pointers and
19900         safety. 
19901
19902 2003-05-27  Ravi Pratap  <ravi@ximian.com>
19903
19904         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
19905         we use the stobj opcode.
19906
19907         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
19908         since it wasn't the correct fix. 
19909
19910         It still is puzzling that we are required to use stobj for IntPtr
19911         which seems to be a ValueType.
19912
19913 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
19916         during regular simple name resolution.   Now, the trick is that
19917         instead of returning for processing the simplename, we do a
19918         TypeManager.LookupType (ie, a rooted lookup as opposed to a
19919         contextual lookup type).   If a match is found, return that, if
19920         not, return for further composition.
19921
19922         This fixes long-standing 30485.
19923
19924         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19925         using the address to initialize an object, do an Stobj instead of
19926         using the regular Stelem.
19927
19928         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
19929         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
19930         Because if we are a BaseIndexerAccess that value will be true.
19931         Fixes 43643.
19932
19933         * statement.cs (GotoCase.Resolve): Return after reporting an
19934         error, do not attempt to continue. 
19935
19936         * expression.cs (PointerArithmetic.Emit): If our operand is a
19937         long, convert our constants to match the operand before
19938         multiplying.  Convert to I type before adding.   Fixes 43670.
19939
19940 2003-05-14  Ravi Pratap  <ravi@ximian.com>
19941
19942         * enum.cs (ImplicitConversionExists) : Rename to
19943         ImplicitEnumConversionExists to remove ambiguity. 
19944
19945         * ecore.cs (NullCast): New type of cast expression class which
19946         basically is very similar to EmptyCast with the difference being
19947         it still is a constant since it is used only to cast a null to
19948         something else
19949         (eg. (string) null)
19950
19951         * convert.cs (ImplicitReferenceConversion): When casting a null
19952         literal, we return a NullCast.
19953
19954         * literal.cs (NullLiteralTyped): Remove - I don't see why this
19955         should be around anymore.
19956
19957         The renaming (reported was slightly wrong). Corrections:
19958
19959         ConvertImplicitStandard -> ImplicitConversionStandard
19960         ConvertExplicitStandard -> ExplicitConversionStandard
19961
19962         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
19963         before passing them in !
19964
19965         * convert.cs (ImplicitConversionStandard): When comparing for
19966         equal expr and target types, ensure that expr is not a
19967         NullLiteral.
19968
19969         In general, we must not be checking (expr_type ==
19970         target_type) in the top level conversion methods
19971         (ImplicitConversion, ExplicitConversion etc). This checking is
19972         done in the methods that they delegate to.
19973
19974 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
19975
19976         * convert.cs: Move Error_CannotConvertType,
19977         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
19978         ImplicitNumericConversion, ImplicitConversionExists,
19979         ImplicitUserConversionExists, StandardConversionExists,
19980         FindMostEncompassedType, FindMostSpecificSource,
19981         FindMostSpecificTarget, ImplicitUserConversion,
19982         ExplicitUserConversion, GetConversionOperators,
19983         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
19984         TryImplicitIntConversion, Error_CannotConvertImplicit,
19985         ConvertImplicitRequired, ConvertNumericExplicit,
19986         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
19987         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
19988         its own file.
19989
19990         Perform the following renames:
19991
19992         StandardConversionExists -> ImplicitStandardConversionExists
19993         ConvertImplicit -> ImplicitConversion
19994         ConvertImplicitStandard -> ImplicitStandardConversion
19995         TryImplicitIntConversion -> ImplicitIntConversion
19996         ConvertImplicitRequired -> ImplicitConversionRequired
19997         ConvertNumericExplicit -> ExplicitNumericConversion
19998         ConvertReferenceExplicit -> ExplicitReferenceConversion
19999         ConvertExplicit -> ExplicitConversion
20000         ConvertExplicitStandard -> ExplicitStandardConversion
20001
20002 2003-05-19  Martin Baulig  <martin@ximian.com>
20003
20004         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20005         (TypeInfo): Added support for structs having structs as fields.
20006
20007         * ecore.cs (FieldExpr): Implement IVariable.
20008         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20009         VariableInfo for the field.
20010
20011 2003-05-18  Martin Baulig  <martin@ximian.com>
20012
20013         * expression.cs (This.DoResolve): Report a CS0027 if we're
20014         emitting a field initializer.
20015
20016 2003-05-18  Martin Baulig  <martin@ximian.com>
20017
20018         * expression.cs (This.ResolveBase): New public function.
20019         (This.DoResolve): Check for CS0188.
20020
20021         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20022         This.Resolve().
20023
20024         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20025         `instance_expression' to null if we don't have any non-static
20026         methods.
20027
20028 2003-05-18  Martin Baulig  <martin@ximian.com>
20029
20030         Reworked the way how local variables and parameters are handled by
20031         the flow analysis code.
20032
20033         * statement.cs (TypeInfo, VariableMap): New public classes.
20034         (VariableInfo): New public class.  This is now responsible for
20035         checking whether a variable has been assigned.  It is used for
20036         parameters and local variables.
20037         (Block.EmitMeta): Take the InternalParameters as argument; compute
20038         the layout of the flow vectors here.
20039         (Block.LocalMap, Block.ParameterMap): New public properties.
20040         (FlowBranching): The .ctor doesn't get the InternalParameters
20041         anymore since Block.EmitMeta() now computes the layout of the flow
20042         vector.
20043         (MyStructInfo): This class is now known as `StructInfo' and nested
20044         in `TypeInfo'; we don't access this directly anymore.
20045
20046         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20047         property and removed IsAssigned(), IsFieldAssigned(),
20048         SetAssigned() and SetFieldAssigned(); we now call them on the
20049         VariableInfo so we don't need to duplicate this code everywhere.
20050
20051         * expression.cs (ParameterReference): Added `Block block' argument
20052         to the .ctor.
20053         (LocalVariableReference, ParameterReference, This): The new
20054         VariableInfo class is now responsible for all the definite
20055         assignment stuff.
20056
20057         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20058         IsParameterAssigned, SetParameterAssigned): Removed.
20059
20060 2003-05-18  Martin Baulig  <martin@ximian.com>
20061
20062         * typemanager.cs (InitCoreTypes): Try calling
20063         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20064         the 3-args-version.  Corlib now also needs our `void_type'.
20065         (GetMethod): Added overloaded version which takes an optional
20066         `bool report_errors' to allow lookups of optional methods.
20067
20068 2003-05-12  Martin Baulig  <martin@ximian.com>
20069
20070         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20071         only used for locals and not for parameters.
20072
20073 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20074
20075         * support.cs (InternalParameters.ParameterType): Return the
20076         ExternalType of the parameter.
20077
20078         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20079         they were unused.
20080
20081 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20082
20083         * class.cs (MethodData.Define): Do not set the `newslot' on
20084         interface members, if they are also flagged as "override".
20085
20086         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20087         better code for ++i and i++.  This only works for static fields
20088         and local variables.
20089
20090         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20091         want to pull the DeclSpace out of the builder_to_declspace instead
20092         of the TypeBuilder (like in TypeContainer.FindMembers).
20093
20094         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20095         instead of LookupTypeContainer.  Fixes the crash on .NET for
20096         looking up interface members.
20097
20098         * const.cs: Create our own emit context during the Definition
20099         stage, so that constants are evaluated in the proper context, when
20100         a recursive definition happens.
20101
20102 2003-05-11  Martin Baulig  <martin@ximian.com>
20103
20104         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20105         new block for a switch section.
20106         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20107         the adding/lookup in the switch block.  Fixes #39828.
20108
20109 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20112         functionality: I needed to convert the data after I had performed
20113         the add/sub operation into the operands type size.
20114
20115         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20116         pass the type for the box operation, otherwise the resulting
20117         object would have been of type object.
20118
20119         (BoxedCast): Add constructor to specify the type to box as.
20120
20121 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20122
20123         * iterators.cs: I was reusing the `count' variable inadvertently,
20124         take steps to not allow this to happen.
20125
20126 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20127
20128         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20129         by creating an array at the point where the params starts and
20130         putting all those arguments there, then adjusting the size of the
20131         array.
20132
20133 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20134
20135         * expression.cs (New.AddressOf): Implement interface
20136         IMemoryLocation.  This is used when the `new' operator is used in
20137         the context of an invocation to a method on a value type.
20138
20139         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20140         example. 
20141
20142         * namespace.cs: Also check the using aliases here.
20143
20144         * driver.cs: Move the test for using validity after the types have
20145         been entered, so we do a single pass that also includes the using
20146         aliases. 
20147
20148         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20149         in the regular case.   CreateSiblingForFinally is doing extra
20150         error checking.
20151
20152         * attribute.cs (GetAttributeArgumentExpression): Store the result
20153         on an out value, and use the return value to indicate failure
20154         instead of using null (which is a valid return for Constant.GetValue).
20155
20156         * statement.cs: Perform the analysis flow for the increment
20157         portion after the statement, because this will be the real flow of
20158         execution.  Fixes #42385
20159
20160         * codegen.cs (EmitContext.EmitArgument,
20161         EmitContext.EmitStoreArgument): New helper functions when the
20162         RemapToProxy flag is set.
20163
20164         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20165         function.
20166
20167         Add support for remapping parameters. 
20168
20169         * iterators.cs: Propagate parameter values;  Store parameter
20170         values in the proxy classes.
20171
20172 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20173
20174         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20175         need a proxy reference;  I do not know what I was thinking
20176
20177         * cs-parser.jay (constructor_initializer): catch another error,
20178         and display nice message.
20179
20180         (field_declaration): catch void field declaration
20181         to flag a better error. 
20182
20183         * class.cs (MemberBase.CheckBase): Report an error instead of a
20184         warning if a new protected member is declared in a struct. 
20185         (Field.Define): catch the error of readonly/volatile.
20186
20187         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20188
20189         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20190         volatile variable is taken
20191
20192 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * statement.cs (Fixed.Resolve): Report an error if we are not in
20195         an unsafe context.
20196
20197 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20198
20199         * typemanager.cs: reuse the code that handles type clashes for
20200         delegates and enumerations.
20201
20202         * class.cs (Report28): Always report.
20203
20204         * expression.cs (EncodeAsAttribute): Allow nulls here.
20205
20206 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20207
20208         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20209         the functionality for testing whether an expression is valid for
20210         an attribute here.  Also handle the case of arrays of elements
20211         being stored. 
20212
20213         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20214         encoding a linear array into an array of objects that are suitable
20215         to be passed to an CustomAttributeBuilder.
20216
20217         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20218
20219         * ecore.cs: (FieldExpr): Handle field remapping here.
20220
20221         * iteratators.cs: Pass the instance variable (if the method is an
20222         instance method) to the constructors, so we can access the field
20223         variables on the class.
20224
20225         TODO: Test this with structs.  I think the THIS variable on
20226         structs might have to be a pointer, and not a refenrece
20227
20228 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20229
20230         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20231         local variables to fields in a proxy class.
20232
20233         * iterators.cs (PopulateProxy): Rename our internal fields to
20234         <XXX>.  
20235         Create a <THIS> field if we are an instance method, so we can
20236         reference our parent container variables.
20237         (MapVariable): Called back from the EmitContext code to enter a
20238         new variable to field mapping into the proxy class (we just create
20239         a FieldBuilder).
20240
20241         * expression.cs
20242         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20243         for using the remapped locals to fields.
20244
20245         I placed the code here, because that gives the same semantics to
20246         local variables, and only changes the Emit code.
20247
20248         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20249         statements inside iterators.
20250         (VariableInfo): Add a FieldBuilder for the cases when we are
20251         remapping local variables to fields in a proxy class
20252
20253         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20254         current_block != null.
20255
20256         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20257         not cope with strings, as it has been moved to the
20258         TableSwitchEmit.  Fixed bug in switch generation.
20259
20260         * expression.cs (New.DoResolve): Provide more context for the user
20261         when reporting an error.
20262
20263         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20264         pointers. 
20265
20266         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20267         check the permissions for it.  Note than in a type-resolution
20268         context the check was already present in DeclSpace.ResolveType,
20269         but was missing from the MemberAccess.
20270
20271         (ArrayCreation.CheckIndices): warn if the user has
20272         more nested levels of expressions, but there are no more
20273         dimensions specified.  Avoids crash on bug 41906.
20274
20275 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20276
20277         * statement.cs (Block): replace Implicit bool, for a generic
20278         flags.   
20279         New flag: `Unchecked'.  This is used during the EmitMeta phase
20280         (which is out-of-line with the regular Resolve/Emit process for a
20281         statement, as this is done ahead of time, but still gets a chance
20282         to call constant resolve).
20283
20284         (Block.Flags): new enum for adding a new flag.
20285
20286         (Block.EmitMeta): track the state of unchecked.
20287
20288         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20289         to enable constant resolution to work there as well.
20290
20291 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * typemanager.cs (ienumerable_type): Also look up
20294         System.Collections.IEnumerable. 
20295
20296 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20297
20298         TODO: Test more than one conditional per method.
20299
20300         * class.cs (Indexer.Define): Report the location where the user is
20301         referencing the unsupported feature.
20302
20303         (MethodData): Overload the use of `conditionals' to
20304         minimize the creation of needless ArrayLists.   This saves roughly
20305         212kb on my machine.
20306
20307         (Method): Implement the new IIteratorContainer interface.
20308         (Method.SetYields): Implement the method by setting the ModFlags
20309         to contain METHOD_YIELDS.
20310
20311         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20312         which just got set to null.
20313
20314         * iterators.cs: New file.
20315
20316         (Yield, YieldBreak): New statements.
20317
20318         * statement.cs (Return.Resolve): Flag an error if we are used in
20319         an iterator method.
20320
20321         * codegen.cs (InIterator): New flag set if the code is being
20322         compiled in an iterator method.
20323
20324         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20325         internal modifier, and we just use it to avoid adding extra
20326         fields, as this is seldom used.  
20327
20328         * cs-parser.jay: Add yield_statement (yield and yield break).
20329
20330         * driver.cs: New flag -v2 to turn on version 2 features. 
20331
20332         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20333         hashtable when v2 is enabled.
20334
20335 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20336
20337         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20338         there is already a namespace defined with this name.
20339
20340         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20341         people upgraded their corlibs.
20342
20343         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20344         always use fully qualified types, no need to use the compiler
20345         front end.
20346
20347         (TypeManager.IsNamespace): Use binarysearch.
20348
20349         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20350         AddDelegate): I did not quite use the new IsValid API properly: I
20351         have to pass the short-name and the fullname.  I was passing only
20352         the basename instead of the fullname sometimes. 
20353
20354         (TypeContainer.DefineType): call NamespaceClash.
20355
20356         * interface.cs (Interface.DefineType): use NamespaceClash before
20357         defining the type.
20358
20359         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20360         defining the type.
20361
20362         * enum.cs: (Enum.DefineType): use NamespaceClash before
20363         defining the type.
20364
20365         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20366         speed increase.  First, use the negative_hits cache when we get a
20367         negative.  Second, add the type with its full original name
20368         instead of the new . and + encoded name (reflection uses + to
20369         separate type from a nested type).  Use LookupTypeReflection
20370         directly which bypasses the type->name hashtable (that we already
20371         know does not contain the type.
20372
20373         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20374         location/container type. 
20375
20376         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20377
20378 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20379
20380         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20381
20382         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20383         method is being referenced in the method group from a static
20384         context, and report error 120 if so.
20385
20386         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20387         Error118. 
20388
20389         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20390         is created, we create the A namespace).
20391
20392         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20393         Fixes #41591
20394
20395 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20396
20397         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20398         invocation to ModuleBuilder.GetType with the same values will
20399         return a new type instance, so we need to cache its return
20400         values. 
20401
20402         * expression.cs (Binary.ResolveOperator): Only allow the compare
20403         operators on enums if they are of the same type.
20404
20405         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20406         types of ValueType on their own case.  Before we were giving them
20407         the same treatment as objects.
20408
20409         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20410         fullname.  Short name is used to compare against container name.
20411         Fullname is used to check against defined namespace names.
20412
20413         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20414         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20415
20416         (Method.CheckBase): Call parent.
20417         (MemberBase.CheckBase): Check for protected members on sealed
20418         classes.
20419         (PropertyBase.CheckBase): Call parent.
20420         (Field.Define): Call parent.
20421
20422         * report.cs: Negative error codes are now mapped to 8000 - code,
20423         so that the display is render more nicely.
20424
20425         * typemanager.cs: Do not use try/catch, instead report a regular
20426         error. 
20427
20428         (GetPointerType, GetReferenceType): These methods provide
20429         mechanisms to obtain the T* and T& from a T.  We had the code
20430         previously scattered around the code base, and it also used
20431         TypeManager.LookupType that would go through plenty of caches.
20432         This one goes directly to the type source.
20433
20434         In some places we did the Type.GetType followed by
20435         ModuleBuilder.GetType, but not in others, so this unifies the
20436         processing as well.
20437
20438         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20439         statements now that we have namespace information.
20440
20441         * typemanager.cs (IsNamespace): New method, returns whether the
20442         string presented is a namespace or not.
20443
20444         (ComputeNamespaces): New public entry point, computes the list of
20445         available namespaces, using the GetNamespaces API call in Mono, or
20446         the slower version in MS.NET.   
20447
20448         Now before we start the semantic analysis phase, we have a
20449         complete list of namespaces including everything that the user has
20450         provided.
20451
20452         Deleted old code to cache namespaces in .nsc files.
20453
20454 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20455
20456         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20457         class/struct location definition Location for the implicit
20458         constructor location.
20459
20460         (Operator.Define): Use the location of the operator for the
20461         implicit Method definition.
20462
20463         (Constructor.Emit): use the constructor location for the implicit
20464         base initializer constructor.
20465
20466         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20467         and the Expression class now contains two new methods:
20468
20469         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20470         isolate type lookup from the rest of the resolution process.
20471
20472         Since we use Expressions to hold type definitions due to the way
20473         we parse the input we have historically overloaded Resolve to
20474         perform the Type lookups if a special flag is passed.  Now this is
20475         eliminated and two methods take their place. 
20476
20477         The differences in the two methods between xStep and xTerminal is
20478         that xStep is involved in our current lookup system that uses
20479         SimpleNames to compose a name, while xTerminal is used just to
20480         catch the case where the simplename lookup failed.
20481
20482 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20483
20484         * expression.cs (ResolveMemberAccess): Remove redundant code.
20485         TypeExpr expressions are always born fully resolved.
20486
20487         * interface.cs (PopulateMethod): Do not lookup the types twice.
20488         We were doing it once during SemanticAnalysis and once during
20489         PopulateMethod.
20490
20491         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20492         in local variable type definitions, were being returned as a
20493         SimpleName (we decomposed everything into a string), that is
20494         because primary_expression was being used instead of a type in the
20495         grammar (reduce/reduce conflicts).
20496
20497         The part that was wrong is that we converted the expression into a
20498         string (an oversimplification in one hand, compounded with primary
20499         expressions doing string concatenation).
20500
20501         So things like:
20502
20503         A.B.C [] x;
20504
20505         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20506         using clauses from working on this particular context.  And a type
20507         was being matched directly against "A.B.C[]".
20508
20509         We now use the correct approach, and allow for ComposedCast to be
20510         part of the unary expression.  So the "A.B.C []" become a composed
20511         cast of "A.B.C" (as a nested group of MemberAccess with a
20512         SimpleName at the end) plus the rank composition "[]". 
20513
20514         Also fixes 35567
20515
20516 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20519         for the access level checking.
20520
20521         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20522         `TypeContainer container', because I kept getting confused when I
20523         was debugging this code.
20524
20525         * expression.cs (Indexers): Instead of tracking getters/setters,
20526         we now track them in parallel.  We create one arraylist less, but
20527         most importantly it is possible now for the LValue code to find a
20528         matching get for a set.
20529
20530         (IndexerAccess.DoResolveLValue): Update the code.
20531         GetIndexersForType has been modified already to extract all the
20532         indexers from a type.  The code assumed it did not.
20533
20534         Also make the code set the correct return type for the indexer.
20535         This was fixed a long time ago for properties, but was missing for
20536         indexers.  It used to be void_type.
20537
20538         (Binary.Emit): Test first for doubles instead of
20539         floats, as they are more common.
20540
20541         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20542         when dealing with floats and the <=, >= operators.  This fixes bug
20543         #39314 
20544
20545         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20546         to load the array value by emitting a load on the foreach variable
20547         type.  This was incorrect.  
20548
20549         We now emit the code to load an element using the the array
20550         variable type, and then we emit the conversion operator.
20551
20552         Fixed #40176
20553
20554 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20555
20556         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20557
20558 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20559
20560         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20561         test for protection before we test for signatures. 
20562
20563         (MethodSignature.ToString): implement.
20564
20565         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20566         to the case where we reduced into a LongConstant.
20567
20568         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20569         depend on whether the information is acurrate, because the
20570         Microsoft runtime will always claim that the array type is public,
20571         regardless of the real state.
20572
20573         If the type is a pointer, another problem happens: the type is
20574         reported as non-public in Microsoft.  
20575
20576         In both cases we have to call CheckAccessLevel recursively with
20577         the underlying type as the argument to be tested.
20578
20579 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20580
20581         * assign.cs (Assign.Emit): If we are dealing with a compound
20582         assignment expression, we should use the code path that stores the
20583         intermediate result in a temporary value.  This fixes #40903.
20584
20585         *expression.cs (Indirection.ToString): Provide ToString method for
20586         debugging. 
20587
20588 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20589
20590         * class.cs: Null out fields holding references to Block objects so
20591         they can be garbage collected.
20592
20593         * expression.cs (OverloadResolve): Remove unused local.
20594
20595 2003-04-07  Martin Baulig  <martin@ximian.com>
20596
20597         * codegen.cs (EmitContext.CurrentFile): New public field.
20598         (EmitContext.Mark): Use the CurrentFile to check whether the
20599         location is in the correct file.
20600         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20601
20602 2003-04-07  Martin Baulig  <martin@ximian.com>
20603
20604         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20605
20606         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20607         location.  [FIXME: The location argument which gets passed to this
20608         method is sometimes wrong!]
20609
20610 2003-04-07  Nick Drochak <ndrochak@gol.com>
20611
20612         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20613
20614 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20615
20616         * expression.cs (Indirection.EmitAssign): We were using the
20617         temporary, but returning immediately instead of continuing the
20618         EmitAssing flow.
20619
20620 2003-04-06  Martin Baulig  <martin@ximian.com>
20621
20622         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20623         if it's a nested child, but also deriving from the outer class.
20624         See test 190.cs.
20625
20626         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20627         nested child, but also deriving from the outer class.  See
20628         test-190.cs.
20629         (FilterWithClosure): We may access private members of the outer
20630         class if we're a nested child and deriving from the outer class.
20631         (RealMemberLookup): Only set `closure_private_ok' if the
20632         `original_bf' contained BindingFlags.NonPublic.
20633
20634 2003-04-05  Martin Baulig  <martin@ximian.com>
20635
20636         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20637
20638 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20639
20640         * class.cs (Event.Define): Do not allow abstract events to have
20641         initializers. 
20642
20643 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20644
20645         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20646         block in event declarations.
20647
20648         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20649         value type, get its address.
20650
20651         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20652         leaving a class on the stack instead of a boolean value (int
20653         0/1).  Change the code so we compare against null, and then the
20654         result against zero.
20655
20656         * class.cs (TypeContainer.GetClassBases): We were checking for the
20657         parent class being sealed too late.
20658
20659         * expression.cs (Binary.Emit): For <= and >= when dealing with
20660         floating point values, use cgt.un and clt.un instead of cgt and
20661         clt alone.
20662
20663 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20664
20665         * statement.cs: Apply the same optimization as MS: skip the 
20666         GetEnumerator returning an IEnumerator, and use the one returning a 
20667         CharEnumerator instead. This allows us to avoid the try-finally block 
20668         and the boxing.
20669
20670 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20671
20672         * cs-parser.jay: Attributes cannot be applied to
20673                          namespaces. Fixes #40473
20674
20675 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20676
20677         * class.cs:
20678         (Add*): check if the name is valid using the full name for constants,
20679         fields, properties and events.
20680
20681 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20684         char constants to be part of the enumeration.
20685
20686         * expression.cs (Conditional.DoResolve): Add support for operator
20687         true. Implements the missing functionality from 14.12
20688
20689         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20690         operator true/false as required by the spec.
20691
20692         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20693         implicit conversion to boolean.
20694
20695         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20696         also one where the type implements `operator true'. 
20697
20698         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20699         get an expression that will invoke operator true based on an
20700         expression.  
20701
20702         (GetConversionOperators): Removed the hack that called op_True
20703         here.  
20704
20705         (Expression.ResolveBoolean): Move this from Statement.
20706
20707 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * ecore.cs (FieldExpr): do not allow initialization of initonly
20710         fields on derived classes
20711
20712 2003-03-13  Martin Baulig  <martin@ximian.com>
20713
20714         * statement.cs (Block.Emit): Call ig.BeginScope() and
20715         ig.EndScope() when compiling with debugging info; call
20716         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20717
20718 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20719
20720         * expression.cs (Indexers): Do not construct immediately, allow
20721         for new members to be appended as we go.  Fixes 38143
20722
20723 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20724
20725         * expression.cs: save/restore context when resolving an unchecked
20726         expression.
20727
20728 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20729
20730         * cfold.cs: Catch division by zero in modulus operator during
20731         constant folding.
20732
20733 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * interface.cs (Interface.DefineMembers): Avoid defining members
20736         twice. 
20737
20738 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * driver.cs: handle the +/- options for -noconfig
20741
20742         * statement.cs (Unckeched.Resolve): Also track the state of
20743         unchecked in the Resolve phase.
20744
20745 2003-02-27  Martin Baulig  <martin@ximian.com>
20746
20747         * ecore.cs (Expression.MemberLookup): Don't create a
20748         MethodGroupExpr for something which is not a method.  Fixes #38291.
20749
20750 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * class.cs (MemberBase.CheckParameters): Also check that the type
20753         is unmanaged if it is a pointer.
20754
20755         * expression.cs (SizeOf.Resolve): Add location information.
20756
20757         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20758         a managed type is declared.
20759
20760         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20761         parameter modifiers as well.  Fixes bug 38606
20762
20763         * class.cs: Very sad.  Am backing out the speed up changes
20764         introduced by the ArrayList -> Array in the TypeContainer, as they
20765         were not actually that much faster, and introduced a bug (no error
20766         reports on duplicated methods).
20767
20768         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20769         source first, this will guarantee that we have a valid expression
20770         before calling in lower levels functions that will require a
20771         resolved object.  Then use this original_source in the
20772         target.ResolveLValue instead of the original source that was
20773         passed to us.
20774
20775         Another change.  Use target.Resolve instead of LValueResolve.
20776         Although we are resolving for LValues, we will let the Assign code
20777         take care of that (it will be called again from Resolve).  This
20778         basically allows code like this:
20779
20780         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20781         class Y { void A (X x) { x [0] += o; }
20782
20783         The problem was that the indexer was trying to resolve for
20784         set_Item (idx, object o) and never finding one.  The real set_Item
20785         was set_Item (idx, X).  By delaying the process we get the right
20786         semantics. 
20787
20788         Fixes bug 36505
20789
20790 2003-02-23  Martin Baulig  <martin@ximian.com>
20791
20792         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20793         while calling DoEmit ().
20794
20795         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20796         source files; if you use the #line directive inside a method, the
20797         compiler stops emitting line numbers for the debugger until it
20798         reaches the end of the method or another #line directive which
20799         restores the original file.
20800
20801 2003-02-23  Martin Baulig  <martin@ximian.com>
20802
20803         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20804
20805 2003-02-23  Martin Baulig  <martin@ximian.com>
20806
20807         * statement.cs (Block.AddChildVariableNames): We need to call this
20808         recursively, not just for our immediate children.
20809
20810 2003-02-23  Martin Baulig  <martin@ximian.com>
20811
20812         * class.cs (Event.Define): Always make the field private, like csc does.
20813
20814         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20815         actually work, fixes bug #37521.
20816
20817 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20818
20819         * delegate.cs: When creating the various temporary "Parameters"
20820         classes, make sure that we call the ComputeAndDefineParameterTypes
20821         on those new parameters (just like we do with the formal ones), to
20822         allow them to be resolved in the context of the DeclSpace.
20823
20824         This fixes the bug that Dick observed in Bugzilla #38530.
20825
20826 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * expression.cs (ResolveMemberAccess): When resolving a constant,
20829         do not attempt to pull a constant if the value was not able to
20830         generate a valid constant.
20831
20832         * const.cs (LookupConstantValue): Do not report more errors than required.
20833
20834 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20835
20836         * expression.cs: fixes bug #38328.
20837
20838 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20839
20840         * class.cs: Changed all the various members that can be part of a
20841         class from being an ArrayList to be an Array of the right type.
20842         During the DefineType type_list, interface_list, delegate_list and
20843         enum_list are turned into types, interfaces, delegates and enums
20844         arrays.  
20845
20846         And during the member population, indexer_list, event_list,
20847         constant_list, field_list, instance_constructor_list, method_list,
20848         operator_list and property_list are turned into their real arrays.
20849
20850         Although we could probably perform this operation earlier, for
20851         good error reporting we need to keep the lists and remove the
20852         lists for longer than required.
20853
20854         This optimization was triggered by Paolo profiling the compiler
20855         speed on the output of `gen-sample-program.pl' perl script. 
20856
20857         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20858         not crash in methods like MemberLookupFailed that use this field.  
20859
20860         This problem arises when the compiler fails to resolve a type
20861         during interface type definition for example.
20862
20863 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20864
20865         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20866         inherit from System.Object, so we have to stop at null, not only
20867         when reaching System.Object.
20868
20869 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20870
20871         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20872         DeclaredOnly because the parent indexer might have had a different
20873         name, but did not loop until the top of the hierarchy was reached.
20874
20875         The problem this one fixes is 35492: when a class implemented an
20876         indexer from an interface, we were getting the interface method
20877         (which was abstract) and we were flagging an error (can not invoke
20878         abstract method).
20879
20880         This also keeps bug 33089 functioning, and test-148 functioning.
20881
20882         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20883         out if a method is special is to see if it is declared in a
20884         property or event, or whether it is one of the predefined operator
20885         names.   This should fix correctly #36804.
20886
20887 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
20888
20889         The goal here is to remove the dependency on EmptyCast.Peel ().
20890         Killing it completely.
20891
20892         The problem is that currently in a number of places where
20893         constants are expected, we have to "probe" for an EmptyCast, and
20894         Peel, which is not the correct thing to do, as this will be
20895         repetitive and will likely lead to errors. 
20896
20897         The idea is to remove any EmptyCasts that are used in casts that
20898         can be reduced to constants, so we only have to cope with
20899         constants. 
20900
20901         This bug hunt was triggered by Bug 37363 and the desire to remove
20902         the duplicate pattern where we were "peeling" emptycasts to check
20903         whether they were constants.  Now constants will always be
20904         constants.
20905
20906         * ecore.cs: Use an enumconstant here instead of wrapping with
20907         EmptyCast.  
20908
20909         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
20910         throwing me off.  By handling this we can get rid of a few hacks.
20911
20912         * statement.cs (Switch): Removed Peel() code.
20913
20914 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
20915
20916         * class.cs: Location information for error 508
20917
20918         * expression.cs (New.DoResolve): Add a guard against double
20919         resolution of an expression.  
20920
20921         The New DoResolve might be called twice when initializing field
20922         expressions (see EmitFieldInitializers, the call to
20923         GetInitializerExpression will perform a resolve on the expression,
20924         and later the assign will trigger another resolution
20925
20926         This leads to bugs (#37014)
20927
20928         * delegate.cs: The signature for EndInvoke should contain any ref
20929         or out parameters as well.  We were not doing this in the past. 
20930
20931         * class.cs (Field.Define): Do not overwrite the type definition
20932         inside the `volatile' group.  Turns out that volatile enumerations
20933         were changing the type here to perform a validity test, which
20934         broke conversions. 
20935
20936 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
20937
20938         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
20939         and structs, we do not want to load the instance variable
20940
20941         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
20942         enum_type has to be handled like an object reference (implicit
20943         conversions exists from this to object), but the regular IsClass
20944         and IsValueType tests will never return true for this one.
20945
20946         Also we use TypeManager.IsValueType instead of type.IsValueType,
20947         just for consistency with the rest of the code (this is only
20948         needed if we ever use the construct exposed by test-180.cs inside
20949         corlib, which we dont today).
20950
20951 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
20952
20953         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
20954         just InternalCall.
20955
20956 2003-02-09  Martin Baulig  <martin@ximian.com>
20957
20958         * namespace.cs (Namespace..ctor): Added SourceFile argument.
20959         (Namespace.DefineNamespaces): New static public method; this is
20960         called when we're compiling with debugging to add all namespaces
20961         to the symbol file.
20962
20963         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
20964         pass it to the Namespace's .ctor.
20965
20966         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
20967         and MethodBase arguments; pass the namespace ID to the symwriter;
20968         pass the MethodBase instead of the token to the symwriter.
20969         (SymbolWriter.DefineNamespace): New method to add a namespace to
20970         the symbol file.
20971
20972 2003-02-09  Martin Baulig  <martin@ximian.com>
20973
20974         * symbolwriter.cs: New file.  This is a wrapper around
20975         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
20976         methods here in near future.
20977
20978 2003-02-09  Martin Baulig  <martin@ximian.com>
20979
20980         * codegen.cs (EmitContext.Mark): Just pass the arguments to
20981         ILGenerator.MarkSequencePoint() which are actually used by the
20982         symbol writer.
20983
20984 2003-02-09  Martin Baulig  <martin@ximian.com>
20985
20986         * location.cs (SourceFile): New public sealed class.  This
20987         contains the name and an index which is used in the location's token.
20988         (Location): Reserve an appropriate number of bits in the token for
20989         the source file instead of walking over that list, this gives us a
20990         really huge performance improvement when compiling with debugging.
20991
20992         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
20993         `SourceFile' argument instead of a string.
20994         (Driver.ProcessFile): Add all the files via Location.AddFile(),
20995         but don't parse/tokenize here, we need to generate the list of all
20996         source files before we do that.
20997         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
20998         the files.
20999
21000         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21001         instead of a string.
21002
21003         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21004         of a string.
21005
21006 2003-02-09  Martin Baulig  <martin@ximian.com>
21007
21008         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21009         filename on `#line default'.
21010
21011 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21012
21013         * statement.cs: don't clear the pinned var when the fixed statement
21014         returns from the method (fixes bug#37752).
21015
21016 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21017
21018         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21019         to IsValueType.
21020
21021 2003-02-07  Martin Baulig  <martin@ximian.com>
21022
21023         * driver.cs: Removed the `--debug-args' command line argument.
21024
21025         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21026         automatically by the AsssemblyBuilder.
21027         (CodeGen.InitializeSymbolWriter): We don't need to call any
21028         initialization function on the symbol writer anymore.  This method
21029         doesn't take any arguments.
21030
21031 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21034         from referenced assemblies as well.
21035
21036 2003-02-02  Martin Baulig  <martin@ximian.com>
21037
21038         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21039
21040 2003-02-02  Martin Baulig  <martin@ximian.com>
21041
21042         * class.cs (Constructor.Emit): Open the symbol writer before
21043         emitting the constructor initializer.
21044         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21045         single-stepping through constructor initializers.
21046
21047 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21048
21049         * class.cs: Handle error 549: do not allow virtual methods in
21050         sealed classes. 
21051
21052 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21053
21054         * decl.cs: Check access levels when resolving types
21055
21056 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21057
21058         * statement.cs: Add parameters and locals set in catch blocks that might 
21059         return to set vector
21060
21061 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21062
21063         * class.cs (Operator): Set the SpecialName flags for operators.
21064
21065         * expression.cs (Invocation.DoResolve): Only block calls to
21066         accessors and operators on SpecialName methods.
21067
21068         (Cast.TryReduce): Handle conversions from char constants.
21069
21070
21071 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21072
21073         * statement.cs: small memory and time optimization in FlowBranching.
21074
21075 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21076
21077         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21078         problem that the last fix but in the other sid (Set).
21079
21080         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21081         access when there is no indexer in the hierarchy.
21082
21083 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21084
21085         * class.cs: Combine some if statements.
21086
21087 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21088
21089         * driver.cs: fixed bug #37187.
21090
21091 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21092
21093         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21094         any indexer, it's needed to build a list with all the indexers in the
21095         hierarchy (AllGetters), else we have problems. Fixes #35653.
21096
21097 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21098
21099         * class.cs (MethodData.Define): It is wrong for an interface
21100         implementation to be static in both cases: explicit and implicit.
21101         We were only handling this in one case.
21102
21103         Improve the if situation there to not have negations.
21104
21105         * class.cs (Field.Define): Turns out that we do not need to check
21106         the unsafe bit on field definition, only on usage.  Remove the test.
21107
21108 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21109
21110         * driver.cs: use assembly.Location instead of Codebase (the latest
21111         patch made mcs fail when using MS assemblies).
21112
21113 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21114
21115         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21116         get the path to *corlib.dll.
21117
21118 2003-01-21  Nick Drochak <ndrochak@gol.com>
21119
21120         * cs-tokenizer.cs:
21121         * pending.cs:
21122         * typemanager.cs: Remove compiler warnings
21123
21124 2003-01-20  Duncan Mak  <duncan@ximian.com>
21125
21126         * AssemblyInfo.cs: Bump the version number to 0.19.
21127
21128 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21129
21130         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21131
21132 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21133
21134         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21135
21136 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21137
21138         * cs-parser.jay: Small fix: we were not comparing the constructor
21139         name correctly.   Thanks to Zoltan for the initial pointer.
21140
21141 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21142
21143         * cs-tokenizer.cs: Set file name when specified with #line
21144
21145 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21146
21147         * cs-parser.jay: Only perform the constructor checks here if we
21148         are named like the class;  This will help provider a better
21149         error.  The constructor path is taken when a type definition is
21150         not found, but most likely the user forgot to add the type, so
21151         report that rather than the constructor error.
21152
21153 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21154
21155         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21156         allocations.
21157
21158 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21159
21160         * cs-parser.jay: Add cleanup call.
21161
21162 2003-01-13  Duncan Mak  <duncan@ximian.com>
21163
21164         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21165         consistent with other methods.
21166
21167 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21168
21169         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21170
21171 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21172
21173         * attribute.cs: only set GuidAttr to true when we have a
21174         GuidAttribute.
21175
21176 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21177
21178         * ecore.cs:
21179         * expression.cs:
21180         * typemanager.cs: fixes to allow mcs compile corlib with the new
21181         Type.IsSubclassOf fix.
21182
21183 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21184
21185         * expression.cs (LocalVariableReference.DoResolve): Classify a
21186         constant as a value, not as a variable.   Also, set the type for
21187         the variable.
21188
21189         * cs-parser.jay (fixed_statement): take a type instead of a
21190         pointer_type, so we can produce a better error message later.
21191
21192         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21193         as an error.  
21194
21195         (For.DoEmit): Make inifinite loops have a
21196         non-conditional branch back.
21197
21198         (Fixed.DoEmit): First populate the pinned variables, then emit the
21199         statement, then clear the variables.  Before I was emitting the
21200         code once for each fixed piece.
21201
21202
21203 2003-01-08  Martin Baulig  <martin@ximian.com>
21204
21205         * statement.cs (FlowBranching.MergeChild): A break in a
21206         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21207
21208 2003-01-08  Martin Baulig  <martin@ximian.com>
21209
21210         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21211         lives in the same number space than `param_map'.  Fixes #36154.
21212
21213 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21214
21215         * cs-parser.jay (constructor_declaration): Set the
21216         Constructor.ModFlags before probing for it.  This makes the
21217         compiler report 514, 515 and 132 (the code was there, but got
21218         broken). 
21219
21220         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21221         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21222         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21223
21224 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21225
21226         * enum.cs: create the enum static fields using the enum type.
21227
21228 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21229
21230         * class.cs: don't try to create the ParamBuilder for the return
21231         type if it's not needed (and handle it breaking for the ms runtime
21232         anyway).
21233
21234 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21235
21236         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21237
21238 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21239
21240         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21241         the command.   This showed up while compiling the JANET source
21242         code, which used \r as its only newline separator.
21243
21244 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * class.cs (Method.Define): If we are an operator (because it
21247         reuses our code), then set the SpecialName and HideBySig.  #36128
21248
21249 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21250
21251         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21252         exception, report error 120 `object reference required'.
21253
21254         * driver.cs: Add --pause option, used during to measure the size
21255         of the process as it goes with --timestamp.
21256
21257         * expression.cs (Invocation.DoResolve): Do not allow methods with
21258         SpecialName to be invoked.
21259
21260 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21263         number before adding it.
21264
21265 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21266
21267         * ecore.cs (StandardImplicitConversion): When in an unsafe
21268         context, we allow conversion between void * to any other pointer
21269         type. This fixes bug #35973.
21270
21271 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21272
21273         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21274         is not thrown when extensionless outputs are used 
21275
21276 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21277
21278         * rootcontext.cs: fixed compilation of corlib.
21279
21280 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21281
21282         * attribute.cs (Attributes.Contains): Add new method.
21283
21284         * class.cs (MethodCore.LabelParameters): if the parameter is an
21285         `out' parameter, check that no attribute `[In]' has been passed.
21286
21287         * enum.cs: Handle the `value__' name in an enumeration.
21288
21289 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21290
21291         * decl.cs: Added special case to allow overrides on "protected
21292         internal" methods
21293
21294 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21295
21296         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21297         since it makes much more sense.
21298
21299         (Attributes.ctor): Don't require a Location parameter.
21300
21301         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21302
21303         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21304         since we already have that information per attribute.
21305
21306         * everywhere : make appropriate changes.
21307
21308         * class.cs (LabelParameters): Write the code which actually
21309         applies attributes to the return type. We can't do this on the MS
21310         .NET runtime so we flag a warning in the case an exception is
21311         thrown.
21312
21313 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * const.cs: Handle implicit null conversions here too.
21316
21317 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21318
21319         * class.cs (MethodCore.LabelParameters): Remove the extra
21320         Type [] parameter since it is completely unnecessary. Instead
21321         pass in the method's attributes so that we can extract
21322         the "return" attribute.
21323
21324 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21325
21326         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21327         of ignoring it and letting the compile continue.
21328
21329         * typemanager.cs (ChangeType): use an extra argument to return an
21330         error condition instead of throwing an exception.
21331
21332 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * expression.cs (Unary.TryReduce): mimic the code for the regular
21335         code path.  Perform an implicit cast in the cases where we can
21336         implicitly convert to one of the integral types, and then reduce
21337         based on that constant.   This fixes bug #35483.
21338
21339 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21340
21341         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21342
21343 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21344
21345         * namespace.cs: fixed bug #35489.
21346
21347 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * class.cs: Remove some dead code.
21350
21351         * cs-parser.jay: Estimate the number of methods needed
21352         (RootContext.MethodCount);
21353
21354         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21355         numbers instead of StringBuilders.
21356
21357         * support.cs (PtrHashtable): Add constructor with initial size;
21358         We can now reduce reallocations of the method table.
21359
21360 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21361
21362         * attribute.cs (ApplyAttributes): Keep track of the emitted
21363         attributes on a per-target basis. This fixes bug #35413.
21364
21365 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21366
21367         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21368         default to the Windows 1252 encoding.
21369
21370         (UnixParseOption): Support version, thanks to Alp for the missing
21371         pointer. 
21372
21373         * AssemblyInfo.cs: Add nice assembly information.
21374
21375         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21376         (bug 35169).
21377
21378         * cs-parser.jay: Allow a trailing comma before the close bracked
21379         in the attribute_section production.
21380
21381         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21382         address of the instance was being taken, I will take this out,
21383         because we take the address of the object immediately here.
21384
21385 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21386
21387         * typemanager.cs (AreMultipleAllowed): Take care of the most
21388         obvious case where attribute type is not in the current assembly -
21389         stupid me ;-)
21390
21391 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21392
21393         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21394         definitions, instead of doing that afterwards.  
21395
21396         Also we use a nice little hack, depending on the constructor, we
21397         know if we are a "composed" name or a simple name.  Hence, we
21398         avoid the IndexOf test, and we avoid 
21399
21400         * codegen.cs: Add code to assist in a bug reporter to track down
21401         the source of a compiler crash. 
21402
21403 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21404
21405         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21406         types have been emitted for a given element and flag an error
21407         if something which does not have AllowMultiple set is used more
21408         than once.
21409
21410         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21411         attribute types and their corresponding AllowMultiple properties
21412
21413         (AreMultipleAllowed): Check the property for a given type.
21414
21415         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21416         property in the case we have a TypeContainer.
21417
21418         (Attributes.AddAttribute): Detect duplicates and just skip on
21419         adding them. This trivial fix catches a pretty gross error in our
21420         attribute emission - global attributes were being emitted twice!
21421
21422         Bugzilla bug #33187 is now fixed.
21423
21424 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21425
21426         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21427         instead of pp_and).
21428
21429         * expression.cs (Binary.ResolveOperator): I can only use the
21430         Concat (string, string, string) and Concat (string, string,
21431         string, string) if the child is actually a concatenation of
21432         strings. 
21433
21434 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21435
21436         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21437         context where we need a 2-character lookahead.
21438
21439         * pending.cs (PendingImplementation): Rework so we can keep track
21440         of interface types all the time, and flag those which were
21441         implemented by parents as optional.
21442
21443 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21444
21445         * expression.cs (Binary.ResolveOperator): Use
21446         String.Concat(string,string,string) or
21447         String.Concat(string,string,string,string) when possible. 
21448
21449         * typemanager: More helper methods.
21450
21451
21452 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21453
21454         * pending.cs: remove the bogus return from GetMissingInterfaces()
21455         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21456
21457 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21458
21459         * namespace.cs: avoid duplicated 'using xxx' being added to
21460         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21461         when we get more than one 'using' statement for the same namespace.
21462         Report a CS0105 warning for it.
21463
21464 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21465
21466         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21467         of calling getChar/putback, uses internal knowledge of it.    
21468
21469         (xtoken): Reorder tokenizer so most common patterns are checked
21470         first.  This reduces the compilation time in another 5% (from 8.11s
21471         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21472
21473         The parsing time is 22% of the compilation in mcs, and from that
21474         64% is spent on the tokenization process.  
21475
21476         I tried using a binary search for keywords, but this is slower
21477         than the hashtable.  Another option would be to do a couple of
21478         things:
21479
21480                 * Not use a StringBuilder, instead use an array of chars,
21481                   with a set value.  Notice that this way we could catch
21482                   the 645 error without having to do it *afterwards*.
21483
21484                 * We could write a hand-parser to avoid the hashtable
21485                   compares altogether.
21486
21487         The identifier consumption process takes 37% of the tokenization
21488         time.  Another 15% is spent on is_number.  56% of the time spent
21489         on is_number is spent on Int64.Parse:
21490
21491                 * We could probably choose based on the string length to
21492                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21493                   computations. 
21494
21495         Another 3% is spend on wrapping `xtoken' in the `token' function.
21496
21497         Handle 0xa0 as whitespace (#34752)
21498
21499 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21500
21501         * typemanager.cs (IsCLRType): New routine to tell whether a type
21502         is one of the builtin types.  
21503
21504         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21505         typecode in more places instead of doing pointer comparissions.
21506         We could leverage some knowledge about the way the typecodes are
21507         laid out.
21508
21509         New code to cache namespaces in assemblies, it is currently not
21510         invoked, to be used soon.
21511
21512         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21513
21514         * expression.cs (Binary.ResolveOperator): specially handle
21515         strings, and do not perform user-defined operator overloading for
21516         built-in types.
21517
21518 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21519
21520         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21521         internalcall as it is a pretty simple operation;  Avoid whenever
21522         possible to call Char.IsLetter.
21523
21524         (consume_identifier): Cut by half the number of
21525         hashtable calls by merging the is_keyword and GetKeyword behavior.
21526
21527         Do not short-circuit, because if we do, we
21528         report errors (ie, #if false && true would produce an invalid
21529         directive error);
21530
21531
21532 2002-11-24  Martin Baulig  <martin@ximian.com>
21533
21534         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21535         check constant ranges and report a CS0221.  Fixes #33186.
21536
21537 2002-11-24  Martin Baulig  <martin@ximian.com>
21538
21539         * cs-parser.jay: Make this work for uninitialized variable
21540         declarations in the `for' initializer.  Fixes #32416.
21541
21542 2002-11-24  Martin Baulig  <martin@ximian.com>
21543
21544         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21545         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21546
21547 2002-11-24  Martin Baulig  <martin@ximian.com>
21548
21549         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21550         argument; if true, we also check for user-defined conversions.
21551         This is only needed if both arguments are of a user-defined type.
21552         Fixes #30443, added test-175.cs.
21553         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21554
21555         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21556
21557 2002-11-24  Martin Baulig  <martin@ximian.com>
21558
21559         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21560         function to get the store opcode.
21561         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21562         only emit the Ldelema if the store opcode is Stobj.  You must run
21563         both test-34 and test-167 to test this.  Fixes #34529.
21564
21565 2002-11-23  Martin Baulig  <martin@ximian.com>
21566
21567         * ecore.cs (Expression.MemberLookup): Added additional
21568         `qualifier_type' argument which is used when we're being called
21569         from MemberAccess.DoResolve() and null if we're called from a
21570         SimpleName lookup.
21571         (Expression.MemberLookupFailed): New method to report errors; this
21572         does the CS1540 check and reports the correct error message.
21573
21574         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21575         argument for the CS1540 check and redone the way how we're dealing
21576         with private members.  See the comment in the source code for details.
21577         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21578         `closure_start_type' to `closure_qualifier_type' and check whether
21579         it's not null.  It was not this filter being broken, it was just
21580         being called with the wrong arguments.
21581
21582         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21583         and pass it the correct `qualifier_type'; this also does the error
21584         handling for us.
21585
21586 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21587
21588         * expression.cs (Invocation.EmitParams): If the we are dealing
21589         with a non-built-in value type, load its address as well.
21590
21591         (ArrayCreation): Use a a pretty constant instead
21592         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21593         static initializers.  
21594
21595         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21596         because they are not really value types, just glorified integers. 
21597
21598         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21599
21600         * ecore.cs: Remove redundant code for enumerations, make them use
21601         the same code path as everything else, fixes the casting issue
21602         with enumerations in Windows.Forms.
21603
21604         * attribute.cs: Do only cast to string if it is a string, the
21605         validation happens later.
21606
21607         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21608         people upgrade their corlibs.
21609
21610         * ecore.cs: Oops, enumerations were not following the entire code path
21611
21612 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21613
21614         * typemanager.cs (FilterWithClosure): Commented out the test for
21615         1540 in typemanager.cs, as it has problems when accessing
21616         protected methods from a parent class (see test-174.cs). 
21617
21618         * attribute.cs (Attribute.ValidateGuid): new method.
21619         (Attribute.Resolve): Use above.
21620
21621 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21624
21625         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21626         handling for enumerations, as we only needed the TypeContainer
21627         functionality to begin with (this is required for the fix below to
21628         work for enums that reference constants in a container class for
21629         example). 
21630
21631         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21632
21633         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21634         a valid TypeBuilder to perform lookups on.o
21635
21636         * class.cs (InheritableMemberSignatureCompare): Use true in the
21637         call to GetGetMethod and GetSetMethod, because we are comparing
21638         the signature, and we need to get the methods *even* if they are
21639         private. 
21640
21641         (PropertyBase.CheckBase): ditto.
21642
21643         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21644         GotoCase.Resolve): Use Peel on EmpytCasts.
21645
21646         * ecore.cs (EmptyCast): drop child, add Peel method.
21647
21648 2002-11-17  Martin Baulig  <martin@ximian.com>
21649
21650         * ecore.cs (EmptyCast.Child): New public property.
21651
21652         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21653         label resolved to an EmptyCast.  Fixes #34162.
21654         (GotoCase.Resolve): Likewise.
21655         (Block.EmitMeta): Likewise.
21656
21657 2002-11-17  Martin Baulig  <martin@ximian.com>
21658
21659         * expression.cs (Invocation.BetterConversion): Prefer int over
21660         uint; short over ushort; long over ulong for integer literals.
21661         Use ImplicitConversionExists instead of StandardConversionExists
21662         since we also need to check for user-defined implicit conversions.
21663         Fixes #34165.  Added test-173.cs.
21664
21665 2002-11-16  Martin Baulig  <martin@ximian.com>
21666
21667         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21668         with the `true' and `false' literals.  Fixes #33151.
21669
21670 2002-11-16  Martin Baulig  <martin@ximian.com>
21671
21672         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21673         October 22nd; don't do the cs1540 check for static members.
21674
21675         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21676         now using our own filter here and doing the cs1540 check again.
21677
21678 2002-11-16  Martin Baulig  <martin@ximian.com>
21679
21680         * support.cs (InternalParameters): Don't crash if we don't have
21681         any fixed parameters.  Fixes #33532.
21682
21683 2002-11-16  Martin Baulig  <martin@ximian.com>
21684
21685         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21686         when looking up static methods to make this work on Windows.
21687         Fixes #33773.
21688
21689 2002-11-16  Martin Baulig  <martin@ximian.com>
21690
21691         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21692         a setter rather than using PropertyInfo.CanWrite.
21693
21694 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21695
21696         * class.cs: Allow acces to block member by subclasses. Fixes build
21697         breaker.
21698
21699 2002-11-14  Martin Baulig  <martin@ximian.com>
21700
21701         * class.cs (Constructor.Emit): Added the extern/block check.
21702         Fixes bug #33678.
21703
21704 2002-11-14  Martin Baulig  <martin@ximian.com>
21705
21706         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21707         iteration while looking for indexers, this is needed because the
21708         indexer may have a different name in our base classes.  Fixed the
21709         error reporting (no indexers at all, not get accessor, no
21710         overloaded match).  Fixes bug #33089.
21711         (IndexerAccess.DoResolveLValue): Likewise.
21712
21713 2002-11-14  Martin Baulig  <martin@ximian.com>
21714
21715         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21716         indexers.  Fixes the first part of bug #33089.
21717         (MethodSignature.InheritableMemberSignatureCompare): Added support
21718         for properties.
21719
21720 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21721
21722         * attribute.cs (Attribute.Resolve): Catch the
21723         NullReferenceException and report it since it isn't supposed to
21724         happen. 
21725
21726 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21727
21728         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21729         LogicalOr and LogicalAnd that can benefit from recursively
21730         handling EmitBranchable.  The code now should be nice for Paolo.
21731
21732 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21733
21734         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21735         the Type lookups, as we perform quite a number of lookups on
21736         non-Types.  This can be removed once we can deterministically tell
21737         whether we have a type or a namespace in advance.
21738
21739         But this might require special hacks from our corlib.
21740
21741         * TODO: updated.
21742
21743         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21744         and double which avoids a conversion from an integer to a double.
21745
21746         * expression.cs: tiny optimization, avoid calling IsConstant,
21747         because it effectively performs the lookup twice.
21748
21749 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21750
21751         But a bogus return here to keep the semantics of the old code
21752         until the Mono runtime is fixed.
21753
21754         * pending.cs (GetMissingInterfaces): New method used to remove all
21755         the interfaces that are already implemented by our parent
21756         classes from the list of pending methods. 
21757
21758         * interface.cs: Add checks for calls after ResolveTypeExpr.
21759
21760 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21761
21762         * class.cs (Class.Emit): Report warning 67: event not used if the
21763         warning level is beyond 3.
21764
21765         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21766         being a NullLiteral.
21767
21768         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21769         specifiers. 
21770
21771         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21772         path that might fail if a type can not be resolved.
21773
21774         * expression.cs (Binary.Emit): Emit unsigned versions of the
21775         operators. 
21776
21777         * driver.cs: use error 5.
21778
21779 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21780
21781         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21782
21783 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21784
21785         * cs-parser.jay (switch_section): A beautiful patch from Martin
21786         Baulig that fixed 33094.
21787
21788 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21789
21790         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21791         Check whether the base is abstract and report an error if so.
21792
21793         * expression.cs (IndexerAccess.DoResolveLValue,
21794         IndexerAccess.DoResolve): ditto. 
21795
21796         (Invocation.DoResolve): ditto.
21797
21798         (Invocation.FullMethodDesc): Improve the report string.
21799
21800         * statement.cs (Block): Eliminate IsVariableDefined as it is
21801         basically just a wrapper for GetVariableInfo.
21802
21803         * ecore.cs (SimpleName): Use new 
21804
21805         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21806         type, as we return the actual parameter ref/unref state on a
21807         different call.
21808
21809 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * support.cs: Return proper flags REF/OUT fixing the previous
21812         commit.  
21813
21814         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21815         not used to mean `ref' but `ref or out' in ParameterReference
21816
21817         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21818         full type signature instead of calling TypeManger.CSharpName
21819         ourselves. 
21820
21821         * support.cs (InternalParameters.ParameterDesc): Do not compare
21822         directly to the modflags, because REF/OUT will actually be bitsets
21823         if set. 
21824
21825         * delegate.cs (VerifyMethod): Check also the modifiers.
21826
21827         * cs-tokenizer.cs: Fix bug where floating point values with an
21828         exponent where a sign was missing was ignored.
21829
21830         * driver.cs: Allow multiple assemblies to be specified in a single
21831         /r: argument
21832
21833 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21834
21835         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21836         because identifiers after a parenthesis would end up in this kind
21837         of production, and we needed to desamiguate it for having casts
21838         like:
21839
21840                 (UserDefinedType *) xxx
21841
21842 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21845         we should set on the Bindingflags.NonPublic, but not turn on
21846         private_ok.  private_ok controls whether a Private member is
21847         returned (this is chekced on the filter routine), while the
21848         BindingFlags.NonPublic just controls whether private/protected
21849         will be allowed.   This fixes the problem part of the problem of
21850         private properties being allowed to be used in derived classes.
21851
21852         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21853         so we can call the children DoResolveLValue method (this will
21854         properly signal errors on lvalue assignments to base properties)
21855
21856         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21857         getter are null, and we have a property info, we know that this
21858         happened because the lookup failed, so we report an error 122 for
21859         protection level violation.
21860
21861         We also silently return if setter and getter are null in the
21862         resolve functions, this condition only happens if we have flagged
21863         the error before.  This is the other half of the problem. 
21864
21865         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21866         not have accessibility information, that is why we were returning
21867         true in the filter function in typemanager.cs.
21868
21869         To properly report 122 (property is inaccessible because of its
21870         protection level) correctly, we report this error in ResolveAccess
21871         by failing if both the setter and the getter are lacking (ie, the
21872         lookup failed). 
21873
21874         DoResolve and DoLResolve have been modified to check for both
21875         setter/getter being null and returning silently, the reason being
21876         that I did not want to put the knowledge about this error in upper
21877         layers, like:
21878
21879         int old = Report.Errors;
21880         x = new PropertyExpr (...);
21881         if (old != Report.Errors)
21882                 return null;
21883         else
21884                 return x;
21885
21886         So the property expr is returned, but it is invalid, so the error
21887         will be flagged during the resolve process. 
21888
21889         * class.cs: Remove InheritablePropertySignatureCompare from the
21890         class, as we no longer depend on the property signature to compute
21891         whether it is possible to implement a method or not.
21892
21893         The reason is that calling PropertyInfo.GetGetMethod will return
21894         null (in .NET, in Mono it works, and we should change this), in
21895         cases where the Get Method does not exist in that particular
21896         class.
21897
21898         So this code:
21899
21900         class X { public virtual int A { get { return 1; } } }
21901         class Y : X { }
21902         class Z : Y { public override int A { get { return 2; } } }
21903
21904         Would fail in Z because the parent (Y) would not have the property
21905         defined.  So we avoid this completely now (because the alternative
21906         fix was ugly and slow), and we now depend exclusively on the
21907         method names.
21908
21909         (PropertyBase.CheckBase): Use a method-base mechanism to find our
21910         reference method, instead of using the property.
21911
21912         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
21913         routines are gone now.
21914
21915         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
21916         names, they were incorrectly named.
21917
21918         * cs-tokenizer.cs: Return are more gentle token on failure. 
21919
21920         * pending.cs (PendingImplementation.InterfaceMethod): This routine
21921         had an out-of-sync index variable, which caused it to remove from
21922         the list of pending methods the wrong method sometimes.
21923
21924 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
21927         CanWrite, because those refer to this particular instance of the
21928         property, and do not take into account the fact that we can
21929         override single members of a property.
21930
21931         Constructor requires an EmitContext.  The resolution process does
21932         not happen here, but we need to compute the accessors before,
21933         because the resolution does not always happen for properties.
21934
21935         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
21936         subclass, before we did not update this flag, but we did update
21937         bindingflags. 
21938
21939         (GetAccessors): Drop this routine, as it did not work in the
21940         presence of partially overwritten set/get methods. 
21941
21942         Notice that this broke the cs1540 detection, but that will require
21943         more thinking. 
21944
21945 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21946
21947         * class.cs:
21948         * codegen.cs:
21949         * driver.cs: issue a warning instead of an error if we don't support
21950         debugging for the platform. Also ignore a couple of errors that may
21951         arise when trying to write the symbols. Undo my previous patch.
21952
21953 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21954
21955         * driver.cs: ignore /debug switch except for Unix platforms.
21956
21957 2002-10-23  Nick Drochak  <ndrochak@gol.com>
21958
21959         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
21960
21961 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
21962
21963         * driver.cs: Do not make mcs-debug conditional, so we do not break
21964         builds that use it.
21965
21966         * statement.cs (UsageVector.MergeChildren): I would like Martin to
21967         review this patch.  But basically after all the children variables
21968         have been merged, the value of "Breaks" was not being set to
21969         new_breaks for Switch blocks.  I think that it should be set after
21970         it has executed.  Currently I set this to the value of new_breaks,
21971         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
21972         conservative, but I do not understand this code very well.
21973
21974         I did not break anything in the build, so that is good ;-)
21975
21976         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
21977
21978 2002-10-20  Mark Crichton  <crichton@gimp.org>
21979
21980         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
21981
21982 2002-10-20  Nick Drochak  <ndrochak@gol.com>
21983
21984         * cfold.cs: Fixed compile blocker.
21985
21986 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
21987
21988         * driver.cs: I was chekcing the key, not the file.
21989
21990 2002-10-19  Ravi Pratap  <ravi@ximian.com>
21991
21992         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
21993         message that we were generating - we just need to silently return
21994         a null.
21995
21996 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
21997
21998         * class.cs (Event.Define): Change my previous commit, as this
21999         breaks the debugger.  This is a temporary hack, as it seems like
22000         the compiler is generating events incorrectly to begin with.
22001
22002         * expression.cs (Binary.ResolveOperator): Added support for 
22003         "U operator - (E x, E y)"
22004
22005         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22006         y)".
22007
22008         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22009         init-only variables, but this path did not take into account that
22010         there might be also instance readonly variables.  Correct this
22011         problem. 
22012
22013         This fixes bug 32253
22014
22015         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22016         delegates as well.
22017
22018         * driver.cs: Change the extension for modules to `netmodule'
22019
22020         * cs-parser.jay: Improved slightly the location tracking for
22021         the debugger symbols.
22022
22023         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22024         modifiers that were specified instead of the hardcoded value
22025         (FamAndAssem).  This was basically ignoring the static modifier,
22026         and others.  Fixes 32429.
22027
22028         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22029         fixed a bug in the process (32476)
22030
22031         * expression.cs (ArrayAccess.EmitAssign): Patch from
22032         hwang_rob@yahoo.ca that fixes bug 31834.3
22033
22034 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * driver.cs: Make the module extension .netmodule.
22037
22038 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22039
22040         * driver.cs: Report an error if the resource file is not found
22041         instead of crashing.
22042
22043         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22044         false, like Emit does.
22045
22046 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22047
22048         * typemanager.cs: Remove unused private member.  Also reported mcs
22049         bug to report this as a warning like csc.
22050
22051 2002-10-15  Martin Baulig  <martin@gnome.org>
22052
22053         * statement.cs (Statement.Emit): Made this a virtual method; emits
22054         the line number info and calls DoEmit().
22055         (Statement.DoEmit): New protected abstract method, formerly knows
22056         as Statement.Emit().
22057
22058         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22059
22060 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22061
22062         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22063         have fixed a remaining problem: not every AddXXXX was adding a
22064         fully qualified name.  
22065
22066         Now everyone registers a fully qualified name in the DeclSpace as
22067         being defined instead of the partial name.  
22068
22069         Downsides: we are slower than we need to be due to the excess
22070         copies and the names being registered this way.  
22071
22072         The reason for this is that we currently depend (on the corlib
22073         bootstrap for instance) that types are fully qualified, because
22074         we dump all the types in the namespace, and we should really have
22075         types inserted into the proper namespace, so we can only store the
22076         basenames in the defined_names array.
22077
22078 2002-10-10  Martin Baulig  <martin@gnome.org>
22079
22080         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22081         from bug #31834, see the bug report for a testcase which is
22082         miscompiled.
22083
22084 2002-10-10  Martin Baulig  <martin@gnome.org>
22085
22086         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22087         flow analysis code for this.
22088
22089         * statement.cs (Do, While, For): Tell the flow analysis code about
22090         infinite loops.
22091         (FlowBranching.UsageVector): Added support for infinite loops.
22092         (Block.Resolve): Moved the dead code elimination here and use flow
22093         analysis to do it.
22094
22095 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22096
22097         * class.cs (Field.Define): Catch cycles on struct type
22098         definitions. 
22099
22100         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22101         fields if the fields are static.  We only need to check instance
22102         fields. 
22103
22104         * expression.cs (As.DoResolve): Test for reference type.
22105
22106         * statement.cs (Using.ResolveExpression): Use
22107         ConvertImplicitRequired, not ConvertImplicit which reports an
22108         error on failture
22109         (Using.ResolveLocalVariableDecls): ditto.
22110
22111         * expression.cs (Binary.ResolveOperator): Report errors in a few
22112         places where we had to.
22113
22114         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22115
22116 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22117
22118         * expression.cs: Use StoreFromPtr instead of extracting the type
22119         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22120
22121         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22122         an enumeration value to a System.Enum, but System.Enum is not a
22123         value type, but an class type, so we need to box.
22124
22125         (Expression.ConvertExplicit): One codepath could return
22126         errors but not flag them.  Fix this.  Fixes #31853
22127
22128         * parameter.cs (Resolve): Do not allow void as a parameter type.
22129
22130 2002-10-06  Martin Baulig  <martin@gnome.org>
22131
22132         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22133         if it's a class type and not a struct.  Fixes #31815.
22134
22135 2002-10-06  Martin Baulig  <martin@gnome.org>
22136
22137         * statement.cs: Reworked the flow analysis code a bit to make it
22138         usable for dead code elimination.
22139
22140 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22141
22142         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22143
22144 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22145
22146         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22147         to fix the test 165, will investigate deeper.
22148
22149 2002-10-04  Martin Baulig  <martin@gnome.org>
22150
22151         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22152         finally blocks actually work.
22153         (Try.Resolve): We don't need to create a sibling for `finally' if
22154         there is no finally block.
22155
22156 2002-10-04  Martin Baulig  <martin@gnome.org>
22157
22158         * class.cs (Constructor.Define): The default accessibility for a
22159         non-default constructor is private, not public.
22160
22161 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22162
22163         * class.cs (Constructor): Make AllowedModifiers public, add
22164         EXTERN.
22165
22166         * cs-parser.jay: Perform the modifiers test here, as the
22167         constructor for the Constructor class usually receives a zero
22168         because of the way we create it (first we create, later we
22169         customize, and we were never checking the modifiers).
22170
22171         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22172         is a version of LookupTypeReflection that includes the type-name
22173         cache.  This can be used as a fast path for functions that know
22174         the fully qualified name and are only calling into *.GetType() to
22175         obtain a composed type.
22176
22177         This is also used by TypeManager.LookupType during its type
22178         composition.
22179
22180         (LookupType): We now also track the real type name, as sometimes
22181         we can get a quey for the real type name from things like
22182         ComposedCast.  This fixes bug 31422.
22183
22184         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22185         complete type fullname, it does not have to go through the type
22186         resolution system to obtain the composed version of the type (for
22187         obtaining arrays or pointers).
22188
22189         (Conditional.Emit): Use the EmitBoolExpression to
22190         generate nicer code, as requested by Paolo.
22191
22192         (ArrayCreation.CheckIndices): Use the patch from
22193         hwang_rob@yahoo.ca to validate the array initializers. 
22194
22195 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * class.cs (ConstructorInitializer.Emit): simplify code by using
22198         Invocation.EmitCall, and at the same time, fix the bugs in calling
22199         parent constructors that took variable arguments. 
22200
22201         * ecore.cs (Expression.ConvertNumericExplicit,
22202         Expression.ImplicitNumericConversion): Remove the code that
22203         manually wrapped decimal (InternalTypeConstructor call is now gone
22204         as well).
22205
22206         * expression.cs (Cast.TryReduce): Also handle decimal types when
22207         trying to perform a constant fold on the type.
22208
22209         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22210
22211         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22212         that only turned off an error report, and did nothing else. 
22213
22214 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22215
22216         * driver.cs: Handle and ignore /fullpaths
22217
22218 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22219
22220         * expression.cs (Binary.ResolveOperator): Catch the case where
22221         DoNumericPromotions returns true, 
22222
22223         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22224
22225 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22226
22227         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22228         report error 70.
22229
22230 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22231
22232         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22233         conversion exists, but it is also required that the conversion be
22234         performed.  This manifested in "(Type64Enum) 2".  
22235
22236         * class.cs (TypeManager.AddMethod): The fix is not to change
22237         AddEnum, because that one was using a fully qualified name (every
22238         DeclSpace derivative does), but to change the AddMethod routine
22239         that was using an un-namespaced name.  This now correctly reports
22240         the duplicated name.
22241
22242         Revert patch until I can properly fix it.  The issue
22243         is that we have a shared Type space across all namespaces
22244         currently, which is wrong.
22245
22246         Options include making the Namespace a DeclSpace, and merge
22247         current_namespace/current_container in the parser.
22248
22249 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22250
22251         * cs-parser.jay: Improve error reporting when we get a different
22252         kind of expression in local_variable_type and
22253         local_variable_pointer_type. 
22254
22255         Propagate this to avoid missleading errors being reported.
22256
22257         * ecore.cs (ImplicitReferenceConversion): treat
22258         TypeManager.value_type as a target just like object_type.   As
22259         code like this:
22260
22261         ValueType v = 1;
22262
22263         Is valid, and needs to result in the int 1 being boxed before it
22264         is assigned to the value type v.
22265
22266         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22267         to validate the enumeration name.
22268
22269         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22270         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22271         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22272
22273         * ecore.cs (TryImplicitIntConversion): When doing an
22274         implicit-enumeration-conversion, check if the type is 64-bits and
22275         perform a conversion before passing to EnumConstant.
22276
22277 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22278
22279         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22280         report ambiguous type references.  Unlike the MS version, we
22281         report what the ambiguity is.   Innovation at work ;-)
22282
22283         (DeclSpace.FindType): Require a location argument to
22284         display when we display an ambiguous error.
22285
22286         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22287
22288         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22289
22290         * expression.cs (EmitDynamicInitializers): Apply patch from
22291         hwang_rob@yahoo.ca that fixes the order in which we emit our
22292         initializers. 
22293
22294 2002-09-21  Martin Baulig  <martin@gnome.org>
22295
22296         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22297         delegate takes no arguments.
22298
22299 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22300
22301         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22302         from integers.
22303
22304         * expression.cs: Extract the underlying type.
22305
22306         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22307
22308         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22309
22310 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22311
22312         * class.cs (TypeContainer.DefineType): We can not use the nice
22313         PackingSize with the size set to 1 DefineType method, because it
22314         will not allow us to define the interfaces that the struct
22315         implements.
22316
22317         This completes the fixing of bug 27287
22318
22319         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22320         means also structs.  This fixes part of the problem. 
22321         (Expresion.ImplicitReferenceConversionExists): ditto.
22322
22323         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22324         error if there were no errors reported during the type lookup
22325         process, to avoid duplicates or redundant errors.  Without this
22326         you would get an ambiguous errors plus a type not found.  We have
22327         beaten the user enough with the first error.  
22328
22329         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22330         reference. 
22331
22332         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22333         during the resolution process, stop the lookup, this avoids
22334         repeated error reports (same error twice).
22335
22336         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22337
22338         * typemanager.cs (LookupType): Redo the type lookup code to match
22339         the needs of System.Reflection.  
22340
22341         The issue is that System.Reflection requires references to nested
22342         types to begin with a "+" sign instead of a dot.  So toplevel
22343         types look like: "NameSpace.TopLevelClass", and nested ones look
22344         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22345         levels. 
22346
22347 2002-09-19  Martin Baulig  <martin@gnome.org>
22348
22349         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22350         says that a method always returns or always throws an exception,
22351         don't report the CS0161.
22352
22353         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22354         set `Returns = new_returns'.
22355
22356 2002-09-19  Martin Baulig  <martin@gnome.org>
22357
22358         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22359         to an enum constant, check for a CS0176.
22360
22361 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22362
22363         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22364         for operators that must be in pairs and report errors.
22365
22366         * ecore.cs (SimpleName.DoResolveType): During the initial type
22367         resolution process, when we define types recursively, we must
22368         check first for types in our current scope before we perform
22369         lookups in the enclosing scopes.
22370
22371         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22372
22373         (Invocation.VerifyArgumentsCompat): Call
22374         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22375         I thought we were supposed to always call this, but there are a
22376         few places in the code where we dont do it.
22377
22378 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22379
22380         * driver.cs: Add support in -linkres and -resource to specify the
22381         name of the identifier.
22382
22383 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22384
22385         * ecore.cs (StandardConversionExists): Sync with the conversion
22386         code: allow anything-* to void* conversions.
22387
22388         (FindMostSpecificSource): Use an Expression argument
22389         instead of a Type, because we might be handed over a Literal which
22390         gets a few more implicit conversions that plain types do not.  So
22391         this information was being lost.
22392
22393         Also, we drop the temporary type-holder expression when not
22394         required.
22395
22396 2002-09-17  Martin Baulig  <martin@gnome.org>
22397
22398         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22399         this is an explicit interface implementation.
22400
22401 2002-09-17  Martin Baulig  <martin@gnome.org>
22402
22403         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22404         different `IndexerName' attributes.
22405
22406         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22407         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22408         virtual CommonResolve().
22409
22410 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22413         and convert that to the UnderlyingType.
22414
22415         * statement.cs (Foreach.Resolve): Indexers are just like variables
22416         or PropertyAccesses.
22417
22418         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22419         inside quoted strings, we were not doing this before.
22420
22421 2002-09-16  Martin Baulig  <martin@gnome.org>
22422
22423         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22424         resolve it.  This is needed for the definite assignment check of the
22425         instance expression, fixes bug #29846.
22426         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22427
22428 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22429
22430         * parameter.cs: Fix compile error.  Cannot reference static member
22431         from an instance object.  Is this an mcs bug?
22432
22433 2002-09-14  Martin Baulig  <martin@gnome.org>
22434
22435         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22436         multiple times.  Fixes bug #30295, added test-166.cs.
22437
22438 2002-09-14  Martin Baulig  <martin@gnome.org>
22439
22440         * statement.cs (Block.Emit): Don't emit unreachable code.
22441         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22442         `break' statements.
22443         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22444
22445 2002-09-14  Martin Baulig  <martin@gnome.org>
22446
22447         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22448         is set.
22449
22450 2002-09-14  Martin Baulig  <martin@gnome.org>
22451
22452         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22453         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22454         be false on the ms runtime.
22455
22456 2002-09-13  Martin Baulig  <martin@gnome.org>
22457
22458         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22459         the CS0038 error message.
22460
22461 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22462
22463         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22464         constant inside, return it.
22465
22466 2002-09-12  Martin Baulig  <martin@gnome.org>
22467
22468         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22469         implicit conversion can be done between enum types.
22470
22471         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22472         check whether an implicit conversion to the current enum's UnderlyingType
22473         exists and report an error if not.
22474
22475         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22476         without debugging support.
22477
22478         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22479         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22480
22481 2002-09-12  Martin Baulig  <martin@gnome.org>
22482
22483         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22484
22485         * ecore.cs (IMemberExpr.DeclaringType): New property.
22486         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22487         nonstatic member of an outer type (CS0038).
22488
22489 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22490
22491         * driver.cs: Activate the using-error detector at warning level
22492         4 (at least for MS-compatible APIs).
22493
22494         * namespace.cs (VerifyUsing): Small buglett fix.
22495
22496         * pending.cs (PendingImplementation): pass the container pointer. 
22497
22498         * interface.cs (GetMethods): Allow for recursive definition.  Long
22499         term, I would like to move every type to support recursive
22500         definitions, not the current ordering mechanism that we have right
22501         now.
22502
22503         The situation is this: Attributes are handled before interfaces,
22504         so we can apply attributes to interfaces.  But some attributes
22505         implement interfaces, we will now handle the simple cases
22506         (recursive definitions will just get an error).  
22507
22508         * parameter.cs: Only invalidate types at the end if we fail to
22509         lookup all types.  
22510
22511 2002-09-09  Martin Baulig  <martin@gnome.org>
22512
22513         * ecore.cs (PropertyExpr.Emit): Also check for
22514         TypeManager.system_int_array_get_length so this'll also work when
22515         compiling corlib.  Fixes #30003.
22516
22517 2002-09-09  Martin Baulig  <martin@gnome.org>
22518
22519         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22520         and throw an exception if we can't get the type's size.  Fixed #30040,
22521         added test-165.cs.
22522
22523 2002-09-09  Martin Baulig  <martin@gnome.org>
22524
22525         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22526
22527         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22528         context.  Fixes bug #30027.
22529
22530         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22531         virtual functions.  Fixes bug #30043, added test-164.cs.
22532
22533 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22534
22535         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22536
22537 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22538
22539         * driver.cs: Use an object to get the windows codepage since it's not a
22540         static property.
22541
22542 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22543
22544         * statement.cs (For.Emit): for infinite loops (test == null)
22545         return whether there is a break inside, not always "true".
22546
22547         * namespace.cs (UsingEntry): New struct to hold the name of the
22548         using definition, the location where it is defined, and whether it
22549         has been used in a successful type lookup.
22550
22551         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22552         strings.
22553
22554         * decl.cs: ditto.
22555
22556 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22557
22558         * attribute.cs : Fix incorrect code which relied on catching
22559         a NullReferenceException to detect a null being passed in
22560         where an object was expected.
22561
22562 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22563
22564         * statement.cs (Try): flag the catch variable as assigned
22565
22566         * expression.cs (Cast): Simplified by using ResolveType instead of
22567         manually resolving.
22568
22569         * statement.cs (Catch): Fix bug by using ResolveType.
22570
22571 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22572
22573         * expression.cs (BetterConversion): Special case for when we have
22574         a NullLiteral as the argument and we have to choose between string
22575         and object types - we choose string the way csc does.
22576
22577         * attribute.cs (Attribute.Resolve): Catch the
22578         NullReferenceException and report error #182 since the Mono
22579         runtime no more has the bug and having this exception raised means
22580         we tried to select a constructor which takes an object and is
22581         passed a null.
22582
22583 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22584
22585         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22586         message (1502, 1503) when we can't locate a method after overload
22587         resolution. This is much more informative and closes the bug
22588         Miguel reported.
22589
22590         * interface.cs (PopulateMethod): Return if there are no argument
22591         types. Fixes a NullReferenceException bug.
22592
22593         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22594         expressions too. Previously we were checking only in one place for
22595         positional arguments leaving out named arguments.
22596
22597         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22598         type to the enum type is not allowed. Remove code corresponding to
22599         that.
22600
22601         (ConvertNumericExplicit): Allow explicit conversions from
22602         the underlying type to enum type. This precisely follows the spec
22603         and closes a bug filed by Gonzalo.
22604
22605 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22606
22607         * compiler.csproj:
22608         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22609
22610 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22611
22612         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22613         it was important that we stored the right value after the
22614         reduction in `converted'.
22615
22616 2002-09-04  Martin Baulig  <martin@gnome.org>
22617
22618         * location.cs (Location.SymbolDocument): Use full pathnames for the
22619         source files.
22620
22621 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22622
22623         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22624         of the expression resolve mechanism, because that will catch the
22625         SimpleName error failures.
22626
22627         (Conditional): If we can not resolve the
22628         expression, return, do not crash.
22629
22630 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22631
22632         * cs-tokenizer.cs:
22633         (location): display token name instead of its number.
22634
22635 2002-08-28  Martin Baulig  <martin@gnome.org>
22636
22637         * expression.cs (Binary.ResolveOperator): Don't silently return
22638         but return an error if an operator cannot be applied between two
22639         enum types.
22640
22641 2002-08-28  Martin Baulig  <martin@gnome.org>
22642
22643         * class.cs (Constructor.Define): Set the permission attributes
22644         correctly instead of making all constructors public.
22645
22646 2002-08-28  Martin Baulig  <martin@gnome.org>
22647
22648         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22649         for private members before reporting a CS0103; if we find anything,
22650         it's a CS0122.
22651
22652 2002-08-28  Martin Baulig  <martin@gnome.org>
22653
22654         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22655         to check whether `closure_start_type == closure_invocation_type',
22656         we also need to check whether `m.DeclaringType == closure_invocation_type'
22657         before bypassing the permission checks.  We might be accessing
22658         protected/private members from the base class.
22659         (TypeManager.RealMemberLookup): Only set private_ok if private
22660         members were requested via BindingFlags.NonPublic.
22661
22662         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22663
22664         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22665         MethodGroupExpr.IsExplicitImpl if appropriate.
22666         (Invocation.DoResolve): Don't report the CS0120 for explicit
22667         interface implementations.
22668
22669 2002-08-27  Martin Baulig  <martin@gnome.org>
22670
22671         * expression.cs (Invocation.DoResolve): If this is a static
22672         method and we don't have an InstanceExpression, we must report
22673         a CS0120.
22674
22675 2002-08-25  Martin Baulig  <martin@gnome.org>
22676
22677         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22678         `==' between a valuetype and an object.
22679
22680 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22681
22682         * ecore.cs (TypeExpr): Provide a ToString method.
22683
22684 2002-08-24  Martin Baulig  <martin@gnome.org>
22685
22686         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22687         now called proggie.dbg and it's a binary file.
22688
22689 2002-08-23  Martin Baulig  <martin@gnome.org>
22690
22691         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22692
22693 2002-08-23  Martin Baulig  <martin@gnome.org>
22694
22695         * struct.cs (MyStructInfo.ctor): Make this work with empty
22696         structs; it's not allowed to use foreach() on null.
22697
22698 2002-08-23  Martin Baulig  <martin@gnome.org>
22699
22700         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22701         writer the full pathname of the generated assembly.
22702
22703 2002-08-23  Martin Baulig  <martin@gnome.org>
22704
22705         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22706         A `finally' block never returns or breaks; improved handling of
22707         unreachable code.
22708
22709 2002-08-23  Martin Baulig  <martin@gnome.org>
22710
22711         * statement.cs (Throw.Resolve): Allow `throw null'.
22712
22713 2002-08-23  Martin Baulig  <martin@gnome.org>
22714
22715         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22716         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22717         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22718         MemberLookup would return a wrong event if this is an explicit
22719         interface implementation and the class has an event with the same
22720         name.
22721
22722 2002-08-23  Martin Baulig  <martin@gnome.org>
22723
22724         * statement.cs (Block.AddChildVariableNames): New public method.
22725         (Block.AddChildVariableName): Likewise.
22726         (Block.IsVariableNameUsedInChildBlock): Likewise.
22727         (Block.AddVariable): Check whether a variable name has already
22728         been used in a child block.
22729
22730         * cs-parser.jay (declare_local_variables): Mark all variable names
22731         from the current block as being used in a child block in the
22732         implicit block.
22733
22734 2002-08-23  Martin Baulig  <martin@gnome.org>
22735
22736         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22737         find the symbol writer.
22738
22739         * driver.cs: csc also allows the arguments to /define being
22740         separated by commas, not only by semicolons.
22741
22742 2002-08-23  Martin Baulig  <martin@gnome.org>
22743
22744         * interface.cs (Interface.GetMembers): Added static check for events.
22745
22746 2002-08-15  Martin Baulig  <martin@gnome.org>
22747
22748         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22749         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22750
22751         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22752         why the MethodData.EmitDestructor() change was necessary.
22753
22754 2002-08-20  Martin Baulig  <martin@gnome.org>
22755
22756         * class.cs (TypeContainer.FindMembers): Added static check for events.
22757
22758         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22759
22760         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22761         use Type.GetEvents(), not Type.FindMembers().
22762
22763 2002-08-20  Martin Baulig  <martin@gnome.org>
22764
22765         * decl.cs (MemberCache): Added a special method cache which will
22766         be used for method-only searched.  This ensures that a method
22767         search will return a MethodInfo with the correct ReflectedType for
22768         inherited methods.      
22769
22770 2002-08-20  Martin Baulig  <martin@gnome.org>
22771
22772         * decl.cs (DeclSpace.FindMembers): Made this public.
22773
22774 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22775
22776         * delegate.cs: fixed build on windows.
22777         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22778
22779 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22780
22781         * ecore.cs (StandardConversionExists): Return a false
22782         if we are trying to convert the void type to anything else
22783         since that is not allowed.
22784
22785         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22786         we flag error 70 in the event an event is trying to be accessed
22787         directly from outside the declaring type.
22788
22789 2002-08-20  Martin Baulig  <martin@gnome.org>
22790
22791         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22792         MemberCache from typemanager.cs to decl.cs.
22793
22794 2002-08-19  Martin Baulig  <martin@gnome.org>
22795
22796         * class.cs (TypeContainer): Implement IMemberContainer.
22797         (TypeContainer.DefineMembers): Create the MemberCache.
22798         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22799         return public members if BindingFlags.Public was given, check
22800         whether members are static.
22801
22802 2002-08-16  Martin Baulig  <martin@gnome.org>
22803
22804         * decl.cs (DeclSpace.Define): Splitted this in Define and
22805         DefineMembers.  DefineMembers is called first and initializes the
22806         MemberCache.
22807
22808         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22809         DefineMembers() on all our DeclSpaces.
22810
22811         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22812         but call DefineMembers() on all nested interfaces.  We call their
22813         Define() in our new Define() function.
22814
22815         * interface.cs (Interface): Implement IMemberContainer.
22816         (Interface.Define): Moved all code except the attribute stuf to
22817         DefineMembers().
22818         (Interface.DefineMembers): Initialize the member cache.
22819
22820         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22821         need this anymore since we can use MemberCache.FindMembers directly.
22822
22823 2002-08-19  Martin Baulig  <martin@gnome.org>
22824
22825         * typemanager.cs (MemberCache): When creating the cache for an
22826         interface type, add all inherited members.
22827         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22828         to `out bool used_cache' and documented it.
22829         (TypeManager.MemberLookup): If we already used the cache in the first
22830         iteration, we don't need to do the interfaces check.
22831
22832 2002-08-19  Martin Baulig  <martin@gnome.org>
22833
22834         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22835         here from IMemberFinder and don't implement this interface anymore.
22836         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22837
22838         * typemanager.cs (IMemberFinder): This interface is now only used by
22839         classes which actually support the member cache.
22840         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22841         since we only put DeclSpaces into this Hashtable.
22842         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22843         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22844
22845 2002-08-16  Martin Baulig  <martin@gnome.org>
22846
22847         * typemanager.cs (ICachingMemberFinder): Removed.
22848         (IMemberFinder.MemberCache): New property.
22849         (TypeManager.FindMembers): Merged this with RealFindMembers().
22850         This function will never be called from TypeManager.MemberLookup()
22851         so we can't use the cache here, just the IMemberFinder.
22852         (TypeManager.MemberLookup_FindMembers): Check whether the
22853         IMemberFinder has a MemberCache and call the cache's FindMembers
22854         function.
22855         (MemberCache): Rewrote larger parts of this yet another time and
22856         cleaned it up a bit.
22857
22858 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22859
22860         * driver.cs (LoadArgs): Support quoting.
22861
22862         (Usage): Show the CSC-like command line arguments.
22863
22864         Improved a few error messages.
22865
22866 2002-08-15  Martin Baulig  <martin@gnome.org>
22867
22868         * typemanager.cs (IMemberContainer.Type): New property.
22869         (IMemberContainer.IsInterface): New property.
22870
22871         The following changes are conditional to BROKEN_RUNTIME, which is
22872         defined at the top of the file.
22873
22874         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22875         class'es members, but add all members from TypeHandle.ObjectType
22876         if we're an interface.
22877         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22878         is the current type.
22879         (MemberCache.CacheEntry.Container): Removed this field.
22880         (TypeHandle.GetMembers): Include inherited members.
22881
22882 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22883
22884         * typemanager.cs: fixed compilation and added a comment on a field that
22885         is never used.
22886
22887 2002-08-15  Martin Baulig  <martin@gnome.org>
22888
22889         * class.cs (ConstructorInitializer.Resolve): In the
22890         Expression.MemberLookup call, use the queried_type as
22891         invocation_type.
22892
22893         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
22894         declared' attribute, it's always true.
22895         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
22896         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
22897         temporary wrapper for FindMembers which tells MemberLookup whether
22898         members from the base classes are included in the return value.
22899         This will go away soon.
22900         (TypeManager.MemberLookup): Use this temporary hack here; once the
22901         new MemberCache is completed, we don't need to do the DeclaredOnly
22902         looping here anymore since the MemberCache will take care of this.
22903         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
22904         (MemberCache): When creating the MemberCache for a class, get
22905         members from the current class and all its base classes.
22906         (MemberCache.CacheEntry.Container): New field.  This is a
22907         temporary hack until the Mono runtime is fixed to distinguish
22908         between ReflectedType and DeclaringType.  It allows us to use MCS
22909         with both the MS runtime and the unfixed Mono runtime without
22910         problems and without accecting performance.
22911         (MemberCache.SearchMembers): The DeclaredOnly looping from
22912         TypeManager.MemberLookup is now done here.      
22913
22914 2002-08-14  Martin Baulig  <martin@gnome.org>
22915
22916         * statement.cs (MyStructInfo.MyStructInfo): Don't call
22917         Type.GetFields on dynamic types but get the fields from the
22918         corresponding TypeContainer.
22919         (MyStructInfo.GetStructInfo): Added check for enum types.
22920
22921         * typemanager.cs (MemberList.IsSynchronized): Implemented.
22922         (MemberList.SyncRoot): Implemented.
22923         (TypeManager.FilterWithClosure): No need to check permissions if
22924         closure_start_type == closure_invocation_type, don't crash if
22925         closure_invocation_type is null.
22926
22927 2002-08-13  Martin Baulig  <martin@gnome.org>
22928
22929         Rewrote TypeContainer.FindMembers to use a member cache.  This
22930         gives us a speed increase of about 35% for the self-hosting MCS
22931         build and of about 15-20% for the class libs (both on GNU/Linux).
22932
22933         * report.cs (Timer): New class to get enhanced profiling.  This
22934         whole class is "TIMER" conditional since it remarkably slows down
22935         compilation speed.
22936
22937         * class.cs (MemberList): New class.  This is an IList wrapper
22938         which we're now using instead of passing MemberInfo[]'s around to
22939         avoid copying this array unnecessarily.
22940         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
22941         (ICachingMemberFinder, IMemberContainer): New interface.
22942         (TypeManager.FilterWithClosure): If `criteria' is null, the name
22943         has already been checked, otherwise use it for the name comparision.
22944         (TypeManager.FindMembers): Renamed to RealMemberFinder and
22945         provided wrapper which tries to use ICachingMemberFinder.FindMembers
22946         if possible.  Returns a MemberList, not a MemberInfo [].
22947         (TypeHandle): New class, implements IMemberContainer.  We create
22948         one instance of this class per type, it contains a MemberCache
22949         which is used to do the member lookups.
22950         (MemberCache): New class.  Each instance of this class contains
22951         all members of a type and a name-based hash table.
22952         (MemberCache.FindMembers): This is our new member lookup
22953         function.  First, it looks up all members of the requested name in
22954         the hash table.  Then, it walks this list and sorts out all
22955         applicable members and returns them.
22956
22957 2002-08-13  Martin Baulig  <martin@gnome.org>
22958
22959         In addition to a nice code cleanup, this gives us a performance
22960         increase of about 1.4% on GNU/Linux - not much, but it's already
22961         half a second for the self-hosting MCS compilation.
22962
22963         * typemanager.cs (IMemberFinder): New interface.  It is used by
22964         TypeManager.FindMembers to call FindMembers on a TypeContainer,
22965         Enum, Delegate or Interface.
22966         (TypeManager.finder_to_member_finder): New PtrHashtable.
22967         (TypeManager.finder_to_container): Removed.
22968         (TypeManager.finder_to_delegate): Removed.
22969         (TypeManager.finder_to_interface): Removed.
22970         (TypeManager.finder_to_enum): Removed.
22971
22972         * interface.cs (Interface): Implement IMemberFinder.
22973
22974         * delegate.cs (Delegate): Implement IMemberFinder.
22975
22976         * enum.cs (Enum): Implement IMemberFinder.
22977
22978         * class.cs (TypeContainer): Implement IMemberFinder.
22979
22980 2002-08-12  Martin Baulig  <martin@gnome.org>
22981
22982         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
22983
22984 2002-08-12  Martin Baulig  <martin@gnome.org>
22985
22986         * ecore.cs (ITypeExpression): New interface for expressions which
22987         resolve to a type.
22988         (TypeExpression): Renamed to TypeLookupExpression.
22989         (Expression.DoResolve): If we're doing a types-only lookup, the
22990         expression must implement the ITypeExpression interface and we
22991         call DoResolveType() on it.
22992         (SimpleName): Implement the new ITypeExpression interface.
22993         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
22994         hack, the situation that we're only looking up types can't happen
22995         anymore when this method is called.  Moved the type lookup code to
22996         DoResolveType() and call it.
22997         (SimpleName.DoResolveType): This ITypeExpression interface method
22998         is now doing the types-only lookup.
22999         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23000         (ResolveFlags): Added MaskExprClass.
23001
23002         * expression.cs (MemberAccess): Implement the ITypeExpression
23003         interface.
23004         (MemberAccess.DoResolve): Added support for a types-only lookup
23005         when we're called via ITypeExpression.DoResolveType().
23006         (ComposedCast): Implement the ITypeExpression interface.
23007
23008         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23009         Expression.Resolve() with ResolveFlags.Type instead.
23010
23011 2002-08-12  Martin Baulig  <martin@gnome.org>
23012
23013         * interface.cs (Interface.Define): Apply attributes.
23014
23015         * attribute.cs (Attribute.ApplyAttributes): Added support for
23016         interface attributes.
23017
23018 2002-08-11  Martin Baulig  <martin@gnome.org>
23019
23020         * statement.cs (Block.Emit): Only check the "this" variable if we
23021         do not always throw an exception.
23022
23023         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23024         whether the property has a set accessor.
23025
23026 2002-08-11  Martin Baulig  <martin@gnome.org>
23027
23028         Added control flow analysis support for structs.
23029
23030         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23031         with control flow analysis turned off.
23032         (IVariable): New interface.
23033         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23034         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23035         (FieldExpr.DoResolve): Resolve the instance expression with flow
23036         analysis turned off and do the definite assignment check after the
23037         resolving when we know what the expression will resolve to.
23038
23039         * expression.cs (LocalVariableReference, ParameterReference):
23040         Implement the new IVariable interface, only call the flow analysis
23041         code if ec.DoFlowAnalysis is true.
23042         (This): Added constructor which takes a Block argument.  Implement
23043         the new IVariable interface.
23044         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23045         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23046         This does the definite assignment checks for struct members.
23047
23048         * class.cs (Constructor.Emit): If this is a non-static `struct'
23049         constructor which doesn't have any initializer, call
23050         Block.AddThisVariable() to tell the flow analysis code that all
23051         struct elements must be initialized before control returns from
23052         the constructor.
23053
23054         * statement.cs (MyStructInfo): New public class.
23055         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23056         argument to this indexer.  If non-zero, check an individual struct
23057         member, not the whole struct.
23058         (FlowBranching.CheckOutParameters): Check struct members.
23059         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23060         overloaded versions of these methods which take an additional
23061         `int field_idx' argument to check struct members.
23062         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23063         overloaded versions of these methods which take an additional
23064         `string field_name' argument to check struct member.s
23065         (VariableInfo): Implement the IVariable interface.
23066         (VariableInfo.StructInfo): New public property.  Returns the
23067         MyStructInfo instance of the variable if it's a struct or null.
23068         (Block.AddThisVariable): New public method.  This is called from
23069         Constructor.Emit() for non-static `struct' constructor which do
23070         not have any initializer.  It creates a special variable for the
23071         "this" instance variable which will be checked by the flow
23072         analysis code to ensure that all of the struct's fields are
23073         initialized before control returns from the constructor.
23074         (UsageVector): Added support for struct members.  If a
23075         variable/parameter is a struct with N members, we reserve a slot
23076         in the usage vector for each member.  A struct is considered fully
23077         initialized if either the struct itself (slot 0) or all its
23078         members are initialized.
23079
23080 2002-08-08  Martin Baulig  <martin@gnome.org>
23081
23082         * driver.cs (Driver.MainDriver): Only report an error CS5001
23083         if there were no compilation errors.
23084
23085         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23086         `UnsafeContext' property to determine whether the parent is in
23087         unsafe context rather than checking the parent's ModFlags:
23088         classes nested in an unsafe class are unsafe as well.
23089
23090 2002-08-08  Martin Baulig  <martin@gnome.org>
23091
23092         * statement.cs (UsageVector.MergeChildren): Distinguish between
23093         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23094         we return.  Added test17() and test18() to test-154.cs.
23095
23096 2002-08-08  Martin Baulig  <martin@gnome.org>
23097
23098         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23099         Family access, make sure the invoking type isn't a subclass of the
23100         queried type (that'd be a CS1540).
23101
23102         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23103         this method which takes an additional `Type invocation_type'.
23104
23105         * expression.cs (BaseAccess.DoResolve): Use the base type as
23106         invocation and query type.
23107         (MemberAccess.DoResolve): If the lookup failed and we're about to
23108         report a CS0122, try a lookup with the ec.ContainerType - if this
23109         succeeds, we must report a CS1540.
23110
23111 2002-08-08  Martin Baulig  <martin@gnome.org>
23112
23113         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23114         (MethodGroupExpr): Implement the IMemberExpr interface.
23115
23116         * expression (MemberAccess.ResolveMemberAccess): No need to have
23117         any special code for MethodGroupExprs anymore, they're now
23118         IMemberExprs.   
23119
23120 2002-08-08  Martin Baulig  <martin@gnome.org>
23121
23122         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23123         Family, FamANDAssem and FamORAssem permissions.
23124         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23125
23126 2002-08-08  Martin Baulig  <martin@gnome.org>
23127
23128         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23129         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23130         or loop block.
23131
23132 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23133
23134         * driver.cs: implemented /resource option to embed managed resources.
23135
23136 2002-08-07  Martin Baulig  <martin@gnome.org>
23137
23138         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23139         (FieldBase.HasFieldInitializer): New public property.
23140         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23141         returns the field initializer and makes sure it is only resolved once.
23142         (TypeContainer.EmitFieldInitializers): Call
23143         FieldBase.GetInitializerExpression to get the initializer, this ensures
23144         that it isn't resolved multiple times.
23145
23146         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23147         the resolving process (SimpleName/MemberLookup) that we're currently
23148         emitting a field initializer (which must not access any instance members,
23149         this is an error CS0236).
23150
23151         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23152         argument, if the `IsFieldInitializer' flag is set, we must report and
23153         error CS0236 and not an error CS0120.   
23154
23155 2002-08-07  Martin Baulig  <martin@gnome.org>
23156
23157         * ecore.cs (IMemberExpr): New public interface.
23158         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23159         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23160         if the expression is an IMemberExpr.
23161
23162         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23163         to be null, implicitly default to `this' if we're non-static in
23164         this case.  Simplified the code a lot by using the new IMemberExpr
23165         interface.  Also fixed bug #28176 here.
23166
23167 2002-08-06  Martin Baulig  <martin@gnome.org>
23168
23169         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23170         ParameterReferences during semantic analysis so that we can do a
23171         type-only search when resolving Cast, TypeOf and SizeOf.
23172         (block): Pass the `current_local_parameters' to the Block's
23173         constructor.
23174
23175         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23176         argument to the constructor.
23177         (ConstructorInitializer.Resolve): Create a temporary implicit
23178         block with the parameters.
23179
23180         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23181         references here if we aren't doing a type-only search.
23182
23183         * statement.cs (Block): Added constructor which takes a
23184         `Parameters parameters' argument.
23185         (Block.Parameters): New public property.
23186
23187         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23188         to `Parameters' and made it public readonly.
23189
23190 2002-08-06  Martin Baulig  <martin@gnome.org>
23191
23192         * ecore.cs (Expression.Warning): Made this public as well.
23193
23194         * report.cs (Report.Debug): Print the contents of collections.
23195
23196 2002-08-06  Martin Baulig  <martin@gnome.org>
23197
23198         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23199         used to tell Resolve() which kinds of expressions it may return.
23200         (Expression.Resolve): Added overloaded version of this method which
23201         takes a `ResolveFlags flags' argument.  This can be used to tell
23202         Resolve() which kinds of expressions it may return.  Reports a
23203         CS0118 on error.
23204         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23205         ResolveFlags.SimpleName.
23206         (Expression.Error118): Added overloaded version of this method which
23207         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23208         which kinds of expressions are allowed.
23209
23210         * expression.cs (Argument.ResolveMethodGroup): New public method.
23211         Resolves an argument, but allows a MethodGroup to be returned.
23212         This is used when invoking a delegate.
23213
23214         * TODO: Updated a bit.
23215
23216 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23217
23218         Fixed compilation with csc.
23219
23220         * ecore.cs: Expression.Error made public. Is this correct? Should
23221         Warning be made public too?
23222
23223         * expression.cs: use ea.Location instead of ea.loc.
23224         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23225
23226 2002-08-06  Martin Baulig  <martin@gnome.org>
23227
23228         * ecore.cs (Expression.loc): Moved the location here instead of
23229         duplicating it in all derived classes.
23230         (Expression.Location): New public property.
23231         (Expression.Error, Expression.Warning): Made them non-static and
23232         removed the location argument.
23233         (Expression.Warning): Added overloaded version which takes an
23234         `int level' argument.
23235         (Expression.Error118): Make this non-static and removed the
23236         expression and location arguments.
23237         (TypeExpr): Added location argument to the constructor.
23238
23239         * expression.cs (StaticCallExpr): Added location argument to
23240         the constructor.
23241         (Indirection, PointerArithmetic): Likewise.
23242         (CheckedExpr, UnCheckedExpr): Likewise.
23243         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23244         (StringPtr): Likewise.
23245
23246
23247 2002-08-05  Martin Baulig  <martin@gnome.org>
23248
23249         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23250
23251         * assign.cs (Assign.DoResolve): Check whether the source
23252         expression is a value or variable.
23253
23254         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23255         while resolving the corresponding blocks.
23256
23257         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23258         an error, don't silently return null.
23259
23260         * statement.cs (Block.AddVariable): Do the error reporting here
23261         and distinguish between CS0128 and CS0136.
23262         (Block.DoResolve): Report all unused labels (warning CS0164).
23263         (LabeledStatement): Pass the location to the constructor.
23264         (LabeledStatement.HasBeenReferenced): New property.
23265         (LabeledStatement.Resolve): Set it to true here.
23266
23267         * statement.cs (Return.Emit): Return success even after reporting
23268         a type mismatch error (CS0126 or CS0127), this is what csc does and
23269         it avoids confusing the users with any consecutive errors.
23270
23271 2002-08-05  Martin Baulig  <martin@gnome.org>
23272
23273         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23274
23275         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23276
23277         * expression.cs (MemberAccess.DoResolve): Silently return if an
23278         error has already been reported.
23279
23280         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23281         error has already been reported.
23282
23283 2002-08-05  Martin Baulig  <martin@gnome.org>
23284
23285         * statement.cs (UsageVector): Only initialize the `parameters'
23286         vector if we actually have any "out" parameters.
23287
23288 2002-08-05  Martin Baulig  <martin@gnome.org>
23289
23290         * expression.cs (Binary.ResolveOperator): When combining delegates,
23291         they must have the same type.
23292
23293 2002-08-05  Martin Baulig  <martin@gnome.org>
23294
23295         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23296         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23297         work with the ms runtime and we also don't need it: if we're a
23298         PropertyBuilder and not in the `indexer_arguments' hash, then we
23299         are a property and not an indexer.
23300
23301         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23302         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23303         since the latter one doesn't work with the ms runtime.
23304
23305 2002-08-03  Martin Baulig  <martin@gnome.org>
23306
23307         Fixed bugs #27998 and #22735.
23308
23309         * class.cs (Method.IsOperator): New public field.
23310         (Method.CheckBase): Report CS0111 if there's already a method
23311         with the same parameters in the current class.  Report CS0508 when
23312         attempting to change the return type of an inherited method.
23313         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23314         and it's not marked abstract or extern.
23315         (PropertyBase): New abstract base class for Property and Indexer.
23316         (PropertyBase.CheckBase): Moved here from Property and made it work
23317         for indexers.
23318         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23319         the same so we can reuse it there.
23320         (Property, Indexer): Derive from PropertyBase.
23321         (MethodSignature.inheritable_property_signature_filter): New delegate
23322         to find properties and indexers.
23323
23324         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23325         argument and improved error reporting.
23326
23327         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23328         EmptyReadOnlyParameters and made it a property.
23329
23330         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23331         version of this method which takes a `PropertyInfo indexer'.
23332         (TypeManager.RegisterIndexer): New method.
23333
23334         * class.cs: Added myself as author of this file :-)
23335
23336 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23337
23338         * class.cs: fixed compilation on windoze.
23339
23340 2002-08-03  Martin Baulig  <martin@gnome.org>
23341
23342         * interface.cs (Interface.GetInterfaceBases): Check whether all
23343         base interfaces are at least as accessible than the current one.
23344
23345         * class.cs (TypeContainer.GetClassBases): Check whether base types
23346         are at least as accessible than the current type.
23347         (TypeContainer.AsAccessible): Implemented and made non-static.
23348         (MemberBase.CheckParameters): Report errors if the accessibility
23349         checks fail.
23350
23351         * delegate.cs (Delegate.Delegate): The default visibility is
23352         internal for top-level types and private for nested types.
23353         (Delegate.Define): Report errors if the accessibility checks fail.
23354
23355         * enum.cs (Enum.Enum): The default visibility is internal for
23356         top-level types and private for nested types.
23357         (Enum.DefineType): Compute the correct visibility.
23358
23359         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23360         function which takes a `bool is_toplevel' instead of a TypeContainer.
23361
23362         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23363         builtin type.
23364
23365 2002-08-02  Martin Baulig  <martin@gnome.org>
23366
23367         * expression.cs (LocalVariableReferenc): Added constructor which
23368         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23369         (LocalVariableReference.IsReadOnly): New property.
23370         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23371         variable is readonly, use our own readonly flag to do this; you can
23372         use the new constructor to get a writable reference to a read-only
23373         variable.
23374
23375         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23376         reference to the local variable.
23377
23378 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23379
23380         * rootcontext.cs (ResolveCore): Also include System.Exception
23381
23382         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23383         we reach an EmptyStatement.
23384
23385         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23386         is also fine.
23387
23388         * expression.cs (Binary.ResolveOperator): Check error result in
23389         two places.
23390
23391         use brtrue/brfalse directly and avoid compares to null.
23392
23393 2002-08-02  Martin Baulig  <martin@gnome.org>
23394
23395         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23396         Fixes bug #28407, added test-155.cs.
23397
23398 2002-08-01  Martin Baulig  <martin@gnome.org>
23399
23400         * class.cs (Event.EmitDefaultMethod): Make this work with static
23401         events.  Fixes #28311, added verify-3.cs.
23402
23403 2002-08-01  Martin Baulig  <martin@gnome.org>
23404
23405         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23406         `is_disposable' fields.
23407         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23408         `hm.is_disposable' if we're using the collection pattern.
23409         (Foreach.EmitCollectionForeach): Use the correct type for the
23410         enumerator's local variable, only emit the try/finally block if
23411         necessary (fixes #27713).
23412
23413 2002-08-01  Martin Baulig  <martin@gnome.org>
23414
23415         * ecore.cs (Expression.report118): Renamed to Error118 and made
23416         it public static.
23417
23418         * statement.cs (Throw.Resolve): Check whether the expression is of
23419         the correct type (CS0118) and whether the type derives from
23420         System.Exception (CS0155).
23421         (Catch.Resolve): New method.  Do the type lookup here and check
23422         whether it derives from System.Exception (CS0155).
23423         (Catch.CatchType, Catch.IsGeneral): New public properties.
23424
23425         * typemanager.cs (TypeManager.exception_type): Added.
23426
23427 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23428
23429         * driver.cs: Updated About function.
23430
23431 2002-07-31  Martin Baulig  <martin@gnome.org>
23432
23433         Implemented Control Flow Analysis.
23434
23435         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23436         (EmitContext.CurrentBranching): Added.
23437         (EmitContext.StartFlowBranching): Added.
23438         (EmitContext.EndFlowBranching): Added.
23439         (EmitContext.KillFlowBranching): Added.
23440         (EmitContext.IsVariableAssigned): Added.
23441         (EmitContext.SetVariableAssigned): Added.
23442         (EmitContext.IsParameterAssigned): Added.
23443         (EmitContext.SetParameterAssigned): Added.
23444         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23445         Added control flow analysis stuff here.
23446
23447         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23448         resolve the expression as lvalue.
23449         (LocalVariableReference.DoResolve): Check whether the variable has
23450         already been assigned.
23451         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23452         the parameter as assigned here.
23453         (ParameterReference.DoResolve): Check whether the parameter has already
23454         been assigned.
23455         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23456         expression as lvalue.
23457
23458         * statement.cs (FlowBranching): New class for the flow analysis code.
23459         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23460         (LabeledStatement.IsDefined): New public property.
23461         (LabeledStatement.AddUsageVector): New public method to tell flow
23462         analyis that the label may be reached via a forward jump.
23463         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23464         flow analysis.
23465         (VariableInfo.Number): New public field.  This is used by flow analysis
23466         to number all locals of a block.
23467         (Block.CountVariables): New public property.  This is the number of
23468         local variables in this block (including the locals from all parent
23469         blocks).
23470         (Block.EmitMeta): Number all the variables.
23471
23472         * statement.cs: Added flow analysis support to all classes.
23473
23474 2002-07-31  Martin Baulig  <martin@gnome.org>
23475
23476         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23477         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23478         then use this argument.
23479
23480         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23481
23482         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23483         use this to specify /define options.
23484
23485 2002-07-29  Martin Baulig  <martin@gnome.org>
23486
23487         * statement.cs (Fixed): Moved all code that does variable lookups
23488         and resolvings from Emit to Resolve.
23489
23490         * statement.cs (For): Moved all code that does variable lookups
23491         and resolvings from Emit to Resolve.
23492
23493         * statement.cs (Using): Moved all code that does variable lookups
23494         and resolvings from Emit to Resolve.
23495
23496 2002-07-29  Martin Baulig  <martin@gnome.org>
23497
23498         * attribute.cs (Attribute.Resolve): Explicitly catch a
23499         System.NullReferenceException when creating the
23500         CustromAttributeBuilder and report a different warning message.
23501
23502 2002-07-29  Martin Baulig  <martin@gnome.org>
23503
23504         * support.cs (ParameterData.ParameterName): Added method to
23505         get the name of a parameter.
23506
23507         * typemanager.cs (TypeManager.IsValueType): New public method.
23508
23509 2002-07-29  Martin Baulig  <martin@gnome.org>
23510
23511         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23512         is a flag which specifies that it's either ref or out.
23513         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23514         the out parameter to `out Parameter.Modifier mod', also set the
23515         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23516
23517         * support.cs (InternalParameters.ParameterModifier): Distinguish
23518         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23519         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23520
23521         * expression.cs (Argument.GetParameterModifier): Distinguish
23522         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23523         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23524
23525 2002-07-29  Martin Baulig  <martin@gnome.org>
23526
23527         * expression.cs (ParameterReference.ParameterReference): Added
23528         `Location loc' argument to the constructor.
23529
23530         * cs-parser.jay: Pass location to ParameterReference.
23531
23532 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23533
23534         * statement.cs (Try): Initialize the location.
23535
23536         * cs-parser.jay: pass location to Try.
23537
23538         * expression.cs (Unary.Reduce): Change the prototype to return
23539         whether a constant fold could be performed or not.  The result is
23540         returned in an out parameters.  In the case of Indirection and
23541         AddressOf, we want to perform the full tests.
23542
23543 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23544
23545         * statement.cs (Statement.Emit): Flag dead code.
23546
23547 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23548
23549         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23550
23551 2002-07-27  Martin Baulig  <martin@gnome.org>
23552
23553         * class.cs (MethodData.Define): Put back call to
23554         TypeManager.AddMethod(), accidentally commented this out.
23555
23556         * report.cs (Debug): New public method to print debugging information,
23557         this is `[Conditional ("DEBUG")]'.
23558
23559 2002-07-26  Martin Baulig  <martin@gnome.org>
23560
23561         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23562         (switch_statement): Push the current_block to the switch_stack and
23563         pop it again when we're done with the switch.
23564         (switch_section): The new block is a child of the current_block.
23565         Fixes bug #24007, added test-152.cs.
23566
23567 2002-07-27  Martin Baulig  <martin@gnome.org>
23568
23569         * expression.cs (Invocation.EmitArguments): When calling a varargs
23570         function with only its fixed arguments, we need to pass an empty
23571         array.
23572
23573 2002-07-27  Martin Baulig  <martin@gnome.org>
23574
23575         Mono 0.13 has been released.
23576
23577 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23578
23579         * driver.cs: Rename --resource to --linkres, because that is what
23580         we do currently, we dont support --resource yet.
23581
23582         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23583
23584 2002-07-25  Martin Baulig  <martin@gnome.org>
23585
23586         * class.cs (MethodData): New public class.  This is a `method builder'
23587         class for a method or one accessor of a Property/Indexer/Event.
23588         (MethodData.GetMethodFlags): Moved here from MemberBase.
23589         (MethodData.ApplyAttributes): Likewise.
23590         (MethodData.ApplyObsoleteAttribute): Likewise.
23591         (MethodData.ApplyConditionalAttribute): Likewise.
23592         (MethodData.ApplyDllImportAttribute): Likewise.
23593         (MethodData.CheckAbstractAndExternal): Likewise.
23594         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23595         (MethodData.Emit): Formerly known as Method.Emit().
23596         (MemberBase): Moved everything which was specific to a single
23597         accessor/method to MethodData.
23598         (Method): Create a new MethodData and call Define() and Emit() on it.
23599         (Property, Indexer, Event): Create a new MethodData objects for each
23600         accessor and call Define() and Emit() on them.
23601
23602 2002-07-25  Martin Baulig  <martin@gnome.org>
23603
23604         Made MethodCore derive from MemberBase to reuse the code from there.
23605         MemberBase now also checks for attributes.
23606
23607         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23608         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23609         as virtual.
23610         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23611         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23612         (MemberBase.ApplyAttributes): New virtual method; applies the
23613         attributes to a method or accessor.
23614         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23615         (MemberBase.ApplyConditionalAttribute): Likewise.
23616         (MemberBase.ApplyDllImportAttribute): Likewise.
23617         (MemberBase.CheckAbstractAndExternal): Likewise.
23618         (MethodCore.ParameterTypes): This is now a property instead of a
23619         method, it's initialized from DoDefineParameters().
23620         (MethodCore.ParameterInfo): Removed the set accessor.
23621         (MethodCore.DoDefineParameters): New protected virtual method to
23622         initialize ParameterTypes and ParameterInfo.
23623         (Method.GetReturnType): We can now simply return the MemberType.
23624         (Method.GetMethodFlags): Override the MemberBase version and add
23625         the conditional flags.
23626         (Method.CheckBase): Moved some code from Define() here, call
23627         DoDefineParameters() here.
23628         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23629         here to avoid some larger code duplication.
23630         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23631         ensure that abstract and external accessors don't declare a body.
23632
23633         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23634         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23635         lookup in the attribute's parent classes, so we need to abort as soon
23636         as we found the first match.
23637         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23638         the attribute has no arguments.
23639
23640         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23641         of a Method.
23642
23643 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23644
23645         * cs-parser.jay: reverted previous patch.
23646
23647 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23648
23649         * cs-parser.jay: fixed bug #22119.
23650
23651 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23652
23653         * attribute.cs: fixed compilation. The error was:
23654         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23655         be assigned to before control leaves the current method."
23656         [FIXME:  Filed as bug #28186: MCS must report this error.]
23657
23658 2002-07-25  Martin Baulig  <martin@gnome.org>
23659
23660         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23661         method to pull the condition name ouf of a Conditional attribute.
23662         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23663         the obsolete message and error flag out of an Obsolete attribute.
23664
23665         * class.cs (Method.GetMethodFlags): New public method to get the
23666         TypeManager.MethodFlags for this method.
23667         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23668         private methods.
23669         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23670         if we're overriding a virtual function, set the new private variable
23671         `parent_method'; call the new TypeManager.AddMethod().
23672
23673         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23674         the MethodBuilder and the Method in a PtrHashtable.
23675         (TypeManager.builder_to_method): Added for this purpose.
23676         (TypeManager.MethodFlags): Added IsObsoleteError.
23677         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23678         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23679         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23680         the message from the attribute.
23681
23682 2002-07-24  Martin Baulig  <martin@gnome.org>
23683
23684         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23685         preprocessor directives, ensure that the argument to #define/#undef is
23686         exactly one identifier and that it's actually an identifier.
23687
23688         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23689         did not work ....
23690
23691 2002-07-24  Martin Baulig  <martin@gnome.org>
23692
23693         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23694         initialize it to TypeManager.object_type in the constructor.
23695         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23696         of the `hm.get_current' method if we're using the collection pattern.
23697         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23698         for the explicit conversion to make it work when we're using the collection
23699         pattern and the `Current' property has a different return type than `object'.
23700         Fixes #27713.
23701
23702 2002-07-24  Martin Baulig  <martin@gnome.org>
23703
23704         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23705         does not match, but don't report any errors.  This method is called in
23706         order for all methods in a MethodGroupExpr until a matching method is
23707         found, so we don't want to bail out if the first method doesn't match.
23708         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23709         matches, report the 123.  Fixes #28070.
23710
23711 2002-07-24  Martin Baulig  <martin@gnome.org>
23712
23713         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23714         TypeManager.TypeToCoreType() to the top of the method so the
23715         following equality checks will work.  Fixes #28107.
23716
23717 2002-07-24  Martin Baulig  <martin@gnome.org>
23718
23719         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23720         operand is of type uint, and the other operand is of type sbyte,
23721         short or int, the operands are converted to type long." -
23722         Actually do what this comment already told us.  Fixes bug #28106,
23723         added test-150.cs.
23724
23725 2002-07-24  Martin Baulig  <martin@gnome.org>
23726
23727         * class.cs (MethodBase): New abstract class.  This is now a base
23728         class for Property, Indexer and Event to avoid some code duplication
23729         in their Define() and DefineMethods() methods.
23730         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23731         generic methods for Define() and DefineMethods().
23732         (FieldBase): Derive from MemberBase, not MemberCore.
23733         (Property): Derive from MemberBase, not MemberCore.
23734         (Property.DefineMethod): Moved all the code from this method to the
23735         new MethodBase.DefineAccessor(), just call it with appropriate
23736         argumetnts.
23737         (Property.Define): Call the new Property.DoDefine(), this does some
23738         sanity checks and we don't need to duplicate the code everywhere.
23739         (Event): Derive from MemberBase, not MemberCore.
23740         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23741         accessors, this will also make them work with interface events.
23742         (Indexer): Derive from MemberBase, not MemberCore.
23743         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23744         (Indexer.Define): Use the new MethodBase functions.
23745
23746         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23747         argument to the constructor.
23748         (Interface.FindMembers): Added support for interface events.
23749         (Interface.PopluateEvent): Implemented.
23750
23751         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23752
23753 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23754
23755         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23756         but this is required to check for a method name being the same as
23757         the containing class.  
23758
23759         Handle this now.
23760
23761 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23762
23763         * interface.cs: initialize variable.
23764
23765 2002-07-23  Martin Baulig  <martin@gnome.org>
23766
23767         Implemented the IndexerName attribute in interfaces.
23768
23769         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23770         name if this is an explicit interface implementation.
23771         (Indexer.InterfaceIndexerName): New public variable.  If we're
23772         implementing an interface indexer, this is the IndexerName in that
23773         interface.  Otherwise, it's the IndexerName.
23774         (Indexer.DefineMethod): If we're implementing interface indexer,
23775         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23776         and Pending.ImplementIndexer methods.
23777         (Indexer.Define): Also define the PropertyBuilder if we're
23778         implementing an interface indexer and this is neither an explicit
23779         interface implementation nor do the IndexerName match the one in
23780         the interface.
23781
23782         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23783         If a method is defined here, then we always need to create a proxy
23784         for it.  This is used when implementing interface indexers.
23785         (Pending.IsInterfaceIndexer): New public method.
23786         (Pending.ImplementIndexer): New public method.
23787         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23788         This is used when implementing interface indexers to define a proxy
23789         if necessary.
23790         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23791         define a proxy if necessary.
23792
23793         * interface.cs (Interface.IndexerName): New public variable.
23794         (Interface.PopulateIndexer): Set the IndexerName.
23795         (Interface.DefineIndexers): New private method.  Populate all the
23796         indexers and make sure their IndexerNames match.
23797
23798         * typemanager.cs (IndexerPropertyName): Added support for interface
23799         indexers.
23800
23801 2002-07-22  Martin Baulig  <martin@gnome.org>
23802
23803         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23804         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23805         ret if HasReturnLabel.
23806         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23807         variables.
23808
23809         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23810         and set the ec.LoopBeginTryCatchLevel.
23811         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23812         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23813         the current ec.TryCatchLevel, the branch goes out of an exception
23814         block.  In this case, we need to use Leave and not Br.
23815
23816 2002-07-22  Martin Baulig  <martin@gnome.org>
23817
23818         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23819         block unless the block does not always return or it is contained in
23820         another try { ... } catch { ... } block.  Fixes bug #26506.
23821         Added verify-1.cs to the test suite.
23822
23823 2002-07-22  Martin Baulig  <martin@gnome.org>
23824
23825         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23826         then we do not always return.  Fixes bug #24985.
23827
23828 2002-07-22  Martin Baulig  <martin@gnome.org>
23829
23830         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23831         lookup on a per-class level; ie. walk up the class hierarchy until we
23832         found at least one applicable method, then choose the best among them.
23833         Fixes bug #24463 and test-29.cs.
23834
23835 2002-07-22  Martin Baulig  <martin@gnome.org>
23836
23837         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23838         return types of the methods.  The return type is not part of the
23839         signature and we must not check it to make the `new' modifier work.
23840         Fixes bug #27999, also added test-147.cs.
23841         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23842
23843         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23844         on the method's return type.
23845
23846 2002-07-21  Martin Baulig  <martin@gnome.org>
23847
23848         * assign.cs: Make this work if the rightmost source is a constant and
23849         we need to do an implicit type conversion.  Also adding a few more tests
23850         to test-38.cs which should have caught this.
23851
23852         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23853         target in the makefile for this.  The makefile.gnu is primarily intended
23854         for end-users who don't want to debug the compiler.
23855
23856 2002-07-21  Martin Baulig  <martin@gnome.org>
23857
23858         * assign.cs: Improved the Assign class so it can now handle embedded
23859         assignments (X = Y = Z = something).  As a side-effect this'll now also
23860         consume less local variables.  test-38.cs now passes with MCS, added
23861         a few new test cases to that test.
23862
23863 2002-07-20  Martin Baulig  <martin@gnome.org>
23864
23865         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23866         instructions.  Fixes bug #27977, also added test-146.cs.
23867
23868 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23869
23870         * cs-tokenizer.cs: fixed getHex ().
23871
23872 2002-07-19  Martin Baulig  <martin@gnome.org>
23873
23874         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23875         not Type.GetType() to lookup the array type.  This is needed when
23876         we're constructing an array of a user-defined type.
23877         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23878         single-dimensional arrays, but also for single-dimensial arrays of
23879         type decimal.
23880
23881 2002-07-19  Martin Baulig  <martin@gnome.org>
23882
23883         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23884         this function is called, it's not allowed to share LocalBuilders
23885         among ILGenerators.
23886
23887 2002-07-19  Martin Baulig  <martin@gnome.org>
23888
23889         * expression.cs (Argument.Resolve): Report an error 118 when trying
23890         to pass a type as argument.
23891
23892 2002-07-18  Martin Baulig  <martin@gnome.org>
23893
23894         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
23895         Conv_R_Un for the signed `long' type.
23896
23897 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
23898
23899         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
23900         `expr' for the temporary result, as that will fail if we do
23901         multiple resolves on the same expression.
23902
23903 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
23904
23905         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
23906         ec.TypeContainer for looking up aliases. 
23907
23908         * class.cs (TypeContainer): Remove LookupAlias from here.
23909
23910         * decl.cs (DeclSpace); Move here.
23911
23912 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
23913
23914         * class.cs (FindMembers): Only call filter if the constructor
23915         bulider is not null.
23916
23917         Also handle delegates in `NestedTypes' now.  Now we will perform
23918         type lookups using the standard resolution process.  This also
23919         fixes a bug.
23920
23921         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
23922         This uses Expressions (the limited kind that can be parsed by the
23923         tree) instead of strings.
23924
23925         * expression.cs (ComposedCast.ToString): Implement, used to flag
23926         errors since now we have to render expressions.
23927
23928         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
23929         FormArrayType. 
23930
23931         * ecore.cs (SimpleName.ToString): ditto.
23932
23933         * cs-parser.jay: Instead of using strings to assemble types, use
23934         Expressions to assemble the type (using SimpleName, ComposedCast,
23935         MemberAccess).  This should fix the type lookups in declarations,
23936         because we were using a different code path for this.
23937
23938         * statement.cs (Block.Resolve): Continue processing statements
23939         even when there is an error.
23940
23941 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * class.cs (Event.Define): Also remove the `remove' method from
23944         the list of pending items.
23945
23946         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
23947         generate more compact code. 
23948
23949 2002-07-17  Martin Baulig  <martin@gnome.org>
23950
23951         * const.cs (Const.LookupConstantValue): Add support for constant
23952         `unchecked' and `checked' expressions.
23953         Also adding test case test-140.cs for this.
23954
23955 2002-07-17  Martin Baulig  <martin@gnome.org>
23956
23957         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
23958         check whether mi.ReturnType implements the IEnumerator interface; the
23959         `==' and the IsAssignableFrom() will fail in this situation.
23960
23961 2002-07-16  Ravi Pratap  <ravi@ximian.com>
23962
23963         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
23964         here too.
23965
23966 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23967
23968         * expression.cs: fixed bug #27811.
23969
23970 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
23971
23972         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
23973         Molaro: when we are a ref, the value already contains a pointer
23974         value, do not take the address of it.
23975
23976 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
23977         * removed mb-parser.jay and mb-tokenizer.cs
23978
23979 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
23980
23981         * expression.cs: check against the building corlib void type.
23982
23983 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
23984
23985         * ecore.cs: fix for valuetype static readonly fields: when 
23986         initializing them, we need their address, not the address of a copy.
23987
23988 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
23989
23990         * typemanager.cs: register also enum_type in corlib.
23991
23992 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
23993
23994         * class.cs: allow calling this (but not base) initializers in structs.
23995
23996 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
23997
23998         * ecore.cs: make sure we compare against the building base types
23999         in GetTypeSize ().
24000
24001 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24002
24003         * typemanager.cs: fix TypeToCoreType() to handle void and object
24004         (corlib gets no more typerefs after this change).
24005
24006 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * expression.cs (ArrayCreation.EmitArrayArguments): use
24009         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24010
24011         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24012         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24013         array indexes, the runtime actually forbids them.
24014
24015         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24016         for array arguments here.
24017
24018         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24019         instead of the default for ValueTypes.
24020
24021         (New.DoEmit): Use IsValueType instead of
24022         IsSubclassOf (value_type)
24023         (New.DoResolve): ditto.
24024         (Invocation.EmitCall): ditto.
24025
24026         * assign.cs (Assign): ditto.
24027
24028         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24029         Statements *are* currently doing part of their resolution during
24030         Emit.  
24031
24032         Expressions do always resolve during resolve, but statements are
24033         only required to propagate resolution to their children.
24034
24035 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24036
24037         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24038
24039         (LoadAssembly): Do not add the dll if it is already specified
24040
24041         (MainDriver): Add the System directory to the link path at the end,
24042         after all the other -L arguments. 
24043
24044         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24045         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24046         ldelem.u1) and using the opposite for sbytes.
24047
24048         This fixes Digger, and we can finally run it.
24049
24050         * driver.cs (UnixParseOption): Move the option parsing here.  
24051         (CSCParseOption): Implement CSC-like parsing of options.
24052
24053         We now support both modes of operation, the old Unix way, and the
24054         new CSC-like way.  This should help those who wanted to make cross
24055         platform makefiles.
24056
24057         The only thing broken is that /r:, /reference: and /lib: are not
24058         implemented, because I want to make those have the same semantics
24059         as the CSC compiler has, and kill once and for all the confussion
24060         around this.   Will be doing this tomorrow.
24061
24062         * statement.cs (Unsafe.Resolve): The state is checked during
24063         resolve, not emit, so we have to set the flags for IsUnsfe here.
24064
24065 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24066
24067         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24068         not catch the Error_ObjectRefRequired in SimpleName (as it is
24069         possible to have a class/instance variable name that later gets
24070         deambiguated), we have to check this here.      
24071
24072 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24073
24074         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24075         make static and put into Expression.
24076
24077         (Event.Define): Register the private field of the event with the 
24078         TypeManager so that GetFieldFromEvent can get at it.
24079
24080         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24081         keep track of the private field associated with an event which
24082         has no accessors.
24083
24084         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24085         private field.
24086
24087         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24088
24089 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24090
24091         * expression.cs (Binary.EmitBranchable): this routine emits the
24092         Binary expression in a branchable context.  This basically means:
24093         we need to branch somewhere, not just get the value on the stack.
24094
24095         This works together with Statement.EmitBoolExpression.
24096
24097         * statement.cs (Statement.EmitBoolExpression): Use
24098         EmitBranchable. 
24099
24100 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24101
24102         * statement.cs (For): Reduce the number of jumps in loops.
24103
24104         (For): Implement loop inversion for the For statement.
24105
24106         (Break): We can be breaking out of a Try/Catch controlled section
24107         (foreach might have an implicit try/catch clause), so we need to
24108         use Leave instead of Br.
24109
24110         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24111         now).  If the instace expression supports IMemoryLocation, we use
24112         the AddressOf method from the IMemoryLocation to extract the
24113         address instead of emitting the instance.
24114
24115         This showed up with `This', as we were emitting the instance
24116         always (Emit) instead of the Address of This.  Particularly
24117         interesting when This is a value type, as we dont want the Emit
24118         effect (which was to load the object).
24119
24120 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24121
24122         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24123
24124         * statement.cs (Checked): Set the CheckedState during the resolve
24125         process too, as the ConvCast operations track the checked state on
24126         the resolve process, and not emit.
24127
24128         * cs-parser.jay (namespace_member_declaration): Flag that we have
24129         found a declaration when we do.  This is used to flag error 1529
24130
24131         * driver.cs: Report ok when we display the help only.
24132
24133 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24134
24135         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24136
24137 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24138
24139         * cs-tokenizer.cs (define): We also have to track locally the
24140         defines.  AllDefines is just used for the Conditional Attribute,
24141         but we also need the local defines for the current source code. 
24142
24143 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24144
24145         * statement.cs (While, For, Do): These loops can exit through a
24146         Break statement, use this information to tell whether the
24147         statement is the last piece of code.
24148
24149         (Break): Flag that we break.
24150
24151         * codegen.cs (EmitContexts): New `Breaks' state variable.
24152
24153 2002-07-03  Martin Baulig  <martin@gnome.org>
24154
24155         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24156         modifiers in method declarations in structs.  Otherwise, you won't
24157         be able to override things like Object.Equals().
24158
24159 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24160
24161         * class.cs (Method, Property, Indexer): Do not allow the public
24162         modifier to be used in explicit interface implementations.
24163
24164         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24165         override modifiers in method declarations in structs
24166
24167 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24168
24169         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24170         integer or real overflow, report an error
24171
24172 2002-07-02  Martin Baulig  <martin@gnome.org>
24173
24174         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24175         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24176         to tell the runtime about our newly created System.Object and
24177         System.ValueType types.
24178
24179 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24180
24181         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24182         struct instead of Ldarg/Starg.
24183
24184 2002-07-02  Martin Baulig  <martin@gnome.org>
24185
24186         * expression.cs (Indirection.Indirection): Call
24187         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24188
24189 2002-07-02  Martin Baulig  <martin@gnome.org>
24190
24191         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24192         ValueType, call TypeManager.TypeToCoreType() on it.
24193         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24194         the OpCodes.Newarr argument.
24195
24196 2002-07-02  Martin Baulig  <martin@gnome.org>
24197
24198         * expression.cs (Invocation.EmitCall): When compiling corlib,
24199         replace all calls to the system's System.Array type to calls to
24200         the newly created one.
24201
24202         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24203         System.Array methods.
24204         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24205         from the system's System.Array type which must be replaced.
24206
24207 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24208
24209         * typemanager.cs: load unverifiable_code_ctor so we can build
24210         corlib using the correct type. Avoid using GetTypeCode() with
24211         TypeBuilders.
24212         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24213         TypeManager.object_type to allow building corlib.
24214
24215 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24216
24217         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24218
24219 2002-07-01  Martin Baulig  <martin@gnome.org>
24220
24221         * class.cs: Make the last change actually work, we need to check
24222         whether `ifaces != null' to avoid a crash.
24223
24224 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24225
24226         * class.cs: when we build structs without fields that implement
24227         interfaces, we need to add the interfaces separately, since there is
24228         no API to both set the size and add the interfaces at type creation
24229         time.
24230
24231 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24232
24233         * expression.cs: the dimension arguments to the array constructors
24234         need to be converted if they are a long.
24235
24236 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24237
24238         * class.cs: don't emit ldarg.0 if there is no parent constructor
24239         (fixes showstopper for corlib).
24240
24241 2002-06-29  Martin Baulig  <martin@gnome.org>
24242
24243         MCS now compiles corlib on GNU/Linux :-)
24244
24245         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24246         ie. check for MethodImplOptions.InternalCall.
24247
24248         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24249         and TypeManager.attribute_type are null, so we must explicitly check
24250         whether parent is not null to find out whether it's an attribute type.
24251         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24252         and SetBuilder, not only if the property is neither abstract nor external.
24253         This is necessary to set the MethodImplOptions on the accessor methods.
24254         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24255         SetBuilder, see Property.Emit().
24256
24257         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24258         populate "System.Object", "System.ValueType" and "System.Attribute" since
24259         they've already been populated from BootCorlib_PopulateCoreTypes().
24260
24261 2002-06-29  Martin Baulig  <martin@gnome.org>
24262
24263         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24264         is the NullLiteral, we also need to make sure that target_type is not
24265         an enum type.   
24266
24267 2002-06-29  Martin Baulig  <martin@gnome.org>
24268
24269         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24270         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24271         before calling BootstrapCorlib_ResolveDelegate ().
24272
24273 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24274
24275         * statement.cs: fixed build-breaker. All tests passed ok.
24276
24277 2002-06-27  Martin Baulig  <martin@gnome.org>
24278
24279         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24280         for System.Decimal when compiling corlib.
24281
24282 2002-06-27  Martin Baulig  <martin@gnome.org>
24283
24284         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24285         switch blocks which contain nothing but a default clause.
24286
24287 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24288
24289        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24290
24291 2002-06-27  Martin Baulig  <martin@gnome.org>
24292
24293         * ecore.cs (PropertyExpr.PropertyExpr): Call
24294         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24295
24296         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24297         is already a TypeBuilder.
24298
24299 2002-06-27  Martin Baulig  <martin@gnome.org>
24300
24301         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24302         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24303         the "from an array-type to System.Array" case.  This makes it work
24304         when compiling corlib.
24305
24306 2002-06-27  Martin Baulig  <martin@gnome.org>
24307
24308         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24309         non-static PropertyExpr, set its InstanceExpression.  This makes
24310         the `ICollection.Count' property work in System/Array.cs.
24311
24312 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24313
24314         * driver.cs: Made error handling more consistent.  Errors now
24315         tracked by Report class, so many methods which used to return int
24316         now return void.  Main() now prints success/failure and 
24317         errors/warnings message.
24318
24319         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24320         the magic number return values (123 and 124).  Now, if the
24321         expected error occurs, the compiler exits with success (exit value
24322         0).  If the compilation completes without seeing that particular
24323         error, the compiler exits with failure (exit value 1).  The
24324         makefile in mcs/errors has been changed to handle the new behaviour.
24325
24326         * report.cs: Made 'expected error' number a property and renamed
24327         it from 'Probe' to 'ExpectedError'.
24328
24329         * genericparser.cs: Removed error handling support, since it is
24330         now all done by Report class.
24331
24332         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24333         class, so parse() no longer returns an int.
24334
24335         * namespace.cs: Use Report.Error instead of GenericParser.error
24336
24337 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24338
24339         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24340         TypeContainer.AddOperator): At the front of the list put the
24341         explicit implementations, so they get resolved/defined first. 
24342
24343 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24344
24345         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24346         interface type is implemented by this TypeContainer.  Used during
24347         explicit interface implementation.
24348
24349         (Property.Define, Indexer.Define, Method.Define): Validate that
24350         the given interface in the explicit implementation is one of the
24351         base classes for the containing type.
24352
24353         Also if we are explicitly implementing an interface, but there is
24354         no match in the pending implementation table, report an error.
24355
24356         (Property.Define): Only define the property if we are
24357         not explicitly implementing a property from an interface.  Use the
24358         correct name also for those properties (the same CSC uses,
24359         although that is really not needed).
24360
24361         (Property.Emit): Do not emit attributes for explicitly implemented
24362         properties, as there is no TypeBuilder.
24363
24364         (Indexer.Emit): ditto.
24365
24366         Hiding then means that we do not really *implement* a pending
24367         implementation, which makes code fail.
24368
24369 2002-06-22  Martin Baulig  <martin@gnome.org>
24370
24371         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24372         the return value of Object.GetType().  [FIXME: we need to do this whenever
24373         we get a type back from the reflection library].
24374
24375 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24376
24377         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24378
24379 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24380
24381         * attribute.cs: Return null if we can not look up the type.
24382
24383         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24384         the interface types found.
24385
24386         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24387         interface types found.
24388
24389         * typemanager.cs (GetInterfaces): Make this routine returns alll
24390         the interfaces and work around the lame differences between
24391         System.Type and System.Reflection.Emit.TypeBuilder in the results
24392         result for GetInterfaces.
24393
24394         (ExpandInterfaces): Given an array of interface types, expand and
24395         eliminate repeated ocurrences of an interface.  This expands in
24396         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24397         be IA, IB, IC.
24398
24399 2002-06-21  Martin Baulig  <martin@gnome.org>
24400
24401         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24402         on System.Enum.
24403
24404 2002-06-21  Martin Baulig  <martin@gnome.org>
24405
24406         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24407         and called with one of the core types, return the corresponding typebuilder for
24408         that type.
24409
24410         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24411         element type.
24412
24413 2002-06-21  Martin Baulig  <martin@gnome.org>
24414
24415         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24416         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24417         (Expression.ConvertReferenceExplicit): Likewise.
24418
24419         * expression.cs (ElementAccess.DoResolve): Likewise.
24420         (ElementAccess.DoResolveLValue): Likewise.
24421
24422 2002-06-10  Martin Baulig  <martin@gnome.org>
24423
24424         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24425         add the "value" parameter to the parameter list.
24426
24427         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24428         to our caller.
24429
24430 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24431
24432         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24433         the argument to an int, uint, long or ulong, per the spec.  Also
24434         catch negative constants in array creation.
24435
24436 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24437
24438         * class.cs: do not allow the same interface to appear twice in
24439         the definition list.
24440
24441 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24442
24443         * ecore.cs: don't use ldlen with System.Array.
24444
24445 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24446
24447         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24448
24449 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24450
24451         * modifiers.cs: produce correct field attributes for protected
24452         internal. Easy fix so miguel can work on ther harder stuff:-)
24453
24454 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * pending.cs: New file.  Move the code from class.cs here.
24457         Support clearning the pending flag for all methods (when not doing
24458         explicit interface implementation).
24459
24460 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24461
24462         * rootcontext.cs: added a couple more types needed to bootstrap.
24463
24464 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24465
24466         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24467         constructor in the type, instead of any constructor in the type
24468         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24469         a bug in the Mono runtime when applying the params attribute). 
24470
24471 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24472         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24473
24474 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24475
24476         * expression.cs (Unary.ResolveOperator): Use TypeManager
24477         to resolve the type.
24478
24479 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24480
24481         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24482         attached.
24483
24484         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24485         with each member too.
24486
24487         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24488         field builders too - this takes care of the enum member case.
24489
24490 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24491
24492         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24493         address-of operator on both value types and pointers.
24494
24495 2002-06-10  Martin Baulig  <martin@gnome.org>
24496
24497         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24498         PropertyBuilder to the `property_builders' list.
24499
24500         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24501         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24502         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24503         find any indexers which are inherited from an interface.
24504
24505 2002-06-09  Martin Baulig  <martin@gnome.org>
24506
24507         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24508         the same type as the constant if necessary.  There's also a test-130.cs
24509         for this.
24510
24511         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24512
24513         * typemanager.cs (TypeManager.ChangeType): Previously known as
24514         Enum.ChangeEnumType().
24515
24516 2002-06-09  Martin Baulig  <martin@gnome.org>
24517
24518         * expression.cs (Cast.TryReduce): Added support for consts.
24519
24520 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24521
24522         * class.cs (Accessor): Hold attributes information so we can pass
24523         it along.
24524
24525         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24526         Modify to pass in attributes attached to the methods.
24527
24528         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24529
24530         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24531         to handle the Accessor kind :-)
24532
24533         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24534
24535 2002-06-08  Martin Baulig  <martin@gnome.org>
24536
24537         * expression.cs (Unary.TryReduceNegative): Added support for
24538         ULongConstants.
24539
24540 2002-06-08  Martin Baulig  <martin@gnome.org>
24541
24542         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24543         name can't be found in the `defined_names' - the caller will do a
24544         MemberLookup in this case and thus find methods in System.Enum
24545         such as Enum.IsDefined().
24546
24547 2002-06-08  Martin Baulig  <martin@gnome.org>
24548
24549         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24550         Convert.ChangeType() which works with TypeBuilder created types.
24551         (Enum.LookupEnumValue, Enum.Define): Use it here.
24552
24553         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24554         `TypeBuilder.BaseType != null' check.
24555         (TypeContainer.FindMembers): Only lookup parent members if we
24556         actually have a parent.
24557         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24558         (ConstructorInitializer.Resolve): Likewise.
24559
24560         * interface.cs (Interface.FindMembers): Added
24561         `TypeBuilder.BaseType != null' check.
24562
24563         * rootcontext.cs (RootContext.ResolveCore): Added
24564         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24565         classes_second_stage.
24566
24567         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24568         debug_type and trace_type when compiling with --nostdlib.       
24569
24570 2002-06-07  Martin Baulig  <martin@gnome.org>
24571
24572         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24573         (AddField): Set it to true when adding a non-static field.
24574         (DefineType): Use `have_nonstatic_fields' to find out whether we
24575         have non-static fields, not `Fields != null'.
24576
24577 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24578
24579         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24580         dereferencing a null on the static-field code path)
24581
24582 2002-05-30  Martin Baulig  <martin@gnome.org>
24583
24584         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24585         to take command line arguments.  Use reflection to call the new
24586         custom `Initialize' function on the symbol writer and pass it the
24587         command line arguments.
24588
24589         * driver.cs (--debug-args): New command line argument to pass command
24590         line arguments to the symbol writer.
24591
24592 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24593
24594         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24595         the target type for indexers and properties.  Thanks to Joe for
24596         catching this.
24597
24598 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24599
24600         * typemanager.cs (MethodFlags): returns the method flags
24601         (Obsolete/ShouldIgnore) that control warning emission and whether
24602         the invocation should be made, or ignored. 
24603
24604         * expression.cs (Invocation.Emit): Remove previous hack, we should
24605         not do this on matching a base type, we should do this based on an attribute
24606
24607         Only emit calls to System.Diagnostics.Debug and
24608         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24609         on the command line.
24610
24611         * rootcontext.cs: Global settings for tracing and debugging.
24612
24613         * cs-tokenizer.cs (define): New utility function to track
24614         defines.   Set the global settings for TRACE and DEBUG if found.
24615
24616 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24617
24618         * interface.cs (Populate*): Pass in the TypeContainer as well as
24619         the DeclSpace as parameters so that we can create EmitContexts and
24620         then use that to apply attributes etc.
24621
24622         (PopulateMethod, PopulateEvent, PopulateProperty)
24623         (PopulateIndexer): Apply attributes everywhere.
24624
24625         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24626         etc.
24627
24628         (ApplyAttributes): Update accordingly.
24629
24630         We now apply interface attributes for all members too.
24631
24632 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24633
24634         * class.cs (Indexer.Define); Correctly check if we are explicit
24635         implementation (instead of checking the Name for a ".", we
24636         directly look up if the InterfaceType was specified).
24637
24638         Delay the creation of the PropertyBuilder.
24639
24640         Only create the PropertyBuilder if we are not an explicit
24641         interface implementation.   This means that explicit interface
24642         implementation members do not participate in regular function
24643         lookups, and hence fixes another major ambiguity problem in
24644         overload resolution (that was the visible effect).
24645
24646         (DefineMethod): Return whether we are doing an interface
24647         implementation. 
24648
24649         * typemanager.cs: Temporary hack until we get attributes in
24650         interfaces (Ravi is working on that) and we get IndexerName
24651         support in interfaces.
24652
24653         * interface.cs: Register the indexers as properties.
24654
24655         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24656         warning, I have verified that this is a bug in the .NET runtime
24657         (JavaScript suffers of the same problem).
24658
24659         * typemanager.cs (MemberLookup): When looking up members for
24660         interfaces, the parent of an interface is the implicit
24661         System.Object (so we succeed in searches of Object methods in an
24662         interface method invocation.  Example:  IEnumerable x;  x.ToString
24663         ()) 
24664
24665 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24666
24667         * class.cs (Event): Events should also register if they do
24668         implement the methods that an interface requires.
24669
24670         * typemanager.cs (MemberLookup); use the new GetInterfaces
24671         method. 
24672
24673         (GetInterfaces): The code used to lookup interfaces for a type is
24674         used in more than one place, factor it here. 
24675
24676         * driver.cs: Track the errors at the bottom of the file, we kept
24677         on going.
24678
24679         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24680         instance if the method we are calling is static!
24681
24682 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24683
24684         * attribute.cs (ApplyAttributes): Make this function filter out
24685         the IndexerName attribute (as that attribute in reality is never
24686         applied) and return the string constant for the IndexerName
24687         attribute. 
24688
24689         * class.cs (TypeContainer.Emit): Validate that all the indexers
24690         have the same IndexerName attribute, and if so, set the
24691         DefaultName attribute on the class. 
24692
24693         * typemanager.cs: The return value might contain other stuff (not
24694         only methods).  For instance, consider a method with an "Item"
24695         property and an Item method.
24696
24697         * class.cs: If there is a problem with the parameter types,
24698         return. 
24699
24700 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24701
24702         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24703         looks at user defined conversion after making a call to 
24704         StandardConversionExists - we need this for overload resolution.
24705
24706         * expression.cs : Update accordingly the various method calls.
24707
24708         This fixes 2 bugs filed against implicit user defined conversions 
24709
24710 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24711
24712         * statement.cs: Track the result of the assignment.
24713
24714 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24715
24716         * expression.cs (MemberAccess): Improved error reporting for
24717         inaccessible members.
24718
24719 2002-05-22  Martin Baulig  <martin@gnome.org>
24720
24721         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24722         itself with debugging support.
24723
24724 2002-05-22  Martin Baulig  <martin@gnome.org>
24725
24726         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24727         Removed, this isn't needed anymore.
24728
24729 2002-05-20  Martin Baulig  <martin@gnome.org>
24730
24731         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24732         be underlying type for an enum.
24733
24734 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24735
24736         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24737         that splits out the loading of just the core types.
24738
24739         * rootcontext.cs (ResolveCore): Split the struct resolution in
24740         two, so we can load the enumeration underlying types before any
24741         enums are used.
24742
24743         * expression.cs (Is): Bandaid until we fix properly Switch (see
24744         bug #24985 for details).
24745
24746         * typemanager.cs (ImplementsInterface): The hashtable will contain
24747         a null if there are no interfaces implemented.
24748
24749 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24750
24751         * cs-parser.jay (indexer_declarator): It is fine to have array
24752         parameters
24753
24754 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24755
24756         * typemanager.cs: (RegisterBuilder): New function used to register
24757         TypeBuilders that implement interfaces.  Since
24758         TypeBuilder.GetInterfaces (as usual) does not work with lame
24759         Reflection.Emit. 
24760         (AddUserType): register interfaces.
24761
24762         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24763         dealing with TypeBuilder.  Also, arrays are showing up as
24764         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24765         methods can not be invoked on them!
24766
24767         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24768         (ImplicitReferenceConversionExists): Split out from
24769         StandardConversionExists. 
24770
24771         * expression.cs (As): We were only implementing one of the three
24772         cases for the as operator.  We now implement them all.
24773         (Is): Implement the various other cases for Is as well.
24774
24775         * typemanager.cs (CACHE): New define used to control if we want or
24776         not the FindMembers cache.  Seems to have a negative impact on
24777         performance currently
24778
24779         (MemberLookup): Nested types have full acess to
24780         enclosing type members
24781
24782         Remove code that coped with instance/static returns for events, we
24783         now catch this in RealFindMembers.
24784
24785         (RealFindMembers): only perform static lookup if the instance
24786         lookup did not return a type or an event.  
24787
24788 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24789
24790         * assign.cs (CompoundAssign): We pass more semantic information
24791         now to Compound Assignments than we did before: now we have all
24792         the information at hand, and now we resolve the target *before* we
24793         do the expression expansion, which allows the "CacheValue" method
24794         to have the effect we intended (before, a [x] += 1 would generate
24795         two differen ArrayAccess expressions from the ElementAccess,
24796         during the resolution process).
24797
24798         (CompoundAssign.DoResolve): Resolve target and original_source here.
24799
24800 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24801
24802         * expression.cs (ArrayAccess): dropped debugging information. 
24803
24804         * typemanager.cs: Small bug fix: I was always returning i_members,
24805         instead of one of i_members or s_members (depending on which had
24806         the content).
24807
24808         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24809         method is invoked before any code generation takes place, and it
24810         is a mechanism to inform that the expression will be invoked more
24811         than once, and that the method should use temporary values to
24812         avoid having side effects
24813
24814         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24815
24816         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24817         implementation.
24818
24819         * expression.cs (Indirection, ArrayAccess): Add support for
24820         CacheTemporaries in these two bad boys. 
24821
24822         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24823         ldobj or ldind_ref.  
24824         (StoreFromPtr): Handle stobj as well.
24825
24826         * expression.cs (UnaryMutator): Share more code.
24827
24828         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24829         down: I was not tracking the Filter function as well, which
24830         was affecting the results of the cache.
24831
24832 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24833
24834         * attribute.cs: Remove the hack to handle the CharSet property on
24835         StructLayouts. 
24836
24837 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24838
24839         * attribute.cs (DoResolve): More uglyness, we now only try to
24840         resolve the attribute partially, to extract the CharSet
24841         information (only if we are a StructLayout attribute).  Otherwise 
24842
24843         (GetExtraTypeInfo): Add some code to conditionally kill in the
24844         future this.   I am more and more convinced that the .NET
24845         framework has special code to handle the attribute setting on
24846         certain elements.
24847
24848         * expression.cs (IsParamsMethodApplicable): Revert my previous
24849         foreach change here, it was wrong.
24850
24851 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24852
24853         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24854         (pp_expr): do not abort on unknown input, just return.
24855         (eval): abort if there are pending chars.
24856
24857         * attribute.cs (Attribute.Resolve): Positional parameters are
24858         optional.  Deal with that case.
24859
24860         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24861         the Ansi/Unicode/Auto information for the type.
24862
24863         (TypeContainer.DefineType): instantiate the EmitContext here, as
24864         we will be using it during the type definition (to resolve
24865         attributes) and during the emit phase.
24866
24867         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24868         to pull type information out of the attributes
24869
24870         (Attribute.Resolve): track the constructor builder, and allow for
24871         multiple invocations (structs and classes will use this).
24872
24873         * ecore.cs (MemberLookupFinal): new version with all the
24874         parameters customizable.
24875
24876         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24877         constructors.  Return if the result value is null (as the error
24878         would have been flagged already by MemberLookupFinal)
24879
24880         Do not allow instances of abstract classes or interfaces to be
24881         created.
24882
24883         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24884         We have to compare the assembly property here when dealing with
24885         FamANDAssem and Assembly access modifiers, because we might be
24886         creating an assembly from *modules* (that means that we are not
24887         getting TypeBuilders for types defined in other modules that are
24888         part of this assembly).
24889
24890         (Method.Emit): If the method is marked abstract and has a body,
24891         emit an error. 
24892
24893         (TypeContainer.DefineMembers): If both the defined member and the
24894         parent name match are methods, then do not emit any warnings: let
24895         the Method.Define routine take care of flagging warnings.  But if
24896         there is a mismatch (method overrides something else, or method is
24897         overriwritten by something, then emit warning).
24898
24899         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
24900         set to null, this means `do not check for the return type on the
24901         signature'. 
24902
24903         (Method.Define): set the return type for the method signature to
24904         null, so that we get methods with the same name and parameters and
24905         different return types.  This is used to flag warning 114 (you are
24906         hiding a method, and you probably want to use the new/override
24907         keywords instead).
24908
24909         * typemanager.cs (MemberLookup): Implemented proper access
24910         control, closing a long standing set of bug reports.  The problem
24911         was that the Framework only has two bits: Public and NonPublic,
24912         and NonPublic includes private and protected methods, but we need
24913         to enforce the FamANDAssem, FamOrAssem and Family. 
24914
24915 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
24916
24917         * statement.cs (GotoCase): Return true: Ammounts to giving up
24918         knowledge on whether we return or not, and letting the other case
24919         be responsible for it.
24920
24921 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
24922
24923         * driver.cs: Do not load directories for each file processed, only
24924         do it if there is a pattern.
24925
24926         * ecore.cs: Report readonly assigns here as well, as we might have
24927         been resolved only by MemberAccess.
24928
24929         (SimpleName.SimpleNameResolve): Also be useful for LValue
24930         resolution.   We need this to propagate assign to local readonly variables
24931
24932         * typemanager.cs: Use a ptrhashtable for the criteria, because we
24933         do not want to reuse potential criteria memory.
24934
24935         * class.cs (MyEventBuilder): Set reflected_type;
24936
24937         * ecore.cs (Constantify): Added support for constifying bools.
24938
24939         (RootContext.LookupType): Added a cache for values looked up in
24940         the declaration space.
24941
24942         * typemanager.cs (FindMembers): Now is a front-end to
24943         RealFindMembers, and provides a two-level hashtable-based cache to
24944         the request.  
24945
24946         15% performance improvement: from 22.5 to 19.2 seconds.
24947
24948         * expression.cs (IsParamsMethodApplicable): use foreach.
24949         (Invocation.DoResolve): ditto.
24950         (New.DoResolve): ditto.
24951         (ArrayCreation.DoResolve): ditto.
24952
24953         * ecore.cs (FindMostEncompassingType): use foreach.
24954
24955         * delegate.cs (NewDelegate.DoResolve): Use foreach
24956
24957         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
24958         (RemoveMethods): use foreach.
24959
24960         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
24961         nested foreach statements instead of for, and also break out of
24962         the inner loop once a match is found.
24963
24964         (Invocation.OverloadResolve): Use foreach, simplify the code. 
24965
24966 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
24967
24968         * cfold.cs (BinaryFold): During an enumeration evaluation context,
24969         we actually unwrap the expression to allow for extra information
24970         to be extracted. 
24971
24972         * expression.cs: Use Shr_Un on unsigned operations. 
24973
24974 2002-05-08  Ravi Pratap  <ravi@ximian.com>
24975
24976         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
24977         applicable operators was not being considered correctly. This closes
24978         the bug Miguel reported.
24979
24980 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
24981
24982         * attribute.cs: check that the type derives from System.Attribute
24983         and report the correct error in that case (moved the duplicate code to
24984         its own method, too).
24985
24986 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
24987
24988         * attribute.cs: lookup attribute type name as the spec says: first the
24989         bare attribute name and then name + "Attribute" (nant compiles with
24990         mcs after this fix).
24991
24992 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
24993
24994         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
24995         Because of the way we parse things, we should try to see if a
24996         UIntConstant can fit in an integer.
24997
24998 2002-05-07  Ravi Pratap  <ravi@ximian.com>
24999
25000         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25001         when we are in an explicit context.
25002
25003         (ConvertReferenceExplicit): When converting from Iface type S to Class
25004         T make sure the rules are implemented as an OR.
25005
25006         * parameter.cs (ParameterType): Make it a property for now although the
25007         purpose really isn't anything immediate.
25008
25009         * expression.cs (Is*Applicable): Do better checking on the parameter type
25010         of a ref/out parameter. The ones from the system assemblies are already 
25011         marked with the correct type so we don't need to do any correction.
25012
25013         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25014         the object type is standard too so include that.
25015
25016 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * ecore.cs (StandardConversionExists): Augment with missing code:
25019         deal with IntConstant, LongConstants and Enumerations.
25020
25021         * assign.cs: Report the error, instead of failing silently
25022
25023         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25024         typecontainer that they are declared, because the
25025         typecontainer/namespace will have the list of using clauses that
25026         need to be applied.
25027
25028         Assembly Attributes were escaping the normal registration
25029         mechanism. 
25030
25031         (EmitCode): Apply attributes within an EmitContext that represents
25032         the container they were declared on.
25033
25034         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25035
25036 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25037
25038         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25039         Revamp completely - make much cleaner as we now operate only
25040         on a set of Types.
25041
25042         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25043         to implement the logic detailed in the spec more correctly.
25044
25045         (UserDefinedConversion): Update accordingly.
25046
25047 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25048
25049         * statement.cs: Return flow analysis information up.
25050
25051         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25052         and the default.
25053
25054         (token): Do not consume an extra character before calling
25055         decimal_digits.
25056
25057 2002-05-06  Piers Haken <piersh@friskit.com>
25058
25059         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25060
25061 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25062
25063         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25064         EmitContext during the instance constructor initializer
25065         resolution, to stop access to instance variables.
25066
25067         This is mandated by the spec, last paragraph of the `constructor
25068         initializers' section. 
25069
25070 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25071
25072         * cs-parser.jay, class.cs (Accessor): new class used to represent
25073         an accessor (get or set).  In the past we used `null' to represent
25074         a missing accessor.  But this is ambiguous because there was no
25075         way to tell in abstract indexers/properties if one of them was
25076         specified.
25077
25078         Now there is a way of addressing that.
25079
25080         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25081         instead of FindMembers.
25082
25083         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25084         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25085
25086         * attribute.cs: Treat indexers and properties as the same in terms
25087         of applying attributes
25088
25089         * ecore.cs (FindMostEncompassedType): Use statically initialized
25090         EmptyExpressions()s like we do elsewhere to avoid creating useless
25091         objects (and we take this out of the tight loop).
25092
25093         (GetConversionOperators): Move the code to extract the actual
25094         operators to a separate routine to clean things up.
25095
25096 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25097
25098         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25099         events are always registered FieldBuilders.
25100
25101         * class.cs (FieldBase): New class shared by Fields 
25102
25103         * delegate.cs: If we are a toplevel delegate, use our full name.
25104         If we are a nested delegate, then only use our tail name.
25105
25106 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25107
25108         * expression.cs (IsApplicable): Ensure that we add the "&" to
25109         ref/out types before comparing it with the type of the argument.
25110
25111         (IsParamsMethodApplicable): Ditto.
25112
25113         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25114         silly me ;-)
25115
25116         * delegate.cs : Handle the case when we have more than one applicable
25117         method. Flag an error only when we finish checking all.
25118
25119 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * expression.cs: Add support for boolean static initializers.
25122
25123 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25124
25125         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25126
25127         * parameter.cs (ComputeParameterTypes,
25128         ComputeAndDefineParameterTypes): Better error handling: now we
25129         clear the `types' cache if we fail during any of the type lookups.
25130         We also return the status code correctly to our caller
25131
25132         * delegate.cs: If we fail to define a delegate, abort the extra
25133         steps. 
25134
25135         * expression.cs (Binary.ResolveOperator): for
25136         operator==(object,object) and operator !=(object, object) we also
25137         have to verify that there is an implicit conversion from one to
25138         the other.
25139
25140         (ArrayAccess.DoResolve): Array Access can operate on
25141         non-variables. 
25142
25143 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * assign.cs (CompoundAssign): A new class used as a "flag" that
25146         the assignment actually is happening as part of a compound
25147         assignment operator.
25148
25149         During compound assignment, a few new rules exist to enable things
25150         like:
25151
25152         byte b |= 1 + 2
25153
25154         From the spec:
25155
25156         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25157         to the type of x) if y is implicitly convertible to the type of x,
25158         and the operator is a builtin operator and the return type of the
25159         operator is explicitly convertible to the type of x. 
25160
25161         * rootcontext.cs: Reset warning level to 2.  4 catches various
25162         "interesting" features in mcs, we must clean this up at some
25163         point, but currently am trying to kill other bugs ;-)
25164
25165         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25166         in container classes as well.  
25167
25168         * expression.cs (Binary.ResolveOperator): Handle string case
25169         before anything else (as operator overloading does emit an error
25170         before doing anything else).
25171
25172         This code could go away when we move to a table driven model, but
25173         i could not come up with a good plan last night.
25174
25175 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25176
25177         * typemanager.cs (CSharpName): reimplementation using regex.
25178         * class.cs: added null check for fields in Emit
25179         * rootcontext.cs: set warninglevel to 4
25180
25181 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25182
25183         * typemanager.cs (CSharpName): reimplemented with Lupus
25184         suggestion.
25185
25186 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25187
25188         * statement.cs (If): correclty implement Resolve, because we were
25189         not catching sem errors in there.  The same process is needed
25190         everywhere else. 
25191         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25192
25193
25194         (Statement.Warning_DeadCodeFound): Factorize code.
25195         (While): Report dead code here too.
25196
25197         (Statement): Added Resolve virtual method to allow
25198         for resolution split from the emit code.
25199
25200 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25201
25202         * statement.cs (EmitBoolExpression): No longer try to resolve the
25203         expression here.    
25204         (MakeBoolean): New utility function that resolve, implicitly
25205         converts to boolean and tags the expression. 
25206
25207
25208         (If, Do): Implement dead code elimination.
25209         (While): Implement loop inversion
25210
25211         (Do, While, For, If): Resolve the expression prior to calling our
25212         code generation.
25213
25214 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25215
25216         * class.cs:
25217           - added method Report28 (warning: program has more than one entry point)
25218           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25219           - modified method Method.Define, the part at the end of the method
25220
25221         * rootcontext.cs: added static public Location EntryPointLocation;
25222           
25223         * ../errors/cs0028.cs : Add test case for the above warning.              
25224
25225         * typemanager.cs:
25226           - modified method CSharpName to allow arrays of primitive type to
25227             be printed nicely (e.g. instead of System.Int32[][] it now prints
25228             int[][])
25229           - added method CSharpSignature: returns the signature of a method
25230             in string format to be used in reporting errors, warnings, etc.
25231
25232         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25233         with String.Empty.
25234
25235 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25236
25237         * delegate.cs (Define): Fix extremely silly bug where I was
25238         setting the type of the 'object' parameter of the BeginInvoke
25239         method to System.IAsyncResult instead of System.Object ;-)
25240
25241 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25242
25243         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25244         here. 
25245
25246         (Constructor.Emit): return if we fail to initialize the
25247         constructor.  Another door closed!  
25248
25249         * expression.cs (New.DoResolve): Improve error message (from -6 to
25250         1501).  Use DeclaredOnly lookup to find the exact constructor.
25251
25252         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25253         loop.  This is useful.
25254
25255         * cs-parser.jay: Adjust the default parameters so that destructors
25256         have the proper signature.
25257
25258 2002-04-26  Martin Baulig  <martin@gnome.org>
25259
25260         * driver.cs (LoadAssembly): If `assembly' contains any characters
25261         which are only valid in path names and not in assembly names
25262         (currently slash, backslash and point), use Assembly.LoadFrom ()
25263         instead of Assembly.Load () on the `assembly' (before iteration
25264         over the link_paths).
25265
25266 2002-04-26  Martin Baulig  <martin@gnome.org>
25267
25268         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25269
25270 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25271
25272         * class.cs (Property): use the new typemanager.MemberLookup
25273
25274         (TypeContainer.MemberLookup): Implement using the
25275         TypeManager.MemberLookup now. 
25276
25277         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25278         and return MemberInfos, so that these can be used without an
25279         EmitContext (what we had before).
25280
25281 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25282
25283         * expression.cs: Fix the case where the argument to params if the
25284         type of the params.  I omitted handling this before.   Fixed
25285
25286 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25287
25288         * driver.cs: Call BootCorlib_PopulateCoreType
25289
25290         * class.cs (Property.CheckBase): Check for properties only, not
25291         for all members. 
25292
25293         * interface.cs: Temporary hack: try/catch around the
25294         CustomAttributeBuilder, because I am getting an exception that I
25295         do not understand.
25296
25297         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25298         types whose definitions are required to be there (attributes are
25299         defined before standard types).
25300
25301         Compute definitions as we boot the various types, as they are used
25302         immediately (value_type class will need object_type, but if we do
25303         not initialize object_type, we will pass a null, which will let
25304         the runtime pick the System.Object from the existing corlib, which
25305         is not what we want).
25306
25307 2002-04-22  Patrik Torstensson <totte@labs2.com>
25308
25309         * cs-tokenizer.cs: fixed a number of trim() issues.
25310
25311 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25312
25313         * expression.cs (Argument.Type): Ensure that we return the correct
25314         type when we have out or ref parameters [in which case we 
25315         append a "&"].
25316
25317 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25318
25319         * class.cs (Property, Indexer): Allow extern modifier in there. 
25320
25321         * typemanager.cs (InitBaseTypes): Initializes object_type and
25322         value_type, since those will be used early on during the bootstrap
25323         process to compile corlib.
25324
25325         (InitCoreTypes): Move code from here to InitBaseTypes.
25326
25327 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25328
25329         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25330         single-dimension arrays as using the ldlen opcode.  
25331
25332         Daniel Lewis discovered this optimization.  
25333
25334         * typemanager.cs: Add signature for System.Array::get_Length
25335
25336 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25337
25338         * statement.cs: report the error when the foreach does not apply to an
25339         array nor a collection.
25340
25341 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25342
25343         * expression.cs: Add implicit conversions to the operator ~.
25344
25345         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25346
25347         * typemanager.cs: Locate the decimal constructor.
25348
25349 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25350
25351         * attribute.cs: use the new property of TypeOf.
25352         * expression.cs: added 'get' property around typearg.
25353
25354         These changes fix a build breaker reported by NickD. Is this the
25355         correct way to fix?  If not, please, revert my changes and make it
25356         work :-).
25357
25358 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25359
25360         * attribute.cs: Add support for typeof in attribute invocations.
25361         I am not sure that this is right though.
25362
25363 2002-04-14  Duncan Mak  <duncan@ximian.com>
25364
25365         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25366         Binary.Operator.Division case.
25367
25368 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25369
25370         * class.cs (DefineType): Ensure that we do a proper check on
25371         attribute types and also register it with the TypeManager.
25372
25373         (TypeContainer.Targets): The default for attribute types is
25374         AttributeTargets.All.
25375
25376         * attribute.cs (ApplyAttributes): Registering the attribute type
25377         is done elsewhere, not when we discover we have a Usage attribute.
25378
25379 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25380
25381         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25382         and get rid of is_delegate parameter.
25383
25384         * everywhere : update.
25385
25386 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25387
25388         * cs-parser.jay (compilation_unit): Revamp completely to use
25389         some new ideas that I got from Rhys' grammar to solve the problems
25390         with assembly level attributes.
25391
25392         (outer_declaration): New grammar production.
25393
25394         (attribute_sections): Add.
25395
25396         (opt_attributes): Base on attribute_sections
25397
25398         (namespace_declaration): Allow opt_attributes to tackle the case
25399         when we have assembly level attributes - we are clever in this
25400         regard now ;-)
25401
25402         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25403         attributes in the non-global context.
25404
25405         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25406         instead of SetGlobalAttributes.
25407
25408         * class.cs, rootcontext.cs : Ensure we define and generate 
25409         attribute types before anything else.
25410
25411         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25412         and flag the new error -20 for the case when the attribute type
25413         does not have valid targets specified. csc does not catch this.
25414
25415         * ../errors/errors.txt : update for error # -20
25416
25417 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25418
25419         * support.cs (InternalParameters.ParameterModifier): Do some null
25420         checking and return sane values.
25421
25422         * class.cs (Method.Define): If we are a PInvoke method, ensure
25423         that we are static and extern. Report error # 601
25424
25425         * ../errors/cs0601.cs : Add test case for the above error.
25426
25427 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25428
25429         * rootcontext.cs (attribute_types): We need to keep type of
25430         all attribute types separately and emit code for them first.
25431
25432         (RegisterAttribute) : Implement.
25433
25434         * class.cs (DefineType): Check if the current Type is a custom
25435         attribute type and register it accordingly.
25436
25437         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25438         adding the first attribute twice and rename to
25439
25440         (SetGlobalAttributes): this.
25441
25442         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25443         lookups.
25444
25445         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25446         if we are processing global arguments. Hmm, I am unsure of this.
25447
25448 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25449
25450         * expression.cs: added static array of strings to avoid calling
25451         Enum.ToString () for Operator in Binary. Significant recover of
25452         performance.
25453
25454 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25455
25456         * class.cs (FindMembers): Allow the Builders of the various
25457         members to be null.  If they are skip them.  This only happens
25458         during the PInvoke declaration.
25459
25460 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25461
25462         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25463         failure, so we do not keep going afterwards.
25464
25465         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25466         wanted to pass `false' as the `is_delegate' argument.  If this is
25467         the case, why not use delegate_type == null to mean `is_delegate =
25468         false' and anything else as is_delegate = true.
25469
25470 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25471
25472         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25473         code for the section, not the beginning of the tests.
25474
25475 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25476
25477         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25478
25479         * expression.cs (Binary): same.  Warn about errors where we have
25480         Enum/Enum in operator + as well.
25481
25482 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25483
25484         * statement.cs:
25485                 - added support for switch(bool)
25486                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25487                 - add TableSwitchEmit() to handle table-based switch statements
25488
25489 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25490
25491         * expression.cs (Invocation.OverloadResolve): Factor out code which
25492         does parameter compatibility checking with arguments so that we can 
25493         re-use the code even from Delegate.VerifyApplicability
25494
25495         (VerifyArgumentsCompat): Move above code here.
25496
25497         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25498         and instead make a call to the above method.
25499
25500 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25501
25502         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25503         We use it to keep track of classes which are attribute types.
25504
25505 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25506
25507         * delegate.cs (Delegate.Define): Correctly define the types in the
25508         presence of fixed and array parameters.
25509
25510         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25511         doing FindMembers.
25512
25513         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25514         include NonPublic after the first iteration.
25515
25516         * class.cs (Indexer.CheckBase): Only check if both parents are
25517         non-null. 
25518
25519         * cs-parser.jay (accessor_body): If empty, set to null.
25520
25521         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25522         same code path here to resolve constants names that we did have in
25523         MemberAccess.DoResolve.  There is too much code duplicated here.
25524
25525 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25526
25527         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25528
25529         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25530         to MakeUnionSet.
25531
25532         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25533         tokens, numbers and strings.
25534
25535         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25536         parenthesis.
25537
25538         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25539         asyncronous parameters and the regular parameters.  
25540
25541         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25542         specify the target directory.
25543
25544         * expression.cs: (This.DoResolve): Simplify
25545         (As.Emit): Optimize, do not generate IsInst if the expression is
25546         always of the given type.
25547
25548         (Is.DoResolve): Bug fix, we were reporting both always/never for
25549         the is expression.
25550
25551         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25552         creating too many unnecessary arrays.
25553
25554 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25555
25556         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25557         fields instead of rolling our own initializer.   Takes care of all
25558         implicit conversions, and drops unnecessary static checks/argument.
25559
25560 2002-03-31  Dick Porter  <dick@ximian.com>
25561
25562         * driver.cs: use the GetDirectories() return values properly, and
25563         use "/" as path separator.
25564
25565 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25566
25567         * expression.cs (Unary): Optimize - - expr into expr.
25568         (Binary): Optimize a + (-b) into a -b.
25569
25570         * codegen.cs (CodeGen): Made all methods static.
25571
25572 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25573
25574         * rootcontext.cs: 
25575
25576         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25577         TypeBuilder property.
25578
25579         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25580         instead. 
25581
25582         * tree.cs: Removed the various RecordXXXX, and replaced with a
25583         single RecordDecl.  Removed all the accessor methods, and just
25584         left a single access point Type 
25585
25586         * enum.cs: Rename DefineEnum to DefineType.
25587
25588         * decl.cs: New abstract method `DefineType' used to unify the
25589         Defines for Enumerations, Interfaces, TypeContainers and
25590         Delegates.
25591
25592         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25593         LookupBaseClasses method that used to live in class.cs and
25594         interface.cs here, and renamed to FindType.
25595
25596         * delegate.cs: Implement DefineType.  Take advantage of the
25597         refactored pattern for locating the parent builder without taking
25598         the parent_builder argument (which we know does not work if we are
25599         nested, and triggering a toplevel definition).
25600
25601 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25602
25603         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25604         accessibility of a member has changed during override and report
25605         an error if so.
25606
25607         * class.cs (Method.Define, Property.Define): Only complain on
25608         overrides if the method is private, any other accessibility is
25609         fine (and since we just checked the permission is the same, we are
25610         good to go).
25611
25612         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25613         and elif are processed always.  The other pre-processing
25614         directives are only processed if we are "taking" the path
25615
25616 2002-03-29  Martin Baulig  <martin@gnome.org>
25617
25618         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25619         current location is not Null.
25620
25621         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25622         a separate method so we can profile it.
25623
25624         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25625         `span.Seconds' are just seconds, but no minutes or hours.
25626         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25627
25628 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25629
25630         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25631         Remove the gratuitous set of Final:
25632
25633                                 // If an interface implementation, then we can set Final.
25634                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25635                                     implementing.DeclaringType.IsInterface)
25636                                         flags |= MethodAttributes.Final;
25637
25638         I do not know what I was smoking when I used that.
25639
25640
25641         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25642         step into fixing the name resolution issues for delegates and
25643         unifying the toplevel name resolution.
25644
25645 2002-03-28  Martin Baulig  <martin@gnome.org>
25646
25647         * class.cs (Method.Emit): If we have a symbol writer, call its
25648         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25649         tell it about the current method.
25650
25651         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25652         writer that we're going to emit the first byte of IL code for a new
25653         statement (a new source line).
25654         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25655         EmitContext.Mark() before emitting any code.
25656
25657         * location.cs (SymbolDocument): Return null when we're Null.
25658
25659         * statement.cs (Statement): Moved the `Location loc' variable here.
25660         (Statement.EmitBoolExpression): If we have a symbol writer, call
25661         ec.Mark() before emitting any code to tell it that we're at the
25662         beginning of a new statement.
25663         (StatementExpression): Added `Location' argument to the constructor.
25664         (Block): Added public readonly variable `StartLocation' and public
25665         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25666         (Block): Added constructor which takes a start and end location.
25667         (Block.SetEndLocation): New method. This sets the end location.
25668         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25669         local variables we create.
25670         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25671         each statement and do also mark the begin and end of the block.
25672
25673         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25674         tell it the current lexer.Location, use Location.Null for the end of the
25675         block.
25676         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25677         current block, set its end location using SetEndLocation().
25678         (statement_expression): StatementExpression constructor now takes the
25679         lexer.Location as additional argument.
25680         (for_statement, declare_local_variables): Likewise.
25681         (declare_local_variables): When creating a new implicit block, use the
25682         new Block constructor and pass it the lexer.Location.
25683
25684 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25685
25686         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25687         members also on the parent interfaces recursively.
25688
25689 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25690
25691         * report.cs: Use new formats, since Gonzalo finished the missing
25692         bits. 
25693
25694         * expression.cs (Binary.ResolveOperator): added missing operator|
25695         operator& and operator^ for bool/bool.
25696
25697         * cs-parser.jay: CheckDef now takes a Location argument that is
25698         used to report errors more precisly (instead of reporting the end
25699         of a definition, we try to track something which is a lot closer
25700         to the source of the problem).
25701
25702         * cs-tokenizer.cs: Track global token use, so we can properly flag
25703         the use of #define/#undef after the first token has been seen.
25704
25705         Also, rename the reportXXXX to Error_DescriptiveName
25706
25707         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25708         TypeContainer, so that Enum and Interface can use this too.
25709
25710         * class.cs (TypeContainer.LookupInterfaceOrClass,
25711         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25712         `builder' argument.  Typically this was used to pass the parent
25713         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25714         the definition).  
25715
25716         The problem is that a nested class could trigger the definition of
25717         a toplevel class, and the builder would be obviously wrong in that
25718         case. 
25719
25720         So we drop this argument, and we compute dynamically the
25721         TypeBuilder/ModuleBuilder (the correct information was available
25722         to us anyways from DeclSpace.Parent)
25723
25724         * interface.cs (Interface.DefineInterface): Drop builder
25725         parameter cleanup like class.cs
25726
25727         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25728         like class.cs
25729
25730         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25731         values. 
25732
25733         (Try.Emit): Propagate the returns value from the statement.
25734
25735         (Return.Emit): Even if we are leavning 
25736
25737         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25738
25739         * modifiers.cs: Fix the computation of MethodAttributes flags.
25740
25741 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25742
25743         * driver.cs: allow compilation of files that start with '/'.
25744         Add a default case when checking the argument of --target.
25745
25746 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25747
25748         * interface.cs: Implement the same search algorithm for types in
25749         the interface code.
25750
25751         * delegate.cs: Do not allow multiple definition.
25752
25753         * Recovered ChangeLog that got accidentally amputated
25754
25755         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25756
25757         * rootcontext.cs: Load manually enum to allow core classes to
25758         contain enumerations.
25759
25760         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25761         Update to new static methods in TypeManager.
25762
25763         * typemanager.cs (GetMethod, GetConstructor): Use our
25764         implementation of FindMembers to find the members, since during
25765         corlib compilation, the types are TypeBuilders and GetMethod and
25766         GetConstructor do not work.
25767
25768         Make all methods in TypeManager static.
25769
25770         (InitCodeHelpers): Split the functionality from
25771         the InitCodeTypes function.
25772
25773         * driver.cs: Call InitCodeHelpers after we have populated the
25774         types. 
25775
25776         * cs-parser.jay (delegate_declaration): we did not used to compute
25777         the delegate name correctly for void delegates.
25778
25779 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25780
25781         * rootcontext.cs (RootContext): Init the interface_resolve_order
25782         and type_container_resolve_order always.
25783
25784         (ResolveCore, BootstrapCorlib_ResolveClass,
25785         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25786         compiler when compiling with --nostdlib
25787
25788         * class.cs (TypeContainer.DefineType): Check that our parent is
25789         not null.  This test is most important when we are bootstraping
25790         the core types.
25791
25792         * codegen.cs: Split out the symbol writing code.
25793
25794 2002-03-25  Martin Baulig  <martin@gnome.org>
25795
25796         * driver.cs (-g): Made -g an alias for --debug.
25797
25798 2002-03-24  Martin Baulig  <martin@gnome.org>
25799
25800         * codegen.cs (SymbolWriter): New public variable. Returns the
25801         current symbol writer.
25802         (CodeGen): Added `bool want_debugging_support' argument to the
25803          constructor. If true, tell the ModuleBuild that we want debugging
25804         support and ask it for the ISymbolWriter.
25805         (Save): If we have a symbol writer, call it's Close() method after
25806         saving the assembly.
25807
25808         * driver.c (--debug): New command line argument to create a
25809         debugger information file.
25810
25811         * location.cs (SymbolDocument): New public property. Returns an
25812         ISymbolDocumentWriter object for the current source file or null
25813         if we don't have a symbol writer.
25814
25815 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25816
25817         * driver.cs (LoadAssembly): Correctly return when all the paths
25818         have been tried and not before.
25819
25820         * statement.cs (Switch.Emit): return the actual coverage for this
25821         statement (returns/not-returns)
25822
25823         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25824         switch of the statement if we are the last switch section.  That
25825         kills two problems: try/catch problems (we used to emit an empty
25826         nop at the end) and switch statements where all branches would
25827         return. 
25828
25829 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25830
25831         * driver.cs: Add default assemblies (the equivalent to the
25832         Microsoft CSC.RSP file)
25833
25834         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25835         also update tokens_seen and set it to false.
25836
25837         * driver.cs: Implement --recurse for Mike.
25838
25839         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25840         correctly splitting out the paths.
25841
25842 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25843
25844         * interface.cs (Interface.PopulateProperty): Instead of using
25845         `parent' as the declaration space for the set parameters, use
25846         `this' 
25847
25848         * support.cs (InternalParameters): InternalParameters constructor
25849         takes a DeclSpace instead of a TypeContainer.
25850
25851         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25852         types are being initialized, load the address of it before calling
25853         the function.  
25854
25855         (New): Provide a mechanism to disable the generation of local
25856         value type temporaries when the caller will be providing us with
25857         an address to store it.
25858
25859         (ArrayCreation.EmitDynamicInitializers): Use it.
25860
25861 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25862
25863         * expression.cs (Invocation.EmitArguments): Only probe for array
25864         property if there is more than one argument.  Sorry about that.
25865
25866         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25867         empty param arrays.
25868
25869         * class.cs (Method.LabelParameters): Fix incorrect code path that
25870         prevented the `ParamArrayAttribute' from being applied to the
25871         params attribute.
25872
25873 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25874
25875         * support.cs (ReflectionParameters): Correctly compute whether the
25876         last argument is a params array.  Fixes the problem with
25877         string.Split ('a')
25878
25879         * typemanager.cs: Make the assemblies array always be non-null
25880         (empty, but non-null)
25881
25882         * tree.cs (RecordDecl): New function that abstracts the recording
25883         of names.  This reports error 101, and provides a pointer to the
25884         previous declaration.  Fixes a crash in the compiler.
25885
25886         * cs-parser.jay (constructor_declaration): Update to new grammar,
25887         and provide a constructor_body that can be empty.
25888
25889 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
25890
25891         * driver.cs: Add support for --resources.
25892
25893         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
25894         Make all types for the various array helper methods be integer.
25895
25896         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
25897         CheckState to ConvCast.
25898
25899         (ConvCast): Now it takes a `checked' state argument, to avoid
25900         depending on the emit context for the conversion, and just using
25901         the resolve time setting.
25902
25903         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
25904         instead of Invocation.EmitArguments.  We do not emit the original
25905         arguments, instead we emit those which have been converted to
25906         unsigned int expressions.
25907
25908         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
25909
25910         * codegen.cs: ditto.
25911
25912         * expression.cs (LocalVariableReference): Drop the use of the
25913         Store function that depended on the variable index.
25914
25915         * statement.cs (VariableInfo): Drop the `Idx' property from this
25916         class, as this is not taking into account the indexes for
25917         temporaries tat we generate during the execution, getting the
25918         indexes wrong.
25919
25920         * class.cs: First emit class initializers, then call the parent
25921         constructor. 
25922
25923         * expression.cs (Binary): Fix opcode emision.
25924         (UnaryMutator.EmitCode): Support checked code generation
25925
25926         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
25927         matches for events for both the Static and Instance scans,
25928         pointing to the same element.   Fix that.
25929
25930 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
25931
25932         * rootcontext.cs (ResolveTree): Always set the
25933         interface_resolve_order, because nested interfaces will be calling
25934         into us.
25935
25936         * class.cs (GetInterfaceOrClass): Track the same resolution
25937         process used by TypeManager.LookupType.  This fixes the nested
25938         type lookups in class declarations (separate path from
25939         LookupType). 
25940
25941         (TypeContainer.DefineType): Also define nested interfaces.
25942         (TypeContainer.RegisterOrder): New public function used to
25943         register the order in which child interfaces need to be closed.
25944
25945         Nested interfaces need to be closed after their parents have been
25946         created. 
25947
25948         * interface.cs (InterfaceAttr): Put all the logic for computing
25949         the interface attribute here. 
25950
25951         (DefineInterface): Register our interface order with the
25952         RootContext or with the TypeContainer depending on the case.
25953
25954 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25955
25956         * cs-parser.jay: rework foreach statement to work with the new
25957         changes to the policy on SimpleNames.
25958
25959         * report.cs: support Stacktrace on warnings as well.
25960
25961         * makefile: drop --unsafe and /unsafe from the compile.
25962
25963 2002-03-13  Ravi Pratap  <ravi@ximian.com>
25964
25965         * ecore.cs (StandardConversionExists): Modify to take an Expression
25966         as the first parameter. Ensure we do null -> reference type conversion
25967         checking.
25968
25969         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
25970         temporary Expression objects.
25971
25972 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25973
25974         * interface.cs: workaround bug in method overloading resolution
25975         (there is already a bugzilla bug for it).
25976
25977 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
25978
25979         We could also solve this problem by having a separate path for
25980         performing type lookups, instead of DoResolve, we could have a
25981         ResolveType entry point, and only participating pieces of the
25982         production (simplename, deref, array) would implement this. 
25983
25984         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
25985         signal SimpleName to only resolve type names and not attempt to
25986         resolve anything else.
25987
25988         * expression.cs (Cast): Set the flag.
25989
25990         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
25991
25992         * class.cs: Only report 108 if there is no `new' modifier.
25993
25994         * cs-parser.jay: rework foreach statement to work with the new
25995         changes to the policy on SimpleNames.
25996
25997         * report.cs: support Stacktrace on warnings as well.
25998
25999         * makefile: drop --unsafe and /unsafe from the compile.
26000
26001 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26002
26003         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26004         lookups here, instead of doing that at parse time.  This means
26005         that our grammar will not introduce `LocalVariableReferences' as
26006         expressions at this point.  That solves the problem of code like
26007         this:
26008
26009         class X {
26010            static void Main ()
26011            { int X = 1;
26012             { X x = null }}}
26013
26014         This is only half the fix.  The full fix requires parameters to
26015         also be handled in this way.
26016
26017         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26018         makes the use more obvious of the DeclSpace.  The
26019         ec.TypeContainer.TypeBuilder is now only used to pull the
26020         TypeBuilder for it.
26021
26022         My theory is that I can get rid of the TypeBuilder completely from
26023         the EmitContext, and have typecasts where it is used (from
26024         DeclSpace to where it matters).  
26025
26026         The only pending problem is that the code that implements Aliases
26027         is on TypeContainer, and probably should go in DeclSpace.
26028
26029         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26030         lookups here, instead of doing that at parse time.  This means
26031         that our grammar will not introduce `LocalVariableReferences' as
26032         expressions at this point.  That solves the problem of code like
26033         this:
26034
26035         class X {
26036            static void Main ()
26037            { int X = 1;
26038             { X x = null }}}
26039
26040         This is only half the fix.  The full fix requires parameters to
26041         also be handled in this way.
26042
26043         * class.cs (Property.DefineMethod): When implementing an interface
26044         method, set newslot, when implementing an abstract method, do not
26045         set the flag (before we tried never setting it, or always setting
26046         it, which is the difference).
26047         (Indexer.DefineMethod): same.
26048         (Method.DefineMethod): same.
26049
26050         * ecore.cs: Only set the status used flag if we get back a Field.
26051
26052         * attribute.cs: Temporary hack, so Paolo can keep working.
26053
26054 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26055
26056         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26057         the unmanaged type in the case we have a MarshalAs attribute.
26058
26059         (Resolve): Handle the case when we are parsing the special MarshalAs
26060         attribute [we need to store the unmanaged type to use later]
26061
26062         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26063         MarshalAs Attribute.
26064
26065         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26066         on parameters and accordingly set the marshalling info.
26067
26068 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26069
26070         * class.cs: Optimizing slightly by removing redundant code after
26071         we switched to the `NoTypes' return value.
26072         (Property.DefineMethod): use NoTypes here too.
26073
26074         This fixes the bug I introduced in my last batch of changes.
26075
26076 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26077
26078         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26079
26080         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26081         Enums since those are types too. 
26082
26083         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26084
26085         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26086         thanks to a call during the lookup process.
26087
26088 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26089
26090         * statement.cs (Foreach): Lots of work to accomodate a particular
26091         kind of foreach statement that I had not kept in mind.  It is
26092         possible to have foreachs on classes that provide a GetEnumerator
26093         method that return objects that implement the "pattern" for using
26094         a foreach, there is no need to support GetEnumerator
26095         specifically. 
26096
26097         This is needed to compile nant.
26098
26099         * decl.cs: Only report 114 if the member is not `Finalize' and if
26100         the warning level is at least 2.
26101
26102         * class.cs: Moved the compare function from Method to
26103         MethodSignature. 
26104
26105         (MethodSignature.InheritableMemberSignatureCompare): Add new
26106         filter function that is used to extract inheritable methods from a
26107         class. 
26108
26109         (Method.Define): Use the new `inheritable_method_signature_filter'
26110         delegate
26111
26112         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26113         command. 
26114
26115 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26116
26117         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26118
26119         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26120
26121         * expression.cs: Pass location information to
26122         ConvertImplicitStandard. 
26123
26124         * class.cs: Added debugging code to track return values from
26125         interfaces. 
26126
26127 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26128
26129         * expression.cs (Is.DoResolve): If either side of the `is' is an
26130         interface, do not flag the warning.
26131
26132         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26133         for interfaces
26134
26135         * report.cs: Allow for --fatal to be used with --probe.
26136
26137         * typemanager.cs (NoTypes): Move the definition for the empty Type
26138         array here. 
26139
26140         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26141         properties. 
26142         (TypeContainer.DefineProxy): New function used to proxy to parent
26143         implementations when implementing interfaces.
26144         (TypeContainer.ParentImplements): used to lookup if our parent
26145         implements a public function that is required by an interface.
26146         (TypeContainer.VerifyPendingMethods): Hook this up.
26147
26148         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26149         `modules' and `assemblies' arraylists into arrays.  We only grow
26150         these are the very early start up of the program, so this improves
26151         the speedof LookupType (nicely measured).
26152
26153         * expression.cs (MakeByteBlob): Replaced unsafe code with
26154         BitConverter, as suggested by Paolo.
26155
26156         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26157         folding of string concatenation, but if either side is a string,
26158         and the other is not, then return null, and let the runtime use
26159         the concatenation on the string plus the object (using
26160         `Object.ToString'). 
26161
26162 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26163
26164         Constant Folding has been implemented now.
26165
26166         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26167         the error instead on types that are not supported in one's
26168         complement. 
26169
26170         * constant.cs (Constant and all children): New set of functions to
26171         perform implict and explicit conversions.
26172
26173         * ecore.cs (EnumConstant): Implement the new functions to perform
26174         conversion by proxying to the child expression.
26175
26176         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26177         own separate setting that can not be turned off from the command
26178         line using --unchecked or --checked and is only controlled using
26179         the checked/unchecked statements and expressions.  This setting is
26180         used by the constant folder to flag errors.
26181
26182         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26183         ConstantCheckState as well.   
26184
26185         During Resolve, they also have to flag the state, because the
26186         constant folder runs completely in the Resolve phase.
26187
26188         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26189         well.
26190
26191 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26192
26193         * cfold.cs: New file, this file contains the constant folder.
26194
26195         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26196         argument to track whether we are using the resulting address to
26197         load or store a value and provide better error messages. 
26198
26199         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26200         new AddressOf arguments.
26201
26202         * statement.cs (Foreach.EmitCollectionForeach): Update
26203
26204         * expression.cs (Argument.Emit): Call AddressOf with proper
26205         arguments to track usage.
26206
26207         (New.DoEmit): Call AddressOf with new arguments.
26208
26209         (Unary.Emit): Adjust AddressOf call.
26210
26211 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26212
26213         * cs-parser.jay (member_access): Change the case for pre-defined types
26214         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26215         this suggestion.
26216
26217         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26218         a method body.
26219
26220         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26221         essentially like methods and apply attributes like MethodImplOptions to them too.
26222
26223         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26224         not being null.
26225
26226         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26227         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26228         is the DeclSpace.
26229
26230         * Update code everywhere accordingly.
26231
26232         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26233
26234         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26235
26236 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26237
26238         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26239         try performing lookups against those instead of jumping straight into using
26240         the 'using' clauses.
26241
26242         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26243
26244         (LookupType): Perform lookups in implicit parents too.
26245
26246         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26247         sequence as RootContext.LookupType. 
26248
26249         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26250         the various cases of namespace lookups into this method.
26251
26252 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26253
26254         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26255         in positional arguments)
26256
26257         * class.cs (Operator): Update the AllowedModifiers to contain
26258         extern. 
26259
26260         * cs-parser.jay: Update operator declaration to allow for the
26261         operator body to be empty.
26262
26263         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26264         values. 
26265
26266 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26267
26268         * class.cs (Method.Emit): Label parameters.
26269
26270         * driver.cs: Return 1 or 0 as the program exit code.
26271
26272 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26273
26274         * expression.cs: Special case the `null' object when trying to
26275         auto-compute the type, as anything can be explicitly converted to
26276         that. 
26277
26278         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26279         spotting this Paolo.
26280
26281         (Expression.ImplicitNumericConversion): Perform comparissions of
26282         the type using the underlying type in the case of an enumeration
26283         rather than using the enumeration type for the compare.
26284
26285         Cope with the underlying == type case, which is not possible to
26286         catch before. 
26287
26288         (Expression.ConvertNumericExplicit): Perform comparissions of
26289         the type using the underlying type in the case of an enumeration
26290         rather than using the enumeration type for the compare.
26291
26292         * driver.cs: If the user does not supply an extension, assume .exe
26293
26294         * cs-parser.jay (if_statement): Rewrote so that we can track the
26295         location for the if statement.
26296
26297         * expression.cs (Binary.ConstantFold): Only concat strings when
26298         the operation is "+", not everything ;-)
26299
26300         * statement.cs (Statement.EmitBoolExpression): Take a location
26301         argument. 
26302         (If, While, Do): Track location.
26303
26304         * expression.cs (Binary.ResolveOperator): In the object + string
26305         case, I was missing a call to ConvertImplicit
26306
26307 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26308
26309         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26310         Location arguments. Ensure we use RootContext.LookupType to do our work
26311         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26312
26313         * interface.cs (PopulateMethod): Handle the type of the parameter being
26314         null gracefully.
26315
26316         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26317         have a params method with no fixed arguments and a call is made with no
26318         arguments.
26319
26320 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26321
26322         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26323         the verbatim-string-literal
26324
26325         * support.cs (InternalParameters.ParameterModifier): handle null
26326         fixed parameters.
26327         (InternalParameters.ParameterType): ditto.
26328
26329         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26330         duplicating the name of the variable parameter.
26331         (GetParameterByName): Fix bug where we were not looking up array
26332         paramters if they were the only present (thanks Paolo!).
26333         (GetParameterInfo): We only have an empty set of types if both
26334         fixed and array are set to null.
26335         (GetParameterInfo-idx): Handle FixedParameter == null
26336
26337         * cs-parser.jay: Handle the case where there is no catch
26338         statements (missing null test).
26339
26340 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26341
26342         * driver.cs (MainDriver): Be conservative on our command line
26343         handling.
26344
26345         Catch DirectoryNotFoundException when calling GetFiles.
26346
26347         (SplitPathAndPattern): Used to split the input specification into
26348         a path and a pattern that we can feed to Directory.GetFiles.
26349
26350 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26351
26352         * statement.cs (Fixed): Implement the last case of the Fixed
26353         statement (string handling).
26354
26355         * expression.cs (StringPtr): New class used to return a char * to
26356         a string;  Used by the Fixed statement.
26357
26358         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26359
26360         * expression.cs (Binary.ResolveOperator): Remove redundant
26361         MemberLookup pn parent type.
26362         Optimize union call, we do not need a union if the types are the same.
26363         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26364         type.
26365
26366         Specialize the use of MemberLookup everywhere, instead of using
26367         the default settings. 
26368
26369         (StackAlloc): Implement stackalloc keyword.
26370
26371         * cs-parser.jay: Add rule to parse stackalloc.
26372
26373         * driver.cs: Handle /h, /help, /?
26374
26375         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26376         before we supported unsafe code.
26377
26378         * makefile: add --unsafe to the self compilation of mcs.
26379
26380 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26381
26382         * expression.cs (PointerArithmetic): New class that is used to
26383         perform pointer arithmetic.
26384         (Binary.Resolve): Handle pointer arithmetic
26385         Handle pointer comparission.
26386         (ArrayPtr): Utility expression class that is used to take the
26387         address of an array.
26388
26389         (ElementAccess): Implement array access for pointers
26390
26391         * statement.cs (Fixed): Implement fixed statement for arrays, we
26392         are missing one more case before we are done.
26393
26394         * expression.cs (Indirection): Implement EmitAssign and set the
26395         ExprClass to Variable.  This allows pointer dereferences to be
26396         treated as variables, and to have values assigned to them.
26397
26398         * ecore.cs (Expression.StoreFromPtr): New utility function to
26399         store values dereferencing.
26400
26401 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26402
26403         * expression.cs (Binary.ResolveOperator): Ensure that we are
26404         not trying to operate on a void type - this fixes the reported
26405         bug.
26406
26407         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26408         the parent implementation is sealed.
26409
26410         * ../errors/cs0239.cs : Add.
26411
26412         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26413
26414         * typemanager.cs (unverifiable_code_type): Corresponds to 
26415         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26416         which have unsafe code in them.
26417
26418         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26419         unsafe context.
26420
26421 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26422
26423         * cs-tokenizer.cs: Add support for @"litreal strings"
26424
26425         Make tokenizer accept pre-processor directives
26426         on any column (remove the old C-like limitation). 
26427
26428         * rootcontext.cs (EmitCode): Emit any global attributes.
26429         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26430
26431         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26432
26433         * cs-parser.jay: Add support for global attributes.  
26434
26435 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26436
26437         * expression.cs (Indirection): New helper class.  Unary will
26438         create Indirection classes to be able to implement the
26439         IMemoryLocation interface on it.
26440
26441 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26442
26443         * cs-parser.jay (fixed_statement): reference the right statement.
26444
26445         * statement.cs (Fixed.Emit): Finish implementing the fixed
26446         statement for the &x case.
26447
26448 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26449
26450         * class.cs (Property.Define, Method.Define): Remove newslot when
26451         `implementing'.  
26452
26453         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26454         wrong.  NewSlot should only be used if the `new' keyword is present.
26455
26456         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26457         locating our system dir.  Sorry about this.
26458
26459 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26460
26461         * driver.cs (GetSystemDir): Compute correctly the location of our
26462         system assemblies.  I was using the compiler directory instead of
26463         the library directory.
26464
26465 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26466
26467         * expression.cs (BetterFunction): Put back in what Miguel commented out
26468         since it is the correct fix. The problem is elsewhere ;-)
26469
26470         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26471         parameters of the parms method are themselves compatible or not !
26472
26473         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26474         to check that a class implements an interface before saying that an implicit
26475         conversion was allowed. Use ImplementsInterface to do the checking.
26476
26477 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26478
26479         * class.cs (Method.Define): Track whether we are an explicit
26480         implementation or not.  And only call DefineMethodOverride if we
26481         are an explicit implementation.
26482
26483         (Property.DefineMethod): Ditto.
26484
26485 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26486
26487         * expression.cs (BetterFunction): Catch hideous bug which was
26488          preventing us from detecting ambiguous calls due to implicit casts i.e
26489         cs0121.
26490
26491 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26492
26493         * support.cs (Pair): Remove un-needed method.  I figured why I was
26494         getting the error in cs-parser.jay, the variable in a foreach loop
26495         is readonly, and the compiler does not really treat this as a variable.
26496
26497         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26498         instead of EQUALS in grammar.  
26499
26500         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26501
26502         * expression.cs (Unary.DoResolve): Check whether the argument is
26503         managed or not.
26504
26505 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26506
26507         * support.cs: Api for Pair to set a value.  Despite the fact that
26508         the variables are public the MS C# compiler refuses to compile
26509         code that accesses the field if the variable is part of a foreach
26510         statement. 
26511
26512         * statement.cs (Fixed): Begin implementation of the fixed
26513         statement.
26514
26515         (Block.AddVariable): Return the VariableInfo on success and null
26516         on failure instead of true/false. 
26517
26518         * cs-parser.jay (foreach): Catch errors on variables already
26519         defined (we were ignoring this value before) and properly unwind
26520         the block hierarchy
26521
26522         (fixed_statement): grammar for the fixed statement.
26523
26524 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26525
26526         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26527         pointer types to be incretemented.
26528
26529         (SizeOf): Implement.
26530
26531         * cs-parser.jay (pointer_member_access): Implement
26532         expr->IDENTIFIER production.
26533
26534         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26535         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26536         on safe contexts.
26537
26538         (Unary): Implement indirection.
26539
26540         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26541         use in non-unsafe context).
26542
26543         (SimpleName.DoResolve): Check for pointers in field access on safe
26544         contexts. 
26545
26546         (Expression.LoadFromPtr): Factor the load-indirect code in this
26547         function.  This was duplicated in UnboxCast and ParameterReference
26548
26549 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26550
26551         * expression.cs (ComposedCast): report an error if a pointer cast
26552         is used in a safe region.
26553
26554         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26555         pointer type casts in unsafe context.
26556
26557         * codegen.cs (EmitContext): Set up IsUnsafe.
26558
26559         * cs-parser.jay (non_expression_type): Add productions for pointer
26560         casts. 
26561
26562         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26563         code.  We should not use force into static mode if the method is
26564         not virtual.  Fixes bug in MIS
26565
26566         * statement.cs (Do.Emit, While.Emit, For.Emit,
26567         Statement.EmitBoolExpression): Add support to Do and While to
26568         propagate infinite loop as `I do return' semantics.
26569
26570         Improve the For case to also test for boolean constants.
26571
26572         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26573         to the list of attributes we can add.
26574
26575         Remove `EmitContext' argument.
26576
26577         * class.cs (Method.Define): Apply parameter attributes.
26578         (Constructor.Define): Apply parameter attributes.
26579         (MethodCore.LabelParameters): Move here the core of labeling
26580         parameters. 
26581
26582         * support.cs (ReflectionParameters.ParameterModifier,
26583         InternalParameters.ParameterModifier): Use IsByRef on the type and
26584         only return the OUT bit for these parameters instead of in/out/ref
26585         flags.
26586
26587         This is because I miss-understood things.  The ParameterInfo.IsIn
26588         and IsOut represent whether the parameter has the [In] and [Out]
26589         attributes set.  
26590
26591 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26592
26593         * ecore.cs (FieldExpr.Emit): Release temporaries.
26594
26595         * assign.cs (LocalTemporary.Release): new function.
26596
26597         * codegen.cs (EmitContext.GetTemporaryStorage,
26598         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26599         temporary storage.  Now we can "put back" localbuilders when we
26600         are done with them
26601
26602 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26603
26604         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26605         need to make a copy of the variable to generate verifiable code.
26606
26607 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26608
26609         * driver.cs: Compute dynamically the system directory.
26610
26611         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26612         Slower, but more generally useful.  Used by the abstract
26613         registering implementation. 
26614
26615         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26616         the rules for the special rule on Type/instances.  First check if
26617         we have the same name, and if so, try that special static path
26618         rather than the instance path.
26619
26620 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26621
26622         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26623         for, while and if.
26624
26625         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26626         Enum, ValueType, Delegate or Array for non-corlib compiles.
26627
26628         * cs-tokenizer.cs: Catch long identifiers (645)
26629
26630         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26631         piece of code.
26632
26633         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26634         fix, we were returning too early, so we were not registering
26635         pending methods from abstract classes.
26636
26637         Do not register pending methods if the class is abstract.
26638
26639         * expression.cs (Conditional.DoResolve): Report circular implicit
26640         conversions when we neecd to compute it for conditional
26641         expressions. 
26642
26643         (Is.DoResolve): If the expression is always of the provided type,
26644         flag warning 183.  If the expression can not ever be of the
26645         provided type flag warning 184.
26646
26647         * class.cs: Catch 169 as well.
26648
26649         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26650         read. 
26651
26652 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26653
26654         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26655
26656 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26657
26658         * interface.cs: (PopulateMethod): Check for pointers being defined
26659         only if the unsafe context is active.
26660         (PopulateProperty): ditto.
26661         (PopulateIndexer): ditto.
26662
26663         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26664         specified.  If pointers are present, make sure that they are
26665         present in an unsafe context.
26666         (Constructor, Constructor.Define): ditto.
26667         (Field, Field.Define): ditto.
26668         (Property, Property.Define): ditto.
26669         (Event, Event.Define): ditto.
26670
26671         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26672         hashtable if there are classes or structs defined.
26673
26674         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26675         code, as the constant resolution moved.
26676
26677         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26678         the metadata, so we can flag error 133. 
26679
26680         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26681         pointer is being declared in an unsafe context.
26682
26683 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26684
26685         * modifiers.cs (Modifiers.Check): Require a Location argument.
26686         Report error 227 for Unsafe use.
26687
26688         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26689
26690         * statement.cs (For.Emit): If the test is null, then report that
26691         we do `return', as we wont reach anything afterwards.
26692
26693         (Switch.SwitchGoverningType): Track the expression that matched
26694         the conversion.
26695
26696         * driver.cs: Allow negative numbers as an error code to flag.
26697
26698         * cs-parser.jay: Handle 1551.
26699
26700         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26701
26702 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26703
26704         * cs-parser.jay: Report 1518 (type declaration can only contain
26705         class, struct, interface, enum or delegate)
26706
26707         (switch_label): Report 1523 (keywords `case' or `default' must
26708         preced code)
26709
26710         (opt_switch_sections): Report 1522 (empty switch)
26711
26712         * driver.cs: Report 1515 (response file specified multiple times)
26713         Report 1516 (Source file specified multiple times).
26714
26715         * expression.cs (Argument.Resolve): Signal 1510
26716
26717         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26718         access not allowed in static code)
26719
26720 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26721
26722         * typemanager.cs (IsPointerType): Utility method which we are going
26723         to need a lot.
26724
26725         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26726         the object type, so we take care of that.
26727
26728         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26729
26730         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26731         added to non-params parameters :-)
26732
26733         * typemanager.cs (CSharpName): Include 'void' type too. 
26734
26735         (void_ptr_type): Include in the set of core types.
26736
26737         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26738         duplicating code.
26739
26740         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26741         an unsafe context.
26742
26743         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26744         completely forgotten about it.
26745
26746 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26747
26748         * cs-parser.jay (pointer_type): Add. This begins our implementation
26749         of parsing rules for unsafe code.
26750
26751         (unsafe_statement): Implement.
26752
26753         (embedded_statement): Modify to include the above.
26754
26755         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26756
26757         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26758         if the current context is an unsafe one.
26759
26760         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26761         are handled differently, we need separate rules for them.
26762
26763         (local_variable_declaration): Update to use local_variable_pointer_type
26764         to allow variable declarations of unmanaged pointer types.
26765
26766         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26767         in unsafe contexts.
26768
26769         * ../errors/cs0214.cs : Add.
26770
26771 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26772
26773         * makefile: remove 'response' file when cleaning.
26774
26775 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26776
26777         * cs-parser.jay: Report 1524.
26778
26779 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26780
26781         * typemanager.cs (RegisterMethod): drop checking if we have
26782         registered this from here
26783
26784 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26785
26786         * class.cs (Method.EmitDestructor): Implement calling our base
26787         destructor. 
26788
26789         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26790         value of InFinally.
26791
26792         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26793         this routine and will wrap the call in a try/catch block.  Deal
26794         with the case.
26795
26796 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26797
26798         * ecore.cs (Expression.MemberLookup): instead of taking a
26799         parameter `same_type' that was used to tell whether we could
26800         access private members we compute our containing type from the
26801         EmitContext.
26802
26803         (FieldExpr): Added partial support for volatile fields.  This does
26804         not work for volatile fields exposed from assemblies, as I can not
26805         figure out how to extract the modreq from it.
26806
26807         Updated all the source files to use this.
26808
26809         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26810         because it is referenced by MemberLookup very often. 
26811
26812 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26813
26814         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26815         TypeBuilder.GetCustomAttributes to retrieve what we need.
26816
26817         Get rid of redundant default_member_attr_type as this is the same as
26818         default_member_type which already exists.
26819
26820         * interface.cs, attribute.cs : Update accordingly.
26821
26822 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26823
26824         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26825         work for TYpeBuilders though.  Ravi, can you please fix this?
26826
26827         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26828
26829         * expression.cs (Argument.Emit): Handle the case of ref objects
26830         being passed to ref functions;  
26831
26832         (ParameterReference.EmitLoad): Loads the content of the pointer
26833         without dereferencing.
26834
26835 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26836
26837         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26838
26839 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26840
26841         * class.cs (Indexer.DefineMethod): Incorporate the interface
26842         type in the name of the method if we are doing explicit interface
26843         implementation.
26844
26845         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26846
26847         (BetterConversion): Fix extremely trivial bug where we were referring to
26848         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26849         again !
26850
26851         * ../errors/bug16.cs : Add although we have fixed it.
26852
26853 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26854
26855         * expression.cs (BaseIndexer): Begin implementation.
26856
26857         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26858
26859         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26860         production directly to remove a shift/reduce, and implement
26861         explicit interface implementation.
26862
26863         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26864         after a floating point suffix.
26865
26866         * expression.cs (DoNumericPromotions): Improved the conversion for
26867         uint/uint.  If we have a constant, we avoid doing a typecast to a
26868         larger type.
26869
26870         * class.cs (Indexer): Implement explicit interface implementation
26871         for indexers.
26872
26873 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26874
26875         * class.cs: make the default instance constructor public and hidebysig.
26876
26877 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26878
26879         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26880         so we can call it from elsewhere.
26881
26882         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26883         we emit it internally if the class has a defined indexer; otherwise the user
26884         emits it by decorating the class definition with the DefaultMemberAttribute.
26885
26886         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
26887         attribute is not used on a type which defines an indexer.
26888
26889         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
26890         character when we skip whitespace.
26891
26892         * ../errors/cs0646.cs : Add.
26893
26894 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
26895
26896         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
26897         again. 
26898
26899         * makefile: Add practical target `mcs3.exe' which builds the third
26900         generation compiler. 
26901
26902         * expression.cs (New): Fix structures constructor calling.
26903
26904         * class.cs (Property, Method, Indexer): Emit Final flag on the
26905         method if we are an interface implementation and we are not
26906         abstract. 
26907
26908         * ecore.cs (PropertyExpr): New public field `IsBase', tells
26909         whether this property is referencing a `base' method.
26910
26911         * expression.cs (Invocation.EmitCall): take an extra argument:
26912         is_base, this is used to determine whether the `call' or
26913         `callvirt' opcode should be used.
26914
26915
26916         * delegate.cs: update EmitCall.
26917
26918         * class.cs (Method.Define): Set NewSlot for the cases where we are
26919         not implementing an interface method.
26920
26921         (Property.Define): ditto.
26922
26923 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
26924
26925         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
26926         'r'.  Allows mcs to parse itself fully.
26927
26928 2002-01-02  Ravi Pratap  <ravi@ximian.com>
26929
26930         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
26931         of the number of initializers that require the InitializeArray method.
26932
26933         (CheckIndices): Store the Expression in all cases - not the plain value. Also
26934         update the above field where necessary.
26935
26936         (MakeByteBlob): Update accordingly.
26937
26938         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
26939         greater than 2.
26940
26941         (EmitDynamicInitializers): Update in accordance with the new optimization.
26942
26943         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
26944         same OpCode applies.
26945
26946         * cs-parser.jay : Fix some glaring errors I introduced.
26947
26948 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
26949
26950         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
26951         so that we can check for name clashes there too.
26952
26953         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
26954         for interface indexers.
26955
26956         * interfaces.cs (Define): Emit the default member attribute.
26957
26958         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
26959         variable was being referred to while setting the value ;-)
26960
26961 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
26962
26963         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
26964         byte-by-byte information when we know the data is zero.
26965
26966         Make the block always a multiple of 4, because
26967         DefineInitializedData has a bug.
26968
26969         * assign.cs: Fix, we should assign from the temporary, not from
26970         the source. 
26971
26972         * expression.cs (MakeByteBlob): Fix my incorrect code.
26973
26974 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
26975
26976         * typemanager.cs (EnumToUnderlying): This function is used to get
26977         the underlying type from an enumeration, because it does not
26978         always work. 
26979
26980         * constant.cs: Use the I4_S form for values between -128 and 127.
26981
26982         * statement.cs (Block.LookupLabel): Looks up a label.
26983         (Block): Drop support for labeled blocks.
26984
26985         (LabeledStatement): New kind of statement that represents a label
26986         only.
26987
26988         (Goto): Finally implement this bad boy.
26989
26990         * cs-parser.jay: Update to reflect new mechanism to implement
26991         labels.
26992
26993 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
26994
26995         * codegen.cs (EmitContext.This): a codegen property that keeps the
26996         a single instance of this instead of creating many different this
26997         instances. 
26998
26999         * delegate.cs (Delegate.DoResolve): Update to use the property;
27000
27001         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27002
27003         * expression.cs (BaseAccess.DoResolve): Ditto.
27004
27005 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27006
27007         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27008         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27009
27010         (InitCoreTypes): Update accordingly.
27011
27012         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27013         so we can quickly store the state.
27014
27015         (ApplyAttributes): Set the correct implementation flags
27016         for InternalCall methods.
27017
27018 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27019
27020         * expression.cs (EmitCall): if a method is not virtual, then do
27021         not use callvirt on it.
27022
27023         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27024         user defined stuff) requires the use of stobj, which takes an
27025         address on the stack instead of an array and an index.  So emit
27026         the Ldelema operation for it.
27027
27028         (EmitStoreOpcode): Use stobj for valuetypes.
27029
27030         (UnaryMutator.EmitCode): Use the right 1 value depending on
27031         whether we are dealing with int64/uint64, float or doubles.
27032
27033         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27034         constructors that I implemented last night.
27035
27036         (Constructor.IsDefault): Fix to work properly for static
27037         constructors.
27038
27039         * cs-parser.jay (CheckDef): report method signature errors.
27040         Update error number 103 to be 132.
27041
27042         * decl.cs: New AdditionResult enumeration value: MethodExists.
27043         Although we do this check for methods later on in the semantic
27044         analysis, catching repeated default constructors is so easy that
27045         we catch these here. 
27046
27047         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27048         promotions code.
27049
27050         (ParameterReference.EmitAssign, Emit): handle
27051         bools as bytes.
27052
27053         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27054         (ArrayAccess.EmitStoreOpcode): ditto.
27055
27056         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27057
27058         * expression.cs (MakeByteBlob): Complete all the missing types
27059         (uint, short, ushort, byte, sbyte)
27060
27061         * class.cs: Only init instance field initializers on instance
27062         constructors. 
27063
27064         Rename `constructors' to instance_constructors. 
27065
27066         (TypeContainer.AddConstructor): Only add constructors to the list
27067         if it is not static.
27068
27069         Make sure that we handle default_static_constructor independently
27070         everywhere where we handle instance_constructors
27071
27072 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27073
27074         * class.cs: Do not lookup or create a base initializer for a
27075         static constructor.
27076
27077         (ConstructorInitializer.Resolve): use the proper type to lookup
27078         for constructors.
27079
27080         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27081
27082         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27083         in DeclSpace. 
27084
27085         * decl.cs: CloseType is now an virtual method, the default
27086         implementation just closes this type.
27087
27088 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27089
27090         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27091         to PreserveSig by default. Also emit HideBySig on such methods.
27092
27093         Basically, set the defaults to standard values.
27094
27095         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27096         argument, if candidate is better, it can't be worse than the best !
27097
27098         (Invocation): Re-write bits to differentiate between methods being
27099         applicable in their expanded form and their normal form - for params
27100         methods of course.
27101
27102         Get rid of use_standard everywhere as only standard conversions are allowed
27103         in overload resolution. 
27104
27105         More spec conformance.
27106
27107 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27108
27109         * driver.cs: Add --timestamp, to see where the compiler spends
27110         most of its time.
27111
27112         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27113         `this' in static code.
27114
27115         (SimpleName.DoResolve): Implement in terms of a helper function
27116         that allows static-references to be passed upstream to
27117         MemberAccess.
27118
27119         (Expression.ResolveWithSimpleName): Resolve specially simple
27120         names when called by MemberAccess to implement the special
27121         semantics. 
27122
27123         (Expression.ImplicitReferenceConversion): Handle conversions from
27124         Null to reference types before others, as Null's type is
27125         System.Object. 
27126
27127         * expression.cs (Invocation.EmitCall): Handle the special case of
27128         calling methods declared on a reference type from a ValueType
27129         (Base classes System.Object and System.Enum)
27130
27131         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27132         the left hand side is a TypeExpr, not on every enumeration. 
27133
27134         (Binary.Resolve): If types are reference types, then do a cast to
27135         object on operators != and == of both arguments.
27136
27137         * typemanager.cs (FindMembers): Extract instance and static
27138         members if requested.
27139
27140         * interface.cs (PopulateProperty): Use void_type instead of null
27141         as the return type for the setter method.
27142
27143         (PopulateIndexer): ditto.
27144
27145 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27146
27147         * support.cs (ReflectionParameters): Fix minor bug where we
27148         were examining the wrong parameter for the ParamArray attribute.
27149
27150         Cope with requests for the type of the parameter at position
27151         greater than the params parameter's. We now return the element
27152         type of the params array as that makes more sense.
27153
27154         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27155         accordingly as we no longer have to extract the element type
27156         ourselves.
27157
27158         (Invocation.OverloadResolve): Update.
27159
27160 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27161
27162         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27163         against IEnumerator, test whether the return value is a descendant
27164         of the IEnumerator interface.
27165
27166         * class.cs (Indexer.Define): Use an auxiliary method to implement
27167         the other bits of the method definition.  Begin support for
27168         explicit interface implementation.
27169
27170         (Property.DefineMethod): Use TypeManager.void_type instead of null
27171         for an empty return value.
27172
27173 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27174
27175         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27176         dealing with a FieldExpr which is composed of a FieldBuilder, in
27177         the code path we did extract the constant, but we should have
27178         obtained the underlying value to be able to cast it (otherwise we
27179         end up in an infinite loop, this is what Ravi was running into).
27180
27181         (ArrayCreation.UpdateIndices): Arrays might be empty.
27182
27183         (MemberAccess.ResolveMemberAccess): Add support for section
27184         14.5.4.1 that deals with the special case of E.I when E is a type
27185         and something else, that I can be a reference to a static member.
27186
27187         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27188         handle a particular array type to create byte blobs, it is just
27189         something we dont generate byteblobs for.
27190
27191         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27192         arguments. 
27193
27194         * location.cs (Push): remove the key from the hashtable that we
27195         are about to add.   This happens for empty files.
27196
27197         * driver.cs: Dispose files after we have parsed them.
27198
27199         (tokenize): new function that only runs the tokenizer on its
27200         input, for speed testing.
27201
27202 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27203
27204         * class.cs (Event.Define): Define the private field only if there
27205         are no accessors defined.
27206
27207         * expression.cs (ResolveMemberAccess): If there is no associated
27208         field with the event, that means we have an event defined with its
27209         own accessors and we should flag error cs0070 since transforming
27210         ourselves into a field is not valid in that case.
27211
27212         * ecore.cs (SimpleName.DoResolve): Same as above.
27213
27214         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27215         and charset to sane values.
27216
27217 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27218
27219         * assign.cs (DoResolve): Perform check on events only if they 
27220         are being accessed outside the declaring type.
27221
27222         * cs-parser.jay (event_declarations): Update rules to correctly
27223         set the type of the implicit parameter etc.
27224
27225         (add_accessor, remove_accessor): Set current local parameters.
27226
27227         * expression.cs (Binary): For delegate addition and subtraction,
27228         cast the return value from the method into the appropriate delegate
27229         type.
27230
27231 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27232
27233         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27234         of these as the workaround is unnecessary.
27235
27236         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27237         delegate data - none of that is needed at all.
27238
27239         Re-write bits to extract the instance expression and the delegate method
27240         correctly.
27241
27242         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27243         on delegates too.
27244
27245         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27246         of attaching attributes instead of duplicating code everywhere.
27247
27248         * everywhere : Update code to do attribute emission using the above method.
27249
27250 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27251
27252         * expression.cs (IsParamsMethodApplicable): if there are not
27253         parameters, return immediately.
27254
27255         * ecore.cs: The 0 literal can be implicity converted to an enum
27256         type. 
27257
27258         (SimpleName.DoResolve): First lookup the type, then lookup the
27259         members. 
27260
27261         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27262         want to get its address.  If the InstanceExpression is not
27263         addressable, store the result in a temporary variable, then get
27264         the address of it.
27265
27266         * codegen.cs: Only display 219 errors on warning level or above. 
27267
27268         * expression.cs (ArrayAccess): Make it implement the
27269         IMemoryLocation interface.
27270
27271         (Binary.DoResolve): handle the operator == (object a, object b)
27272         and operator != (object a, object b) without incurring into a
27273         BoxedCast (because 5 != o should never be performed).
27274
27275         Handle binary enumerator operators.
27276
27277         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27278         value type, otherwise use Ldelem_ref.
27279
27280         Use precomputed names;
27281
27282         (AddressOf): Implement address of
27283
27284         * cs-parser.jay (labeled_statement): Fix recursive block
27285         addition by reworking the production.
27286
27287         * expression.cs (New.DoEmit): New has a special case:
27288                 
27289                  If we are dealing with a ValueType, we have a few
27290                  situations to deal with:
27291                 
27292                     * The target of New is a ValueType variable, that is
27293                       easy, we just pass this as the variable reference
27294                 
27295                     * The target of New is being passed as an argument,
27296                       to a boxing operation or a function that takes a
27297                       ValueType.
27298                 
27299                       In this case, we need to create a temporary variable
27300                       that is the argument of New.
27301
27302
27303 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27304
27305         * rootcontext.cs (LookupType): Check that current_type is not null before
27306         going about looking at nested types.
27307
27308         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27309         not implement the IAssignMethod interface any more.
27310
27311         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27312         where we tranform them into FieldExprs if they are being resolved from within
27313         the declaring type.
27314
27315         * ecore.cs (SimpleName.DoResolve): Do the same here.
27316
27317         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27318
27319         * ../errors/bug10.cs : Add.
27320
27321         * ../errors/cs0070.cs : Add.
27322
27323         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27324
27325         * assign.cs : Get rid of EventIsLocal everywhere.
27326
27327 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27328
27329         * ecore.cs (ConvertIntLiteral): finished the implementation.
27330
27331         * statement.cs (SwitchLabel): Convert the value we are using as a
27332         key before looking up the table.
27333
27334 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27335
27336         * codegen.cs (EmitTopBlock): Require a Location argument now.
27337
27338         * cs-parser.jay (constructor_declarator): We need to setup
27339         current_local_parameters before we parse the
27340         opt_constructor_initializer, to allow the variables to be bound
27341         to the constructor arguments.
27342
27343         * rootcontext.cs (LookupType): First lookup nested classes in our
27344         class and our parents before we go looking outside our class.
27345
27346         * expression.cs (ConstantFold): Extract/debox the values at the
27347         beginnning. 
27348
27349         * rootcontext.cs (EmitCode): Resolve the constants first before we
27350         resolve the types.  This is not really needed, but it helps debugging.
27351
27352         * statement.cs: report location.
27353
27354         * cs-parser.jay: pass location to throw statement.
27355
27356         * driver.cs: Small bug fix.
27357
27358         * report.cs: Updated format to be 4-zero filled digits.
27359
27360 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27361
27362         * expression.cs (CheckIndices): Fix minor bug where the wrong
27363         variable was being referred to ;-)
27364
27365         (DoEmit): Do not call EmitStaticInitializers when the 
27366         underlying type is System.Object.
27367
27368 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27369
27370         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27371         and do the usual workaround for SRE.
27372
27373         * class.cs (MyEventBuilder.EventType): New member to get at the type
27374         of the event, quickly.
27375
27376         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27377
27378         * assign.cs (Assign.DoResolve): Handle the case when the target
27379         is an EventExpr and perform the necessary checks.
27380
27381         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27382         interface.
27383
27384         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27385
27386         (EventExpr): Set the type in the constructor itself since we 
27387         are meant to be born fully resolved.
27388
27389         (EventExpr.Define): Revert code I wrote earlier.
27390                 
27391         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27392         instance expression is null. The instance expression is a This in that case
27393         or a null, depending on whether it is a static method or not.
27394
27395         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27396         refers to more than one method.
27397
27398         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27399         and accordingly flag errors.
27400
27401 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27402
27403         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27404
27405 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27406
27407         * location.cs (ToString): Provide useful rutine.
27408
27409 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27410
27411         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27412         objects, return the actual integral boxed.
27413
27414         * statement.cs (SwitchLabel): define an ILLabel for each
27415         SwitchLabel. 
27416
27417         (Switch.CheckSwitch): If the value is a Literal, extract
27418         the underlying literal.
27419
27420         Also in the unused hashtable we had, add the SwitchLabel so we can
27421         quickly look this value up.
27422
27423         * constant.cs: Implement a bunch of new constants.  Rewrite
27424         Literal based on this.  Made changes everywhere to adapt to this.
27425
27426         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27427         dereferencing array only once, and also copes with enumrations.
27428
27429         bytes are two bytes wide, not one.
27430
27431         (Cast): Perform constant conversions.
27432
27433         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27434         wrappers to the literals here.
27435
27436         * expression.cs (DoNumericPromotions): long literals can converted
27437         to ulong implicity (this is taken care of elsewhere, but I was
27438         missing this spot).
27439
27440         * ecore.cs (Expression.Literalize): Make the return type Literal,
27441         to improve type checking.
27442
27443         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27444
27445 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27446
27447         * literal.cs: Revert code from ravi that checked the bounds.  The
27448         bounds are sane by the definition of the type itself. 
27449
27450         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27451         need to actually look up in our parent hierarchy for interfaces
27452         implemented. 
27453
27454         * const.cs: Use the underlying type for enumerations
27455
27456         * delegate.cs: Compute the basename for the delegate creation,
27457         that should fix the delegate test case, and restore the correct
27458         Type Lookup semantics in rootcontext
27459
27460         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27461         referencing a nested type with the Reflection API is using the "+"
27462         sign. 
27463
27464         * cs-parser.jay: Do not require EOF token at the end.
27465
27466 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27467
27468         * rootcontext.cs (LookupType): Concatenate type names with
27469         a '.' instead of a '+' The test suite passes again.
27470
27471         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27472         field of the enumeration.
27473
27474         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27475         the case when the member is an EventExpr.
27476
27477         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27478         static has an associated instance expression.
27479
27480         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27481
27482         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27483
27484         * class.cs (Event.Define): Register event and perform appropriate checks
27485         for error #111.
27486
27487         We define the Add and Remove methods even if the use provides none because
27488         in that case, we provide default implementations ourselves.
27489
27490         Define a private field of the type of the event. This is done by the CSC compiler
27491         and we should be doing it too ;-)
27492
27493         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27494         More methods we use in code we generate.
27495
27496         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27497         is important.
27498
27499         (InitCoreTypes): Update accordingly for the above.
27500
27501         * class.cs (Event.Emit): Generate code for default accessors that we provide
27502
27503         (EmitDefaultMethod): Do the job in the above.
27504
27505         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27506         appropriate place.
27507
27508 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27509
27510         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27511         builders even if we were missing one.
27512
27513         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27514         pass the Basename as our class name instead of the Name.  The
27515         basename will be correctly composed for us.
27516
27517         * parameter.cs (Paramters): Now takes a Location argument.
27518
27519         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27520         make all the code call directly LookupType in RootContext and take
27521         this chance to pass the Location information everywhere.
27522
27523         * Everywhere: pass Location information.
27524
27525 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27526
27527         * class.cs (Constructor.Define): Updated way of detecting the
27528         length of the parameters.
27529
27530         (TypeContainer.DefineType): Use basename as the type name for
27531         nested types.
27532
27533         (TypeContainer.Define): Do not recursively define types here, as
27534         definition is taken care in order by the RootContext.
27535
27536         * tree.cs: Keep track of namespaces in a per-file basis.
27537
27538         * parameter.cs (Parameter.ComputeSignature): Update to use
27539         DeclSpace. 
27540
27541         (Parameters.GetSignature): ditto.
27542
27543         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27544         instead of a TypeContainer.
27545
27546         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27547         resolve names.  Because we need to be resolve in our context, not
27548         our parents.
27549
27550         * driver.cs: Implement response files.
27551
27552         * class.cs (TypeContainer.DefineType): If we are defined, do not
27553         redefine ourselves.
27554
27555         (Event.Emit): Emit the code for add/remove handlers.
27556         (Event.Define): Save the MethodBuilders for add/remove.
27557
27558         * typemanager.cs: Use pair here too.
27559
27560         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27561         DictionaryEntry requires the first argument to be non-null.  
27562
27563         (enum_declaration): Compute full name for registering the
27564         enumeration.
27565
27566         (delegate_declaration): Instead of using
27567         formal_parameter_list, use opt_formal_parameter_list as the list
27568         can be empty.
27569
27570         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27571         (EventParsing): New property that controls whether `add' and
27572         `remove' are returned as tokens or identifiers (for events);
27573
27574 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27575
27576         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27577         use MyEventBuilder only and let it wrap the real builder for us.
27578
27579         (MyEventBuilder): Revamp constructor etc.
27580
27581         Implement all operations that we perform on EventBuilder in precisely the same
27582         way here too.
27583
27584         (FindMembers): Update to use the EventBuilder member.
27585
27586         (Event.Emit): Update accordingly.
27587
27588 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27589
27590         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27591         by calling the appropriate methods.
27592
27593         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27594         useful.
27595
27596         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27597
27598 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27599
27600         * delegate.cs (Delegate.Populate): Check that the return type
27601         and various parameters types are indeed accessible.
27602
27603         * class.cs (Constructor.Define): Same here.
27604
27605         (Field.Define): Ditto.
27606
27607         (Event.Define): Ditto.
27608
27609         (Operator.Define): Check that the underlying Method defined itself
27610         correctly - so it's MethodBuilder should not be null.
27611
27612         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27613         expression happens to be null.
27614
27615         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27616         members but as of now we don't seem to be able to do anything really useful with it.
27617
27618         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27619         not the EventBuilder.
27620
27621 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27622
27623         * cs-tokenizer.cs: Add support for defines.
27624         Add support for #if, #elif, #else, #endif
27625
27626         (eval_var): evaluates a variable.
27627         (eval): stubbed for evaluating functions.
27628
27629         * cs-parser.jay: Pass the defines information
27630
27631         * driver.cs: Add --define command line option.
27632
27633         * decl.cs: Move MemberCore here.
27634
27635         Make it the base class for DeclSpace.  This allows us to catch and
27636         report 108 and 109 for everything now.
27637
27638         * class.cs (TypeContainer.Define): Extract all the members
27639         before populating and emit the warning 108 (new keyword required
27640         to override) instead of having each member implement this.
27641
27642         (MemberCore.Define): New abstract method, we will be using this in
27643         the warning reporting engine in Populate.
27644
27645         (Operator.Define): Adjust to new MemberCore protocol. 
27646
27647         * const.cs (Const): This does not derive from Expression, it is a
27648         temporary object we use to create fields, it is a MemberCore. 
27649
27650         * class.cs (Method.Define): Allow the entry point to be in a
27651         specific class.
27652
27653         * driver.cs: Rewrite the argument handler to clean it up a bit.
27654
27655         * rootcontext.cs: Made it just an auxiliary namespace feature by
27656         making everything static.
27657
27658         * driver.cs: Adapt code to use RootContext type name instead of
27659         instance variable.
27660
27661         * delegate.cs: Remove RootContext argument.
27662
27663         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27664         argument. 
27665
27666         * class.cs (Event.Define): The lookup can fail.
27667
27668         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27669
27670         * expression.cs: Resolve the this instance before invoking the code.
27671
27672 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27673
27674         * cs-parser.jay: Add a production in element_access that allows
27675         the thing to become a "type" reference.  This way we can parse
27676         things like "(string [])" as a type.
27677
27678         Note that this still does not handle the more complex rules of
27679         casts. 
27680
27681
27682         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27683
27684         * ecore.cs: (CopyNewMethods): new utility function used to
27685         assemble the list of methods from running FindMembers.
27686
27687         (MemberLookup): Rework FindMembers so that 
27688
27689 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27690
27691         * class.cs (TypeContainer): Remove Delegates who fail to be
27692         defined.
27693
27694         * delegate.cs (Populate): Verify that we dont get null return
27695         values.   TODO: Check for AsAccessible.
27696
27697         * cs-parser.jay: Use basename to emit error 574 (destructor should
27698         have the same name as container class), not the full name.
27699
27700         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27701         possible representation.  
27702
27703         Also implements integer type suffixes U and L.
27704
27705 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27706
27707         * expression.cs (ArrayCreation.DoResolve): We need to do the
27708         argument resolution *always*.
27709
27710         * decl.cs: Make this hold the namespace.  Hold the root context as
27711         well.
27712         (LookupType): Move here.
27713
27714         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27715
27716         * location.cs (Row, Name): Fixed the code, it was always returning
27717         references to the first file.
27718
27719         * interface.cs: Register properties defined through interfaces.
27720
27721         * driver.cs: Add support for globbing on the command line
27722
27723         * class.cs (Field): Make it derive from MemberCore as well.
27724         (Event): ditto.
27725
27726 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27727
27728         * class.cs (Event::Define): Check that the type of the event is a delegate
27729         type else flag error #66.
27730
27731         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27732         same.
27733
27734         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27735         values of EntryPoint, CharSet etc etc.
27736
27737         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27738
27739         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27740         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27741         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27742         which needs this to do its work.
27743
27744         * ../errors/cs0066.cs : Add.
27745
27746 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27747
27748         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27749         helper functions.
27750
27751         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27752         clears out the parameters field.
27753         (MemberSignatureCompare): Cleanup
27754
27755         (MemberCore): New base class used to share code between MethodCore
27756         and Property.
27757
27758         (RegisterRequiredImplementations) BindingFlags.Public requires
27759         either BindingFlags.Instace or Static.  Use instance here.
27760
27761         (Property): Refactored code to cope better with the full spec.
27762
27763         * parameter.cs (GetParameterInfo): Return an empty array instead
27764         of null on error.
27765
27766         * class.cs (Property): Abstract or extern properties have no bodies.
27767
27768         * parameter.cs (GetParameterInfo): return a zero-sized array.
27769
27770         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27771         method modifier validation to the typecontainer so we can reuse
27772         this on properties.
27773
27774         (MethodCore.ParameterTypes): return an empty sized array of types.
27775
27776         (Property.Define): Test property modifier validity.
27777
27778         Add tests for sealed/override too.
27779
27780         (Method.Emit): abstract or extern methods have no bodies.
27781
27782 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27783
27784         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27785         thing.
27786
27787         (Method::Define, ::Emit): Modify accordingly.
27788
27789         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27790
27791         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27792
27793         * makefile: Pass in /unsafe.
27794
27795 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27796
27797         * class.cs (MakeKey): Kill routine.
27798
27799         * class.cs (TypeContainer.Define): Correctly define explicit
27800         method implementations (they require the full interface name plus
27801         the method name).
27802
27803         * typemanager.cs: Deply the PtrHashtable here and stop using the
27804         lame keys.  Things work so much better.
27805
27806         This of course broke everyone who depended on `RegisterMethod' to
27807         do the `test for existance' test.  This has to be done elsewhere.
27808
27809         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27810         the object stupid Equals method (because, that like fails all over
27811         the place).  We still do not use it.
27812
27813         * class.cs (TypeContainer.SetRequiredInterface,
27814         TypeContainer.RequireMethods): Killed these two routines and moved
27815         all the functionality to RegisterRequiredImplementations.
27816
27817         (TypeContainer.RegisterRequiredImplementations): This routine now
27818         registers all the implementations required in an array for the
27819         interfaces and abstract methods.  We use an array of structures
27820         which can be computed ahead of time to reduce memory usage and we
27821         also assume that lookups are cheap as most classes will not
27822         implement too many interfaces.
27823
27824         We also avoid creating too many MethodSignatures.
27825
27826         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27827         clear the "pending" bit if we find that there are problems with
27828         the declaration.
27829
27830         (TypeContainer.VerifyPendingMethods): Update to report errors of
27831         methods that look like implementations but are not.
27832
27833         (TypeContainer.Define): Add support for explicit interface method
27834         implementation. 
27835
27836 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27837
27838         * typemanager.cs: Keep track of the parameters here instead of
27839         being a feature of the TypeContainer.
27840
27841         * class.cs: Drop the registration of parameters here, as
27842         InterfaceMethods are also interface declarations.
27843
27844         * delegate.cs: Register methods with the TypeManager not only with
27845         the TypeContainer.  This code was buggy.
27846
27847         * interface.cs: Full registation here.
27848
27849 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27850
27851         * expression.cs: Remove reducer for binary expressions, it can not
27852         be done this way.
27853
27854         * const.cs: Put here the code that used to go into constant.cs
27855
27856         * constant.cs: Put here the code for constants, this is a new base
27857         class for Literals.
27858
27859         * literal.cs: Make Literal derive from Constant.
27860
27861 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27862
27863         * statement.cs (Return.Emit): Report error 157 if the user
27864         attempts to return from a finally block.
27865
27866         (Return.Emit): Instead of emitting a return, jump to the end of
27867         the function.
27868
27869         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27870         LocalBuilder to store the result of the function.  ReturnLabel is
27871         the target where we jump.
27872
27873
27874 2001-12-09  Radek Doulik  <rodo@ximian.com>
27875
27876         * cs-parser.jay: remember alias in current namespace
27877
27878         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27879         namespaces
27880
27881         * class.cs (LookupAlias): lookup alias in my_namespace
27882
27883         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27884         aliases hashtable
27885         (LookupAlias): lookup alias in this and if needed in parent
27886         namespaces
27887
27888 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
27889
27890         * support.cs: 
27891
27892         * rootcontext.cs: (ModuleBuilder) Made static, first step into
27893         making things static.  I need this to avoid passing the
27894         TypeContainer when calling ParameterType.
27895
27896         * support.cs (InternalParameters.ParameterType): Remove ugly hack
27897         that did string manipulation to compute the type and then call
27898         GetType.  Use Parameter.ParameterType instead.
27899
27900         * cs-tokenizer.cs: Consume the suffix for floating values.
27901
27902         * expression.cs (ParameterReference): figure out whether this is a
27903         reference parameter or not.  Kill an extra variable by computing
27904         the arg_idx during emission.
27905
27906         * parameter.cs (Parameters.GetParameterInfo): New overloaded
27907         function that returns whether a parameter is an out/ref value or not.
27908
27909         (Parameter.ParameterType): The type of the parameter (base,
27910         without ref/out applied).
27911
27912         (Parameter.Resolve): Perform resolution here.
27913         (Parameter.ExternalType): The full type (with ref/out applied).
27914
27915         * statement.cs (Using.Emit, Using.EmitExpression): Implement
27916         support for expressions on the using statement.
27917
27918 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
27919
27920         * statement.cs (Using.EmitLocalVariableDecls): Split the
27921         localvariable handling of the using statement.
27922
27923         (Block.EmitMeta): Keep track of variable count across blocks.  We
27924         were reusing slots on separate branches of blocks.
27925
27926         (Try.Emit): Emit the general code block, we were not emitting it. 
27927
27928         Check the type of the declaration to be an IDisposable or
27929         something that can be implicity converted to it. 
27930
27931         Emit conversions if required.
27932
27933         * ecore.cs (EmptyExpression): New utility class.
27934         (Expression.ImplicitConversionExists): New utility function.
27935
27936 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
27937
27938         * statement.cs (Using): Implement.
27939
27940         * expression.cs (LocalVariableReference): Support read only variables.
27941
27942         * statement.cs: Remove the explicit emit for the Leave opcode.
27943         (VariableInfo): Add a readonly field.
27944
27945 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
27946
27947         * ecore.cs (ConvCast): new class used to encapsulate the various
27948         explicit integer conversions that works in both checked and
27949         unchecked contexts.
27950
27951         (Expression.ConvertNumericExplicit): Use new ConvCast class to
27952         properly generate the overflow opcodes.
27953
27954 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27955
27956         * statement.cs: The correct type for the EmptyExpression is the
27957         element_type, not the variable type.  Ravi pointed this out.
27958
27959 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27960
27961         * class.cs (Method::Define): Handle PInvoke methods specially
27962         by using DefinePInvokeMethod instead of the usual one.
27963
27964         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
27965         above to do the task of extracting information and defining the method.
27966
27967 2001-12-04  Ravi Pratap  <ravi@ximian.com>
27968
27969         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
27970         of the condition for string type.
27971
27972         (Emit): Move that here. 
27973
27974         (ArrayCreation::CheckIndices): Keep string literals in their expression
27975         form.
27976
27977         (EmitDynamicInitializers): Handle strings appropriately.
27978
27979 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
27980
27981         * codegen.cs (EmitContext): Replace multiple variables with a
27982         single pointer to the current Switch statement.
27983
27984         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
27985         EmitContext.
27986
27987 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
27988
27989         * statement.cs 
27990
27991         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
27992         default'.
27993
27994         (Foreach.Emit): Foreach on arrays was not setting
27995         up the loop variables (for break/continue).
27996
27997         (GotoCase): Semi-implented.
27998
27999 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28000
28001         * attribute.cs (CheckAttribute): Handle system attributes by using
28002         Attribute.GetAttributes to examine information we need.
28003
28004         (GetValidPlaces): Same here.
28005
28006         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28007
28008         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28009
28010         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28011
28012         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28013
28014         (Method::Emit): Handle the case when we are a PInvoke method.
28015
28016 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28017
28018         * expression.cs: Use ResolveWithSimpleName on compound names.
28019
28020 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28021
28022         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28023         before trying to reduce it.
28024
28025         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28026
28027         * constant.cs (LookupConstantValue): Implement.
28028
28029         (EmitConstant): Use the above in emitting the constant.
28030
28031         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28032         that are user-defined by doing a LookupConstantValue on them.
28033
28034         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28035         too, like above.
28036
28037 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28038
28039         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28040
28041         (BaseAccess.DoResolve): Implement.
28042
28043         (MemberAccess.DoResolve): Split this routine into a
28044         ResolveMemberAccess routine that can be used independently
28045
28046 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28047
28048         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28049         As that share bits of the implementation.  Is returns a boolean,
28050         while As returns the Type that is being probed.
28051
28052 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28053
28054         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28055         instead of a Literal - much easier.
28056
28057         (EnumInTransit): Remove - utterly useless :-)
28058
28059         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28060
28061         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28062
28063         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28064         chain when we have no associated expression.
28065
28066 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28067
28068         * constant.cs (Define): Use Location while reporting the errror.
28069
28070         Also emit a warning when 'new' is used and there is no inherited
28071         member to hide.
28072
28073         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28074         populated.
28075
28076         (LookupEnumValue): Implement to lookup an enum member's value and define it
28077         if necessary.
28078
28079         (Populate): Re-write accordingly to use the above routine.
28080
28081 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28082
28083         * expression.cs (This): Fix prototype for DoResolveLValue to
28084         override the base class DoResolveLValue.
28085
28086         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28087         declarations) 
28088
28089         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28090         (we need to load the address of the field here).  This fixes
28091         test-22. 
28092
28093         (FieldExpr.DoResolveLValue): Call the DoResolve
28094         function to initialize the Instance expression.
28095
28096         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28097         correctly the GetEnumerator operation on a value type.
28098
28099         * cs-parser.jay: Add more simple parsing error catches.
28100
28101         * statement.cs (Switch): Add support for string switches.
28102         Handle null specially.
28103
28104         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28105
28106 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28107
28108         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28109
28110         (declare_local_constant): New helper function.
28111
28112         * statement.cs (AddConstant): Keep a separate record of constants
28113
28114         (IsConstant): Implement to determine if a variable is a constant.
28115
28116         (GetConstantExpression): Implement.
28117
28118         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28119
28120         * statement.cs (IsVariableDefined): Re-write.
28121
28122 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28123
28124         * class.cs (TypeContainer::FindMembers): Look for constants
28125         in the case when we are looking for MemberTypes.Field
28126
28127         * expression.cs (MemberAccess::DoResolve): Check that in the
28128         case we are a FieldExpr and a Literal, we are not being accessed
28129         by an instance reference.
28130
28131         * cs-parser.jay (local_constant_declaration): Implement.
28132
28133         (declaration_statement): Implement for constant declarations.
28134
28135 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28136
28137         * statement.cs (Switch): Catch double defaults.
28138
28139         (Switch): More work on the switch() statement
28140         implementation.  It works for integral values now, need to finish
28141         string support.
28142
28143
28144 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28145
28146         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28147         integer literals into other integer literals.  To be used by
28148         switch. 
28149
28150 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28151
28152         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28153         some memory.
28154
28155         (EmitDynamicInitializers): Cope with the above since we extract data
28156         directly from ArrayData now.
28157
28158         (ExpectInitializers): Keep track of whether initializers are mandatory
28159         or not.
28160
28161         (Bounds): Make it a hashtable to prevent the same dimension being 
28162         recorded for every element in that dimension.
28163
28164         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28165         from being found.
28166
28167         Also fix bug which was causing the indices to be emitted in the reverse
28168         order.
28169
28170 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28171
28172         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28173         unfinished.  They do not work, because the underlying code is
28174         sloppy.
28175
28176 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28177
28178         * cs-parser.jay: Remove bogus fixme.
28179
28180         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28181         on Switch statement.
28182
28183 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28184
28185         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28186         the same. 
28187
28188         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28189         parameter. Apparently, any expression is allowed. 
28190
28191         (ValidateInitializers): Update accordingly.
28192
28193         (CheckIndices): Fix some tricky bugs thanks to recursion.
28194
28195         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28196         I was being completely brain-dead.
28197
28198         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28199         and re-write acordingly.
28200
28201         (DelegateInvocation): Re-write accordingly.
28202
28203         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28204
28205         (MakeByteBlob): Handle types more correctly.
28206
28207         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28208         initialization from expressions but it is incomplete because I am a complete
28209         Dodo :-|
28210
28211 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28212
28213         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28214         on If.  Basically, we have to return `true' (ie, we do return to
28215         our caller) only if both branches of the if return.
28216
28217         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28218         short-circuit operators, handle them as short circuit operators. 
28219
28220         (Cast.DoResolve): Resolve type.
28221         (Cast.Cast): Take an expression as the target type.
28222
28223         * cs-parser.jay (cast_expression): Remove old hack that only
28224         allowed a limited set of types to be handled.  Now we take a
28225         unary_expression and we resolve to a type during semantic
28226         analysis.
28227
28228         Use the grammar productions from Rhys to handle casts (this is
28229         not complete like Rhys syntax yet, we fail to handle that corner
28230         case that C# has regarding (-x), but we will get there.
28231
28232 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28233
28234         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28235         field which is an array type.
28236
28237         * cs-parser.jay (declare_local_variables): Support array initialization too.
28238
28239         * typemanager.cs (MakeKey): Implement.
28240
28241         (everywhere): Use the above appropriately.
28242
28243         * cs-parser.jay (for_statement): Update for array initialization while
28244         declaring variables.
28245
28246         * ecore.cs : The error message was correct, it's the variable's names that
28247         were misleading ;-) Make the code more readable.
28248
28249         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28250         the correct type etc.
28251
28252         (ConvertExplicit): Handle Enum types by examining the underlying type.
28253
28254 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28255
28256         * parameter.cs (GetCallingConvention): Always return
28257         CallingConventions.Standard for now.
28258
28259 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28260
28261         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28262         and `r' after calling DoNumericPromotions.
28263
28264         * ecore.cs: Fix error message (the types were in the wrong order).
28265
28266         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28267         BindingFlags.Instance as well 
28268
28269         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28270         implicit int literal conversion in an empty cast so that we
28271         propagate the right type upstream.
28272
28273         (UnboxCast): new class used to unbox value types.
28274         (Expression.ConvertExplicit): Add explicit type conversions done
28275         by unboxing.
28276
28277         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28278         the target type before applying the implicit LongLiterals to ULong
28279         literal cast.
28280
28281 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28282
28283         * cs-parser.jay (for_statement): Reworked the way For works: now
28284         we declare manually any variables that are introduced in
28285         for_initializer to solve the problem of having out-of-band code
28286         emition (that is what got for broken).
28287
28288         (declaration_statement): Perform the actual variable declaration
28289         that used to be done in local_variable_declaration here.
28290
28291         (local_variable_declaration): Do not declare anything, just pass
28292         the information on a DictionaryEntry
28293
28294 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28295
28296         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28297         re-write of the logic to now make it recursive.
28298
28299         (UpdateIndices): Re-write accordingly.
28300
28301         Store element data in a separate ArrayData list in the above methods.
28302
28303         (MakeByteBlob): Implement to dump the array data into a byte array.
28304
28305 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28306
28307         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28308         into CheckIndices.
28309
28310         * constant.cs (Define): Implement.
28311
28312         (EmitConstant): Re-write fully.
28313
28314         Pass in location info.
28315
28316         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28317         respectively.
28318
28319         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28320         DictionaryEntry since we need location info too.
28321
28322         (constant_declaration): Update accordingly.
28323
28324         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28325         code into another method : UpdateIndices.
28326
28327 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28328
28329         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28330         some type checking etc.
28331
28332 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28333
28334         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28335         bits to provide dimension info if the user skips doing that.
28336
28337         Update second constructor to store the rank correctly.
28338
28339 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28340
28341         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28342         and try to implement.
28343
28344         * ../errors/cs0150.cs : Add.
28345
28346         * ../errors/cs0178.cs : Add.
28347
28348 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28349
28350         * statement.cs: Implement foreach on multi-dimensional arrays. 
28351
28352         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28353         name of the params argument.
28354
28355         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28356         initializing the array.
28357
28358         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28359         we can use this elsewhere.
28360
28361         * statement.cs: Finish implementation of foreach for single
28362         dimension arrays.
28363
28364         * cs-parser.jay: Use an out-of-band stack to pass information
28365         around, I wonder why I need this.
28366
28367         foreach_block: Make the new foreach_block the current_block.
28368
28369         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28370         function used to return a static Parameters structure.  Used for
28371         empty parameters, as those are created very frequently.
28372
28373         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28374
28375 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28376
28377         * interface.cs : Default modifier is private, not public. The
28378         make verify test passes again.
28379
28380 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28381
28382         * support.cs (ReflectionParameters): Fix logic to determine
28383         whether the last parameter is a params one. Test 9 passes again.
28384
28385         * delegate.cs (Populate): Register the builders we define with
28386         RegisterParameterForBuilder. Test 19 passes again.
28387
28388         * cs-parser.jay (property_declaration): Reference $6 instead
28389         of $$ to get at the location.
28390
28391         (indexer_declaration): Similar stuff.
28392
28393         (attribute): Ditto.
28394
28395         * class.cs (Property): Register parameters for the Get and Set methods
28396         if they exist. Test 23 passes again.
28397
28398         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28399         call to EmitArguments as we are sure there aren't any params arguments. 
28400         Test 32 passes again.
28401
28402         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28403         IndexOutOfRangeException. 
28404
28405         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28406         Test 33 now passes again.
28407
28408 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28409
28410         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28411         broke a bunch of things.  Will have to come up with a better way
28412         of tracking locations.
28413
28414         * statement.cs: Implemented foreach for single dimension arrays.
28415
28416 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28417
28418         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28419         an error.  This removes the lookup from the critical path.
28420
28421         * cs-parser.jay: Removed use of temporary_loc, which is completely
28422         broken. 
28423
28424 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28425
28426         * support.cs (ReflectionParameters.ParameterModifier): Report
28427         whether the argument is a PARAMS argument or not.
28428
28429         * class.cs: Set the attribute `ParamArrayAttribute' on the
28430         parameter argument.
28431
28432         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28433         and cons_param_array_attribute (ConstructorInfo for
28434         ParamArrayAttribute)., 
28435
28436         * codegen.cs: Emit the return using the `Return' statement, that
28437         way we can report the error correctly for missing return values. 
28438
28439         * class.cs (Method.Emit): Clean up.
28440
28441         * expression.cs (Argument.Resolve): Take another argument: the
28442         location where this argument is used.  Notice that this is not
28443         part of the "Argument" class as to reduce the size of the
28444         structure (we know the approximate location anyways).
28445
28446         Test if the argument is a variable-reference, if not, then
28447         complain with a 206.
28448
28449         (Argument.Emit): Emit addresses of variables.
28450
28451         (Argument.FullDesc): Simplify.
28452
28453         (Invocation.DoResolve): Update for Argument.Resolve.
28454
28455         (ElementAccess.DoResolve): ditto.
28456
28457         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28458         method should be virtual, as this method is always virtual.
28459
28460         (NewDelegate.DoResolve): Update for Argument.Resolve.
28461
28462         * class.cs (ConstructorInitializer.DoResolve): ditto.
28463
28464         * attribute.cs (Attribute.Resolve): ditto.
28465
28466 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28467
28468         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28469
28470         * expression.cs (ParameterReference): Drop IStackStorage and implement
28471         IAssignMethod instead. 
28472
28473         (LocalVariableReference): ditto.
28474
28475         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28476         IAssignMethod instead. 
28477
28478 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28479
28480         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28481         enumerations that are used in heavily used structures derive from
28482         byte in a laughable and pathetic attempt to reduce memory usage.
28483         This is the kind of pre-optimzations that you should not do at
28484         home without adult supervision.
28485
28486         * expression.cs (UnaryMutator): New class, used to handle ++ and
28487         -- separatedly from the other unary operators.  Cleans up the
28488         code, and kills the ExpressionStatement dependency in Unary.
28489
28490         (Unary): Removed `method' and `Arguments' from this class, making
28491         it smaller, and moving it all to SimpleCall, so I can reuse this
28492         code in other locations and avoid creating a lot of transient data
28493         strucutres when not required.
28494
28495         * cs-parser.jay: Adjust for new changes.
28496
28497 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28498
28499         * enum.cs (Enum.Populate): If there is a failure during
28500         definition, return
28501
28502         * cs-parser.jay (opt_enum_base): we used to catch type errors
28503         here, but this is really incorrect.  The type error should be
28504         catched during semantic analysis.
28505
28506 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28507
28508         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28509         current_local_parameters as expected since I, in my stupidity, had forgotten
28510         to do this :-)
28511
28512         * attribute.cs (GetValidPlaces): Fix stupid bug.
28513
28514         * class.cs (Method::Emit): Perform check on applicability of attributes.
28515
28516         (Constructor::Emit): Ditto.
28517
28518         (Field::Emit): Ditto.
28519
28520         (Field.Location): Store location information.
28521
28522         (Property, Event, Indexer, Operator): Ditto.
28523
28524         * cs-parser.jay (field_declaration): Pass in location for each field.
28525
28526         * ../errors/cs0592.cs : Add.
28527
28528 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28529
28530         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28531
28532         (InitCoreTypes): Update accordingly.
28533
28534         (RegisterAttrType, LookupAttr): Implement.
28535
28536         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28537         info about the same.
28538
28539         (Resolve): Update to populate the above as necessary.
28540
28541         (Error592): Helper.
28542
28543         (GetValidPlaces): Helper to the above.
28544
28545         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28546
28547         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28548
28549 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28550
28551         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28552
28553         * ../errors/cs0617.cs : Add.
28554
28555 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28556
28557         * enum.cs (Emit): Rename to Populate to be more consistent with what
28558         we expect it to do and when exactly it is called.
28559
28560         * class.cs, rootcontext.cs : Update accordingly.
28561
28562         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28563         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28564
28565         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28566
28567         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28568         of a fieldinfo using the above, when dealing with a FieldBuilder.
28569
28570 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28571
28572         * ../errors/cs0031.cs : Add.
28573
28574         * ../errors/cs1008.cs : Add.
28575
28576         * ../errrors/cs0543.cs : Add.
28577
28578         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28579         enum type.
28580
28581         (FindMembers): Implement.
28582
28583         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28584         enums and delegates too.
28585
28586         (enum_types): Rename to builder_to_enum.
28587
28588         (delegate_types): Rename to builder_to_delegate.
28589
28590         * delegate.cs (FindMembers): Implement.
28591
28592 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28593
28594         * typemanager.cs (IsEnumType): Implement.
28595
28596         * enum.cs (Emit): Re-write parts to account for the underlying type
28597         better and perform checking etc.
28598
28599         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28600         of the underlying type.
28601
28602         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28603         value
28604
28605         * enum.cs (error31): Helper to report error #31.
28606
28607         * cs-parser.jay (enum_declaration): Store location of each member too.
28608
28609         * enum.cs (member_to_location): New hashtable. 
28610
28611         (AddEnumMember): Update location hashtable.
28612
28613         (Emit): Use the location of each member while reporting errors.
28614
28615 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28616
28617         * cs-parser.jay: A for_initializer if is a
28618         local_variable_declaration really ammount to have an implicit
28619         block with the variable declaration and no initializer for for.
28620
28621         * statement.cs (For.Emit): Cope with null initializers.
28622
28623         This fixes the infinite loop on for initializers.
28624
28625 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28626
28627         * enum.cs: More cleanup.
28628
28629         * ecore.cs: Remove dead code.
28630
28631         * class.cs (Property.Emit): More simplification.
28632         (Event.Emit): ditto.
28633
28634         Reworked to have less levels of indentation.
28635
28636 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28637
28638         * class.cs (Property): Emit attributes.
28639
28640         (Field): Ditto.
28641
28642         (Event): Ditto.
28643
28644         (Indexer): Ditto.
28645
28646         (Operator): Ditto.
28647
28648         * enum.cs (Emit): Ditto.
28649
28650         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28651         Enums too.
28652
28653         * class.cs (Field, Event, etc.): Move attribute generation into the
28654         Emit method everywhere.
28655
28656         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28657         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28658         as we had no way of defining nested enums !
28659
28660         * rootcontext.cs : Adjust code accordingly.
28661
28662         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28663
28664 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28665
28666         * expression.cs (EvalConstantExpression): Move into ecore.cs
28667
28668         * enum.cs (Enum): Rename some members and make them public and readonly
28669         according to our convention.
28670
28671         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28672         nothing else.
28673
28674         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28675
28676         (Enum::Emit): Write a simple version for now which doesn't try to compute
28677         expressions. I shall modify this to be more robust in just a while.
28678
28679         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28680
28681         (TypeContainer::CloseType): Create the Enum types too.
28682
28683         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28684
28685         * expression.cs (EvalConstantExpression): Get rid of completely.
28686
28687         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28688         user-defined values and other cases.
28689
28690         (IsValidEnumLiteral): Helper function.
28691
28692         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28693         out there in the case we had a literal FieldExpr.
28694
28695         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28696
28697         (Literalize): Revamp a bit to take two arguments.
28698
28699         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28700
28701 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28702
28703         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28704
28705         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28706
28707         (Resolve): Use the above to ensure we have proper initializers.
28708
28709 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28710
28711         * expression.cs (Expression::EvalConstantExpression): New method to 
28712         evaluate constant expressions.
28713
28714         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28715
28716 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28717
28718         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28719         in an array.
28720
28721         (Binary.ResolveOperator): Handle operator != (object a, object b)
28722         and operator == (object a, object b);
28723
28724         (Binary.DoNumericPromotions): Indicate whether the numeric
28725         promotion was possible.
28726
28727         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28728         Implement.  
28729
28730         Made the ArrayAccess implement interface IAssignMethod instead of
28731         IStackStore as the order in which arguments are passed reflects
28732         this.
28733
28734         * assign.cs: Instead of using expr.ExprClass to select the way of
28735         assinging, probe for the IStackStore/IAssignMethod interfaces.
28736
28737         * typemanager.cs: Load InitializeArray definition.
28738
28739         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28740         static data that can be used to initialize arrays. 
28741
28742 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28743
28744         * expression.cs: Handle operator== and operator!= for booleans.
28745
28746         (Conditioal.Reduce): Implement reducer for the ?: operator.
28747
28748         (Conditional.Resolve): Implement dead code elimination.
28749
28750         (Binary.Resolve): Catch string literals and return a new
28751         concatenated string.
28752
28753         (Unary.Reduce): Implement reduction of unary expressions.
28754
28755         * ecore.cs: Split out the expression core handling here.
28756
28757         (Expression.Reduce): New method used to perform constant folding
28758         and CSE.  This is needed to support constant-expressions. 
28759
28760         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28761         targets, and optimize for !x.
28762
28763 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28764
28765         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28766         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28767         set custom atttributes.
28768
28769         * literal.cs (Literal::GetValue): New abstract method to return the actual
28770         value of the literal, cast as an object.
28771
28772         (*Literal): Implement GetValue method.
28773
28774         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28775         expressions to the arraylist but objects of type Argument.
28776
28777         * class.cs (TypeContainer::Emit): Emit our attributes too.
28778
28779         (Method::Emit, Constructor::Emit): Ditto.
28780
28781         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28782         to be ignoring earlier.
28783
28784 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28785
28786         * attribute.cs (AttributeSection::Define): Implement to do the business
28787         of constructing a CustomAttributeBuilder.
28788
28789         (Attribute): New trivial class. Increases readability of code.  
28790
28791         * cs-parser.jay : Update accordingly.
28792
28793         (positional_argument_list, named_argument_list, named_argument): New rules
28794
28795         (attribute_arguments): Use the above so that we are more correct.
28796
28797 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28798
28799         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28800         to perform all checks for a method with a params parameter.
28801
28802         (Invocation::OverloadResolve): Update to use the above method and therefore
28803         cope correctly with params method invocations.
28804
28805         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28806         params too.
28807
28808         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28809         constructors in our parent too because we can't afford to miss out on 
28810         protected ones ;-)
28811
28812         * attribute.cs (AttributeSection): New name for the class Attribute
28813
28814         Other trivial changes to improve readability.
28815
28816         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28817         use the new class names.
28818
28819 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28820
28821         * class.cs (Method::Define): Complete definition for params types too
28822
28823         (Indexer::Define): Ditto.
28824
28825         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28826         Cope everywhere with a request for info about the array parameter.
28827
28828 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28829
28830         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28831
28832         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28833         local_variable_type to extract the string corresponding to the type.
28834
28835         (local_variable_type): Fixup the action to use the new helper method.
28836
28837         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28838         go.
28839
28840         * expression.cs : Clean out code which uses the above.
28841
28842 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28843
28844         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28845         and bale out if necessary by returning a false.
28846
28847         (RegisterProperty): Ditto.
28848
28849         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28850         and print out appropriate error messages.
28851
28852         * interface.cs (everywhere): Ditto.
28853
28854         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28855         location to constructor.
28856
28857         * class.cs (Property, Event, Indexer): Update accordingly.
28858
28859         * ../errors/cs111.cs : Added.
28860
28861         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28862         of a method, as laid down by the spec.
28863
28864         (Invocation::OverloadResolve): Use the above method.
28865
28866 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28867
28868         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28869         now take a TypeContainer and a Parameters object.
28870
28871         (ParameterData): Modify return type of ParameterModifier method to be 
28872         Parameter.Modifier and not a string.
28873
28874         (ReflectionParameters, InternalParameters): Update accordingly.
28875
28876         * expression.cs (Argument::GetParameterModifier): Same here.
28877
28878         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28879         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28880         symbol in it at all so maybe this is only for now.
28881
28882 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28883
28884         * support.cs (InternalParameters): Constructor now takes an extra argument 
28885         which is the actual Parameters class.
28886
28887         (ParameterDesc): Update to provide info on ref/out modifiers.
28888
28889         * class.cs (everywhere): Update call to InternalParameters to pass in
28890         the second argument too.
28891
28892         * support.cs (ParameterData): Add ParameterModifier, which is a method 
28893         to return the modifier info [ref/out etc]
28894
28895         (InternalParameters, ReflectionParameters): Implement the above.
28896
28897         * expression.cs (Argument::ParameterModifier): Similar function to return
28898         info about the argument's modifiers.
28899
28900         (Invocation::OverloadResolve): Update to take into account matching modifiers 
28901         too.
28902
28903         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
28904         a new SetFormalParameters object which we pass to InternalParameters.
28905
28906 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28907
28908         * expression.cs (NewArray): Merge into the ArrayCreation class.
28909
28910 2001-10-29  Ravi Pratap  <ravi@ximian.com>
28911
28912         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
28913         NewUserdefinedArray into one as there wasn't much of a use in having
28914         two separate ones.
28915
28916         * expression.cs (Argument): Change field's name to ArgType from Type.
28917
28918         (Type): New readonly property which returns the proper type, taking into 
28919         account ref/out modifiers.
28920
28921         (everywhere): Adjust code accordingly for the above.
28922
28923         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
28924         whether we are emitting for a ref or out parameter.
28925
28926         * expression.cs (Argument::Emit): Use the above field to set the state.
28927
28928         (LocalVariableReference::Emit): Update to honour the flag and emit the
28929         right stuff.
28930
28931         * parameter.cs (Attributes): Set the correct flags for ref parameters.
28932
28933         * expression.cs (Argument::FullDesc): New function to provide a full desc.
28934
28935         * support.cs (ParameterData): Add method ParameterDesc to the interface.
28936
28937         (ReflectionParameters, InternalParameters): Implement the above method.
28938
28939         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
28940         reporting errors.
28941
28942         (Invocation::FullMethodDesc): Ditto. 
28943
28944 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
28945
28946         * cs-parser.jay: Add extra production for the second form of array
28947         creation. 
28948
28949         * expression.cs (ArrayCreation): Update to reflect the above
28950         change. 
28951
28952         * Small changes to prepare for Array initialization.
28953
28954 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
28955
28956         * typemanager.cs (ImplementsInterface): interface might be null;
28957         Deal with this problem;
28958
28959         Also, we do store negative hits on the cache (null values), so use
28960         this instead of calling t.GetInterfaces on the type everytime.
28961
28962 2001-10-28  Ravi Pratap  <ravi@ximian.com>
28963
28964         * typemanager.cs (IsBuiltinType): New method to help determine the same.
28965
28966         * expression.cs (New::DoResolve): Get rid of array creation code and instead
28967         split functionality out into different classes.
28968
28969         (New::FormArrayType): Move into NewBuiltinArray.
28970
28971         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
28972         quite useless.
28973
28974         (NewBuiltinArray): New class to handle creation of built-in arrays.
28975
28976         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
28977         account creation of one-dimensional arrays.
28978
28979         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
28980
28981         (NewUserdefinedArray::DoResolve): Implement.
28982
28983         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
28984
28985         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
28986         we maintain inside the TypeManager. This is necessary to perform lookups on the
28987         module builder.
28988
28989         (LookupType): Update to perform GetType on the module builders too.     
28990
28991         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
28992
28993         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
28994
28995 2001-10-23  Ravi Pratap  <ravi@ximian.com>
28996
28997         * expression.cs (New::DoResolve): Implement guts of array creation.
28998
28999         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29000
29001 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29002
29003         * expression.cs: Fix bug I introduced lsat night that broke
29004         Delegates. 
29005
29006         (Expression.Resolve): Report a 246 error (can not resolve name)
29007         if we find a SimpleName in the stream.
29008
29009         (Expression.ResolveLValue): Ditto.
29010
29011         (Expression.ResolveWithSimpleName): This function is a variant of
29012         ResolveName, this one allows SimpleNames to be returned without a
29013         warning.  The only consumer of SimpleNames is MemberAccess
29014
29015 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29016
29017         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29018         might arrive here.  I have my doubts that this is correct.
29019
29020         * statement.cs (Lock): Implement lock statement.
29021
29022         * cs-parser.jay: Small fixes to support `lock' and `using'
29023
29024         * cs-tokenizer.cs: Remove extra space
29025
29026         * driver.cs: New flag --checked, allows to turn on integer math
29027         checking. 
29028
29029         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29030         Threading.Monitor.Exit 
29031
29032 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29033
29034         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29035         Expression Class to be IndexerAccess.
29036
29037         Notice that Indexer::DoResolve sets the eclass to Value.
29038
29039 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29040
29041         * class.cs (TypeContainer::Emit): Emit code for indexers.
29042
29043         * assign.cs (IAssignMethod): New interface implemented by Indexers
29044         and Properties for handling assignment.
29045
29046         (Assign::Emit): Simplify and reuse code. 
29047
29048         * expression.cs (IndexerAccess, PropertyExpr): Implement
29049         IAssignMethod, clean up old code. 
29050
29051 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29052
29053         * typemanager.cs (ImplementsInterface): New method to determine if a type
29054         implements a given interface. Provides a nice cache too.
29055
29056         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29057         method.
29058
29059         (ConvertReferenceExplicit): Ditto.
29060
29061         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29062         various methods, with correct names etc.
29063
29064         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29065         Operator.UnaryNegation.
29066
29067         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29068         we have a unary plus or minus operator.
29069
29070         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29071         UnaryMinus.
29072
29073         * everywhere : update accordingly.
29074
29075         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29076         respectively.
29077
29078         * class.cs (Method::Define): For the case where we are implementing a method
29079         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29080         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29081
29082 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29083
29084         * interface.cs (FindMembers): Implement to work around S.R.E
29085         lameness.
29086
29087         * typemanager.cs (IsInterfaceType): Implement.
29088
29089         (FindMembers): Update to handle interface types too.
29090
29091         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29092         use IsAssignableFrom as that is not correct - it doesn't work.
29093
29094         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29095         and accordingly override EmitStatement.
29096
29097         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29098         using the correct logic :-)
29099
29100 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29101
29102         * ../errors/cs-11.cs : Add to demonstrate error -11 
29103
29104 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29105
29106         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29107         then pass this as a hint to ResolveLValue.
29108
29109         * expression.cs (FieldExpr): Add Location information
29110
29111         (FieldExpr::LValueResolve): Report assignment to readonly
29112         variable. 
29113
29114         (Expression::ExprClassFromMemberInfo): Pass location information.
29115
29116         (Expression::ResolveLValue): Add new method that resolves an
29117         LValue. 
29118
29119         (Expression::DoResolveLValue): Default invocation calls
29120         DoResolve. 
29121
29122         (Indexers): New class used to keep track of indexers in a given
29123         Type. 
29124
29125         (IStackStore): Renamed from LValue, as it did not really describe
29126         what this did.  Also ResolveLValue is gone from this interface and
29127         now is part of Expression.
29128
29129         (ElementAccess): Depending on the element access type
29130
29131         * typemanager.cs: Add `indexer_name_type' as a Core type
29132         (System.Runtime.CompilerServices.IndexerNameAttribute)
29133
29134         * statement.cs (Goto): Take a location.
29135
29136 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29137
29138         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29139         if two delegates are compatible.
29140
29141         (NewDelegate::DoResolve): Update to take care of the case when
29142         we instantiate a delegate from another delegate.
29143
29144         * typemanager.cs (FindMembers): Don't even try to look up members
29145         of Delegate types for now.
29146
29147 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29148
29149         * delegate.cs (NewDelegate): New class to take care of delegate
29150         instantiation.
29151
29152         * expression.cs (New): Split the delegate related code out into 
29153         the NewDelegate class.
29154
29155         * delegate.cs (DelegateInvocation): New class to handle delegate 
29156         invocation.
29157
29158         * expression.cs (Invocation): Split out delegate related code into
29159         the DelegateInvocation class.
29160
29161 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29162
29163         * expression.cs (New::DoResolve): Implement delegate creation fully
29164         and according to the spec.
29165
29166         (New::DoEmit): Update to handle delegates differently.
29167
29168         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29169         because of which we were printing out arguments in reverse order !
29170
29171         * delegate.cs (VerifyMethod): Implement to check if the given method
29172         matches the delegate.
29173
29174         (FullDelegateDesc): Implement.
29175
29176         (VerifyApplicability): Implement.
29177
29178         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29179         delegate invocations too.
29180
29181         (Invocation::Emit): Ditto.
29182
29183         * ../errors/cs1593.cs : Added.
29184
29185         * ../errors/cs1594.cs : Added.
29186
29187         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29188
29189 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29190
29191         * typemanager.cs (intptr_type): Core type for System.IntPtr
29192
29193         (InitCoreTypes): Update for the same.
29194
29195         (iasyncresult_type, asynccallback_type): Ditto.
29196
29197         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29198         correct.
29199
29200         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29201         too.
29202
29203         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29204         the builders for the 4 members of a delegate type :-)
29205
29206         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29207         type.
29208
29209         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29210
29211         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29212
29213 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29214
29215         * statement.cs (Break::Emit): Implement.   
29216         (Continue::Emit): Implement.
29217
29218         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29219         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29220         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29221         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29222         end loop
29223
29224         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29225         properties that track the label for the current loop (begin of the
29226         loop and end of the loop).
29227
29228 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29229
29230         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29231         use of emitting anything at all.
29232
29233         * class.cs, rootcontext.cs : Get rid of calls to the same.
29234
29235         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29236
29237         (Populate): Define the constructor correctly and set the implementation
29238         attributes.
29239
29240         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29241         have been defined.
29242
29243         (AddDelegateType): Implement.
29244
29245         (IsDelegateType): Implement helper method.
29246
29247         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29248
29249         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29250         and accordingly handle it.
29251
29252         * delegate.cs (Populate): Take TypeContainer argument.
29253         Implement bits to define the Invoke method. However, I still haven't figured out
29254         how to take care of the native int bit :-(
29255
29256         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29257         Qualify the name of the delegate, not its return type !
29258
29259         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29260         conversion.
29261
29262         (StandardConversionExists): Checking for array types turns out to be recursive.
29263
29264         (ConvertReferenceExplicit): Implement array conversion.
29265
29266         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29267
29268 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29269
29270         * cs-parser.jay (delegate_declaration): Store the fully qualified
29271         name as it is a type declaration.
29272
29273         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29274         readonly.
29275
29276         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29277         as TypeContainer::DefineType.
29278
29279         (Populate): Method in which all the definition of the various methods (Invoke)
29280         etc is done.
29281
29282         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29283         see.
29284
29285         (CloseDelegate): Finally creates the delegate.
29286
29287         * class.cs (TypeContainer::DefineType): Update to define delegates.
29288         (Populate, Emit and CloseType): Do the same thing here too.
29289
29290         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29291         delegates in all these operations.
29292
29293 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29294
29295         * expression.cs: LocalTemporary: a new expression used to
29296         reference a temporary that has been created.
29297
29298         * assign.cs: Handle PropertyAccess back here, so that we can
29299         provide the proper semantic access to properties.
29300
29301         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29302         a few more explicit conversions. 
29303
29304         * modifiers.cs: `NEW' modifier maps to HideBySig.
29305
29306         * expression.cs (PropertyExpr): Make this into an
29307         ExpressionStatement, and support the EmitStatement code path. 
29308
29309         Perform get/set error checking, clean up the interface.
29310
29311         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29312         them into toplevel access objects.
29313
29314 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29315
29316         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29317         SRE.
29318
29319         * typemanager.cs: Keep track here of our PropertyBuilders again to
29320         work around lameness in SRE.
29321
29322 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29323
29324         * expression.cs (LValue::LValueResolve): New method in the
29325         interface, used to perform a second resolution pass for LValues. 
29326
29327         (This::DoResolve): Catch the use of this in static methods.
29328
29329         (This::LValueResolve): Implement.
29330
29331         (This::Store): Remove warning, assigning to `this' in structures
29332         is 
29333
29334         (Invocation::Emit): Deal with invocation of
29335         methods on value types.  We need to pass the address to structure
29336         methods rather than the object itself.  (The equivalent code to
29337         emit "this" for structures leaves the entire structure on the
29338         stack instead of a pointer to it). 
29339
29340         (ParameterReference::DoResolve): Compute the real index for the
29341         argument based on whether the method takes or not a `this' pointer
29342         (ie, the method is static).
29343
29344         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29345         value types returned from functions when we need to invoke a
29346         method on the sturcture.
29347
29348
29349 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29350
29351         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29352         defining the type in the Modulebuilder or Typebuilder. This is to take
29353         care of nested types which need to be defined on the TypeBuilder using
29354         DefineNestedMethod.
29355
29356         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29357         methods in RootContext, only ported to be part of TypeContainer.
29358
29359         (TypeContainer::GetInterfaceOrClass): Ditto.
29360
29361         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29362
29363         * interface.cs (Interface::DefineInterface): New method. Does exactly
29364         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29365         too.
29366
29367         (Interface::GetInterfaces): Move from RootContext here and port.
29368
29369         (Interface::GetInterfaceByName): Same here.
29370
29371         * rootcontext.cs (ResolveTree): Re-write.
29372
29373         (PopulateTypes): Re-write.
29374
29375         * class.cs (TypeContainer::Populate): Populate nested types too.
29376         (TypeContainer::Emit): Emit nested members too.
29377
29378         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29379         instead just use the name argument passed in as it is already fully
29380         qualified.
29381
29382         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29383         to TypeContainer mapping to see if a type is user-defined.
29384
29385         * class.cs (TypeContainer::CloseType): Implement. 
29386
29387         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29388         the default constructor.
29389
29390         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29391         twice.
29392
29393         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29394
29395         * interface.cs (CloseType): Create the type here.
29396
29397         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29398         the hierarchy.
29399
29400         Remove all the methods which are now in TypeContainer.
29401
29402 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29403
29404         * delegate.cs (Define): Re-write bits to define the delegate
29405         correctly.
29406
29407 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29408
29409         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29410
29411         * expression.cs (ImplicitReferenceConversion): handle null as well
29412         as a source to convert to any reference type.
29413
29414         * statement.cs (Return): Perform any implicit conversions to
29415         expected return type.  
29416
29417         Validate use of return statement.  
29418
29419         * codegen.cs (EmitContext): Pass the expected return type here.
29420
29421         * class.cs (Method, Constructor, Property): Pass expected return
29422         type to EmitContext.
29423
29424 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29425
29426         * expression.cs: Make DoResolve take an EmitContext instead of a
29427         TypeContainer.
29428
29429         Replaced `l' and `location' for `loc', for consistency.
29430
29431         (Error, Warning): Remove unneeded Tc argument.
29432
29433         * assign.cs, literal.cs, constant.cs: Update to new calling
29434         convention. 
29435
29436         * codegen.cs: EmitContext now contains a flag indicating whether
29437         code is being generated in a static method or not.
29438
29439         * cs-parser.jay: DecomposeQI, new function that replaces the old
29440         QualifiedIdentifier.  Now we always decompose the assembled
29441         strings from qualified_identifier productions into a group of
29442         memberaccesses.
29443
29444 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29445
29446         * rootcontext.cs: Deal with field-less struct types correctly now
29447         by passing the size option to Define Type.
29448
29449         * class.cs: Removed hack that created one static field. 
29450
29451 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29452
29453         * statement.cs: Moved most of the code generation here. 
29454
29455 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29456
29457         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29458         seem very right.
29459
29460         (ElementAccess): Remove useless bits for now - keep checks as the spec
29461         says.
29462
29463 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29464
29465         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29466         and start performing checks according to the spec.
29467
29468 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29469
29470         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29471         rank_specifiers instead.
29472
29473         (rank_specifiers): Change the order in which the rank specifiers are stored
29474
29475         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29476
29477         * expression.cs (ElementAccess): Implement the LValue interface too.
29478
29479 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29480
29481         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29482         except that user defined conversions are not included.
29483
29484         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29485         perform the conversion of the return type, if necessary.
29486
29487         (New::DoResolve): Check whether we are creating an array or an object
29488         and accordingly do the needful.
29489
29490         (New::Emit): Same here.
29491
29492         (New::DoResolve): Implement guts of array creation.
29493
29494         (New::FormLookupType): Helper function.
29495
29496 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29497
29498         * codegen.cs: Removed most of the code generation here, and move the
29499         corresponding code generation bits to the statement classes. 
29500
29501         Added support for try/catch/finalize and throw.
29502
29503         * cs-parser.jay: Added support for try/catch/finalize.
29504
29505         * class.cs: Catch static methods having the flags override,
29506         virtual or abstract.
29507
29508         * expression.cs (UserCast): This user cast was not really doing
29509         what it was supposed to do.  Which is to be born in fully resolved
29510         state.  Parts of the resolution were being performed at Emit time! 
29511
29512         Fixed this code.
29513
29514 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29515
29516         * expression.cs: Implicity convert the result from UserCast.
29517
29518 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29519
29520         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29521         prevented it from working correctly. 
29522
29523         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29524         merely ConvertImplicit.
29525
29526 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29527
29528         * typemanager.cs: Make the LookupTypeContainer function static,
29529         and not per-instance.  
29530
29531         * class.cs: Make static FindMembers (the one that takes a Type
29532         argument). 
29533
29534         * codegen.cs: Add EmitForeach here.
29535
29536         * cs-parser.jay: Make foreach a toplevel object instead of the
29537         inline expansion, as we need to perform semantic analysis on it. 
29538
29539 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29540
29541         * expression.cs (Expression::ImplicitUserConversion): Rename to
29542         UserDefinedConversion.
29543
29544         (Expression::UserDefinedConversion): Take an extra argument specifying 
29545         whether we look for explicit user conversions too.
29546
29547         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29548
29549         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29550
29551         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29552         with the appropriate arguments.
29553
29554         * cs-parser.jay (cast_expression): Record location too.
29555
29556         * expression.cs (Cast): Record location info.
29557
29558         (Expression::ConvertExplicit): Take location argument.
29559
29560         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29561         to determine if we are doing explicit conversions.
29562
29563         (UserCast::Emit): Update accordingly.
29564
29565         (Expression::ConvertExplicit): Report an error if everything fails.
29566
29567         * ../errors/cs0030.cs : Add.
29568
29569 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29570
29571         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29572         virtual and newslot bits. 
29573
29574         * class.cs (TypeContainer::RegisterRequiredImplementations):
29575         Record methods we need.
29576
29577         (TypeContainer::MakeKey): Helper function to make keys for
29578         MethodBases, since the Methodbase key is useless.
29579
29580         (TypeContainer::Populate): Call RegisterRequiredImplementations
29581         before defining the methods.   
29582
29583         Create a mapping for method_builders_to_methods ahead of time
29584         instead of inside a tight loop.
29585
29586         (::RequireMethods):  Accept an object as the data to set into the
29587         hashtable so we can report interface vs abstract method mismatch.
29588
29589 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29590
29591         * report.cs: Make all of it static.
29592
29593         * rootcontext.cs: Drop object_type and value_type computations, as
29594         we have those in the TypeManager anyways.
29595
29596         Drop report instance variable too, now it is a global.
29597
29598         * driver.cs: Use try/catch on command line handling.
29599
29600         Add --probe option to debug the error reporting system with a test
29601         suite. 
29602
29603         * report.cs: Add support for exiting program when a probe
29604         condition is reached.
29605
29606 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29607
29608         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29609         we do a forcible conversion regardless of type, to check if 
29610         ForceConversion returns a null.
29611
29612         (Binary::error19): Use location to report error.
29613
29614         (Unary::error23): Use location here too.
29615
29616         * ../errors/cs0019.cs : Check in.
29617
29618         * ../errors/cs0023.cs : Check in.
29619
29620         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29621         case of a non-null MethodInfo object with a length of 0 !
29622
29623         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29624         an applicable member - according to the spec :-)
29625         Also fix logic to find members in base types.
29626
29627         (Unary::ResolveOperator): Same here.
29628
29629         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29630         as I was getting thoroughly confused between this and error19 :-)
29631
29632         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29633         (::FindMostEncompassedType): Implement.
29634         (::FindMostEncompassingType): Implement.
29635         (::StandardConversionExists): Implement.
29636
29637         (UserImplicitCast): Re-vamp. We now need info about most specific
29638         source and target types so that we can do the necessary conversions.
29639
29640         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29641         mathematical union with no duplicates.
29642
29643 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29644
29645         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29646         in order from base classes to child classes, so that we can in
29647         child classes look up in our parent for method names and
29648         attributes (required for handling abstract, virtual, new, override
29649         constructs: we need to instrospect our base class, and if we dont
29650         populate the classes in order, the introspection might be
29651         incorrect.  For example, a method could query its parent before
29652         the parent has any methods and would determine that the parent has
29653         no abstract methods (while it could have had them)).
29654
29655         (RootContext::CreateType): Record the order in which we define the
29656         classes.
29657
29658 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29659
29660         * class.cs (TypeContainer::Populate): Also method definitions can
29661         fail now, keep track of this.
29662
29663         (TypeContainer::FindMembers): Implement support for
29664         DeclaredOnly/noDeclaredOnly flag.
29665
29666         (Constructor::Emit) Return the ConstructorBuilder.
29667
29668         (Method::Emit) Return the MethodBuilder. 
29669         Check for abstract or virtual methods to be public.
29670
29671         * rootcontext.cs (RootContext::CreateType): Register all the
29672         abstract methods required for the class to be complete and the
29673         interface methods that must be implemented. 
29674
29675         * cs-parser.jay: Report error 501 (method requires body if it is
29676         not marked abstract or extern).
29677
29678         * expression.cs (TypeOf::Emit): Implement.
29679
29680         * typemanager.cs: runtime_handle_type, new global type.
29681
29682         * class.cs (Property::Emit): Generate code for properties.
29683
29684 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29685
29686         * expression.cs (Unary::ResolveOperator): Find operators on base type
29687         too - we now conform exactly to the spec.
29688
29689         (Binary::ResolveOperator): Same here.
29690
29691         * class.cs (Operator::Define): Fix minor quirk in the tests.
29692
29693         * ../errors/cs0215.cs : Added.
29694
29695         * ../errors/cs0556.cs : Added.
29696
29697         * ../errors/cs0555.cs : Added.
29698
29699 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29700
29701         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29702         single integer which is really efficient
29703
29704 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29705
29706         *  expression.cs (Expression::ImplicitUserConversion): Use location
29707         even in the case when we are examining True operators.
29708  
29709         * class.cs (Operator::Define): Perform extensive checks to conform
29710         with the rules for operator overloading in the spec.
29711
29712         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29713         some of the other conversions mentioned in the spec.
29714
29715         * typemanager.cs (array_type): New static member for the System.Array built-in
29716         type.
29717
29718         (cloneable_interface): For System.ICloneable interface.
29719
29720         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29721         we start resolving the tree and populating types.
29722
29723         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29724  
29725 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29726
29727         * expression.cs (Expression::ExprClassFromMemberInfo,
29728         Expression::Literalize): Create literal expressions from
29729         FieldInfos which are literals.
29730
29731         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29732         type casts, because they were wrong.  The test suite in tests
29733         caught these ones.
29734
29735         (ImplicitNumericConversion): ushort to ulong requires a widening
29736         cast. 
29737
29738         Int32 constant to long requires widening cast as well.
29739
29740         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29741         for integers because the type on the stack is not i4.
29742
29743 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29744
29745         * expression.cs (report118): require location argument. 
29746
29747         * parameter.cs: Do not dereference potential null value.
29748
29749         * class.cs: Catch methods that lack the `new' keyword when
29750         overriding a name.  Report warnings when `new' is used without
29751         anything being there to override.
29752
29753         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29754
29755         * class.cs: Only add constructor to hashtable if it is non-null
29756         (as now constructors can fail on define).
29757
29758         (TypeManager, Class, Struct): Take location arguments.
29759
29760         Catch field instance initialization in structs as errors.
29761
29762         accepting_filter: a new filter for FindMembers that is static so
29763         that we dont create an instance per invocation.
29764
29765         (Constructor::Define): Catch errors where a struct constructor is
29766         parameterless 
29767
29768         * cs-parser.jay: Pass location information for various new
29769         constructs. 
29770
29771         * delegate.cs (Delegate): take a location argument.
29772
29773         * driver.cs: Do not call EmitCode if there were problesm in the
29774         Definition of the types, as many Builders wont be there. 
29775
29776         * decl.cs (Decl::Decl): Require a location argument.
29777
29778         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29779         into integers, and find the most appropiate integer for it.
29780
29781         * literal.cs: Implement ULongLiteral.
29782
29783         * rootcontext.cs: Provide better information about the location of
29784         failure when CreateType fails.
29785
29786 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29787
29788         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29789         as well.
29790
29791         * expression.cs (Binary::CheckShiftArguments): Add missing type
29792         computation.
29793         (Binary::ResolveOperator): Add type to the logical and and logical
29794         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29795         before.
29796
29797         (Binary::DoNumericPromotions): In the case where either argument
29798         is ulong (and most signed types combined with ulong cause an
29799         error) perform implicit integer constant conversions as well.
29800
29801 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29802
29803         * expression.cs (UserImplicitCast): Method should always be
29804         non-null. 
29805         (Invocation::BetterConversion): Simplified test for IntLiteral.
29806
29807         (Expression::ImplicitNumericConversion): Split this routine out.
29808         Put the code that performs implicit constant integer conversions
29809         here. 
29810
29811         (Expression::Resolve): Become a wrapper around DoResolve so we can
29812         check eclass and type being set after resolve.
29813
29814         (Invocation::Badness): Remove this dead function
29815
29816         (Binary::ResolveOperator): Do not compute the expensive argumnets
29817         unless we have a union for it.
29818
29819         (Probe::Emit): Is needs to do an isinst and then
29820         compare against null.
29821
29822         (::CanConvert): Added Location argument.  If the Location argument
29823         is null (Location.Null), then we do not report errors.  This is
29824         used by the `probe' mechanism of the Explicit conversion.  We do
29825         not want to generate an error for something that the user
29826         explicitly requested to be casted.  But the pipeline for an
29827         explicit cast first tests for potential implicit casts.
29828
29829         So for now, if the Location is null, it means `Probe only' to
29830         avoid adding another argument.   Might have to revise this
29831         strategy later.
29832
29833         (ClassCast): New class used to type cast objects into arbitrary
29834         classes (used in Explicit Reference Conversions).
29835
29836         Implement `as' as well.
29837
29838         Reverted all the patches from Ravi below: they were broken:
29839
29840                 * The use of `level' as a mechanism to stop recursive
29841                   invocations is wrong.  That was there just to catch the
29842                   bug with a strack trace but not as a way of addressing
29843                   the problem.
29844
29845                   To fix the problem we have to *understand* what is going
29846                   on and the interactions and come up with a plan, not
29847                   just get things going.
29848
29849                 * The use of the type conversion cache that I proposed
29850                   last night had an open topic: How does this work across
29851                   protection domains.  A user defined conversion might not
29852                   be public in the location where we are applying the
29853                   conversion, a different conversion might be selected
29854                   (ie, private A->B (better) but public B->A (worse),
29855                   inside A, A->B applies, but outside it, B->A will
29856                   apply).
29857
29858                 * On top of that (ie, even if the above is solved),
29859                   conversions in a cache need to be abstract.  Ie, `To
29860                   convert from an Int to a Short use an OpcodeCast', not
29861                   `To convert from an Int to a Short use the OpcodeCast on
29862                   the variable 5' (which is what this patch was doing).
29863
29864 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29865
29866         * expression.cs (Invocation::ConversionExists): Re-write to use
29867         the conversion cache
29868
29869         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29870         cache all conversions done, not just user-defined ones.
29871
29872         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29873         to determine if a conversion exists instead of acutually trying to 
29874         perform the conversion. It's faster too.
29875
29876         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29877         and only then attempt the implicit conversion.
29878
29879 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29880
29881         * expression.cs (ConvertImplicit): Use a cache for conversions
29882         already found. Check level of recursion and bail out if necessary.
29883
29884 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29885
29886         * typemanager.cs (string_concat_string_string, string_concat_object_object):
29887         Export standard methods that we expect for string operations.
29888
29889         * statement.cs (Block::UsageWarning): Track usage of variables and
29890         report the errors for not used variables.
29891
29892         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
29893         operator. 
29894
29895 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
29896
29897         * codegen.cs: remove unnneded code 
29898
29899         * expression.cs: Removed BuiltinTypeAccess class
29900
29901         Fix the order in which implicit conversions are
29902         done.  
29903
29904         The previous fixed dropped support for boxed conversions (adding a
29905         test to the test suite now)
29906
29907         (UserImplicitCast::CanConvert): Remove test for source being null,
29908         that code is broken.  We should not feed a null to begin with, if
29909         we do, then we should track the bug where the problem originates
29910         and not try to cover it up here.
29911
29912         Return a resolved expression of type UserImplicitCast on success
29913         rather than true/false.  Ravi: this is what I was talking about,
29914         the pattern is to use a static method as a "constructor" for
29915         objects. 
29916
29917         Also, do not create arguments until the very last minute,
29918         otherwise we always create the arguments even for lookups that
29919         will never be performed. 
29920
29921         (UserImplicitCast::Resolve): Eliminate, objects of type
29922         UserImplicitCast are born in a fully resolved state. 
29923
29924         * typemanager.cs (InitCoreTypes): Init also value_type
29925         (System.ValueType). 
29926
29927         * expression.cs (Cast::Resolve): First resolve the child expression.
29928
29929         (LValue): Add new method AddressOf to be used by
29930         the `&' operator.  
29931
29932         Change the argument of Store to take an EmitContext instead of an
29933         ILGenerator, because things like FieldExpr need to be able to call
29934         their children expression to generate the instance code. 
29935
29936         (Expression::Error, Expression::Warning): Sugar functions for
29937         reporting errors.
29938
29939         (Expression::MemberLookup): Accept a TypeContainer instead of a
29940         Report as the first argument.
29941
29942         (Expression::ResolvePrimary): Killed.  I still want to improve
29943         this as currently the code is just not right.
29944
29945         (Expression::ResolveMemberAccess): Simplify, but it is still
29946         wrong. 
29947
29948         (Unary::Resolve): Catch errors in AddressOf operators.
29949
29950         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
29951         index to a byte for the short-version, or the compiler will choose
29952         the wrong Emit call, which generates the wrong data.
29953
29954         (ParameterReference::Emit, ::Store): same.
29955
29956         (FieldExpr::AddressOf): Implement.
29957
29958         * typemanager.cs: TypeManager: made public variable instead of
29959         property.
29960
29961         * driver.cs: document --fatal.
29962
29963         * report.cs (ErrorMessage, WarningMessage): new names for the old
29964         Error and Warning classes.
29965
29966         * cs-parser.jay (member_access): Turn built-in access to types
29967         into a normal simplename
29968
29969 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29970
29971         * expression.cs (Invocation::BetterConversion): Fix to cope
29972         with q being null, since this was introducing a bug.
29973
29974         * expression.cs (ConvertImplicit): Do built-in conversions first.
29975
29976 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29977
29978         * expression.cs (UserImplicitCast::Resolve): Fix bug.
29979
29980 2001-09-27  Ravi Pratap  <ravi@ximian.com>
29981
29982         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
29983         I had introduced long ago (what's new ?).
29984
29985         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
29986         the work of all the checking. 
29987         (ConvertImplicit): Call CanConvert and only then create object if necessary.
29988         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
29989
29990         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
29991         that is the right way. 
29992
29993         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
29994         overloading resolution. Use everywhere instead of cutting and pasting code.
29995
29996         (Binary::ResolveOperator): Use MakeUnionSet.
29997
29998         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
29999         we have to convert to bool types. Not complete yet.
30000
30001 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30002
30003         * typemanager.cs (TypeManager::CSharpName): support ushort.
30004
30005         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30006         to provide an expression that performsn an implicit constant int
30007         conversion (section 6.1.6).
30008         (Expression::ConvertImplicitRequired): Reworked to include
30009         implicit constant expression conversions.
30010
30011         (Expression::ConvertNumericExplicit): Finished.
30012
30013         (Invocation::Emit): If InstanceExpression is null, then it means
30014         that we perform a call on this.
30015
30016 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30017
30018         * expression.cs (Unary::Emit): Remove some dead code.
30019         (Probe): Implement Resolve and Emit for `is'.
30020         (Expression::ConvertImplicitRequired): Attempt to do constant
30021         expression conversions here.  Maybe should be moved to
30022         ConvertImplicit, but I am not sure.
30023         (Expression::ImplicitLongConstantConversionPossible,
30024         Expression::ImplicitIntConstantConversionPossible): New functions
30025         that tell whether is it possible to apply an implicit constant
30026         expression conversion.
30027
30028         (ConvertNumericExplicit): Started work on explicit numeric
30029         conversions.
30030
30031         * cs-parser.jay: Update operator constants.
30032
30033         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30034         (Parameters::GetSignature): Hook up VerifyArgs here.
30035         (Parameters::VerifyArgs): Verifies that no two arguments have the
30036         same name. 
30037
30038         * class.cs (Operator): Update the operator names to reflect the
30039         ones that the spec expects (as we are just stringizing the
30040         operator names).
30041
30042         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30043         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30044         previous usage did only work for our methods.
30045         (Expression::ConvertImplicit): Handle decimal implicit numeric
30046         conversions as well.
30047         (Expression::InternalTypeConstructor): Used to invoke constructors
30048         on internal types for default promotions.
30049
30050         (Unary::Emit): Implement special handling for the pre/post
30051         increment/decrement for overloaded operators, as they need to have
30052         the same semantics as the other operators.
30053
30054         (Binary::ResolveOperator): ditto.
30055         (Invocation::ConversionExists): ditto.
30056         (UserImplicitCast::Resolve): ditto.
30057
30058 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30059
30060         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30061         operator, return after emitting body. Regression tests pass again !
30062
30063         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30064         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30065         (Invocation::OverloadResolve): Ditto.
30066         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30067
30068         * everywhere : update calls to the above methods accordingly.
30069
30070 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30071
30072         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30073
30074         * expression.cs (ExpressionStatement): New base class used for
30075         expressions that can appear in statements, so that we can provide
30076         an alternate path to generate expression that do not leave a value
30077         on the stack.
30078
30079         (Expression::Emit, and all the derivatives): We no longer return
30080         whether a value is left on the stack or not.  Every expression
30081         after being emitted leaves a single value on the stack.
30082
30083         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30084         facilties of ExpressionStatement if possible.
30085
30086         * cs-parser.jay: Update statement_expression.
30087
30088 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30089
30090         * driver.cs: Change the wording of message
30091
30092 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30093
30094         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30095         the type of the expression to the return type of the method if
30096         we have an overloaded operator match ! The regression tests pass again !
30097         (Unary::ResolveOperator): Ditto.
30098
30099         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30100         to find "op_Implicit", not "implicit" ;-)
30101         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30102         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30103
30104         * everywhere : Correct calls to the above accordingly.
30105
30106         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30107         (ConvertImplicit): Do user-defined conversion if it exists.
30108
30109 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30110
30111         * assign.cs: track location.
30112         (Resolve): Use implicit conversions on assignment.
30113
30114         * literal.cs: Oops.  Not good, Emit of short access values should
30115         pass (Bytes) or the wrong argument will be selected.
30116
30117         * expression.cs (Unary::Emit): Emit code for -expr.
30118
30119         (Unary::ResolveOperator): Handle `Substract' for non-constants
30120         (substract from zero from the non-constants).
30121         Deal with Doubles as well. 
30122
30123         (Expression::ConvertImplicitRequired): New routine that reports an
30124         error if no implicit conversion exists. 
30125
30126         (Invocation::OverloadResolve): Store the converted implicit
30127         expressions if we make them
30128
30129 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30130
30131         * class.cs (ConstructorInitializer): Take a Location argument.
30132         (ConstructorBaseInitializer): Same here.
30133         (ConstructorThisInitializer): Same here.
30134
30135         * cs-parser.jay : Update all calls accordingly.
30136
30137         * expression.cs (Unary, Binary, New): Take location argument.
30138         Update accordingly everywhere.
30139
30140         * cs-parser.jay : Update all calls to the above to take a location
30141         argument.
30142
30143         * class.cs : Ditto.
30144
30145 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30146
30147         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30148         (Invocation::BetterConversion): Same here
30149         (Invocation::ConversionExists): Ditto.
30150
30151         (Invocation::ConversionExists): Implement.
30152
30153 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30154
30155         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30156         Also take an additional TypeContainer argument.
30157
30158         * All over : Pass in TypeContainer as argument to OverloadResolve.
30159
30160         * typemanager.cs (CSharpName): Update to check for the string type and return
30161         that too.
30162
30163         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30164         a given method.
30165
30166 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30167
30168         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30169         (Invocation::BetterFunction): Implement.
30170         (Invocation::BetterConversion): Implement.
30171         (Invocation::ConversionExists): Skeleton, no implementation yet.
30172
30173         Okay, things work fine !
30174
30175 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30176
30177         * typemanager.cs: declare and load enum_type, delegate_type and
30178         void_type. 
30179
30180         * expression.cs (Expression::Emit): Now emit returns a value that
30181         tells whether a value is left on the stack or not.  This strategy
30182         might be reveted tomorrow with a mechanism that would address
30183         multiple assignments.
30184         (Expression::report118): Utility routine to report mismatches on
30185         the ExprClass.
30186
30187         (Unary::Report23): Report impossible type/operator combination
30188         utility function.
30189
30190         (Unary::IsIncrementableNumber): Whether the type can be
30191         incremented or decremented with add.
30192         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30193         complemented. 
30194         (Unary::ResolveOperator): Implement ++, !, ~,
30195
30196         (Invocation::Emit): Deal with new Emit convetion.
30197
30198         * All Expression derivatives: Updated their Emit method to return
30199         whether they leave values on the stack or not.
30200
30201         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30202         stack for expressions that are statements. 
30203
30204 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30205
30206         * expression.cs (LValue): New interface.  Must be implemented by
30207         LValue objects.
30208         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30209         LValue interface.
30210
30211         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30212         interface for generating code, simplifies the code.
30213
30214 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30215
30216         * expression.cs (everywhere): Comment out return statements in ::Resolve
30217         methods to avoid the warnings.
30218
30219 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30220
30221         * driver.cs (parse): Report error 2001 if we can not open the
30222         source file.
30223
30224         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30225         not resolve it.
30226
30227         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30228         object. 
30229
30230         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30231         otherwise nested blocks end up with the same index.
30232
30233         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30234
30235         * expression.cs:  Instead of having FIXMEs in the Resolve
30236         functions, throw exceptions so it is obvious that we are facing a
30237         bug. 
30238
30239         * cs-parser.jay (invocation_expression): Pass Location information.
30240
30241         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30242         Use a basename for those routines because .NET does not like paths
30243         on them. 
30244
30245         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30246         already defined.
30247
30248 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30249
30250         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30251         are loading the correct data types (throws an exception if not).
30252         (TypeManager::InitCoreTypes): Use CoreLookupType
30253
30254         * expression.cs (Unary::ResolveOperator): return the child
30255         expression for expressions which are just +expr.
30256         (Unary::ResolveOperator): Return negative literals for -LITERAL
30257         expressions (otherwise they are Unary {Literal}).
30258         (Invocation::Badness): Take into account `Implicit constant
30259         expression conversions'.
30260
30261         * literal.cs (LongLiteral): Implement long literal class.
30262         (IntLiteral): export the `Value' of the intliteral. 
30263
30264 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30265
30266         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30267
30268         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30269         instead of 'Operator'
30270
30271         * expression.cs (Binary::ResolveOperator): Update accordingly.
30272         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30273         and 'Minus'
30274
30275         * cs-parser.jay (unary_expression): Update to use the new names.
30276
30277         * gen-treedump.cs (GetUnary): Same here.
30278
30279         * expression.cs (Unary::Resolve): Implement.
30280         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30281         operators are found instead of making noise ;-)
30282         (Unary::ResolveOperator): New method to do precisely the same thing which
30283         Binary::ResolveOperator does for Binary expressions.
30284         (Unary.method, .Arguments): Add.
30285         (Unary::OperName): Implement.   
30286         (Unary::ForceConversion): Copy and Paste !
30287
30288         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30289         a unary operator.
30290
30291         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30292         for the inbuilt operators. Only overloading works for now ;-)
30293
30294 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30295
30296         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30297         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30298
30299         * expression.cs (This::Emit): Implement. 
30300         (This::Resolve): Implement.
30301         (TypeOf:Resolve): Implement.
30302         (Expression::ResolveSimpleName): Add an implicit this to instance
30303         field references. 
30304         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30305         Bind instance variable to Field expressions.
30306         (FieldExpr::Instance): New field used to track the expression that
30307         represents the object instance.
30308         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30309         binding 
30310         (FieldExpr::Emit): Implement.
30311
30312         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30313         the last instruction contains a return opcode to avoid generating
30314         the last `ret' instruction (this generates correct code, and it is
30315         nice to pass the peverify output).
30316
30317         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30318         initializer for static and instance variables.
30319         (Constructor::Emit): Allow initializer to be null in the case of
30320         static constructors.  Only emit initializer for instance
30321         constructors. 
30322
30323         (TypeContainer::FindMembers): Return a null array if there are no
30324         matches.
30325
30326         Also fix the code for the MemberTypes.Method branch, as it was not
30327         scanning that for operators (or tried to access null variables before).
30328
30329         * assign.cs (Assign::Emit): Handle instance and static fields. 
30330
30331         * TODO: Updated.
30332
30333         * driver.cs: Stop compilation if there are parse errors.
30334
30335         * cs-parser.jay (constructor_declaration): Provide default base
30336         initializer for non-static constructors.
30337         (constructor_declarator): Do not provide a default base
30338         initializers if none was specified.
30339         Catch the fact that constructors should not have parameters.
30340
30341         * class.cs: Do not emit parent class initializers for static
30342         constructors, that should be flagged as an error.
30343
30344 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30345
30346         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30347         Move back code into TypeContainer::Populate.
30348
30349 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30350
30351         * class.cs (TypeContainer::AddConstructor): Fix the check to
30352         compare against Name, not Basename. 
30353         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30354
30355         * cs-parser.jay : Update accordingly.
30356
30357         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30358         for methods, don't forget to look into the operators too.
30359         (RegisterMethodBuilder): Helper method to take care of this for
30360         methods, constructors and operators.
30361         (Operator::Define): Completely revamp.
30362         (Operator.OperatorMethod, MethodName): New fields.
30363         (TypeContainer::Populate): Move the registering of builders into
30364         RegisterMethodBuilder.
30365         (Operator::Emit): Re-write.
30366
30367         * expression.cs (Binary::Emit): Comment out code path to emit method
30368         invocation stuff for the case when we have a user defined operator. I am
30369         just not able to get it right !
30370
30371 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30372
30373         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30374         argument. 
30375
30376         (Expression::MemberLookup): Provide a version that allows to
30377         specify the MemberTypes and BindingFlags. 
30378
30379         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30380         so it was not fetching variable information from outer blocks.
30381
30382         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30383         Beforefieldinit as it was buggy.
30384
30385         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30386         that Ravi put here.  
30387
30388         * class.cs (Constructor::Emit): Only emit if block is not null.
30389         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30390         deal with this by semantically definining it as if the user had
30391         done it.
30392
30393         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30394         constructors as we now "emit" them at a higher level.
30395
30396         (TypeContainer::DefineDefaultConstructor): Used to define the
30397         default constructors if none was provided.
30398
30399         (ConstructorInitializer): Add methods Resolve and Emit. 
30400
30401         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30402
30403 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30404
30405         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30406         the default constructor builder with our hashtable for methodbuilders
30407         to methodcores.
30408
30409         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30410         and argument_count is 0 in which case we have a match.
30411         (Binary::ResolveOperator): More null checking and miscellaneous coding
30412         style cleanup.
30413
30414 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30415
30416         * rootcontext.cs (IsNameSpace): Compare against null.
30417
30418         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30419
30420         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30421         and Unary::Operator.
30422
30423         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30424         accordingly.
30425
30426         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30427         we have overloaded operators.
30428         (Binary::ResolveOperator): Implement the part which does the operator overload
30429         resolution.
30430
30431         * class.cs (Operator::Emit): Implement.
30432         (TypeContainer::Emit): Emit the operators we have too.
30433
30434         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30435         the case when we have a user-defined operator.
30436
30437 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30438
30439         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30440
30441 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30442
30443         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30444         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30445         (Constructor::Emit): Implement.
30446         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30447         if we have no work to do. 
30448         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30449         Emit method.
30450
30451         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30452         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30453
30454         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30455         of parent.parent.
30456
30457 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30458
30459         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30460         in the source.
30461         (Tree::RecordNamespace): Method to do what the name says ;-)
30462         (Tree::Namespaces): Property to get at the namespaces hashtable.
30463
30464         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30465         keep track.
30466
30467         * rootcontext.cs (IsNamespace): Fixed it :-)
30468
30469 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30470
30471         * class.cs (TypeContainer::FindMembers): Add support for
30472         constructors. 
30473         (MethodCore): New class that encapsulates both the shared aspects
30474         of a Constructor and a Method.  
30475         (Method, Constructor): Factored pieces into MethodCore.
30476
30477         * driver.cs: Added --fatal which makes errors throw exceptions.
30478         Load System assembly as well as part of the standard library.
30479
30480         * report.cs: Allow throwing exceptions on errors for debugging.
30481
30482         * modifiers.cs: Do not use `parent', instead use the real type
30483         container to evaluate permission settings.
30484
30485         * class.cs: Put Ravi's patch back in.  He is right, and we will
30486         have to cope with the
30487
30488 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30489
30490         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30491         FamORAssem, not FamANDAssem.
30492
30493 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30494
30495         * driver.cs: Added --parse option that only parses its input files
30496         and terminates.
30497
30498         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30499         incorrect.  IsTopLevel is not used to tell whether an object is
30500         root_types or not (that can be achieved by testing this ==
30501         root_types).  But to see if this is a top-level *class* (not
30502         necessarly our "toplevel" container). 
30503
30504 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30505
30506         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30507         parent instead of a direct call to GetType.
30508
30509 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30510
30511         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30512         Modifiers.TypeAttr. This should just be a call to that method.
30513
30514         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30515         object so that we can determine if we are top-level or not.
30516
30517         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30518         TypeContainer too.
30519
30520         * enum.cs (Enum::Define): Ditto.
30521
30522         * modifiers.cs (FieldAttr): Re-write.
30523
30524         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30525         (TypeContainer::HaveStaticConstructor): New property to provide access
30526         to precisely that info.
30527
30528         * modifiers.cs (MethodAttr): Re-write.
30529         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30530
30531         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30532         of top-level types as claimed.
30533
30534 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30535
30536         * expression.cs (MemberLookup): Fruitless attempt to lookup
30537         constructors.  Maybe I need to emit default constructors?  That
30538         might be it (currently .NET emits this for me automatically).
30539         (Invocation::OverloadResolve): Cope with Arguments == null.
30540         (Invocation::EmitArguments): new function, shared by the new
30541         constructor and us.
30542         (Invocation::Emit): Handle static and instance methods.  Emit
30543         proper call instruction for virtual or non-virtual invocations.
30544         (New::Emit): Implement.
30545         (New::Resolve): Implement.
30546         (MemberAccess:Resolve): Implement.
30547         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30548         to track instances.
30549         (FieldExpr::Resolve): Set type.
30550
30551         * support.cs: Handle empty arguments.
30552                 
30553         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30554         SimpleLookup): Auxiliary routines to help parse a qualifier
30555         identifier.  
30556
30557         Update qualifier_identifier rule.
30558
30559         * codegen.cs: Removed debugging messages.
30560
30561         * class.cs: Make this a global thing, this acts just as a "key" to
30562         objects that we might have around.
30563
30564         (Populate): Only initialize method_builders_to_methods once.
30565
30566         * expression.cs (PropertyExpr): Initialize type from the
30567         PropertyType. 
30568
30569         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30570         Resolve pattern.  Attempt to implicitly convert value to boolean.
30571         Emit code.
30572
30573         * expression.cs: Set the type for the int32/int32 argument case.
30574         (Binary::ResolveOperator): Set the return type to boolean for
30575         comparission operators
30576
30577         * typemanager.cs: Remove debugging print code.
30578
30579         (Invocation::Resolve): resolve type.
30580
30581         * class.cs: Allocate a MemberInfo of the correct size, as the code
30582         elsewhere depends on the test to reflect the correct contents.
30583
30584         (Method::) Keep track of parameters, due to System.Reflection holes
30585
30586         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30587         mapping here.
30588
30589         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30590         of the exact size and return that.
30591
30592         (Class::LookupMethodByBuilder): New function that maps
30593         MethodBuilders to its methods.  Required to locate the information
30594         on methods because System.Reflection bit us again.
30595
30596         * support.cs: New file, contains an interface ParameterData and
30597         two implementations: ReflectionParameters and InternalParameters
30598         used to access Parameter information.  We will need to grow this
30599         as required.
30600
30601         * expression.cs (Invocation::GetParameterData): implement a cache
30602         and a wrapper around the ParameterData creation for methods. 
30603         (Invocation::OverloadResolve): Use new code.
30604
30605 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30606
30607         * class.cs (TypeContainer::EmitField): Remove and move into 
30608         (Field::Define): here and modify accordingly.
30609         (Field.FieldBuilder): New member.
30610         (TypeContainer::Populate): Update accordingly.
30611         (TypeContainer::FindMembers): Implement.
30612
30613 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30614
30615         * statement.cs: (VariableInfo::VariableType): New field to be
30616         initialized with the full type once it is resolved. 
30617
30618 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30619
30620         * parameter.cs (GetParameterInfo): Use a type cache to compute
30621         things only once, and to reuse this information
30622
30623         * expression.cs (LocalVariableReference::Emit): Implement.
30624         (OpcodeCast::Emit): fix.
30625
30626         (ParameterReference::Resolve): Implement.
30627         (ParameterReference::Emit): Implement.
30628
30629         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30630         that are expressions need to stay as Expressions.
30631
30632         * typemanager.cs (CSharpName): Returns the C# name of a type if
30633         possible. 
30634
30635         * expression.cs (Expression::ConvertImplicit): New function that
30636         implements implicit type conversions.
30637
30638         (Expression::ImplicitReferenceConversion): Implements implicit
30639         reference conversions.
30640
30641         (EmptyCast): New type for transparent casts.
30642
30643         (OpcodeCast): New type for casts of types that are performed with
30644         a sequence of bytecodes.
30645
30646         (BoxedCast): New type used for casting value types into reference
30647         types.  Emits a box opcode.
30648
30649         (Binary::DoNumericPromotions): Implements numeric promotions of
30650         and computation of the Binary::Type.
30651
30652         (Binary::EmitBranchable): Optimization.
30653
30654         (Binary::Emit): Implement code emission for expressions.
30655
30656         * typemanager.cs (TypeManager): Added two new core types: sbyte
30657         and byte.
30658
30659 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30660
30661         * class.cs (TypeContainer::FindMembers): Method which does exactly
30662         what Type.FindMembers does, only we don't have to use reflection. No
30663         implementation yet.
30664
30665         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30666         typecontainer objects as we need to get at them.
30667         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30668
30669         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30670         typecontainer object.
30671
30672         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30673         of just a Report object.
30674
30675 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30676
30677         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30678         "remove_"
30679         (TypeContainer::Populate): Now define the delegates of the type too.
30680         (TypeContainer.Delegates): Property to access the list of delegates defined
30681         in the type.
30682
30683         * delegates.cs (Delegate::Define): Implement partially.
30684
30685         * modifiers.cs (TypeAttr): Handle more flags.
30686
30687 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30688
30689         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30690         and not <=
30691         (Operator::Define): Re-write logic to get types by using the LookupType method
30692         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30693         (Indexer::Define): Ditto.
30694         (Event::Define): Ditto.
30695         (Property::Define): Ditto.
30696
30697 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30698
30699         * class.cs (TypeContainer::Populate): Now define operators too. 
30700         (TypeContainer.Operators): New property to access the list of operators
30701         in a type.
30702         (Operator.OperatorMethodBuilder): New member to hold the method builder
30703         for the operator we are defining.
30704         (Operator::Define): Implement.
30705
30706 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30707
30708         * class.cs (Event::Define): Make the prefixes of the accessor methods
30709         addOn_ and removeOn_ 
30710
30711         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30712         of the location being passed in too. Ideally, this should go later since all
30713         error reporting should be done through the Report object.
30714
30715         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30716         (Populate): Iterate thru the indexers we have and define them too.
30717         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30718         for the get and set accessors.
30719         (Indexer::Define): Implement.
30720
30721 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30722
30723         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30724         my previous implementation, did not work.
30725
30726         * typemanager.cs: Add a couple of missing types (the longs).
30727
30728         * literal.cs: Use TypeManager.bool_type instead of getting it.
30729
30730         * expression.cs (EventExpr): New kind of expressions.
30731         (Expressio::ExprClassFromMemberInfo): finish
30732
30733 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30734
30735         * assign.cs: Emit stores to static fields differently.
30736
30737 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30738
30739         * Merge in changes and adjust code to tackle conflicts. Backed out my
30740         code in Assign::Resolve ;-) 
30741
30742 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30743
30744         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30745         instead Report.Error and also pass in the location.
30746         (CSharpParser::Lexer): New readonly property to return the reference
30747         to the Tokenizer object.
30748         (declare_local_variables): Use Report.Error with location instead of plain 
30749         old error.
30750         (CheckDef): Ditto.
30751
30752         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30753         (Operator.CheckBinaryOperator): Ditto.
30754
30755         * cs-parser.jay (operator_declarator): Update accordingly.
30756
30757         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30758         (CheckBinaryOperator): Same here.
30759
30760         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30761         on the name without any prefixes of namespace names etc. This is because we
30762         already might have something already fully qualified like 
30763         'System.Console.WriteLine'
30764
30765         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30766
30767 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30768
30769         * cs-tokenizer.cs (location): Return a string which also contains
30770         the file name.
30771
30772         * expression.cs (ElementAccess): New class for expressions of the
30773         type 'element access.'
30774         (BaseAccess): New class for expressions of the type 'base access.'
30775         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30776         respectively.
30777
30778         * cs-parser.jay (element_access): Implement action.
30779         (base_access): Implement actions.
30780         (checked_expression, unchecked_expression): Implement.
30781
30782         * cs-parser.jay (local_variable_type): Correct and implement.
30783         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30784
30785         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30786
30787         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30788         name and the specifiers.
30789
30790         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30791
30792         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30793         making them all public ;-)
30794
30795         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30796         class anyways.
30797
30798 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30799
30800         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30801         PropertyExprs.
30802         (FieldExpr, PropertyExprs): New resolved expressions.
30803         (SimpleName::MemberStaticCheck): Perform static checks for access
30804         to non-static fields on static methods. Maybe this should be
30805         generalized for MemberAccesses. 
30806         (SimpleName::ResolveSimpleName): More work on simple name
30807         resolution. 
30808
30809         * cs-parser.jay (primary_expression/qualified_identifier): track
30810         the parameter index.
30811
30812         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30813         (EmitContext::EmitBoolExpression): Chain to expression generation
30814         instead of temporary hack.
30815         (::EmitStatementExpression): Put generic expression code generation.
30816
30817         * assign.cs (Assign::Emit): Implement variable assignments to
30818         local variables, parameters and fields.
30819
30820 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30821
30822         * statement.cs (Block::GetVariableInfo): New method, returns the
30823         VariableInfo for a variable name in a block.
30824         (Block::GetVariableType): Implement in terms of GetVariableInfo
30825
30826         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30827         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30828
30829 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30830
30831         * cs-parser.jay (operator_declaration): Continue on my quest : update
30832         to take attributes argument.
30833         (event_declaration): Ditto.
30834         (enum_declaration): Ditto.
30835         (indexer_declaration): Ditto.
30836
30837         * class.cs (Operator::Operator): Update constructor accordingly.
30838         (Event::Event): Ditto.
30839
30840         * delegate.cs (Delegate::Delegate): Same here.
30841
30842         * enum.cs (Enum::Enum): Same here.
30843
30844 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30845
30846         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30847
30848         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30849
30850         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30851         being passed around as an arraylist.
30852         (Attributes::AddAttribute): Method to add attribute sections.
30853
30854         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30855         (struct_declaration): Update accordingly.
30856         (constant_declaration): Update.
30857         (field_declaration): Update.
30858         (method_header): Update.
30859         (fixed_parameter): Update.
30860         (parameter_array): Ditto.
30861         (property_declaration): Ditto.
30862         (destructor_declaration): Ditto.
30863
30864         * class.cs (Struct::Struct): Update constructors accordingly.
30865         (Class::Class): Ditto.
30866         (Field::Field): Ditto.
30867         (Method::Method): Ditto.
30868         (Property::Property): Ditto.
30869         (TypeContainer::OptAttribute): update property's return type.
30870
30871         * interface.cs (Interface.opt_attributes): New member.
30872         (Interface::Interface): Update to take the extra Attributes argument.
30873
30874         * parameter.cs (Parameter::Parameter): Ditto.
30875
30876         * constant.cs (Constant::Constant): Ditto.
30877
30878         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30879         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30880         the attributes as a parameter.
30881         (InterfaceProperty): Update constructor call.
30882         (InterfaceEvent): Ditto.
30883         (InterfaceMethod): Ditto.
30884         (InterfaceIndexer): Ditto.
30885
30886         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
30887         pass the attributes too.
30888         (interface_event_declaration): Ditto.
30889         (interface_property_declaration): Ditto.
30890         (interface_method_declaration): Ditto.
30891         (interface_declaration): Ditto.
30892
30893 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
30894
30895         * class.cs (Method::Define): Track the "static Main" definition to
30896         create an entry point. 
30897
30898         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
30899         EntryPoint if we find it. 
30900
30901         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
30902         (EmitContext::ig): Make this variable public.
30903
30904         * driver.cs: Make the default output file be the first file name
30905         with the .exe extension.  
30906
30907         Detect empty compilations
30908
30909         Handle various kinds of output targets.  Handle --target and
30910         rename -t to --dumper.
30911
30912         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
30913         methods inherited from Expression return now an Expression.  This
30914         will is used during the tree rewriting as we resolve them during
30915         semantic analysis.
30916
30917         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
30918         the spec.  Missing entirely is the information about
30919         accessability of elements of it.
30920
30921         (Expression::ExprClassFromMemberInfo): New constructor for
30922         Expressions that creates a fully initialized Expression based on
30923         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
30924         a Type.
30925
30926         (Invocation::Resolve): Begin implementing resolution of invocations.
30927
30928         * literal.cs (StringLiteral):  Implement Emit.
30929
30930 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30931
30932         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
30933         member.
30934
30935 2001-09-04  Ravi Pratap  <ravi@ximian.com>
30936
30937         * cs-parser.jay (attribute_arguments): Implement actions.
30938         (attribute): Fix bug in production. Implement action.
30939         (attribute_list): Implement.
30940         (attribute_target): Implement.
30941         (attribute_target_specifier, opt_target_specifier): Implement
30942         (CheckAttributeTarget): New method to check if the attribute target
30943         is valid.
30944         (attribute_section): Implement.
30945         (opt_attributes): Implement.
30946
30947         * attribute.cs : New file to handle attributes.
30948         (Attribute): Class to hold attribute info.
30949
30950         * cs-parser.jay (opt_attribute_target_specifier): Remove production
30951         (attribute_section): Modify production to use 2 different rules to 
30952         achieve the same thing. 1 s/r conflict down !
30953         Clean out commented, useless, non-reducing dimension_separator rules.
30954
30955         * class.cs (TypeContainer.attributes): New member to hold list
30956         of attributes for a type.
30957         (Struct::Struct): Modify to take one more argument, the attribute list.
30958         (Class::Class): Ditto.
30959         (Field::Field): Ditto.
30960         (Method::Method): Ditto.
30961         (Property::Property): Ditto.
30962
30963         * cs-parser.jay (struct_declaration): Update constructor call to
30964         pass in the attributes too.
30965         (class_declaration): Ditto.
30966         (constant_declaration): Ditto.
30967         (field_declaration): Ditto.
30968         (method_header): Ditto.
30969         (fixed_parameter): Ditto.
30970         (parameter_array): Ditto.
30971         (property_declaration): Ditto.
30972
30973         * constant.cs (Constant::Constant): Update constructor similarly.
30974         Use System.Collections.
30975
30976         * parameter.cs (Parameter::Parameter): Update as above.
30977
30978 2001-09-02  Ravi Pratap  <ravi@ximian.com>
30979
30980         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
30981         (TypeContainer.delegates): New member to hold list of delegates.
30982
30983         * cs-parser.jay (delegate_declaration): Implement the action correctly 
30984         this time as I seem to be on crack ;-)
30985
30986 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
30987
30988         * rootcontext.cs (RootContext::IsNamespace): new function, used to
30989         tell whether an identifier represents a namespace.
30990
30991         * expression.cs (NamespaceExpr): A namespace expression, used only
30992         temporarly during expression resolution.
30993         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
30994         utility functions to resolve names on expressions.
30995
30996 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
30997
30998         * codegen.cs: Add hook for StatementExpressions. 
30999
31000         * class.cs: Fix inverted test for static flag in methods.
31001
31002 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31003
31004         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31005         to make it coincide with MS' number.
31006         (Operator::CheckBinaryOperator): Ditto.
31007
31008         * ../errors/errors.txt : Remove error numbers added earlier.
31009
31010         * ../errors/cs1019.cs : Test case for error # 1019
31011
31012         * ../errros/cs1020.cs : Test case for error # 1020
31013
31014         * cs-parser.jay : Clean out commented cruft.
31015         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31016         used anywhere - non-reducing rule.
31017         (namespace_declarations): Non-reducing rule - comment out.
31018
31019         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31020         with TypeContainer::AddEnum.
31021
31022         * delegate.cs : New file for delegate handling classes.
31023         (Delegate): Class for declaring delegates.
31024
31025         * makefile : Update.
31026
31027         * cs-parser.jay (delegate_declaration): Implement.
31028
31029 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31030
31031         * class.cs (Event::Define): Implement.
31032         (Event.EventBuilder): New member.
31033
31034         * class.cs (TypeContainer::Populate): Update to define all enums and events
31035         we have.
31036         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31037         readonly fields for all these cases ?
31038
31039 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31040
31041         * class.cs (Property): Revamp to use the convention of making fields readonly.
31042         Accordingly modify code elsewhere.
31043
31044         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31045         the Define method of the Property class.
31046
31047         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31048         trivial bug.
31049         (TypeContainer::Populate): Update to define all the properties we have. Also
31050         define all enumerations.
31051
31052         * enum.cs (Define): Implement.
31053
31054 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31055
31056         * cs-parser.jay (overloadable_operator): The semantic value is an
31057         enum of the Operator class.
31058         (operator_declarator): Implement actions.
31059         (operator_declaration): Implement.
31060
31061         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31062         validity of definitions.
31063         (Operator::CheckBinaryOperator): Static method to check for binary operators
31064         (TypeContainer::AddOperator): New method to add an operator to a type.
31065
31066         * cs-parser.jay (indexer_declaration): Added line to actually call the
31067         AddIndexer method so it gets added ;-)
31068
31069         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31070         already taken care of by the MS compiler ?  
31071
31072 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31073
31074         * class.cs (Operator): New class for operator declarations.
31075         (Operator::OpType): Enum for the various operators.
31076
31077 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31078
31079         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31080         ostensibly handle this in semantic analysis.
31081
31082         * cs-parser.jay (general_catch_clause): Comment out
31083         (specific_catch_clauses, specific_catch_clause): Ditto.
31084         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31085         (catch_args, opt_catch_args): New productions.
31086         (catch_clause): Rewrite to use the new productions above
31087         (catch_clauses): Modify accordingly.
31088         (opt_catch_clauses): New production to use in try_statement
31089         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31090         and re-write the code in the actions to extract the specific and
31091         general catch clauses by being a little smart ;-)
31092
31093         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31094         Hooray, try and catch statements parse fine !
31095
31096 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31097
31098         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31099         string from the hashtable of variables.
31100
31101         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31102         I end up making that mistake ;-)
31103         (catch_clauses): Fixed gross error which made Key and Value of the 
31104         DictionaryEntry the same : $1 !!
31105
31106 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31107
31108         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31109
31110         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31111         when the add and remove accessors are specified. 
31112
31113 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31114
31115         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31116         information about indexer_declarator.
31117         (indexer_declarator): Implement actions.
31118         (parsing_indexer): New local boolean used to keep track of whether
31119         we are parsing indexers or properties. This is necessary because 
31120         implicit_parameters come into picture even for the get accessor in the 
31121         case of an indexer.
31122         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31123
31124         * class.cs (Indexer): New class for indexer declarations.
31125         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31126         (TypeContainer::indexers): New member to hold list of indexers for the
31127         type.
31128
31129 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31130
31131         * cs-parser.jay (add_accessor_declaration): Implement action.
31132         (remove_accessor_declaration): Implement action.
31133         (event_accessors_declaration): Implement
31134         (variable_declarators): swap statements for first rule - trivial.
31135
31136         * class.cs (Event): New class to hold information about event
31137         declarations.
31138         (TypeContainer::AddEvent): New method to add an event to a type
31139         (TypeContainer::events): New member to hold list of events.
31140
31141         * cs-parser.jay (event_declaration): Implement actions.
31142
31143 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31144
31145         * cs-parser.jay (dim_separators): Implement. Make it a string
31146         concatenating all the commas together, just as they appear.
31147         (opt_dim_separators): Modify accordingly
31148         (rank_specifiers): Update accordingly. Basically do the same
31149         thing - instead, collect the brackets here.
31150         (opt_rank_sepcifiers): Modify accordingly.
31151         (array_type): Modify to actually return the complete type string
31152         instead of ignoring the rank_specifiers.
31153         (expression_list): Implement to collect the expressions
31154         (variable_initializer): Implement. We make it a list of expressions
31155         essentially so that we can handle the array_initializer case neatly too.
31156         (variable_initializer_list): Implement.
31157         (array_initializer): Make it a list of variable_initializers
31158         (opt_array_initializer): Modify accordingly.
31159
31160         * expression.cs (New::NType): Add enumeration to help us
31161         keep track of whether we have an object/delegate creation
31162         or an array creation.
31163         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31164         members to hold data about array creation.
31165         (New:New): Modify to update NewType
31166         (New:New): New Overloaded contructor for the array creation
31167         case.
31168
31169         * cs-parser.jay (array_creation_expression): Implement to call
31170         the overloaded New constructor.
31171
31172 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31173
31174         * class.cs (TypeContainer::Constructors): Return member
31175         constructors instead of returning null.
31176
31177 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31178
31179         * typemanager.cs (InitCoreTypes): Initialize the various core
31180         types after we have populated the type manager with the user
31181         defined types (this distinction will be important later while
31182         compiling corlib.dll)
31183
31184         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31185         on Expression Classification.  Now all expressions have a method
31186         `Resolve' and a method `Emit'.
31187
31188         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31189         generation from working.     Also add some temporary debugging
31190         code. 
31191
31192 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31193
31194         * codegen.cs: Lots of code generation pieces.  This is only the
31195         beginning, will continue tomorrow with more touches of polish.  We
31196         handle the fundamentals of if, while, do, for, return.  Others are
31197         trickier and I need to start working on invocations soon.
31198
31199         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31200         s.InitStatement. 
31201
31202         * codegen.cs (EmitContext): New struct, used during code
31203         emission to keep a context.   Most of the code generation will be
31204         here. 
31205
31206         * cs-parser.jay: Add embedded blocks to the list of statements of
31207         this block.  So code generation proceeds in a top down fashion.
31208
31209 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31210
31211         * statement.cs: Add support for multiple child blocks.
31212
31213 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31214
31215         * codegen.cs (EmitCode): New function, will emit the code for a
31216         Block of code given a TypeContainer and its ILGenerator. 
31217
31218         * statement.cs (Block): Standard public readonly optimization.
31219         (Block::Block constructors): Link children. 
31220         (Block::Child): Child Linker.
31221         (Block::EmitVariables): Emits IL variable declarations.
31222
31223         * class.cs: Drop support for MethodGroups here, delay until
31224         Semantic Analysis.
31225         (Method::): Applied the same simplification that I did before, and
31226         move from Properties to public readonly fields.
31227         (Method::ParameterTypes): Returns the parameter types for the
31228         function, and implements a cache that will be useful later when I
31229         do error checking and the semantic analysis on the methods is
31230         performed.
31231         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31232         and made a method, optional argument tells whether this is a class
31233         or a structure to apply the `has-this' bit.
31234         (Method::GetCallingConvention): Implement, returns the calling
31235         convention. 
31236         (Method::Define): Defines the type, a second pass is performed
31237         later to populate the methods.
31238
31239         (Constructor::ParameterTypes): implement a cache similar to the
31240         one on Method::ParameterTypes, useful later when we do semantic
31241         analysis. 
31242
31243         (TypeContainer::EmitMethod):  New method.  Emits methods.
31244
31245         * expression.cs: Removed MethodGroup class from here.
31246
31247         * parameter.cs (Parameters::GetCallingConvention): new method.
31248
31249 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31250
31251         * class.cs (TypeContainer::Populate): Drop RootContext from the
31252         argument. 
31253
31254         (Constructor::CallingConvention): Returns the calling convention.
31255         (Constructor::ParameterTypes): Returns the constructor parameter
31256         types. 
31257
31258         (TypeContainer::AddConstructor): Keep track of default constructor
31259         and the default static constructor.
31260
31261         (Constructor::) Another class that starts using `public readonly'
31262         instead of properties. 
31263
31264         (Constructor::IsDefault): Whether this is a default constructor. 
31265
31266         (Field::) use readonly public fields instead of properties also.
31267
31268         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31269         track of static constructors;  If none is used, turn on
31270         BeforeFieldInit in the TypeAttributes. 
31271
31272         * cs-parser.jay (opt_argument_list): now the return can be null
31273         for the cases where there are no arguments. 
31274
31275         (constructor_declarator): If there is no implicit `base' or
31276         `this', then invoke the default parent constructor. 
31277
31278         * modifiers.cs (MethodAttr): New static function maps a set of
31279         modifiers flags into a MethodAttributes enum
31280         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31281         MethodAttr, TypeAttr to represent the various mappings where the
31282         modifiers are used.
31283         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31284
31285 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31286
31287         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31288         method arguments.
31289
31290         * interface.cs (PopulateIndexer): Implemented the code generator
31291         for interface indexers.
31292
31293 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31294
31295         * interface.cs (InterfaceMemberBase): Now we track the new status
31296         here.  
31297
31298         (PopulateProperty): Implement property population.  Woohoo!  Got
31299         Methods and Properties going today. 
31300
31301         Removed all the properties for interfaces, and replaced them with
31302         `public readonly' fields. 
31303
31304 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31305
31306         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31307         initialize their hashtables/arraylists only when they are needed
31308         instead of doing this always.
31309
31310         * parameter.cs: Handle refs and out parameters.
31311
31312         * cs-parser.jay: Use an ArrayList to construct the arguments
31313         instead of the ParameterCollection, and then cast that to a
31314         Parameter[] array.
31315
31316         * parameter.cs: Drop the use of ParameterCollection and use
31317         instead arrays of Parameters.
31318
31319         (GetParameterInfo): Use the Type, not the Name when resolving
31320         types. 
31321
31322 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31323
31324         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31325         and instead use public readonly fields.
31326
31327         * class.cs: Put back walking code for type containers.
31328
31329 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31330
31331         * class.cs (MakeConstant): Code to define constants.
31332
31333         * rootcontext.cs (LookupType): New function.  Used to locate types 
31334
31335
31336 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31337
31338         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31339         this System.Reflection code is.  Kudos to Microsoft
31340
31341         * typemanager.cs: Implement a type cache and avoid loading all
31342         types at boot time.  Wrap in LookupType the internals.  This made
31343         the compiler so much faster.  Wow.  I rule!
31344
31345         * driver.cs: Make sure we always load mscorlib first (for
31346         debugging purposes, nothing really important).
31347
31348         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31349         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31350
31351         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31352         on namespaces that have been imported using the `using' keyword.
31353
31354         * class.cs (TypeContainer::TypeAttr): Virtualize.
31355         (Class::TypeAttr): Return attributes suitable for this bad boy.
31356         (Struct::TypeAttr): ditto.
31357         Handle nested classes.
31358         (TypeContainer::) Remove all the type visiting code, it is now
31359         replaced with the rootcontext.cs code
31360
31361         * rootcontext.cs (GetClassBases): Added support for structs. 
31362
31363 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31364
31365         * interface.cs, statement.cs, class.cs, parameter.cs,
31366         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31367         Drop use of TypeRefs, and use strings instead.
31368
31369 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31370
31371         * rootcontext.cs: 
31372
31373         * class.cs (Struct::Struct): set the SEALED flags after
31374         checking the modifiers.
31375         (TypeContainer::TypeAttr): new property, returns the
31376         TypeAttributes for a class.  
31377
31378         * cs-parser.jay (type_list): Oops, list production was creating a
31379         new list of base types.
31380
31381         * rootcontext.cs (StdLib): New property.
31382         (GetInterfaceTypeByName): returns an interface by type name, and
31383         encapsulates error handling here.
31384         (GetInterfaces): simplified.
31385         (ResolveTree): Encapsulated all the tree resolution here.
31386         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31387         types. 
31388
31389         * driver.cs: Add support for --nostdlib, to avoid loading the
31390         default assemblies.
31391         (Main): Do not put tree resolution here. 
31392
31393         * rootcontext.cs: Beginning of the class resolution.
31394
31395 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31396
31397         * rootcontext.cs: Provide better error reporting. 
31398
31399         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31400
31401         * rootcontext.cs (CreateInterface): Handle the case where there
31402         are no parent interfaces.
31403
31404         (CloseTypes): Routine to flush types at the end.
31405         (CreateInterface): Track types.
31406         (GetInterfaces): Returns an array of Types from the list of
31407         defined interfaces.
31408
31409         * typemanager.c (AddUserType): Mechanism to track user types (puts
31410         the type on the global type hash, and allows us to close it at the
31411         end). 
31412
31413 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31414
31415         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31416         RecordInterface instead.
31417
31418         * cs-parser.jay: Updated to reflect changes above.
31419
31420         * decl.cs (Definition): Keep track of the TypeBuilder type that
31421         represents this type here.  Not sure we will use it in the long
31422         run, but wont hurt for now.
31423
31424         * driver.cs: Smaller changes to accomodate the new code.
31425
31426         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31427         when done. 
31428
31429         * rootcontext.cs (CreateInterface):  New method, used to create
31430         the System.TypeBuilder type for interfaces.
31431         (ResolveInterfaces): new entry point to resolve the interface
31432         hierarchy. 
31433         (CodeGen): Property, used to keep track of the code generator.
31434
31435 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31436
31437         * cs-parser.jay: Add a second production for delegate_declaration
31438         with `VOID'.
31439
31440         (enum_body): Put an opt_comma here instead of putting it on
31441         enum_body or enum_member_declarations so we can handle trailing
31442         commas on enumeration members.  Gets rid of a shift/reduce.
31443
31444         (type_list): Need a COMMA in the middle.
31445
31446         (indexer_declaration): Tell tokenizer to recognize get/set
31447
31448         * Remove old targets.
31449
31450         * Re-add the parser target.
31451
31452 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31453
31454         * cs-parser.jay: Add precendence rules for a number of operators
31455         ot reduce the number of shift/reduce conflicts in the grammar.
31456
31457 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31458
31459         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31460         and put it here.
31461
31462         Get rid of old crufty code.
31463
31464         * rootcontext.cs: Use this to keep track of the parsed
31465         representation and the defined types available to the program. 
31466
31467         * gen-treedump.cs: adjust for new convention.
31468
31469         * type.cs: Split out the type manager, and the assembly builder
31470         from here. 
31471
31472         * typemanager.cs: the type manager will live here now.
31473
31474         * cil-codegen.cs: And the code generator here. 
31475
31476 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31477
31478         * makefile: Fixed up for easy making.
31479
31480 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31481
31482         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31483         the 
31484
31485         (unary_expression): Expand pre_increment_expression and
31486         post_decrement_expression to reduce a shift/reduce.
31487
31488 2001-07-11  Simon Cozens
31489
31490         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31491
31492         Improve allow_keyword_as_indent name.
31493
31494 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31495
31496         * Adjustments for Beta2. 
31497
31498 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31499
31500         * decl.cs: Added `Define' abstract method.
31501         (InTransit): new property, used to catch recursive definitions. 
31502
31503         * interface.cs: Implement `Define'. 
31504
31505         * modifiers.cs: Map Modifiers.constants to
31506         System.Reflection.TypeAttribute flags.
31507
31508         * class.cs: Keep track of types and user-defined types.
31509         (BuilderInit): New method for creating an assembly
31510         (ResolveType): New function to launch the resolution process, only
31511         used by interfaces for now.
31512
31513         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31514         that are inserted into the name space. 
31515
31516 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31517
31518         * ARGH.  I have screwed up my tree so many times due to the use of
31519         rsync rather than using CVS.  Going to fix this at once. 
31520
31521         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31522         load types.
31523
31524 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31525
31526         * Experiment successful: Use System.Type rather that our own
31527         version of Type.  
31528
31529 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31530
31531         * cs-parser.jay: Removed nsAliases from here.
31532
31533         Use new namespaces, handle `using XXX;' 
31534
31535         * namespace.cs: Reimplemented namespace handling, use a recursive
31536         definition of the class.  Now we can keep track of using clauses
31537         and catch invalid using clauses.
31538
31539 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31540
31541         * gen-treedump.cs: Adapted for all the renaming.
31542
31543         * expression.cs (Expression): this class now has a Type property
31544         which returns an expression Type.
31545
31546         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31547         `Type', as this has a different meaning now in the base
31548
31549 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31550
31551         * interface.cs, class.cs: Removed from all the sources the
31552         references to signature computation, as we can not do method
31553         signature computation during the parsing time, as we are not
31554         trying to solve at that point distinguishing:
31555
31556         class X {
31557                 void a (Blah x) {}
31558                 void a (NS.Blah x) {}
31559         }
31560
31561         Which depending on the context might be valid or not, as we do not
31562         know if Blah is the same thing as NS.Blah at that point.
31563
31564         * Redid everything so the code uses TypeRefs now instead of
31565         Types.  TypeRefs are just temporary type placeholders, that need
31566         to be resolved.  They initially have a pointer to a string and the
31567         current scope in which they are used.  This is used later by the
31568         compiler to resolve the reference to an actual Type. 
31569
31570         * DeclSpace is no longer a CIR.Type, and neither are
31571         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31572         are all DeclSpaces, but no Types. 
31573
31574         * type.cs (TypeRefManager): This implements the TypeRef manager,
31575         which keeps track of all the types that need to be resolved after
31576         the parsing has finished. 
31577
31578 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31579
31580         * ARGH.  We are going to have to store `foreach' as a class rather
31581         than resolving it, as we need to verify error 1579 after name
31582         resolution.   *OR* we could keep a flag that says `This request to
31583         IEnumerator comes from a foreach statement' which we can then use
31584         to generate the error.
31585
31586 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31587
31588         * class.cs (TypeContainer.AddMethod): we now add methods to the
31589         MethodGroup instead of the method hashtable.  
31590
31591         * expression.cs: Add MethodGroup abstraction, which gets us one
31592         step closer to the specification in the way we handle method
31593         declarations.  
31594
31595         * cs-parser.jay (primary_expression): qualified_identifier now
31596         tried to match up an identifier to a local variable reference or
31597         to a parameter reference.
31598
31599         current_local_parameters is now a parser global variable that
31600         points to the current parameters for the block, used during name
31601         lookup.
31602
31603         (property_declaration): Now creates an implicit `value' argument to
31604         the set accessor.
31605
31606 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31607
31608         * parameter.cs: Do not use `param' arguments as part of the
31609         signature, per the spec.
31610
31611 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31612
31613         * decl.cs: Base class for classes, structs and interfaces.  This
31614         is the "Declaration Space" 
31615
31616         * cs-parser.jay: Use CheckDef for checking declaration errors
31617         instead of having one on each function.
31618
31619         * class.cs: Factor out some code for handling error handling in
31620         accordance to the "Declarations" section in the "Basic Concepts"
31621         chapter in the ECMA C# spec.
31622
31623         * interface.cs: Make all interface member classes derive from
31624         InterfaceMemberBase.
31625
31626 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31627
31628         * Many things: all interfaces are parsed and generated in
31629         gen-treedump.  Support for member variables, constructors,
31630         destructors, properties, constants is there.
31631
31632         Beginning of the IL backend, but very little done, just there for
31633         testing purposes. 
31634
31635 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31636
31637         * cs-parser.jay: Fix labeled statement.
31638
31639         * cs-tokenizer.cs (escape): Escape " and ' always.
31640         ref_line, ref_name: keep track of the line/filename as instructed
31641         by #line by the compiler.
31642         Parse #line.
31643
31644 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31645
31646         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31647         to match the values in System.CodeDOM.
31648
31649         Divid renamed to Divide.
31650
31651         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31652         statements. 
31653         (Statements.set): remove.
31654
31655         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31656         statements. 
31657
31658         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31659         falseStatements always have valid values. 
31660
31661         * cs-parser.jay: Use System.CodeDOM now.
31662