96e9034a7b4ba667cf820d765e1160d67b097877
[mono.git] / mcs / mcs / ChangeLog
1 2008-01-22  Marek Safar  <marek.safar@gmail.com>
2
3         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
4         not allowed.
5         
6         * generic.cs: Implemented coalesce expression.
7
8 2008-01-22  Marek Safar  <marek.safar@gmail.com>
9
10         A fix for bug #355145
11         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
12         expression tree type inference.
13
14 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
15
16         Fix #354663
17         * expression.cs (Binary.IsUnsignedType): Fix typo.
18         
19 2008-01-22  Marek Safar  <marek.safar@gmail.com>
20
21         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
22         
23 2008-01-22  Marek Safar  <marek.safar@gmail.com>
24
25         A fix for bug #355161
26         * ecore.cs, expression.cs: Wider range of extension method supported
27         expressions.
28  
29 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
30
31         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
32         AssemblyBuilder to operate in compiler context. Fixes mcs part of
33         bug #354970.
34
35 2008-01-22  Marek Safar  <marek.safar@gmail.com>
36
37         A fix for bug #355148
38         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
39         
40 2008-01-22  Miguel de Icaza  <miguel@novell.com>
41
42         * expression.cs (CreateExpressionTree): Add support for or and
43         logical or, and indent following the coding conventions.
44
45         * typemanager.cs (LinqExpression): renamed from
46         ExpressionTreeManager, for a shorter name.
47
48         Use TypeManager.CoreLookupType to lookup types from our core
49         assemblies and turn those into "Type" variables.
50
51         Consumers that previously used "Namespace" and "Type" from this
52         class should instead use the TypeExpression which is a type that
53         is fully resolved (without involving the regular C# resolution
54         rules). 
55
56         This typically looks like this:
57
58         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
59         new MemberAccess (texpr, name, type_arguments, loc)
60
61         This avoids the problem in: #355178
62
63 2008-01-21  Marek Safar  <marek.safar@gmail.com>
64
65         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
66         feature in parser only as we do in other cases.
67         
68 2008-01-21  Marek Safar  <marek.safar@gmail.com>
69
70         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
71         typemanager.cs: A refactoring of params arguments to reuse existing
72         expressions (params -> array initializer) to emit params argument instead
73         of specialized handling.
74         It was required by expression tree implementation and it has other benefits
75         as well, we now apply same optimization for params arguments as we do for
76         array initializers.
77         
78 2008-01-18  Marek Safar  <marek.safar@gmail.com>
79
80         A fix for bug #353526
81         * generic.cs: A type inference of params arguments may not required any
82         temporary array creation.
83         
84 2008-01-18  Marek Safar  <marek.safar@gmail.com>
85
86         A fix for bug #353534
87         * generic.cs, ecore.cs, expression.cs: A method group type inference is
88         supported for delegates only.
89         
90 2008-01-18  Marek Safar  <marek.safar@gmail.com>
91
92         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
93         type for more than 1 candidates.
94         
95 2008-01-18  Marek Safar  <marek.safar@gmail.com>
96
97         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
98         expressions.
99         
100 2008-01-16  Marek Safar  <marek.safar@gmail.com>
101
102         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
103         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
104         operator) expressions. 
105                 
106 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
107
108         * statement.cs: Avoid declaring an IL variable for this_variable since it is
109         not accessed from the generated IL.
110
111 2008-01-14  Marek Safar  <marek.safar@gmail.com>
112
113         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
114         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
115         statement.cs: The first expression tree implementation drop, mostly
116         infrastructure work.
117
118 2008-01-14  Marek Safar  <marek.safar@gmail.com>
119
120         * ecore.cs (IsNestedChild): Refactored.
121
122 2008-01-11  Marek Safar  <marek.safar@gmail.com>
123
124         * lambda.cs: Don't use a cast on unknown expression statement.
125
126 2008-01-10  Geoff Norton  <gnorton@novell.com>
127
128         * cs-tokenizer.cs: One more token to distinguish between method and lambda
129         arguments
130
131 2008-01-09  Marek Safar  <marek.safar@gmail.com>
132
133         * doc.cs: Report better /doc crash details.
134         
135 2008-01-09  Marek Safar  <marek.safar@gmail.com>
136
137         A fix for bug #352536
138         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
139
140 2008-01-08  Marek Safar  <marek.safar@gmail.com>
141
142         A fix for bug #352287
143         * ecore.cs, expression.cs: Do `this' access checking in all member access
144         expressions.
145         
146 2008-01-08  Marek Safar  <marek.safar@gmail.com>
147
148         * rootcontext.cs, driver.cs: Switch to linq mode by default.
149         
150         * report.cs: Reset message stacks.
151         
152 2008-01-08  Marek Safar  <marek.safar@gmail.com>
153
154         * generic.cs (InferInPhases): Correctly calculate params position.
155         
156 2008-01-08  Marek Safar  <marek.safar@gmail.com>
157
158         * cs-tokenizer.cs: No need to parse full string when parsing lambda
159         arguments.
160
161 2008-01-07  Marek Safar  <marek.safar@gmail.com>
162
163         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
164         
165         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
166         
167         * driver.cs: Updated --help option.
168         
169 2008-01-07  Marek Safar  <marek.safar@gmail.com>
170
171         * generic.cs (InferParamsTypeArguments): Removed.
172         (InferInPhases): Add params type inference.
173         (LowerBoundInference): Fixed scoring mechanism.
174         
175         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
176         
177 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
178
179         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
180         byte array for unsigned "baked" assemblies.
181
182 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
183
184         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
185         array for assemblies that are not strongnamed.
186
187 2008-01-04  Marek Safar  <marek.safar@gmail.com>
188
189         A fix for bug #351481
190         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
191         declaring type for nested generic types.
192         
193 2008-01-04  Marek Safar  <marek.safar@gmail.com>
194
195         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
196         instead of ToString.
197         
198 2008-01-03  Marek Safar  <marek.safar@gmail.com>
199
200         A fix for bug #351047
201         * expression.cs (Binary.ResolveOperator): Allow equality operators between
202         null and structs only when equality and inequality operators are defined
203         either as an user-operators or predefined operators.
204         
205 2008-01-03  Marek Safar  <marek.safar@gmail.com>
206
207         A fix for bug #351047
208         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
209         
210 2008-01-03  Marek Safar  <marek.safar@gmail.com>
211
212         A fix for bug #351257
213         * cs-tokenizer.cs: Advance line number for '\r' correctly.
214         
215 2008-01-03  Marek Safar  <marek.safar@gmail.com>
216
217         A fix for bug #351157
218         * class.cs (Using): Fixed yet another broken cloning.
219         
220         (Block): Put back more sensible default value for statements.
221         
222 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
223
224         * codegen.cs: Allow AssemblyVersion with only major version component.
225         Fixes bug #351055.
226
227 2007-12-29  Marek Safar  <marek.safar@gmail.com>
228
229         A fix for bug #324654
230         * class.cs: Use FullName property as member name.
231
232 2007-12-28  Marek Safar  <marek.safar@gmail.com>
233
234         A fix for bug #342117
235         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
236         constructor constraint.
237
238 2007-12-28  Marek Safar  <marek.safar@gmail.com>
239
240         A fix for bug #338273
241         * class.cs (ProbertyBase): Access modifier checks are required for overrides
242         only.
243
244 2007-12-28  Marek Safar  <marek.safar@gmail.com>
245
246         A fix for bug #350839
247         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
248
249 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
250
251         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
252         GHOP:
253         
254         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
255
256         * statement.cs: Changed some Hashtables to use HybridDictionaries
257         instead. It was observed that some HashTables only contained a few
258         items in the vast majority of cases. Since HybridDictionary is
259         more efficient on small sets (<10 elements), "known_variables"
260         from class ExplicitBlock as well as "labels" and "constants " from
261         class Block were changed to HybridDictionaries. 
262
263         Atsai results: (56216kb->54987kb)
264
265         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
266
267
268 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
269
270         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
271         GHOP:
272         
273         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
274         
275         * expression.cs: foreach loop to for loop, saved on allocation of
276         enumerator (59333kb->59141kb)
277
278         * statement.cs. Changed foreach loops to for loops, saved on
279         allocation of enumerator (59141kb->59006kb)
280
281         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
282         when constructed with no specified capacity. This was causing a
283         few ArrayLists to allocate more memory than they would potentially
284         need in the Block class and MemberCache class. Setting the
285         ArrayLists to construct with a capacity of 1 saves some
286         memory. (56216kb->55585kb)
287
288 2007-12-27  Marek Safar  <marek.safar@gmail.com>
289
290         A fix for bug #347189 (2nd issue)
291         * expression.cs (MemberAccess): Nested type can be found in base non-generic
292         type.
293
294 2007-12-27  Miguel de Icaza  <miguel@novell.com>
295         
296         * report.cs: Do not use colors if stdout and stderr are not a
297         terminal.
298
299 2007-12-27  Marek Safar  <marek.safar@gmail.com>
300
301         A fix for bug #346998
302         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
303         overloads.
304
305 2007-12-27  Marek Safar  <marek.safar@gmail.com>
306
307         A fix for bug #343465
308         * class.cs: Explicit method name for nested types uses dots only.
309
310 2007-12-27  Marek Safar  <marek.safar@gmail.com>
311
312         A fix for bug #343707
313         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
314
315 2007-12-27  Marek Safar  <marek.safar@gmail.com>
316
317         * ecore.cs: Report type inference errors only when arguments count matches
318         parameter count.
319         
320         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
321         
322         * expression.cs, report.cs: New warning.
323         
324         * typemanager.cs: Catch anonymous method type too.
325
326 2007-12-23  Marek Safar  <marek.safar@gmail.com>
327
328         A fix for bug #346379
329         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
330
331 2007-12-23  Marek Safar  <marek.safar@gmail.com>
332
333         A fix for bug #347359
334         * expression.cs (Invocation): Don't resolve already resolved expression.
335
336 2007-12-23  Marek Safar  <marek.safar@gmail.com>
337
338         A fix for bug #347189
339         * class.cs (FixedField): Use non-dependent code only in the define phase.
340
341 2007-12-23  Marek Safar  <marek.safar@gmail.com>
342
343         A fix for bug #348076
344         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
345
346 2007-12-22  Marek Safar  <marek.safar@gmail.com>
347
348         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
349         discovered extension methods.
350
351 2007-12-22  Marek Safar  <marek.safar@gmail.com>
352
353         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
354         method.
355
356 2007-12-21  Miguel de Icaza  <miguel@novell.com>
357
358         * report.cs (ErrorMessage): Add support for using colors on
359         terminals that support it. 
360
361 2007-12-21  Marek Safar  <marek.safar@gmail.com>
362
363         * ecore.cs: Use information about expanded params for error reporting.
364
365 2007-12-21  Marek Safar  <marek.safar@gmail.com>
366
367         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
368         and logic for params overloads.
369         
370 2007-12-15  Miguel de Icaza  <miguel@novell.com>
371
372         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
373         as this is also created from the parser.  Fixes #349034
374
375 2007-12-12  Miguel de Icaza  <miguel@novell.com>
376
377         * statement.cs (Throw.CloneTo): it is valid to have empty
378         expressions for throw. 
379
380 2007-12-03  Marek Safar  <marek.safar@gmail.com>
381
382         * cs-parser.jay: Set delegate constraint parsing region correctly.
383
384 2007-12-03  Marek Safar  <marek.safar@gmail.com>
385
386         A fix for bug #345467
387         * typemanager.cs (IsEqual): Compare generic parameters position only.
388         
389 2007-11-28  Marek Safar  <marek.safar@gmail.com>
390
391         * expression.cs (BaseAccess): Type arguments can be null.
392
393 2007-11-27  Raja R Harinath  <harinath@gmail.com>
394
395         * statement.cs (Block.Resolve): Ensure flow-branching tree is
396         consistent even when an error has occured.
397         (Switch.Resolve): Likewise.
398
399 2007-11-22  Marek Safar  <marek.safar@gmail.com>
400
401         A fix for bug #334505
402         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
403         overrides.
404         
405 2007-11-22  Marek Safar  <marek.safar@gmail.com>
406
407         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
408         refactorings required to resolve extension methods correctly when mixing
409         generics and non-generics members.
410         
411 2007-11-20  Marek Safar  <marek.safar@gmail.com>
412
413         A fix for bug #342584
414         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
415         conversion.
416         
417 2007-11-19  Marek Safar  <marek.safar@gmail.com>
418
419         A fix for bug #342512
420         * delegate.cs: Use delegate argument expression when is available. Don't
421         emit virtual call when class is sealed.
422         
423 2007-11-16  Marek Safar  <marek.safar@gmail.com>
424
425         A fix for bug #325423
426         * assign.cs (FieldInitializer): Use resolved expression for emit.
427         
428         * class.cs: Print less confusing error message.
429         
430 2007-11-16  Marek Safar  <marek.safar@gmail.com>
431
432         * cs-tokenizer.cs: Removed GMCS ifdefs.
433         
434         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
435         mcs.
436         
437         * cs-parser.jay: Disabled nullable check.
438         
439         * generic-mcs: Copied more generic stuff.
440                 
441 2007-11-16  Marek Safar  <marek.safar@gmail.com>
442
443         * gcs-parser.jay: Merged to cs-parser.jay.
444         
445         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
446         * *.csproj, *.sources: Updated to use only jay parser file.
447
448 2007-11-16  Marek Safar  <marek.safar@gmail.com>
449
450         * gcs-parser.jay: Added nullable and default expression feature checks.
451         
452 2007-11-16  Marek Safar  <marek.safar@gmail.com>
453
454         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
455         it fixes many TODOs and hidden bugs.
456         
457         * expression: Removed duplicate error check.
458
459 2007-11-15  Marek Safar  <marek.safar@gmail.com>
460
461         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
462         implicitly type local variable only when it is used in a declaration.
463
464 2007-11-15  Marek Safar  <marek.safar@gmail.com>
465
466         * attribute.cs: Use CS0612 for empty strings.
467
468 2007-11-14  Marek Safar  <marek.safar@gmail.com>
469
470         * lambda.cs, statement.cs: Contextual return may act as a statement.
471
472 2007-11-14  Marek Safar  <marek.safar@gmail.com>
473
474         A fix for a regression cause by #324222
475         * class.cs: Don't report unused even when it implements an interface.
476         
477 2007-11-13  Marek Safar  <marek.safar@gmail.com>
478
479         A fix for bug #341205
480         * ecore.cs, expression.cs: Method group expression cannot do static
481         method access with an instance reference check before overloading takes
482         a place.
483         
484 2007-11-13  Marek Safar  <marek.safar@gmail.com>
485
486         A fix for bug #325359
487         * class.cs: Use predictable name for automatically generated property.
488         
489 2007-11-12  Marek Safar  <marek.safar@gmail.com>
490
491         A fix for bug #324996
492         * expression.cs (Is): Handle case where D is nullable and T is not
493         correctly.
494         
495         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
496         
497 2007-11-12  Marek Safar  <marek.safar@gmail.com>
498
499         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
500         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
501         Flush small error reporting changes.
502         
503 2007-11-09  Marek Safar  <marek.safar@gmail.com>
504
505         A fix for bug #324996
506         * expression.cs: Rewrote Is expression implementation to work with
507         generics, nullable types, anonymous method. A const result expression 
508         uses existing infrastructure instead of custom not fully-featured one.
509         
510 2007-11-08  Marek Safar  <marek.safar@gmail.com>
511
512         A fix for bug #340202
513         * class.cs: Consider generics for volatile field.
514
515 2007-11-08  Marek Safar  <marek.safar@gmail.com>
516
517         A fix for bug #335594
518         * expression.cs: Use conversion rules when handling string addition.
519         
520 2007-11-07  Marek Safar  <marek.safar@gmail.com>
521
522         A fix for bug #336651
523         * expression.cs: Fixed a crash when probing is on.
524         
525 2007-11-07  Marek Safar  <marek.safar@gmail.com>
526
527         A fix for bug #324242
528         * covert.cs: Added a conversion from any nullable-type with an 
529         underlying enum-type to the type System.Enum.
530         
531 2007-11-07  Marek Safar  <marek.safar@gmail.com>
532
533         A fix for bug #324222
534         * class.cs: Report all non-used event fields.
535         
536 2007-11-07  Marek Safar  <marek.safar@gmail.com>
537
538         A fix for bug #325161
539         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
540         qualifier for generic types.
541         
542 2007-11-07  Marek Safar  <marek.safar@gmail.com>
543
544         A fix for bug #322971
545         * expression.cs, ecore.cs: Added intermediate result value check for
546         indexers. 
547         
548 2007-11-07  Marek Safar  <marek.safar@gmail.com>
549
550         A fix for bug #324754
551         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
552         when it was requested.
553
554 2007-11-07  Marek Safar  <marek.safar@gmail.com>
555
556         A fix for bug #325101
557         * expression.cs: Do type not value comparison for `is' expression.
558
559 2007-11-07  Marek Safar  <marek.safar@gmail.com>
560
561         A fix for bug #320236
562         * convert.cs: Don't apply user conversion on underlying target type.
563
564 2007-11-06  Marek Safar  <marek.safar@gmail.com>
565
566         * expression.cs: Don't use unresolved expression for error reporting.
567  
568 2007-11-06  Marek Safar  <marek.safar@gmail.com>
569
570         A fix for bugs #337712, #324490
571         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
572         overloading resolution too.
573         
574         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
575         the process consistent and more robust.
576         
577         * expression.cs, linq.cs, report.cs: Update.
578
579 2007-11-02  Marek Safar  <marek.safar@gmail.com>
580
581         A fix for bug #332909
582         * attribute.cs: Resolve attributes in correct context using error
583         handling procedure.
584         
585         * rootcontext.cs: Define Obsolete attribute members as core members.
586         
587 2007-11-02  Marek Safar  <marek.safar@gmail.com>
588
589         * statement.cs: Removed unused methods.
590         
591 2007-10-31  Wade Berrier  <wberrier@novell.com>
592
593         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
594         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
595         during 'make dist')
596
597 2007-10-31  Marek Safar  <marek.safar@gmail.com>
598
599         A fix for bug #338102
600         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
601         methods registered as non-generics.
602         
603 2007-10-31  Marek Safar  <marek.safar@gmail.com>
604
605         A fix for bugs #337712, #324490
606         * delegate.cs: Delegate covariance and contravariance is not allowed for
607         value types.
608         
609 2007-10-31  Marek Safar  <marek.safar@gmail.com>
610
611         A fix for bug #337719 
612         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
613         `from' keyword.
614         
615 2007-10-30  Marek Safar  <marek.safar@gmail.com>
616  
617         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
618
619 2007-10-29  Marek Safar  <marek.safar@gmail.com>
620  
621         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
622         query expressions.
623
624 2007-10-29  Raja R Harinath  <rharinath@novell.com>
625
626         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
627
628 2007-10-29  Marek Safar  <marek.safar@gmail.com>
629  
630         A fix for bug #334652
631         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
632         extension methods when we have not found the best candidate in normal
633         container.
634
635 2007-10-27  Marek Safar  <marek.safar@gmail.com>
636
637         * AssemblyInfo.cs: Keep up-to-date.
638
639 2007-10-27  Marek Safar  <marek.safar@gmail.com>
640
641         * Makefile: Fixed generics compiler name.
642         
643 2007-10-27  Marek Safar  <marek.safar@gmail.com>
644
645         * lambda.test: removed, lambda parsing is done differently.
646         
647         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
648
649 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
650
651         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
652
653 2007-10-27  Marek Safar  <marek.safar@gmail.com>
654
655         * Makefile, *.sources : All C# compilers are in mcs folder.
656         
657         * *.cs: Use existing 2_1 define for smcs.
658
659 2007-10-26  Marek Safar  <marek.safar@gmail.com>
660
661         A fix for bug #335847
662         * assign.cs, expression.cs: Couple of changes to avoid creating a
663         temporary variable for each object initializer assignment statement. It
664         simplifies struct initialization too, otherwise two temporary variables
665         would be required.
666         Implemented optimization of redundant default element initializers.
667         
668 2007-10-25  Marek Safar  <marek.safar@gmail.com>
669
670         A fix for bug #336766
671         * expression.cs (Class.CheckBase): Use generic name when method is
672         generic.
673         
674 2007-10-25  Marek Safar  <marek.safar@gmail.com>
675
676         A fix for bug #334737
677         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
678         variable and not variable argument for prepared copies.
679
680 2007-10-24  Marek Safar  <marek.safar@gmail.com>
681
682         A fix for bug #325110
683         * class.cs, expression.cs, attribute.cs: Use open generic method when
684         checking conditional attribute.
685         
686 2007-10-24  Marek Safar  <marek.safar@gmail.com>
687
688         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
689         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
690         FeatureIsNotAvailable.
691
692 2007-10-24  Marek Safar  <marek.safar@gmail.com>
693
694         ** C# 3.0 Partial methods
695         
696         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
697         methods support. Because of member cache issue with generics only
698         non-generics partial methods are fully supported.
699         
700 2007-10-23  Marek Safar  <marek.safar@gmail.com>
701         
702         * class.cs, decl.cs: Rewrote member overloads check to cope with 
703         generics and to use member cache for member checking. It also improves
704         performance and fixes remaining overloads issues.
705         
706 2007-10-20  Marek Safar  <marek.safar@gmail.com>
707         
708         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
709         roottypes.cs, typemanager.cs:
710                 
711         A member cache creation logic changed to add members immediately and
712         not rely on fallback. The member cache is now only prefered way
713         how to access and find type declaration members. It saves 5 MB of memory
714         during MWF compilation and makes code ready for more optimizations and
715         clean-ups, it's also a pre-requirement for partial methods.
716         
717 2007-10-18  Raja R Harinath  <harinath@gmail.com>
718
719         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
720         handling for generic parameters.
721
722 2007-10-15  Marek Safar  <marek.safar@gmail.com>
723         
724         * class.cs (FixedField): Removed redundant volatile check.
725         
726 2007-10-15  Marek Safar  <marek.safar@gmail.com>
727         
728         * class.cs, decl.cs: Fixed overload members verification to do only one
729         check per possible collision.
730         
731 2007-10-13  Marek Safar  <marek.safar@gmail.com>
732         
733         A fix for bug #325478
734         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
735         and create only one disposable flags container.
736         
737 2007-10-12  Marek Safar  <marek.safar@gmail.com>
738         
739         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
740         * statement.cs (Fixed): Fixed variables cloning.
741         
742 2007-10-12  Marek Safar  <marek.safar@gmail.com>
743         
744         A fix for bug #333342
745         * class.cs (EventField): Don't mark value type event as synchronized. 
746         
747 2007-10-12  Marek Safar  <marek.safar@gmail.com>
748         
749         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
750         inference to identify best candidate method correctly.
751         (ProperyExpr): A range variable is read only and cannot be modified.
752         
753 2007-10-11  Marek Safar  <marek.safar@gmail.com>
754         
755         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
756         logic to identify best candidate method correctly.
757         
758 2007-10-11  Marek Safar  <marek.safar@gmail.com>
759         
760         * location.cs (Equals, GetHashCode): Removed.
761         
762 2007-10-11  Marek Safar  <marek.safar@gmail.com>
763         
764         * report.cs: Implemented message recorder. It is used mainly for lambda
765         expressions to capture otherwise swallowed error messages.
766         
767         * anonymous.cs, lambda.cs.cs: Do full parameters check.
768
769         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
770         and not at the top.
771         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
772                 
773         * expression.cs (MemberAccess): Always report lookup failure.
774         
775         * location.cs: Implemented Equals, GetHashCode.
776         
777         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
778         
779 2007-10-10  Jb Evain  <jbevain@novell.com>
780
781         * codegen.cs: re-enable assembly version check.
782
783 2007-10-09  Marek Safar  <marek.safar@gmail.com>
784         
785         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
786         checks.
787         
788         * namespace.cs (UsingAlias): Do correct version check.
789         
790 2007-10-08  Marek Safar  <marek.safar@gmail.com>
791         
792         * expresison.cs, ecore.cs: Issue extension method error message when
793         appropriate.
794         
795         * rootcontext.cs: Added ISO_2 compiler mode option.
796
797 2007-10-08  Marek Safar  <marek.safar@gmail.com>
798         
799         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
800          message.
801         
802 2007-10-08  Marek Safar  <marek.safar@gmail.com>
803         
804         * attribute.cs (GetString, GetBoolean): Work with both literal and
805         constant.
806         
807         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
808         Moved method overload specific methods to MethodGroupExpr.
809         
810         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
811         it should be less memory consuming.
812         
813 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
814
815         * codegen.cs: remove the assembly version check until the buildbot is
816         fixed.
817
818 2007-10-07  Jb Evain  <jbevain@novell.com>
819
820         * attribute.cs (Attribute.GetString): if the value
821         expression is a StringConstant, return its string value.
822
823 2007-10-07  Jb Evain  <jbevain@novell.com>
824
825         * typemanager.cs: add `assembly_version_attribute_type`.
826         * codegen.cs: on attribute emission, check that the
827         AssemblyVersionAttribute doesn't overflow.
828
829 2007-10-05  Marek Safar  <marek.safar@gmail.com>
830         
831         A fix for bug #324677
832         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
833         parent container of a scope container with currently resolved one. 
834         
835 2007-10-05  Marek Safar  <marek.safar@gmail.com>
836         
837         A fix for bug #325534
838         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
839         only.
840         
841 2007-10-05  Marek Safar  <marek.safar@gmail.com>
842         
843         A fix for bug #327504
844         * class.cs (Operator.Define): Refactored implicit and explicit user
845         operator conversion rules.
846         
847 2007-10-05  Marek Safar  <marek.safar@gmail.com>
848         
849         A fix for bug #327520
850         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
851         
852 2007-10-04  Marek Safar  <marek.safar@gmail.com>
853         
854         A fix for bug #328022
855         * class.cs (MethodData.Define): Use correct method to check whether
856         a method implementents an accessor.
857         
858 2007-10-04  Marek Safar  <marek.safar@gmail.com>
859         
860         A fix for bug #330069
861         * statement.cs (Fixed.Resolve): Read the first array element only when
862         an array is instantiated. 
863         
864 2007-10-04  Marek Safar  <marek.safar@gmail.com>
865         
866         * expression.cs, assign.cs, generics.cs: Print correct operator when
867         compound assignment is used.
868         
869 2007-10-04  Marek Safar  <marek.safar@gmail.com>
870         
871         A fix for bug #325841
872         * expression.cs (ArrayAccess): Use full argument cloning only for
873         string compound concatenation.
874         
875 2007-10-03  Marek Safar  <marek.safar@gmail.com>
876         
877         A fix for bug #328774
878         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
879         assignment.
880         (PropertyExpr.EmitAssign): Fixed string concatenation compound
881         assignment.
882
883 2007-10-03  Raja R Harinath  <rharinath@novell.com>
884
885         Fix #328490
886         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
887         Event accessibility checks here.  Remove some bogus code that
888         accidently made GenericMethods work.
889         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
890
891 2007-09-25  Marek Safar  <marek.safar@gmail.com>
892         
893         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
894         
895         * statement.cs (Block): Refactored AddVariable to allow error handling
896         customization.
897         
898         * generic.cs: New stub.
899         
900 2007-09-23  Marek Safar  <marek.safar@gmail.com>
901         
902         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
903         flag.
904         
905 2007-09-17  Marek Safar  <marek.safar@gmail.com>
906
907         * class.cs: Use partial container to record whether any partial part
908         contains static field initializer and therefore default contructor has
909         to be defined.
910         
911 2007-09-14  Marek Safar  <marek.safar@gmail.com>
912
913         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
914         mono-list when only one of two partial parts has defined accessibility
915         modifier.
916         
917 2007-09-14  Marek Safar  <marek.safar@gmail.com>
918
919         A fix for bug #82845
920         
921         * class.cs (TypeContainer): Set correct resolve context for all field
922         initializers.
923         
924 2007-09-13  Marek Safar  <marek.safar@gmail.com>
925
926         * assign.cs: Fixed a crash when field is resolved twice with an error.
927         
928         * codegen.cs: Changed InFieldInitializer to be flag.
929         
930         * anonymous.cs, ecore.cs, expression.cs: Update after
931         IsInFieldInitializer rename.
932         
933         * const.cs: Removed unused parameter.
934         
935         * class.cs: Changed the way how we resolve and emit field initializers.
936         The field initilizers have to have access to contructor block to emit
937         compiler generated code.
938
939 2007-09-13  Marek Safar  <marek.safar@gmail.com>
940
941         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
942         generics use TypeContainer instead.
943         
944 2007-09-12  Marek Safar  <marek.safar@gmail.com>
945         
946         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
947
948         * lambda.cs (ResolveParameters): Use more powerful
949         InflateGenericArgument.
950         
951         * parameters.cs: Better exception message.
952                 
953 2007-09-10  Marek Safar  <marek.safar@gmail.com>
954
955         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
956         correct expression block type. 
957         
958         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
959         
960         * expression.cs (Invocation): Extracted method group resolve to
961         DoResolveOverload.
962         
963 2007-09-07  Marek Safar  <marek.safar@gmail.com>
964
965         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
966         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
967         
968         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
969         generic extension methods.
970
971 2007-09-06  Marek Safar  <marek.safar@gmail.com>
972
973         A fix for bug #82676 (Do I get it right now?)
974         * convert.cs (Binary.ResolveOperator): An interface is converted to the
975         object before a standard conversion is applied.
976         
977 2007-09-06  Marek Safar  <marek.safar@gmail.com>
978
979         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
980         #82676.
981         
982 2007-09-05  Marek Safar  <marek.safar@gmail.com>
983
984         A fix for bug #82676
985         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
986         non-generic interface types.
987         
988 2007-09-05  Marek Safar  <marek.safar@gmail.com>
989
990         A fix for bug #82690
991         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
992         
993 2007-09-05  Marek Safar  <marek.safar@gmail.com>
994
995         A fix for bug #82571
996         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
997         modifier for container based methods.
998         
999 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1000
1001         A fix for bug #82676
1002         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1003         any interface-type T means to any of interface type T.
1004
1005 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1006
1007         * namespace.cs: We have 2 versions of System.Core assembly.
1008
1009 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1010
1011         A fix for bug #82652
1012         * class.cs (Class.GetClassBases): Compare types and not expressions.
1013
1014 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1015
1016         A fix for bug #82620
1017         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1018         actually never worked before.
1019         (IndexerAccess): Emit prepared arguments before they are modified.
1020         
1021 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1022
1023         A fix for bug #82563
1024         * assign.cs: Revert wrong fix.
1025         
1026         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1027         correctly.
1028         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1029         Instead of ldelema/stdind we have to use temporary variables to handle
1030         cases like String.Concat (params string[]).
1031         
1032 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1033
1034         * class.cs: EmitAttributes to Emit rename.
1035         
1036         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1037         null.
1038         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1039         GetClsCompliantAttributeValue execution.
1040         
1041 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1042
1043         * anonymous.cs: Use shorter type prefix.
1044         
1045         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1046         when exist.
1047         
1048         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1049         variables when probing is on.
1050         
1051         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1052         unresolved variables.
1053         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1054         handle transparent identifiers.
1055         
1056 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1057
1058         * attribute.cs (IsClsCompliant): Add nullable types test.
1059         
1060 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1061
1062         * doc.cs : catch other types of exception than XmlException to
1063           report CS1570. Fixed bug #82565.
1064
1065 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1066
1067         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1068         The number of delegate parameters has to match.
1069         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1070         arrays.
1071
1072 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1073
1074         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1075         to fix problem with private arguments.
1076
1077 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1078
1079         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1080         
1081         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1082         
1083         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1084         empty. Add cloning suport.
1085         
1086         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1087
1088 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1089
1090         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1091         to create EmptyCast. It handles EmptyConstantCast specialization for
1092         constants.
1093         
1094 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1095
1096         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1097         (EmitArrayArgument): One routine for array arguments.
1098         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1099         
1100 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1101
1102         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1103
1104 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1105
1106         * anonymous.cs: MemberLookupFinal update.
1107
1108         * class.cs (ConstructorInitializer): Is expression based.
1109         
1110         * delegate.cs: MethodGroupExpr update.
1111         
1112         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1113         messages.
1114         (Error_MemberLookupFailed): Customizable error override.
1115         (MethodGroupExpr): Keep queried type for later usage.
1116         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1117         resolve.
1118         
1119         * expression.cs: Error_MemberLookupFailed refactoring.
1120         (New.DoResolve): Resolve as much as possible.
1121         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1122         customization for invalid member types.
1123
1124         * statement.cs: MethodGroupExpr update.
1125         
1126 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1127
1128         * modifier.cs (Check): Check all modifiers and not only accessibility
1129         ones.
1130
1131 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1132
1133         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1134         type and not an expression.
1135
1136 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1137
1138         * statement.cs (Catch.Clone): Type and variable can be null.
1139
1140 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1141
1142         A fix for bug #81979
1143         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1144         I am really not sure whether this is the best fix.
1145         
1146         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1147         only once.
1148         
1149 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1150
1151         ** C# 3.0 Object and collection initializers (major re-write)
1152         
1153         * assign.cs (DoResolve): Initializers are not assign related.
1154         
1155         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1156         used during collection or object initialization.
1157         
1158         * expression.cs (Error_InvalidArguments): Add initializers specific
1159         messages. More will come later because it requires some general
1160         refactoring.
1161         (New.DoResolve): Better error handling for unsafe types.
1162         (EmptyExpressionStatement): New class.
1163         (ElementInitializer): An object initializer expression.
1164         (CollectionElementInitializer): A collection initializer expression.
1165         (CollectionOrObjectInitializers): A block of object or collection
1166         initializers.
1167         (NewInitialize): New expression with element/object initializers.
1168         
1169         * statement.cs: Reverted object/collection initializer hacks.
1170         
1171         * typemanager.cs (CSharpName): Filter __arglist type.
1172         
1173 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1174
1175         ** C# 3.0 Anonymous Types (update to the latest standard)
1176         
1177         * expression.cs (Binary.ResolveOperator): Threat all null based types
1178         same.
1179         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1180         (AnonymousTypeParameter): Updated.
1181         
1182         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1183         (AnonymousTypeClass): New anonymous type container.
1184         
1185         * class.cs (AddField): Return operation result.
1186         
1187         * generic.cs: Another empty TypeArguments overload.
1188         
1189         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1190         are stored at top of normal hierarchy.
1191         
1192         * typemanager.cs (CSharpName): Filter anonymous types.
1193         
1194 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1195
1196         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1197         as single Concat call. How could we miss that :-(
1198         
1199 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1200
1201         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1202         
1203 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1204
1205         * expression.cs: Fix the previous commit, the creation of the
1206         arguments array list needs also to be conditional on the arguments
1207         not being null.
1208
1209         * class.cs: Add a little bit of help to help narrow down problems.
1210
1211         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1212         not try to copy in that case. 
1213
1214         * driver.cs: When building SMCS, include a new different set of
1215         default assemblies here.   Do this here so we can control whether
1216         to include the default assemblies with /noconfig.
1217
1218 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1219
1220         A fix for bug #81979
1221         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1222         only.
1223
1224 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1225
1226         A fix for bug #82300
1227
1228         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1229         we are in probing scope.
1230
1231 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1232
1233         A fix for bug #82301
1234
1235         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1236         (Statement.CloneTo): Clone and not map children blocks.
1237
1238 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1239
1240         A fix for bug #82299
1241
1242         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1243         variable too.
1244         
1245         * statement.cs (Statement.CloneTo): Clone variables before statements
1246         to allow remaping of local variables.
1247
1248 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1249
1250         A fix for bug #82296
1251
1252         * anonymous.cs,
1253         * report.cs: Log crash details for future clone problems.
1254         
1255         * statement.cs (Return.Clone): Don't clone non-existent expression.
1256
1257 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1258
1259         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1260         (Class.AddBasesForPart): Move CS0537 check here from ...
1261         * cs-parser.jay (class_declaration): ... here.  Move calling of
1262         'AddBasesForPart' to ...
1263         (class_bases): ... here.
1264         (struct_declaration, interface_declaration): Update to changes.
1265
1266 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1267
1268         A fix for bug #81923
1269
1270         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1271         conversion is allowed.
1272
1273 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1274
1275         A fix for bug #81564
1276
1277         * ecore.cs (EventExpr): Add IsBase handling.
1278
1279         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1280         too.    
1281         
1282 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1283
1284         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1285         * cs-parser.jay: Some whitespace cleanups.
1286         (current_delegate): New.
1287         (type_name): New.
1288         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1289         a dummy code block, and use 'type_name' instead of 'member_name'.
1290         (interface_declaration, class_declaration): Likewise.
1291         (delegate_declaration): Likewise.  Rearrange slightly and use
1292         'current_delegate'.
1293         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1294         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1295
1296 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1297
1298         A fix for bug #82039
1299
1300         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1301         available.
1302
1303         * typemanager.cs (CSharpName): Split to string overload.
1304
1305 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1306
1307         * expression.cs,
1308         * report.cs: Updated warning CS0472.
1309
1310 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1311
1312         A fix for bug #82181
1313         * cs-parser.jay,
1314         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1315
1316 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1317
1318         A fix for bug #82277
1319         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1320
1321 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1322
1323         ** C# 3.0 Type Inference (major bits are working)
1324         
1325         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1326         (.ImplicitStandardConversionExists): Uses compatible.
1327         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1328         (.InferReturnType): New method.
1329         (.Compatible): Refactored.
1330         (.ResolveParameters): Uses factory to create resolved parameters.
1331         (.CompatibleMethod): Add probing mode support.
1332         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1333         clearly distinguish between 2 different operations.
1334         (LambdaMethod): Moved to lambda.cs.
1335         (AnonymousMethod): Removed unused fields and methods.
1336         (AnonymousDelegate): Simplified.
1337         
1338         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1339         
1340         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1341         
1342         * delegate.cs (Delegate): New mehods to reduce code duplication.
1343         (.GetConstructor): New method.
1344         (.GetInvokeMethod): New method.
1345         (DelegateCreation): Updated.
1346         
1347         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1348         does not exist.
1349         (OverloadResolve): Made probing little bit faster.
1350         
1351         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1352         when probing is on.
1353         
1354         * generic.cs (TypeInferenceContext): Dummy implementation.
1355         
1356         * iterators.cs: Updated after Resolve/Define rename.
1357         
1358         * lambda.cs (LambdaExpression)
1359         (.ResolveParameters): Handles both type of arguments and type inference too.
1360         
1361         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1362         (InflateTypes): Updated.
1363         
1364         * support.cs (InflateTypes): Changed signature and updated.
1365         
1366         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1367         (MemberLookup_FindMembers): More MS tricks.
1368         (GetParameterData): Ditto.
1369         (GetDelegateParameters): Uses quick path for dynamic types.
1370         
1371 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1372
1373         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1374         only.
1375
1376 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1377
1378         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1379         syntax.
1380         
1381 2007-07-26  Jb Evain  <jbevain@novell.com>
1382
1383         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1384         which takes a boolean 'report_errors', similar to the GetMethod.
1385         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1386         in .net 2.1, do not report errors here.
1387
1388         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1389         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1390         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1391         in .net 2.1.
1392
1393         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1394         of the type InternalsVisibleToAttribute before the first call
1395         to CoreLookupType which is allowed to fail (third boolean parameter
1396         to true). Because, during the resolution for a type that is not
1397         immediately found, we try to check if the type is not defined in
1398         a friend assembly, and to do so, we need the
1399         InternalVisibleToAttribute.
1400
1401 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1402
1403         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1404         feature that allows structs to be compared against null and inline
1405         the result as true or false.
1406
1407         Notice that the same code is not permitted inside a generic block
1408         of code that would do:
1409
1410         class Foo<T> where T : struct {
1411             bool Eval (T x)
1412             {
1413                  return x == null;
1414             }
1415         }
1416
1417         It is only allowed if the type of T is not bound (no where
1418         clause).   In my opinion, this CSC 2 behavior is broken but people
1419         seem to be using it (IronRuby does, a few bug reports on bugzilla
1420         have it and some people have complained about it).
1421
1422         All of the users that depend on this behavior have code that is
1423         very likely broken. 
1424         
1425         * report.cs (Warning, Error): make these take object arguments,
1426         not strings, as that allows us to take advantage of Format.
1427
1428 2007-07-20  William Holmes  <billholmes54@gmail.com>
1429
1430         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1431           Left member variable for the Count.
1432         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1433           MemberName.CountTypeArguments to avoid a NRE. 
1434
1435         This code is contributed under the MIT X11 license
1436
1437 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1438
1439         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1440
1441 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1442
1443         * doc.cs : generic method arguments are written as ``x while generic
1444           type arguments are `x. Combined with the previous change, fixed bug
1445           #79706.
1446
1447 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1448
1449         Fix #82120
1450         * expression.cs (Binary.ResolveOperator): When converting
1451         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1452
1453 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1454
1455         * doc.cs : when T: or whatever x: is specified, it does not really
1456           check the doc comment's syntax correctness. Fixed bug #82006.
1457
1458 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1459
1460         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1461         LambdaExpression better.
1462         
1463         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1464         
1465         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1466         
1467         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1468         as it can be generated.
1469         
1470         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1471         modifiers.
1472         
1473         * lambda.cs (LambdaExpression): Refactored to share same code with
1474         AnonymousMethodExpression.
1475         
1476 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1477
1478         * anonymous.cs (MakeName): Include host name for easier debugging.
1479         (LambdaMethod): New class for lambda spcecific stuff.
1480         
1481         * attribute.cs: Set EmitContext return type.
1482
1483         * class.cs: Set EmitContext return type.
1484         
1485         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1486         with null/void meaning.
1487         
1488         * iterators.cs (ContainerType): Implemented.
1489         
1490         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1491         
1492         * statement.cs (Return): Updated to lambda expressions.
1493         (Block.CloneTo): Parent can be null.
1494                 
1495 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1496
1497         A fix for bug #81917
1498         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1499         
1500         * class.cs (FixedField): Check whether field is in unsafe scope.
1501
1502         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1503         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1504
1505         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1506         FieldExpr.
1507         
1508         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1509                 
1510 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1511
1512         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1513         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1514         from Report class.
1515
1516 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1517
1518         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1519         
1520 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1521
1522         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1523         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1524         
1525         * codegen.cs(EmitContext): Add ProbingMode flag.
1526         
1527         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1528         
1529         * driver.cs: For now set both warning values.
1530         
1531         * ecore.cs (SimpleName): Name is readonly.
1532         (MethodGroup.OverloadResolve): One quick path for probing.
1533         
1534         * expression.cs (Unary): Set Oper r/o.
1535         (Binary): Set Oper r/o.
1536         (ParameterReference): Set few instance variables as r/o.
1537         (ParameterReference.DoResolveBase): Don't capture aruments when 
1538         the probing is on.
1539         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1540         (Arglist): arguments are private.
1541         (SizeOf): type is private and r/o.
1542         (MemberAccess): arguments are private.
1543
1544         * report.cs: Enhanced reporting on/off capabilities.
1545         
1546         * lambda.cs: Uses ec.IsInProbingMode.
1547         (ContextualReturn): Derives from return.
1548         
1549         * rootcontext.cs: For now set both warning values.
1550         
1551         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1552         copy if one exists.
1553         (Return.Resolve): Don't die immediately.
1554         (Block.Resolve): Speed-up probing.
1555         (Block.CloneTo): Clone only child blocks.
1556
1557 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1558
1559         * iterators.cs: reverted Miguel's latest change (r81925) as it
1560         breaks the build in System.
1561
1562 2007-07-13  Miguel de Icaza  <miguel@novell.com>
1563
1564         * iterators.cs (Yield.CheckContext): Check for the iterator type
1565         also here as we can call into Yield even in codepaths that are not
1566         directly checked by
1567         (MethodOrOperator is the only path that was checked).
1568
1569         In addition to the standard check, use a more specific check for
1570         constructors to report a more verbose error. 
1571
1572 2007-07-12  Miguel de Icaza  <miguel@novell.com>
1573
1574         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1575         report the warning and continue 
1576
1577         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1578         values on the stack on the call to Emit.   Use EmitStatement if
1579         possible, or using Emit + Pop if not possible.   Fixes #82064
1580
1581 2007-07-12  Raja R Harinath  <rharinath@novell.com>
1582
1583         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1584         avoid try...finally in some cases.
1585
1586 2007-07-10  Marek Safar  <marek.safar@gmail.com>
1587
1588         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1589         
1590         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1591         instead of method. Re-use standard error handling.
1592         (ConstructorInitializer.Emit): Simplified.
1593         
1594         * delegate.cs: Updated after Invocation.EmitCall change.
1595         
1596         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1597         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1598         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1599         method and don't permanently changing input arguments.
1600         (MethodGroupExpr): Introduced resolved best_candidate, when method group
1601         is resolved it has one of the candidates is the best one which is later
1602         used to emit. Removed a few unused method.
1603         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1604
1605         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1606         (Binary.ResolveOperator): Ditto.
1607         (ConditionalLogicalOperator.DoResolve): Ditto.
1608         (Invocation): Uses method group.
1609         (Invocation.DoResolve): Simplified.
1610         (Invocation.EmitCall): Removed useless is_static.
1611         (Invocation.Emit): Delegate to method group.
1612         (Invocation.EmitStatement): Simplified.
1613         (New): Uses method group.
1614         (MemberAccess.DoResolve): Don't destroy original expression.
1615         
1616         * statement.cs (ForEach.Resolve): Use null for no method arguments.
1617         
1618 2007-07-04  Marek Safar  <marek.safar@gmail.com>
1619
1620         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1621         
1622         * anonymous.cs,
1623         * lambda.cs: Add custom error message type.
1624
1625 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1626
1627         * lambda.cs: Simplified little bit.
1628         
1629         * parameter.cs: Introduced ImplicitLambdaParameter.
1630         (Parameters.CreateFullyResolved): New factory instead of ctor.
1631         
1632         * anonymous.cs,
1633         * class.cs,
1634         * delegate.cs: Updated parameter creation.
1635         
1636 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1637
1638         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1639         arguments.
1640         
1641         * generic.cs: Synchronized with gmcs.
1642         
1643 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1644
1645         * class.cs (Indexer): Check return type as soon as possible.
1646         
1647         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1648         members too.
1649         
1650         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1651         
1652         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1653         
1654         * parameter.cs (Parameter): Use expression type when it is available.
1655         
1656         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1657         method modifier for the first parameter only.
1658
1659 2007-06-24  Marek Safar  <marek.safar@gmail.com>
1660
1661         A fix for bug #81938
1662         * typemanager.cs (ChangeType): Fixed couple of char conversions.
1663         
1664         * constant.cs: Tide up an exception message.
1665
1666 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1667
1668         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1669         an uninitialized variable is used.
1670         
1671         * expression.cs (LocalVariableReference.DoResolve): Ditto.
1672
1673 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1674
1675         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1676         not found error handling.
1677
1678         * expression.cs (ArrayCreation): Removed redundant fields and little bit
1679         simplified.
1680         (ArrayCreation.ResolveArrayElement): To be ready to customization.
1681         (ArrayCreation.DoResolve): Simplified.
1682         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1683         its own resolve process.
1684         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1685
1686 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1687
1688         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1689         more error details.
1690         
1691 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1692
1693         * cs-tokenizer.cs: Removed var related stuff.
1694         
1695         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1696         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1697         a type and a keyword at same time.
1698         
1699         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1700         matches to "var".
1701         
1702         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1703         implicitly typed arrays, more changes will follow.
1704         
1705         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1706         
1707 2007-06-19  Marek Safar  <marek.safar@gmail.com>
1708
1709         * ecore.cs (VarExpr): Removed Handled field.
1710         
1711         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1712         build-in assign functionality.
1713         (ForEach.Resolve): Removed all implicitly typed local variable code and
1714         simplified.
1715         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1716         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1717
1718 2007-06-18  Marek Safar  <marek.safar@gmail.com>
1719
1720         * assign.cs: Removed implicitly typed local variable check.
1721         
1722         * expression.cs (LocalVariableReference.DoResolve): Add check for self
1723         referencing implicitly typed local variable.
1724         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1725         variable here.
1726         
1727         * statement.cs (Fixed): Removed unsupported implicitly typed local
1728         variable code.
1729
1730 2007-06-15  Marek Safar  <marek.safar@gmail.com>
1731
1732         * decl.cs (MemberName): Moved all Unbound stuff to parser.
1733
1734 2007-06-14  Marek Safar  <marek.safar@gmail.com>
1735
1736         A fix for bugs #81855 and #76274
1737         * attribute.cs (AttachTo): Always set owner for global attributes to
1738         prefined owner.
1739         
1740         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1741         usefull too.
1742         
1743         * cs-parser.jay: Assembly and module attributes must precede all other
1744         elements except using clauses and extern alias declarations.
1745
1746 2007-06-13  Marek Safar  <marek.safar@gmail.com>
1747
1748         A fix for bug #81748
1749         * cs-tokenizer.cs,
1750         * expression.cs: More checks for non ISO-1 features.
1751
1752 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1753
1754         A fix for bug #81807
1755         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1756         present inside switch statement and it is required by nullable check.
1757
1758 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1759
1760         A fix for bug #81840
1761         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
1762         when type matching fails.
1763         
1764         * namespace.cs: Tiny error message change.
1765
1766 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1767
1768         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
1769         reporting. Added automatic property check.
1770         
1771         * class.cs: Updated after CheckAbstractAndExtern relocation.
1772         (AEventPropertyAccessor.GetSignatureForError): Customized.
1773         
1774 2007-06-11  Marek Safar  <marek.safar@gmail.com>
1775
1776         * class.cs (DefineBaseTypes): Base type can be undefined.
1777         
1778         * ecore.cs (TypeLookup): Minor refactoring.
1779         (DoResolveAsTypeStep): Removed redundant check.
1780
1781         * namespace.cs (Lookup): Removed redundant check.
1782                 
1783         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
1784         ResolveAsTypeTerminal step.
1785         (BootstrapCorlib_*): Simplified.
1786         (PopulateCoreType): Core types can be now external.
1787
1788 2007-06-07  Marek Safar  <marek.safar@gmail.com>
1789
1790         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
1791          verification only.
1792          (InferTypeArguments): Infers anonymous expression type arguments.
1793          (Compatible): Split to Compatible and InferTypeArguments. 
1794         
1795         * lambda.cs: Updated.
1796
1797 2007-06-08  Marek Safar  <marek.safar@gmail.com>
1798
1799         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
1800
1801 2007-06-07  Raja R Harinath  <harinath@gmail.com>
1802
1803         Fix #80477, cs0135-2.cs, cs0135-3.cs
1804         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
1805         names to the "known" variables list.
1806         (Block.CheckInvariantMeaningInBlock): Handle the fact the
1807         parameter names are also "known".
1808         (Block.CheckError136): Remove.
1809         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
1810         null.
1811
1812 2007-06-07  Marek Safar  <marek.safar@gmail.com>
1813
1814         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
1815
1816 2007-06-06  Marek Safar  <marek.safar@gmail.com>
1817
1818         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
1819         internal error not an user error.
1820          
1821         * expression.cs (IsApplicable): Refactored to make debugging easier.
1822
1823         * support.cs: More tricks for non-mono runtimes.
1824         
1825         * typemanager.cs (CoreLookupType): Made public.
1826         (InitSystemCore): All linq specific stuff moved to linq.cs
1827
1828 2007-06-05  Marek Safar  <marek.safar@gmail.com>
1829
1830         * typemanager.cs (CSharpSignature): One more missing build-in types
1831         replacement.
1832         More tricks for non-mono runtime.
1833
1834 2007-06-05  Raja R Harinath  <harinath@gmail.com>
1835
1836         * statement.cs (Block.CheckError136_InParents): Remove.
1837         (Block.AddVariable): Use GetParameterInfo instead.
1838         (ToplevelBlock.ProcessArguments): Likewise.
1839
1840 2007-06-04  Raja R Harinath  <rharinath@novell.com>
1841
1842         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
1843         information too.
1844         (ToplevelBlock.GetParameterInfo): Split out of ...
1845         (ToplevelBlock.GetParameterRefernce): ... this.
1846         (ToplevelBlock.ParameterMap): Remove.
1847         * expression.cs (ParameterReference): Update to use
1848         ToplevelParameterInfo.
1849
1850         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
1851         regression.
1852
1853         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
1854         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
1855
1856         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
1857         (ToplevelBlock.ProcessParameters) ... here.
1858         (ToplevelBlock..ctor): Invoke it.
1859
1860         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
1861         new parameters.
1862
1863         * statement.cs (IKnownVariable): New interface.
1864         (LocalInfo): Implement it.
1865         (ToplevelParameterInfo): New class.
1866         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
1867         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
1868         GetKnownVariableInfo.
1869
1870 2007-06-03  Raja R Harinath  <harinath@gmail.com>
1871
1872         Partly speed up CS0136 error checks.
1873         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
1874         'recurse' parameter.
1875         (Block.DoCheckError136): Only check errors in parameters.  Move
1876         local variable checks ...
1877         (Block.AddVariable): ... here, and ...
1878         (ToplevelBlock.ResolveMeta): ... here.
1879
1880 2007-06-02  Raja R Harinath  <harinath@gmail.com>
1881
1882         * statement.cs (Block.IsChildOf): Remove.
1883
1884         * statement.cs (Statement.Clone): Move special case code ...
1885         (Block.CloneTo): ... here.
1886
1887 2007-05-29  Raja R Harinath  <rharinath@novell.com>
1888
1889         * statement.cs (ToplevelBlock.container): Remove field.  It's
1890         redundant with 'Parent'.
1891         (ToplevelBlock.ContainerBlock): Remove accessor.
1892         (ToplevelBlock..ctor): Update to changes.  Register anonymous
1893         child with parent here, ...
1894         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
1895         current_block.
1896         (start_anonymous): Don't save current_block.
1897         (top_current_block): Remove.
1898
1899         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
1900         (Block.Resolve): Update to changes.
1901         (Block..ctor): Move setting of "correct" 'Toplevel'
1902         and 'Explicit' fields to ...
1903         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
1904
1905 2007-05-27  Raja R Harinath  <harinath@gmail.com>
1906
1907         Kill Block.Implicit
1908         * statement.cs (Block.Implicit): Remove.
1909         (Block): Update to changes.
1910         * flowanalysis.cs: Likewise.
1911
1912         Mildly speed up CheckInvariantMeaningInBlock
1913         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
1914         Recursively call AddKnownVariable to all enclosing blocks.
1915         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
1916         Remove recursive calls.
1917         (Block): Update to changes.
1918
1919         New ExplicitBlock invariants
1920         * statement.cs (Block.Explicit): New field.  It points to the
1921         immediately enclosing non-implicit block.
1922         (Block..ctor): Maintain the invariant.
1923         * cs-parser.jay: Take advantage of invariant.
1924
1925         Introduce ExplicitBlock
1926         * statement.cs (ExplicitBlock): New.
1927         (ToplevelBlock): Derive from it.
1928         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
1929         sense of flag.
1930         (Block.Implicit): Update to changes.
1931         * cs-parser.jay: Update to changes.
1932
1933         Remove unused field
1934         * codegen.cs (EmitContext.IsLastStatement): Remove.
1935         * statement.cs (Block.DoEmit): Update to changes.
1936
1937 2007-05-25  Raja R Harinath  <rharinath@novell.com>
1938
1939         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
1940         modifying current_block directly.
1941
1942 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
1943         
1944         * class.cs: Implemented automatic properties (C# 3.0)
1945           Thanks to Marek for the help.
1946
1947 2007-05-23  Raja R Harinath  <rharinath@novell.com>
1948
1949         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
1950         variable as assigned, note also that all its components are
1951         assigned too.
1952         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
1953
1954 2007-05-19  Marek Safar  <marek.safar@gmail.com>
1955
1956         * anonymous.cs, class.cs: Emit Compiler generated attribute when
1957         member is marked as compiler generated.
1958         
1959         * decl.cs (MemberCore): Refactored ModFlags into property.
1960
1961         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
1962         (Check): Check only accessibility modifiers.
1963
1964 2007-05-18  Raja R Harinath  <rharinath@novell.com>
1965
1966         Track all assignable slots in one bit array
1967         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
1968         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
1969         logic from VariableMap constructor here.  Use the same 'offset'
1970         variable that's later used for computing offsets of local
1971         variables.
1972         * flowanalysis.cs (UsageVector.parameters): Remove.
1973         (UsageVector): Update to changes.
1974         (VariableMap): Remove.
1975
1976         Avoid creating ParameterMap in every block
1977         * statement.cs (Block.ParameterMap): Move ...
1978         (ToplevelBlock.ParameterMap): ... here.
1979         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
1980         only once.
1981         * flowanalysis.cs (FlowBranching.param_map): Remove.
1982         (FlowBranching.UsageVector): Update to changes.
1983         (FlowBranchingToplevel.CheckOutParameters): Likewise.
1984
1985         * statement.cs (Block.CloneTo): Clone Toplevel field too.
1986
1987         * expression.cs (ParameterReference): Distinguish between block
1988         where parameter was referenced and declared.
1989
1990 2007-05-18  Marek Safar  <marek.safar@gmail.com>
1991
1992         * flowanalysis.cs, statement.cs: Put back improved error handling.
1993
1994 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
1995         
1996         * assign.cs:
1997         * expression.cs:
1998           Imporved object and collection initialization (C# 3.0).
1999
2000 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2001
2002         A fix for bug #81380
2003         * expression.cs (Is.DoResolve): Only value types have constant `is'
2004         behaviour.
2005
2006 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2007
2008         * statement.cs (ToplevelBlock.child): Remove.
2009
2010 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2011
2012         Rationalize ResolveMeta: refactoring
2013         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2014         out constant handling code into ...
2015         (Block.DoResolveConstants): ... this.
2016
2017         Rationalize ResolveMeta: kill local_map
2018         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2019         (Block.AssignableSlots): New.
2020         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2021         for locals -- move code from VariableMap here.  Avoid unnecessary
2022         allocations.
2023         * flowanalysis.cs (FlowBranching.local_map): Remove.
2024         (FlowBranching..ctor): Use Block.AssignableSlots.
2025         (VariableMap): Remove unused constructors.
2026
2027 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2028
2029         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2030
2031 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2032
2033         * typemanager.cs (IsFriendAssembly): Should not be called for building
2034         assembly.
2035
2036 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2037
2038         * literal.cs (NullConstant): Print null in all cases.
2039         
2040         * expression.cs (Binary.ResolveOperator): Implemented delegate
2041          comparison based on C# 2.0 changes.
2042
2043 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2044
2045         This code is contributed under the MIT X11 license
2046         
2047         The following enables support for several C# 3.0 language features:
2048         
2049         * cs-tokenizer.cs: Added support for the "var" keyword.
2050         
2051         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2052           Added VarExpr class to facilitate type inferencing.
2053         
2054         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2055           to support anonymous types.
2056         
2057         * assign.cs: Added support for type inferencing and initialization.
2058         
2059         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2060         
2061         * expression.cs: Added implicit array support to ArrayCreation.
2062           Added 5 types and 1 interface:
2063           
2064           IInitializable                Implementing classes can inject initializing
2065                                         statements after object instantiation.
2066           
2067           Initializer                   Stores data for object initialization.
2068           
2069           AnonymousType                 An expression for anonymous types.
2070           
2071           AnonymousTypeParameter        Stores data about an anonymous type's field.
2072           
2073           NewInitialize                 An expression for object initialization.
2074           
2075           CollectionInitialize          An expression for collection initialization.
2076         
2077         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2078           statements.
2079
2080 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2081
2082         A fix for bug #81500
2083         * cs-tokenizer.cs: Add special handling for coalescing operator.
2084
2085 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2086
2087         A fix for bug #81529
2088         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2089         its value from base class until it is redefined.
2090
2091 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2092
2093         Fix regression in cs0631-3.cs
2094         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2095         fallback.  Make error fallback catch more cases.
2096
2097 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2098
2099         * cs-parser.jay: Allow parameters in operator declarations to have
2100         attributes. 
2101
2102 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2103
2104         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2105         exists. 
2106
2107         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2108         inside the ContextualReturn, it does not have to be an
2109         ExpressionStatement. 
2110
2111 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2112
2113         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2114         set, set it.
2115
2116 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2117
2118         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2119         method in two methods: ResolveNoDefine and Resolve.
2120
2121         ResolveNoDefine will stop just after ResolveTopBlock has been
2122         called.   
2123
2124         Resolve will then continue by creating a method and issuing the
2125         call to method.Define ().
2126
2127         (AnonymousMethod): Split and implement the new Resolve and
2128         ResolveNoDefine as well.
2129
2130         * lambda.cs (LambdaExpression): Split the anonymous method
2131         resolution code into a separate routine (CoreCompatibilityTest)
2132         from DoCompatibleTest.
2133
2134         (LambdaExpression.TryBuild): New method, this method tries to
2135         build the LambdaExpression with the given set of types to be used
2136         as the types for the various parameters of the lambda expression. 
2137
2138         If the compilation succeed with the given types, the infered type
2139         of the Anonymous method is returned, otherwise null is returned.
2140
2141 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2142
2143         A fix for bug #81414
2144         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2145
2146 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2147
2148         * cs-tokenizer.cs: Change various identifiers here from the
2149         camelCasing to the recommended Linux-like style for instance
2150         variables from the Coding Guidelines. 
2151
2152 2007-04-19  Martin Baulig  <martin@ximian.com>
2153
2154         * convert.cs
2155         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2156         System.Enum to System.ValueType.
2157
2158 2007-04-13  Martin Baulig  <martin@ximian.com>
2159
2160         Rewrote implicit reference conversions.  We need to distinguish
2161         between implicit reference conversions (13.1.4) and implicit
2162         boxing conversions (13.1.5).
2163
2164         According to the spec, there's an an implicit conversion
2165         "From a one-dimensional array-type S[] to IList<T> and base
2166         interfaces of this interface, provided there is an implicit
2167         reference conversion from S to T."  Note that this does not
2168         include boxing conversions.
2169
2170         * convert.cs
2171         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2172         (Convert.ImplicitReferenceConversion): Split into
2173         ImplicitReferenceConversionCore() and
2174         ImplicitBoxingConversionExist().
2175         (Convert.ImplicitReferenceConversionExists): Use the new
2176         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2177
2178 2007-04-12  Martin Baulig  <martin@ximian.com>
2179
2180         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2181         `TypeManager.null_type' checks up to the top of the method.
2182
2183 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2184
2185         A fix for bug #81350
2186         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2187         extension methods.
2188
2189 2007-04-11  Martin Baulig  <martin@ximian.com>
2190
2191         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2192         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2193         to make this work for generic classes; fixes #79561.
2194
2195 2007-04-11  Martin Baulig  <martin@ximian.com>
2196
2197         * expression.cs (As): Add support for nullable types; fixes #79371.
2198
2199 2007-04-11  Martin Baulig  <martin@ximian.com>
2200
2201         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2202         `type.FullName' is null; fixes #80243.
2203
2204 2007-04-11  Martin Baulig  <martin@ximian.com>
2205
2206         * expression.cs (Invocation.IsApplicable): Don't modify the method
2207         if type inference succeeded, but the method was not applicable.
2208         Fixes #81250.
2209
2210 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2211
2212         A fix for bug #81324
2213         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2214         internal and external namespaces containers.
2215
2216 2007-04-10  Martin Baulig  <martin@ximian.com>
2217
2218         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2219         TypeManager.DropGenericMethodArguments() so we also call
2220         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2221
2222 2007-04-10  Martin Baulig  <martin@ximian.com>
2223
2224         * iterators.cs (Iterator.CreateIterator): Don't crash if
2225         `method.ReturnType' is null.  This happens if something went wrong
2226         while resolving that typ (we already reported an error in this case).
2227
2228 2007-04-10  Martin Baulig  <martin@ximian.com>
2229
2230         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2231         generic interfaces; report the CS0144 directly.
2232
2233 2007-04-10  Martin Baulig  <martin@ximian.com>
2234
2235         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2236         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2237
2238 2007-04-10  Martin Baulig  <martin@ximian.com>
2239
2240         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2241
2242 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2243
2244         A better fix
2245         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2246         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2247
2248         Fix #81338
2249         * statement.cs (For.Resolve): If resolution fails, use
2250         KillFlowBranching.
2251
2252 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2253
2254         * anonymous.cs (MakeName): Make faster and zero-based.
2255         (VerifyExplicitParameterCompatibility): Back to mode where generic
2256         parameter is ignored.
2257         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2258
2259         * class.cs (EmitType): Method can emit another new method.
2260
2261         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2262
2263         * driver.cs: Updated.
2264
2265         * lambda.cs: Reuse predefined empty parameters.
2266
2267         * parameter.cs: Updated
2268
2269         * support.cs: Implemented InflateTypes.
2270
2271         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2272         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2273
2274 2007-04-03  Martin Baulig  <martin@ximian.com>
2275
2276         Fix #80632.
2277
2278         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2279         version of TypeManager.IsOverride() which also works with generic
2280         types.  
2281
2282 2007-04-03  Martin Baulig  <martin@ximian.com>
2283
2284         Fix #81044.
2285
2286         * convert.cs
2287         (Convert.ExplicitReferenceConversion): We need to cast when
2288         converting from IList<T> to S[].
2289
2290 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2291
2292         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2293         at this level.
2294         
2295         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2296
2297 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2298
2299         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2300         argument and return type inferring.
2301
2302         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2303         (ReturnType): Turned to property.
2304
2305         * statement.cs (Return): Implemented return type inferring.
2306
2307         * support.cs (ReflectionParameters): Use local types if possible.
2308
2309 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2310
2311         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2312         (FlowBranching.UsageVector): Update to changes.
2313
2314         Prepare to kill 'Reachability'
2315         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2316         argument of constructor.
2317
2318 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2319
2320         Prepare to kill 'Reachability'
2321         * flowanalysis.cs (UsageVector.is_unreachable): New.
2322         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2323         'reachability', and verify they're consistent.
2324
2325         Fix #81121
2326         * expression.cs (New.EmitStatement): Handle type parameters here too.
2327
2328 2007-03-29  Martin Baulig  <martin@ximian.com>
2329
2330         Fix #79148.
2331
2332         * anonymous.cs
2333         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2334         CompilerGeneratedClass.
2335         (ScopeInfo.EmitScopeInstance): Make this protected.
2336         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2337         `ec.CurrentAnonymousMethod.Scope == Scope'.
2338
2339         * statement.cs (Block.ScopeInfo): Make this a property.
2340
2341 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2342
2343         Prepare to kill 'Reachability'
2344         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2345         (FlowBranching.UsageVector.Reachability): Remove property.
2346         (FlowBranching.UsageVector.IsUnreachable): New property.
2347         (FlowBranching.UsageVector.ResetBarrier): New.
2348         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2349         * codegen.cs, statement.cs: Update to changes.
2350
2351 2007-03-27  Martin Baulig  <martin@ximian.com>
2352
2353         Fix #81209.
2354
2355         * decl.cs
2356         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2357         generic types.
2358
2359 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2360
2361         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2362         instead of TriState.  Remove all mention of TriState.
2363
2364         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2365         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2366         and maintain invariants.
2367
2368 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2369
2370         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2371
2372 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2373
2374         * expression.cs: Stop using obsolete 2.0 opcodes.
2375
2376 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2377
2378         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2379         one of the latests Martin's fixes.
2380
2381 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2382
2383         * expression.cs: On BigEndian systems, swap the bytes, temporary
2384         solution until we get a new bitconverter class.
2385
2386 2007-03-23  Martin Baulig  <martin@ximian.com>
2387
2388         Fix #81158.
2389
2390         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2391         "Method" and "Method`1".  Normally, a cache lookup is done on the
2392         "Method" form (ie. without the generic arity), but this one makes
2393         lookups on the full form work as well.
2394
2395 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2396
2397         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2398         unused properties.
2399
2400 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2401         * class.cs: 
2402         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2403         ordered_member_list, to TypeBuilder to store members to be defined
2404         in the order they were parsed in.
2405         - ordered_explicit_member_list contains all properties indexers
2406           and methods that are defined as explicit implementation of an
2407           interface or base class.
2408         - ordered_member_list contains all properties indexers and methods
2409           that are not defined as explicit implementation of an interface
2410           or base class.
2411
2412         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2413         functionality in these removed classes has been replaced with 
2414         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2415         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2416
2417         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2418         to CheckForDuplications inside GetMethod and SetMethod Define Method
2419         to handle method property and indexer name conflicts.
2420
2421         Fixes #79434
2422
2423         All code is contributed under the MIT/X11 license.
2424
2425 2007-03-20  Martin Baulig  <martin@ximian.com>
2426
2427         * class.cs (TypeContainer.Interfaces): Removed; they're now
2428         included in `TypeContainer.Types'.
2429
2430 2007-03-20  Martin Baulig  <martin@ximian.com>
2431
2432         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2433
2434         * class.cs (TypeContainer.CreateType): New public method.  This is
2435         now called before DefineType() to create the TypeBuilders.
2436         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2437         has already been created by CreateType().
2438         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2439         don't resolve our base classes here; this has been moved into
2440         DefineBaseTypes().  We're now called from CreateType().
2441         (TypeContainer.DefineBaseTypes): New private method; resolve our
2442         base classes here.  We're now called from DefineType().
2443
2444         * rootcontext.cs
2445         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2446         our types first to create all the TypeBuilders.  After that, call
2447         TypeContainer.DefineType() on all the types which'll resolve their
2448         base classes and setup the resolve order.
2449
2450 2007-03-20  Martin Baulig  <martin@ximian.com>
2451
2452         * class.cs (TypeContainer.Enums): Removed; they're now included in
2453         `TypeContainer.Types'.  
2454
2455 2007-03-20  Martin Baulig  <martin@ximian.com>
2456
2457         * class.cs
2458         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2459         (TypeContainer.DoResolveMembers): Call DefineType() on our
2460         `compiler_generated' classes; moved here from DefineNestedTypes().
2461
2462         * rootcontext.cs
2463         (RootContext.ResolveTree): Call ResolveMembers() on all
2464         TypeContainer's in the `type_container_resolve_order'.
2465
2466 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2467
2468         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2469
2470 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2471
2472         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2473         implementation flags.
2474
2475 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2476
2477         * class.cs: More optimizations for type parameters.
2478
2479 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2480
2481         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2482
2483         * ecore.cs, parameter.cs: More common code for both corlibs.
2484
2485         * typemanager.cs (IsGenericMethod): Simplified.
2486
2487 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2488
2489         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2490         'returns'.
2491         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2492
2493         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2494         unconditionally.  Simplify explanation.
2495         (Try.Resolve, Using.Resolve): Likewise.
2496
2497 2007-03-15  Martin Baulig  <martin@ximian.com>
2498
2499         Fix #80731.
2500
2501         * decl.cs (DeclSpace): If we're a partial class, use our
2502         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2503
2504 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2505
2506         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2507         'throws'.
2508         (FlowBranching.UsageVector): Update to changes.
2509         (FlowBranching.MergeSiblings): Likewise.
2510         * statement.cs: Likewise.
2511
2512 2007-03-15  Martin Baulig  <martin@ximian.com>
2513
2514         Fix #79302.
2515
2516         * decl.cs
2517         (MemberCache): Added a special .ctor for type parameters.
2518
2519         * typemanager.cs
2520         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2521         `MemberCache'.  
2522
2523 2007-03-09  Martin Baulig  <martin@ximian.com>
2524
2525         * enum.cs (Enum): Make this a TypeContainer.
2526         (EnumMember): Derive from `Const'.
2527
2528         * const.cs
2529         (Const.DoResolveValue): New protected virtual method; move most of
2530         the functionality of ResolveValue() here so we can override it in
2531         `EnumMember'.
2532         (Const.CreateConstantReference): Make this virtual.
2533
2534         * class.cs (Kind): Add `Kind.Enum'.
2535         (TypeContainer.Emit): Don't emit the enums here; they're already
2536         in the `RootContext.typecontainer_resolve_order'.
2537
2538         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2539         here; they're already in the `typecontainer_resolve_order'.
2540
2541         * ecore.cs (EnumConstant.ConvertImplicitly): Add
2542         TypeManager.DropGenericTypeArguments().
2543
2544         * typemanager.cs
2545         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2546         (TypeManager.IsEnumType): Likewise.
2547         (TypeManager.EnumToUnderlying): Likewise.
2548         (TypeManager.IsEqual): Add support for enums.
2549
2550 2007-03-12  Raja R Harinath  <rharinath@novell.com>
2551
2552         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2553         DefaultParameterValueAttribute to be undefined, say if System.dll
2554         is not referenced.
2555
2556 2007-03-11  Marek Safar  <marek.safar@gmail.com>
2557
2558         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2559         any mscorlib.
2560
2561 2007-03-10  Marek Safar  <marek.safar@gmail.com>
2562
2563         * class.cs, parameter.cs: Unified parameters verification.
2564
2565 2007-03-08  Martin Baulig  <martin@ximian.com>
2566
2567         * cs-parser.jay (constructor_header): Pass the location to the
2568         newly created TopLevelBlock.
2569
2570 2007-03-07  Martin Baulig  <martin@ximian.com>
2571
2572         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2573
2574 2007-03-06  Miguel de Icaza  <miguel@novell.com>
2575
2576         * convert.cs (ExplicitReferenceConversionExists): Sync this method
2577         with the changes from David, fixes the build.
2578
2579 2007-03-05  David Mitchell  <dmitchell@logos.com>
2580
2581         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2582         and its base interfaces to a one-dimensional array type S[],
2583         provided there is an implicit or explicit reference conversion
2584         from S to T.
2585
2586 2007-03-03  Marek Safar  <marek.safar@gmail.com>
2587
2588         * cs-tokenizer.cs: Implemented basic linq grammar.
2589
2590         * driver.cs: Set linq lang version on demand.
2591
2592 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2593
2594         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2595
2596 2007-02-25  Marek Safar  <marek.safar@gmail.com>
2597
2598         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2599         (Fixes #80455)
2600
2601         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2602         here.
2603         Check property and event extern attributes.
2604
2605         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2606         charset.
2607
2608 2007-02-24  Marek Safar  <marek.safar@gmail.com>
2609
2610         A fix for bug #80407
2611         * ecore.cs: Don't report ambiguity error when methods have same parent.
2612
2613 2007-02-23  Marek Safar  <marek.safar@gmail.com>
2614
2615         A fix for bug #80878
2616         * class.cs, cs-parser.jay: Event property can host anonymous methods.
2617
2618 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2619
2620         * attribute.cs: Enable ExtensionAttribute presence test.
2621
2622 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2623
2624         * class.cs: Warn about missing GetHashCode only when Equals is override.
2625
2626         * decl.cs: Check accessibility of type arguments.
2627
2628         * typemanager.cs: Correctly report nullable array.
2629
2630 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2631
2632         * class.cs, report.cs: Capture more details when things go wrong.
2633
2634 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2635
2636         A fix for bug #80650
2637         * cs-parser.jay: Anonymous container starts at constructor declaration
2638         and not at block beginning because it has to be usable in constructor
2639         initializer.
2640
2641         * statement.cs: Use context location and not block one for error reporting.
2642
2643 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2644
2645         A fix for bug #78712
2646         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2647         too.
2648
2649 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2650
2651         A fix for bug #80493 by Atsushi Enomoto
2652         * cs-parser.jay: Ignore invalid attribute target.
2653
2654 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2655  
2656         * cs-tokenizer.cs: Ignore '\0' as white space character.
2657
2658 2007-02-17  Miguel de Icaza  <miguel@novell.com>
2659
2660         * cs-parser.jay: Add support for lambda expressions to the mcs
2661         compiler as well.
2662
2663         * lambda.cs: Only clone when we are probing, not on the final call
2664         (Compatible is the final call). 
2665
2666         * statement.cs (CloneContext): Introduce class to provide block
2667         remapping during clone.
2668
2669         All statements Clone themselves now.
2670
2671         (Clone): special handling for blocks, when we clone a block, we
2672         register the block inside this routine, as children of the block
2673         might trigger a lookup. 
2674         
2675         * expression.cs: Add support for CloneContext in all expressions. 
2676         
2677 2007-02-17  Marek Safar  <marek.safar@gmail.com>
2678  
2679         A fix for bug #80493
2680         * statement.cs: Report ambiguous warning when interfaces are not related.
2681
2682 2007-02-15  Marek Safar  <marek.safar@gmail.com>
2683
2684         C# 3.0 extension methods.
2685
2686         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2687         cannot be used directly.
2688
2689         * class.cs (Class.Emit): Emit extension attribute if any class method
2690         is extension method.
2691         (Method.Define): Add basic extension method validation conditions.
2692         (Method.Emit): Emit extension attribute for method.
2693
2694         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2695         extension method exists. Currently we follow same approach as Microsoft
2696         does, emit even if a method or a class are private but this can change
2697         later.
2698
2699         * cs-parser.jay: Add handling of `this' keyword in method parameters
2700         context.
2701
2702         * decl.cs (DeclSpace.IsStaticClass): New property.
2703         (MemberCache.FindExtensionMethods): Looks for extension methods with
2704         defined name and extension type.
2705
2706         * doc.cs: Updated after OverloadResolve changes.
2707
2708         * driver.cs: Add new soft reference to System.Core.dll.
2709
2710         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2711         (ExtensionMethodGroupExpr): Represents group of extension methods.
2712
2713         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2714         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2715         to MethodGroupExpr and made non-static for easier customization.
2716         (Invocation.DoResolve): Add extension method lookup when no standard
2717         method was found.
2718         (MemberAccess.DoResolve): Try extension methods if no member exists.
2719
2720         * modifiers.cs: Add METHOD_EXTENSION modifier.
2721
2722         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2723         as well as candidate extension type.
2724         (ComputeNamespaces): When assembly constains extension methods registers
2725         them.
2726         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2727         extension method lookup.
2728         (Namespace.LookupExtensionMethod): Looks for extension method in this
2729         namespace.
2730         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2731         find a method which matches name and extensionType.
2732
2733         * parameter.cs (Parameter): Add This modifer.
2734         (HasExtensionMethodModifier): New property.
2735         (Resolve): Add extension parameter check.
2736         (ModFlags): turned to property to exclude this modifier as it is not real
2737         parameter modifier.
2738         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2739
2740         * support.cs (ParameterData): Add ExtensionMethodType.
2741         (ReflectionParameters): Implemented ExtensionMethodType interface property.
2742
2743         * typemanager.cs: Add type and ctor extension attribute type.
2744
2745 2007-02-15  Miguel de Icaza  <miguel@novell.com>
2746
2747         * report.cs (DisableErrors, EnableErrors): used to prevent error
2748         output when we are "trying" to compile various methods with
2749         different types. 
2750
2751         * ecore.cs (Expression): Add Clone method that calls the virtual
2752         CloneTo method.  The current CloneTo method in Expression throws
2753         an exception so we can track down all the places where this must
2754         be implemented (not using abstract, because that would be a lot of
2755         up-front-work before we can start testing the implementation
2756         idea). 
2757
2758         Important: we only need Clone capabilities for expressions created
2759         by the parser, as the expressions we will be cloning are
2760         expressions in the pre-resolved state.   This vastly simplifies
2761         the work required. 
2762         
2763         (SimpleName): Add CloneTo that does nothing.
2764         (EmptyCast): Add CloneTo.
2765         
2766         * expression.cs (Binary): Implement CloneTo.
2767         (Invocation.IsApplicable): Store the current ec in
2768         EmitContext.TempEc and restore it on return.  This is used so we
2769         do not have to sprinkle hundres of methods with an extra
2770         EmitContext, we know that the only user is the lambda expression
2771         ImplicitConversionExists code. 
2772         
2773         (Argument): Add Cloning capabilities.
2774         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
2775         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
2776         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
2777         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
2778         IndexerAccess): Add Clone capability.
2779
2780         (LocalVariableReference, This): TODO: needs cloned Block mapping.
2781
2782         (Argument): Add cloning capability.
2783
2784         * assign.cs (Assign): Implement CloneTo.
2785
2786         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
2787         
2788         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
2789         version by calling Convert with the EmitContext (that we are
2790         currently storing in ec, this is not great, but will do for now,
2791         to avoid passing EmitContext parameters to hundreds of functions
2792         that do not need them now).
2793
2794         (SetExpression): Remove, it is not needed.
2795         
2796         (ContextualReturn): Implement CloneTo.
2797
2798         * statement.cs (Statement): Implement cloning infrastructure,
2799         similar to expressions.
2800
2801         (Block): Partial implementation of Clone for statements.
2802
2803         (Return): Implement clone.
2804         
2805         * constant.cs (Constant.CloneTo): New method, does nothing.
2806
2807         * codegen.cs (TempEc): Add a static EmitContext as a temporary
2808         solution, until we decide how to exactly do this.  
2809         
2810 2007-02-14  Marek Safar  <marek.safar@gmail.com>
2811  
2812         A fix for bug #80493
2813         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
2814         a property is override we need to use second accessor.
2815
2816 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2817  
2818         A fix for bug #80418
2819         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
2820         methods.
2821
2822 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2823
2824         Another fix for bug #80749
2825         * pending.cs: Abstract class has priority over interfaces.
2826
2827 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2828
2829         Another fix for bug #80749
2830         * pending.cs: Abstract class has priority over interfaces.
2831
2832 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2833
2834         Another fix for bug #80749
2835         * pending.cs: Abstract class has priority over interfaces.
2836
2837 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2838
2839         Another fix for bug #80749
2840         * pending.cs: Abstract class has priority over interfaces.
2841
2842 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2843
2844         * class.cs Better error message.
2845
2846         * driver.cs: Add shorter versions of -optimize option.
2847
2848 2007-02-13  Martin Baulig  <martin@ximian.com>
2849
2850         * class.cs (Constructor.Emit): Check the return value of
2851         ec.ResolveTopBlock() and return on error.
2852
2853 2007-02-13  Raja R Harinath  <rharinath@novell.com>
2854
2855         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
2856         message to fix error message regression.
2857
2858 2007-02-12  Marek Safar  <marek.safar@gmail.com>
2859
2860         * delegate.cs: Delegate creation expression cannot be of Nullable type.
2861
2862 2007-02-12  Marek Safar  <marek.safar@gmail.com>
2863
2864         A fix for bug #80749
2865         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
2866         its parent container.
2867
2868         * class.cs (DefineFieldInitializers): Each initializer can has different
2869         resolve context.
2870
2871         * const.cs: Updated.
2872
2873 2007-02-11  Miguel de Icaza  <miguel@novell.com>
2874
2875         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
2876         now all the heavy lifting to check that embedded statements or
2877         expressions have the right form is done in the ContextualReturn.
2878
2879         (ContextualReturn): New class.  
2880
2881         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
2882         method that can be invoked to report 201, so we do not replicate
2883         this everywhere.
2884
2885         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
2886         
2887         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
2888         treating tabs as spaces. 
2889
2890 2007-02-09  Marek Safar  <marek.safar@gmail.com>
2891
2892         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
2893         * assign.cs: Use full implicit conversion for right side check.
2894
2895 2007-02-09  Marek Safar  <marek.safar@gmail.com>
2896
2897         * statement.cs (Switch): Switch over boolean type is not standardized.
2898
2899 2007-02-08  Marek Safar  <marek.safar@gmail.com>
2900
2901         A fix for bug #80755
2902         * decl.cs (FindBaseEvent): Don't use method cache for events.
2903
2904 2007-02-07  Marek Safar  <marek.safar@gmail.com>
2905
2906         * cs-parser.jay: Better syntax error handling.
2907
2908         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
2909         instead of underlying type value.
2910
2911 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2912
2913         * driver.cs: Check define identifier before is registered.
2914
2915         * namespace.cs: Use existing error message.
2916
2917         * report.cs: New warning.
2918
2919 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2920
2921         A fix for bug #80742
2922         * expression.cs: Delegate Invoke method can be called directly.
2923
2924 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2925
2926         A fix for bug #80676
2927         * class.cs (IsEntryPoint): The Main method can have params modifier.
2928
2929 2007-02-04  Miguel de Icaza  <miguel@novell.com>
2930
2931         * parameter.cs (Parameter, Parameters): Add Clone method.
2932
2933         * anonymous.cs (Compatible): Turn method into virtual method, so
2934         LambdaExpression can implement a different behavior.
2935
2936         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
2937         out the basic checking here, so it can be used by
2938         LambdaExpressions.
2939         
2940         * lambda.cs: Introduce "Compatible" function that will do the
2941         heavy lifting.
2942
2943 2007-02-02  Marek Safar  <marek.safar@gmail.com>
2944
2945         * attribute.cs: Unified one error message.
2946
2947         * class.cs (Class): Use type attributes and not properties to test static
2948         class.
2949         (IsEntryPoint): Don's pass local variable.
2950
2951         * convert.cs: Removed duplicate check.
2952
2953         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
2954
2955         * driver.cs: Don't crash when soft reference does not exist.
2956
2957         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
2958         (UsingEntry): Removed redundant allocation.
2959
2960         * parameter.cs: Add fast path for type parameters.
2961
2962         * support.cs: Don't allocate attribute when it's not used.
2963
2964 2007-01-30  Miguel de Icaza  <miguel@novell.com>
2965
2966         * anonymous.cs
2967         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
2968         this into a virtual method, so we can override it in LambdaExpression.
2969
2970         * driver.cs: Improve diagnostics in case of failure. 
2971
2972         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
2973         write a function that is slightly more complex and that parses:
2974
2975         type identifier [, type identifier]* )
2976
2977         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
2978         this expression:
2979
2980                 (canEmpty ? i >= 0 : i > 0)
2981
2982 2007-01-30  Raja R Harinath  <rharinath@novell.com>
2983
2984         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
2985         exception on possibly valid code.
2986
2987 2007-01-29  Raja R Harinath  <rharinath@novell.com>
2988
2989         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
2990         Push/PopPosition.
2991         (parse_opt_type_arguments): Remove.  It's almost the same as
2992         parse_less_than.
2993         (parse_namespace_or_typename): Use parse_less_than.
2994
2995 2007-01-28  Miguel de Icaza  <miguel@novell.com>
2996
2997         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
2998         this bug took a few hours to find, because the state saved and
2999         restored by PushPosition and PopPosition was ignoring the state of
3000         parse_generic_less_than.
3001
3002         I can also now remove the handling of OP_LT and OP_GT, this solves
3003         the big mistery.
3004         
3005         * cs-tokenizer.cs: store the location for the ARROW token, we use
3006         that in the parser.
3007
3008         (PushPosition, PopPosition): save/restore also `current_token',
3009         restore `parse_generic_less_than' (was missing).
3010
3011         (parse_opt_type_arguments): use parse_type, not
3012         parse_namespace_or_typename to parse types.
3013
3014         * lambda.cs: Empty new file, will eventually have the lambda
3015         expression implementation.
3016
3017         * lambda.test: used to test the internal tokenizer. 
3018
3019         * report.cs (FeatureIsNotISO1): Rename from
3020         FeatureIsNotStandardized, because it was about the language level
3021         (1 vs 2) it was not about standarization.
3022
3023         (FeatureRequiresLINQ): New.
3024
3025         * support.cs (SeekableStreamReader): Only require that the reader
3026         is a TextReader, not a StreamReader, so we can plug StringReader. 
3027
3028         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3029         given position in the input stream the following tokens can be
3030         parsed as a type followed by an identifier.
3031
3032         (is_punct): after a '(' if parse_type_and_parameter returns true,
3033         then return a special token OPEN_PARENS_LAMBDA which is used to
3034         avoid reduce/reduce errors in the grammar for the
3035         lambda_expression rules.
3036
3037         (parse_type): implement a type parser inside the
3038         tokenizer, the parser only returns true or false depending on
3039         whether the input at a given position can be parsed as a type.
3040
3041         (peek_token): new method used during type parsing.
3042
3043 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3044
3045         Fix #80531
3046         * anonymous.cs (ScopeInfo.InflateParameters): New.
3047         (AnonymousContainer.Resolve): Use it to redirect types of
3048         delegate parameters.
3049
3050 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3051
3052         Fix #80530
3053         * expression.cs (Error_InvalidArguments): Don't use two different
3054         messages for CS1503.  Use ExtraInformation and
3055         SymbolRelatedToPreviousError instead.
3056
3057         Fix #80358
3058         * decl.cs (DeclSpace.initialize_type_params): Don't access
3059         'type_params' of a partial class directly.
3060
3061 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3062
3063         * constant.cs: Removed a handful of out-of-range checks that were
3064         not necessary. 
3065
3066 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3067
3068         * expression.cs (CheckUselessComparison): Add additional check for char
3069         constants.
3070
3071         * namespace.cs: Fixed typo.
3072
3073 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3074
3075         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3076         gone, instead we inline the test, preventing the needless casts to
3077         longs, ulongs and doubles for the parameters, avoiding calls to
3078         methods that overchecked stuff, and instead inlined things
3079         nicely. 
3080
3081 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3082
3083         * cs-parser.jay: Better parameter error handling.
3084
3085 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3086
3087         A fix for bug #80368, #80522
3088         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3089         whether array initializer contains constants only.
3090         (ArrayCreation.Emit): Use better formula to decide when
3091         are array initializers for static initialization.
3092         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3093         have to emit even constants otherwise they are pre-initialized.
3094
3095 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3096             Raja R Harinath  <rharinath@novell.com>
3097
3098         Fix emit order of 'get' vs. 'set'.
3099         * support.cs (Accessors): New.
3100         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3101         Note the order in which accessors are declared in the source.
3102         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3103         Refactored from Property.Define and Indexer.Define.
3104         (PropertyBase.DefineAccessors): New helper that calls the above in
3105         appropriate order as noted by the parser.
3106         (Property.Define, Indexer.Define): Update to changes.
3107         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3108
3109 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3110
3111         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3112         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3113         there's an implicit conversion from the current type to the target
3114         type before converting the underlying constant.
3115
3116 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3117
3118         * const.cs (ResolveValue): Updated after constant conversion was made more
3119         generic.
3120
3121         * constant.cs (GetAttributableValue): constant to object conversion is
3122         used for attributes only.
3123         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3124         constant conversions.
3125         (LongConstant.ConvertImplicitly): Ditto.
3126
3127         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3128         (ImplicitConversionStandard): Handle constant conversion as extra step.
3129         It solves the issue when constant conversion was called indirectly like
3130         inside array initializer and constant folding was skipped.
3131
3132         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3133         this change.
3134
3135         * statement.cs(ImplicitConversionStandard): Updated after constant
3136         conversion was made more generic.
3137
3138 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3139
3140         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3141         Constraints, solves the problem where the compiler incorrectly
3142         reported that a type parameter was not constrained to a class (Bug
3143         80518)
3144
3145 2007-01-14  Marek Habersack  <grendello@gmail.com>
3146
3147         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3148
3149 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3150
3151         A fix for bug #80368
3152         * assign.cs (FieldInitializer): New class implements field
3153         initializer statement.
3154
3155         * attribute.cs: Update after FieldMember rename.
3156
3157         * class.cs (PropertyBasedMember): New common class for property based
3158         types.
3159         (InterfaceMemberBase): New base class for all members which can be used as
3160         an interface members.
3161         (MethodCore): Moved really common code to InterfaceMemberBase.
3162         (Method.Define): Equal and GetHasCode detection is relevant for methods
3163         only.
3164         (MethodData.Define): Don't assume that public event implements an
3165         interface automatically.
3166         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3167         modifier is used.
3168         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3169         (FieldMember): Merged with FieldBase.
3170         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3171         event extern modifier can be used.
3172         (EventField.EventFieldAccessor): Moved event field specific code here.
3173         (Event.AllowedModifiers): Even event can be extern.
3174         (Event.FindOutBaseMethod): New override specific to events.
3175         (Indexer.parameters): Reintroduce parameters because base class holds
3176         only properties common data.
3177         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3178         need do extra parameters check.
3179
3180         * const.cs: Update after FieldMember rename.
3181
3182         * decl.cs (MemberCache.FindBaseEvent): New method.
3183
3184         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3185         to reflect that indexer is now derived from PropertyBased.
3186
3187         * ecore.cs (GetMemberType): Made public.
3188         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3189         obsolete event.
3190
3191         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3192         
3193         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3194         (RegisterEvent): Removed.
3195         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3196         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3197
3198 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3199
3200         Fix #80249
3201         * statement.cs (CollectionForeach.TryType): Prefer generic
3202         GetEnumerator over non-generic variant.  Fix code to follow comments.
3203
3204 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3205
3206         Fix #80446
3207         * support.cs (ReflectionParameter): Don't use an invalid index on
3208         the generic parameter data.
3209
3210 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3211
3212         * driver.cs: Just add a tiny bit of infrastructure.
3213
3214 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3215
3216         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3217         where field type is struct from current assembly.
3218         
3219         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3220         it is possible.
3221
3222 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3223
3224         A fix for bug #80381
3225         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3226         the core types.
3227
3228         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3229         messages.
3230         (Namespace.LookupType): Always use core types from corlib when speficied.
3231
3232         * report.cs: A new warning.
3233
3234         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3235         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3236         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3237
3238         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3239         (InitCoreTypes): Set expression type of object_type and value_type
3240         immediately after lookup.
3241
3242 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3243
3244         * cs-tokenizer.cs: Accept Pc class characters (Connector
3245         Punctuation) as valid identifiers.  Fixes #78259
3246
3247         * expression.cs (Invocation.DoResolve): Moved the check for the
3248         use of `this' for doing method calls to the Invocation resolution
3249         step, after overload resolution has taken place instead of doing
3250         the check at the low-level `This.DoResolve' level.
3251
3252         The `This.DoResolve'(appens before overload resolution, so it has
3253         no way of knowing if the method that will be called will be
3254         instace or static, triggering an erroneous report for cs0188 (Bug
3255         78113).
3256
3257         We now do the check for instance method invocations after we know
3258         what method will be called.
3259
3260         (This.CheckThisUsage): Move the actual use of this structure
3261         checking into its own method and expose it. 
3262
3263         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3264         EmitContext.
3265
3266         Exceptions: Null.ConvertImplicitly,
3267         Constant.ImplicitConversionRequired as there are too many call
3268         sites for passing the ec. 
3269
3270         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3271         EmitContext, if the value is null, then we do not try to provide
3272         the extra information from the error (If a userdefined conversion
3273         exists, as UserDefinedConversion requires a non null-EmitContext).
3274
3275         Fixes: #80347
3276
3277 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3278
3279         * flowanalysis.cs (MyBitVector): Document some invariants.
3280         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3281         introduced below, and add a couple of others, 
3282
3283 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3284
3285         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3286         GetPropertyFromAccessor and GetEventFromAccessor.
3287         
3288         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3289         overrides non-obsolete one.
3290         (Indexer.Define): Error message has been moved to the parser.
3291
3292         * cs-parser.jay: Better syntax errors handling.
3293
3294         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3295         when an invocation has no arguments.
3296
3297         * ecore.cs: Removed not used caching.
3298
3299         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3300         implementation.
3301
3302         * report.cs: Add a new warning.
3303
3304         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3305
3306         * typemanager.cs (enumeration_type): Removed.
3307         (CSharpSignature): Reuses IsSpecialMethod.
3308         (IsEqual): Hack for MS BCL.
3309         (GetPropertyFromAccessor): New method.
3310         (GetEventFromAccessor): New method.
3311         (IsSpecialMethod): Fixed to handle more cases.
3312
3313 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3314
3315         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3316         Made white spaces array static.
3317
3318         * ecore.cs (RemoveGenericArity): Optimized.
3319
3320         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3321         10 times faster).
3322         (MyBitVector.initialize_vector): Simplified.
3323
3324 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3325
3326         * ecore.cs: Am not entirely happy with this hack, but it seems to
3327         address the issue in 80257 (a small test case for
3328         CreativeDocs.NET). 
3329
3330         I set the MethodGroupExpr.Type to an internal compiler type
3331         (itself in this case) to force the resolution to take place.   Why
3332         it does not take place with a null is beyond me.
3333
3334 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3335
3336         A fix for bug #80288
3337         * expression.cs (ResolveOperator): Consider user defined conversion for
3338         logical and operator too.
3339         (EmitBranchable): Optimization for logical and when full constant folding
3340         could not be applied but one operand is constant.
3341
3342 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3343
3344         * class.cs (GetClassBases): Write 5 times every day, will never use
3345         FullName for error reporting.
3346
3347         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3348
3349 2006-12-19  Martin Baulig  <martin@ximian.com>
3350
3351         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3352         the symbol file info here.
3353
3354 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3355
3356         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3357         of `elseif' is taking then following sections are not taking.
3358         Fixes an issue reported on mono mailing list.
3359
3360 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3361
3362         A fix for bug #80300
3363         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3364         a caller is not taking.
3365
3366 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3367
3368         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3369         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3370         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3371         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3372         * class.cs: Update to changes.
3373
3374 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3375
3376         A fix for bug #79934
3377         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3378         partial container.
3379
3380         * class.cs (ResolveMembers): Register an iterator in current container and
3381         not in shared one.
3382
3383 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3384
3385         Fix test-543.cs
3386         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3387         satisfy a params annotated parameter.
3388
3389 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3390
3391         A fix for bug #77014
3392         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3393         paramters correctly and not rely on hacks in Parameters class.
3394         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3395         at any possition.
3396         (Invocation.VerifyArgumentsCompat): Ditto.
3397         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3398         any possition.
3399
3400         * parameter.cs (HasParams): Don't assume that params is the last one.
3401
3402         * support.cs (ReflectionParameters.ctor): Look for params attribute
3403         correctly.
3404         (ReflectionParameters.ParameterType): Removed hack when we returned last
3405         parameter for out of range parameters.
3406         (ParameterName, ParameterModifier): Ditto.
3407
3408 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3409
3410         A fix for bug #79987
3411         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3412         when assembly is not CLS compliant but type is. I have no idea why is this
3413         allowed.
3414
3415         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3416
3417 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3418
3419         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3420         in struct constructors, they are basically no-ops.
3421
3422 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3423
3424         * cs-tokenizer.cs (Position): Save preprocessor status too.
3425
3426 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3427
3428         A fix for bug #77794
3429         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3430
3431 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3432
3433         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3434         Fixes #69299.
3435         (pp_expr): Report error for an invalid expression.
3436         (handle_preprocessing_directive): Simplified; add more error checking.
3437
3438 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3439
3440         A fix for bug #74939
3441         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3442         directives handling.
3443
3444 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3445
3446         A fix for bugs #80093, and #75984
3447         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3448         logic, it seems to me as it worked before "by coincidence".
3449         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3450         (cleanup): Enabled endif check.
3451
3452 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3453
3454         A fix for bug #80162
3455         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3456         enumerators are never ambiguous.
3457
3458 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3459
3460         Fix #80060
3461         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3462
3463 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3464
3465         A fix for bug #80144
3466         * class.cs (EventProperty.Define): Explicit implementation means
3467         that an even is used.
3468
3469 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3470
3471         Fixes the operators implementation (part II)
3472
3473         * cfold.cs (DoConstantNumericPromotions): Renamed to
3474         DoBinaryNumericPromotions and simplified.
3475         (BinaryFold): Couple of conversion fixes; simplified.
3476
3477         * constant.cs, ecore.cs, literal.cs
3478         (ToType): Renamed to ConvertImplicitly.
3479         (Reduce): Renamed to ConvertExplicitly.
3480
3481         * class.cs, convert.cs: Updated.
3482
3483         * expression.cs: TryReduce doesn't throw an exception.
3484
3485 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3486
3487         A fix for bug #80108
3488         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3489         compatible.
3490
3491 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3492
3493         Fixes unary operators implementation (part I)
3494         Also fixes #80026
3495
3496         * cfold.cs (Error_CompileTimeOverflow): Made internal
3497
3498         * const.cs (IConstant): Changed to use reference to constant and
3499         not constant itself.
3500         Updated IConstant implementations.
3501
3502         * constant.cs (CreateConstant): New factory method.
3503         Updated IConstant implementation.
3504
3505         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3506
3507         * ecore.cs: Updated to use CreateConstantReference.
3508
3509         * enum.cs: Reflects IConstant changes.
3510
3511         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3512
3513         * literal.cs (NullConstant): Change to be independently usable.
3514
3515 2006-11-29  Martin Baulig  <martin@ximian.com>
3516
3517         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3518         we need to emit the scope initializer before calling the base .ctor.
3519
3520         * anonymous.cs: Merged back from the new anonymous methods branch.
3521         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3522
3523         * expression.cs (ParameterReference.DoResolveBase): Create a
3524         "normal" ScopeInfo when capturing parameters rather than using the
3525         root scope; this makes things work with anonymous methods having
3526         parameters.
3527
3528         * statement.cs
3529         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3530
3531 2006-11-22  Marek Safar  <marek.safar@gmail.com>
3532
3533         A fix for bug #79987
3534         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3535         check to a base class.
3536         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3537         only when assembly has missing attribute.
3538         * report.cs: Update.
3539
3540 2006-11-21  Marek Safar  <marek.safar@gmail.com>
3541
3542         * cs-tokenizer.cs: Merged with gmcs version.
3543
3544 2006-11-20  Marek Safar  <marek.safar@gmail.com>
3545
3546         * cs-tokenizer.cs,
3547         * cs-parser.jay: Better error message when partial keyword is misplaced.
3548
3549 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
3550
3551         A fix for bug #79810
3552         report.cs: CS1058 only applies to 2.0 profile (gmcs).
3553         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3554         a RuntimeWrappedException by default.
3555
3556 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3557
3558         A fix for bug #79843
3559         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3560         implementation.
3561         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3562
3563 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3564
3565         * driver.cs, namespace.cs: Uses faster IndexOf version.
3566
3567 2006-11-17  Marek Safar  <marek.safar@gmail.com>
3568
3569         A fix for bug #79941
3570         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3571         operators.
3572         (Operator.Define): Implicit/Explicit operator of same type is duplicate
3573         even if internal name is different.
3574         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3575         (UserDefinedConversion): Simplified as the operators cannot be internal.
3576         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3577         conversions.
3578         (MethodLookup): Replaced EmitContext with parentType.
3579         * expression.cs: Updated.
3580
3581 2006-11-09  Raja R Harinath  <rharinath@novell.com>
3582
3583         * driver.cs (BadAssembly): Handle all the ugliness of
3584         DefineDynamicAssembly.
3585
3586 2006-11-08  Raja R Harinath  <rharinath@novell.com>
3587
3588         Address parts of #58244 -- most of what's left is in the runtime
3589         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
3590         CS1509 error checks, and handle them for all assembly loads, not
3591         just the first invocation.
3592         (LoadModule): Likewise.  Move handling of 'adder_method' ...
3593         * codegen.cs (AssemblyClass.AddModule): ... here.
3594
3595 2006-11-02  Marek Safar  <marek.safar@gmail.com>
3596
3597         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3598         IEnumerable<T> is ambiguous.
3599
3600 2006-10-31  Marek Safar  <marek.safar@gmail.com>
3601
3602         A fix for bug #67689
3603         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3604         GetEnumerator is ambiguous.
3605
3606         * report.cs: Add new warning.
3607
3608 2006-10-29  Marek Safar  <marek.safar@gmail.com>
3609
3610         A fix for bug #78602
3611         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3612         to protected member can be nested type.
3613
3614 2006-10-28  Marek Safar  <marek.safar@gmail.com>
3615
3616         A fix for bug #78965
3617         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3618         to protected member must derive from current type.
3619
3620 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3621
3622         assign.cs: Reuses error method.
3623
3624         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3625         instead of type for constants.
3626         (Expression.Error_ValueAssignment): Common error method.
3627
3628         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3629         for any assignment.
3630
3631 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3632
3633         A fix for bug #79081
3634         * expression.cs (MemberAccess.DoResolve): Check nested type
3635         accessibility.
3636
3637 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
3638
3639         * doc.cs : nested delegates were not handled. Fixed bug #79754.
3640
3641 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3642
3643         A fix for bug #76591
3644         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3645
3646 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3647
3648         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3649         type forwarder of the same type multiple times.
3650
3651 2006-10-26  Raja R Harinath  <rharinath@novell.com>
3652
3653         Fix #78820
3654         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3655         instance as an rvalue, even when we later resolve as an lvalue.
3656
3657 2006-10-25  Martin Baulig  <martin@ximian.com>
3658
3659         * anonymous.cs: Fix #79673.
3660
3661 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
3662
3663         A fix for bug #79666
3664         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3665         ignored when is optimized (= default value) as its value is already set.
3666
3667 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3668
3669         A fix for bug #79724
3670         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3671         TypeContainer for type lookup.
3672
3673 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3674
3675         A fix for bug #79231
3676         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3677         * expression.cs (OverloadResolve): Always convert type name for
3678         an error message.
3679         (ResolveNamespaceOrType): Don't confuse a nested type with any 
3680         other member.
3681
3682 2006-10-18  Martin Baulig <martin@ximian.com>
3683
3684         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3685
3686 2006-10-17  Miguel de Icaza  <miguel@novell.com>
3687
3688         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3689         an int32, but requesting an int64 from the conversion
3690
3691 2006-10-12  Martin Baulig  <martin@ximian.com>
3692
3693         * anonymous.cs
3694         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
3695         
3696 2006-10-12  Martin Baulig  <martin@ximian.com>
3697
3698         * statement.cs
3699         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3700
3701 2006-10-11  Miguel de Icaza  <miguel@novell.com>
3702
3703         * convert.cs: Remove broken code: I was doing the "Existance"
3704         tests for Implicit conversions.
3705
3706 2006-10-10  Miguel de Icaza  <miguel@novell.com>
3707
3708         * convert.cs: Added one missing case in
3709         ImplicitStandardConversionExists uint64 to intptr.
3710
3711         Fixes #59800
3712         
3713         * typemanager.cs (uintptr_type): another core known type.   
3714
3715         * ecore.cs (OperatorCast): routine used to do cast operations that
3716         depend on op_Explicit.  We could change some of the Decimal
3717         conversions to use this.
3718
3719         This one has a probe mechanism that checks both types for an op_
3720         which it coudl be used to eliminate two classes: CastToDecimal
3721         and CastFromDecimal.
3722
3723         * convert.cs: Implement the conversions documented in #59800
3724         
3725 2006-10-10  Martin Baulig  <martin@ximian.com>
3726
3727         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3728         before RootScope.ResolveMembers().
3729
3730         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3731         `CurrentType' if appropriate.
3732
3733 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
3734
3735         A fix for bug #78568
3736         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3737         when contains binary operators.
3738         * cs-parser.jay: Updated.
3739
3740 2006-10-09  Martin Baulig  <martin@ximian.com>
3741
3742         * delegate.cs
3743         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3744         moved that into Define() and also do the other type parameter
3745         checks there.  Fixes #79094.  Added gtest-292.cs.
3746
3747         * expression.cs
3748         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3749         since that doesn't include type parameters; don't use `Ldelema'
3750         for type parameters.  Fixes #78980.  Added gtest-293.cs.
3751
3752 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
3753
3754         A fix for #77796
3755         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3756         conversion is allowed.
3757
3758 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
3759
3760         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
3761         error reporting when no error occurs.
3762
3763 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
3764
3765         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
3766         does not exist.
3767
3768 2006-10-06  Raja R Harinath  <rharinath@novell.com>
3769
3770         Fix #79584
3771         * class.cs (DefineTypeBuilder): Check circular dependencies before
3772         setting the parent of the TypeBuilder.
3773         (CheckRecursiveDefinition): Don't use 'BaseType', since
3774         it may not be valid until after DefineTypeBuilder.  Use
3775         'base_type' instead.
3776
3777 2006-10-04  Martin Baulig  <martin@ximian.com>
3778
3779         Merged the Anonymous Methods patch.
3780
3781         * anonymous.cs, iterators.cs: The new anonymous methods code.
3782
3783         * statement.cs (Variable): New public abstract class.
3784         (LocalInfo.Variable): New public property.
3785         (LocalInfo.ResolveVariable): New public method.
3786         (Block.Flags): Add `IsIterator'.
3787         (Block.AddVariable): Improved the CS0136 check.
3788         (Block.AnonymousChildren): New public property.
3789         (Block.AddAnonymousChild): New public method.
3790         (ToplevelBlock): Update to use the new anonymous method framework.
3791         (ToplevelBlock.ctor): `container' is now a `Block' and not a
3792         `ToplevelBlock'; this is required to correctly implement the
3793         CS0136 check.
3794         (Fixed, Using): Use `TemporaryVariable' instead of directly
3795         creating the `LocalBuilder'.
3796
3797         * parameter.cs (Parameter.ResolveVariable): New public method.
3798         (Parameters.ResolveVariable): Likewise.
3799
3800         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
3801
3802         * class.cs (TypeContainer): Replaced the `iterators' list and
3803         corresponding methods with a list of `CompilerGeneratedClass'es.
3804         (TypeContainer.ResolveMembers): New public method.
3805         (Method): `IIteratorContainer' has been replaced by
3806         `IAnonymousHost'.
3807
3808         * expression.cs (VariableReference): New public abstract base
3809         class for `LocalVariableReference', `ParameterReference' and
3810         `This'.
3811
3812         * codegen.cs (EmitContext): Removed `capture_context',
3813         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
3814         (EmitContext.EmitThis): Removed.
3815
3816         * cs-parser.jay: Replace `iterator_container' with
3817         `anonymous_host'.       
3818
3819 2006-10-04  Martin Baulig  <martin@ximian.com>
3820
3821         * generic.cs (GenericMethod): Don't make this abstract.
3822         (Constraints.Clone): Added dummy implementation.
3823
3824 2006-10-04  Raja R Harinath  <harinath@gmail.com>
3825
3826         Fix #79577
3827         * namespace.cs (LookForAnyGenericType): Avoid nullref on
3828         'declspaces'.  Avoid allocating arrays willy-nilly.
3829
3830         Fix #79553
3831         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
3832         cases out of the switch.
3833
3834 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
3835
3836         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
3837         message when non-generic type is used with the type arguments.
3838         * expression.cs: Updated.
3839
3840 2006-09-28  Raja R Harinath  <rharinath@novell.com>
3841
3842         Fix #79013
3843         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
3844         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3845         Change semantics slightly.  Don't insist on having only one
3846         temporary EmptyExpression -- just throttle the creation of new ones.
3847
3848         Fix #79451
3849         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
3850         non-interfaces too.  If no methods are found, don't try to create
3851         a MethodGroupExpr.
3852
3853 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
3854
3855         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
3856         generic type.
3857
3858         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
3859         us produce better error message.
3860
3861 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
3862
3863         * expression.cs (Binary.ResolveOperator): Warn about a side effect
3864         of the `|' operator.
3865
3866         * report.cs: A new warning added.
3867
3868 2006-09-27  Martin Baulig  <martin@ximian.com>
3869
3870         * generic.cs (GenericMethod): Don't make this abstract.
3871
3872 2006-09-27  Martin Baulig  <martin@ximian.com>
3873
3874         * report.cs
3875         (InternalErrorException): Added overloaded ctor taking a params array.
3876
3877 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
3878
3879         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
3880         Fixed the cases when same error was reported twice.
3881
3882         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
3883         now report symbol information.
3884
3885 2006-09-25  Martin Baulig  <martin@ximian.com>
3886
3887         * class.cs: Completely unified with the gmcs version.
3888
3889 2006-09-25  Martin Baulig  <martin@ximian.com>
3890
3891         * typemanager.cs (TypeManager.IsNullableType): New public function.
3892         (TypeManager.IsNullableTypeOf): Likewise.
3893         (TypeManager.IsNullableValueType): Likewise.
3894
3895         * class.cs (MethodCore): Added the `GenericMethod' argument from
3896         gmcs and also unified all classes derived from `MethodCore' with gmcs.
3897
3898 2006-09-24  Raja R Harinath  <harinath@gmail.com>
3899
3900         * convert.cs: Unify with gmcs version.
3901
3902 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3903
3904         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
3905         verify them as well.
3906
3907         * report.cs: New warning.
3908
3909 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3910
3911         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
3912         for anonymous block with out argument.
3913
3914 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3915
3916         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
3917         not used private events only.
3918
3919 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
3920
3921         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
3922
3923         * const.cs (Const.Define): Check for constant type.
3924         (Const.IsConstantTypeValid): Looks for valid constant types.
3925
3926         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
3927
3928         * ecore.cs (EmptyConstantCast): New common class for all constant based
3929         EmptyCast(s).
3930
3931         * expression.cs (Is.DoResolve): Handle null constant especially.
3932         (New.DoResolve): Check for new void().
3933         (MemberAccess.DoResolve): Cope with all kind of nulls.
3934
3935         * literal.cs (NullConstant): Uses EmptyConstantCast.
3936         (NullDefault): Based on EmptyConstantCast.
3937         (NullLiteral): Uses EmptyConstantCast.
3938
3939         * statement.cs (Block.ResolveMeta): Check for constant type.
3940
3941 2006-09-22  Martin Baulig  <martin@ximian.com>
3942
3943         * delegate.cs, attribute.cs: Merged with the gmcs versions.
3944
3945 2006-09-22  Raja R Harinath  <rharinath@novell.com>
3946
3947         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
3948         not the null type.
3949
3950         Fix part of #79451
3951         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
3952         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
3953         code slightly.
3954
3955 2006-09-22  Martin Baulig  <martin@ximian.com>
3956
3957         * ecore.cs: Merged with the gmcs version.
3958
3959         * generic.cs (ConstructedType): New dummy class.
3960         (TypeArguments): Don't make this abstract.
3961
3962         * typemanager.cs
3963         (TypeManager.IsGenericTypeDefinition): New method.
3964         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
3965
3966 2006-09-22  Raja R Harinath  <rharinath@novell.com>
3967
3968         * expression.cs (ComposedCast): Check for arrays of TypedReference
3969         before creating the type, not after.
3970
3971 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
3972
3973         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
3974         after ToType change.
3975
3976         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
3977         when constant must be implicitly convertible.
3978
3979         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
3980
3981         * ecore.cs (NullCast): Derives from NullConstant.
3982
3983         * expression.cs (Is.DoResolve): Removed useless variables.
3984         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
3985         (New.Constantify): Add enum support.
3986         (MemberAccess.DoResolve): Add warning when accessing null constant or
3987         variable.
3988
3989         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
3990         property.
3991
3992         * literal.cs (NullConstant): New abstract class with common
3993         functionality for all null specializations.
3994         (NullDefault): Represents default(X) when result can be
3995         reduced to null.
3996         (NullLiteral): Updated.
3997
3998         * report.cs: Add new warning.
3999
4000 2006-09-21  Martin Baulig  <martin@ximian.com>
4001
4002         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4003
4004 2006-09-21  Martin Baulig  <martin@ximian.com>
4005
4006         * generic.cs (GenericConstraints): New dummy class.
4007         (Constraints): Likewise.
4008         (TypeParameter): Likewise.
4009         (TypeParameterName): Likewise.
4010         (GenericMethod): Likewise.
4011
4012         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4013
4014         * decl.cs: Merged with the gmcs version.
4015
4016 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4017
4018         * generic.cs (TypeParameter): Implement IMemberContainer.
4019         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4020
4021         * rootcontext.cs: Unify with gmcs version.
4022
4023         * report.cs: Unify with gmcs version.
4024         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4025         from gmcs/generics.cs.
4026         * generics.cs (TypeParameter): New dummy class.
4027
4028         * support.cs: Unify with gmcs version.
4029
4030 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4031
4032         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4033         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4034
4035         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4036         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4037         * mcs.exe.sources: Add generic.cs.
4038
4039         * codegen.cs: Unify with gmcs version.
4040
4041         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4042         (EmitContext): Add GenericDeclContainer implementation.
4043         * decl.cs (MemberCore, DeclSpace): Likewise.
4044         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4045
4046         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4047         MCS TypeManager has a corresponding dummy method.
4048
4049 2006-09-19  Martin Baulig  <martin@ximian.com>
4050
4051         * expression.cs: Completely merged with the gmcs version.
4052
4053 2006-09-19  Martin Baulig  <martin@ximian.com>
4054
4055         * expression.cs (Invocation): Merged with the gmcs version.
4056         (ArrayAccess.GetStoreOpcode): Likewise.
4057
4058 2006-09-19  Martin Baulig  <martin@ximian.com>
4059
4060         * typemanager.cs
4061         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4062         (TypeManager.IsGenericMethodDefinition): Likewise.
4063
4064 2006-09-19  Martin Baulig  <martin@ximian.com>
4065
4066         * typemanager.cs
4067         (TypeManager.IsEqual): Moved the gmcs implementation here.
4068         (TypeManager.DropGenericTypeArguments): Likewise.
4069         (TypeManager.DropGenericMethodArguments): Likewise.
4070         (TypeManager.GetTypeArguments): Moved here from gmcs.
4071         (TypeManager.HasGenericArguments): Likewise.
4072
4073 2006-09-19  Martin Baulig  <martin@ximian.com>
4074
4075         * expression.cs (Binary): Merged with the gmcs version.
4076
4077 2006-09-19  Martin Baulig  <martin@ximian.com>
4078
4079         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4080
4081 2006-09-19  Martin Baulig  <martin@ximian.com>
4082
4083         * typemanager.cs: Merged with the gmcs version.
4084
4085 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4086
4087         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4088         * driver.cs: Likewise.
4089
4090 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4091
4092         A fix for #79401
4093         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4094         only if parent type is class.
4095         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4096         update.
4097
4098 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4099
4100         * cs-parser.jay,
4101         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4102         keywords are used.
4103         * typemanager.cs(CSharpName): Converts NullType to null.
4104
4105 2006-09-15  Martin Baulig  <martin@ximian.com>
4106
4107         * typemanager.cs
4108         (TypeManager.GetMethodName): Added mcs implementation.
4109         (TypeManager.IsEqual): Likewise.
4110
4111         * ecore.cs
4112         (SimpleName.RemoveGenericArity): Added dummy implementation.
4113
4114         * pending.cs: Merged with the gmcs version.     
4115
4116 2006-09-15  Martin Baulig  <martin@ximian.com>
4117
4118         * statement.cs: Merge with the gmcs version.
4119
4120 2006-09-15  Martin Baulig  <martin@ximian.com>
4121
4122         * statement.cs (Switch): Merge with the gmcs implementation
4123         (without nullables), which is newer.
4124
4125 2006-09-15  Martin Baulig  <martin@ximian.com>
4126
4127         * statement.cs (Block.Variables): Make this public.
4128         (ToplevelBlock.Parameters): Make this a property.
4129         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4130
4131 2006-09-15  Martin Baulig  <martin@ximian.com>
4132
4133         * namespace.cs: Merge with the gmcs version.
4134
4135 2006-09-15  Martin Baulig  <martin@ximian.com>
4136
4137         * decl.cs (MemberName): Minor code cleanups.
4138
4139 2006-09-15  Martin Baulig  <martin@ximian.com>
4140
4141         * parameter.cs: Merge with the gmcs version.
4142
4143 2006-09-15  Martin Baulig  <martin@ximian.com>
4144
4145         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4146         and an error in mcs.
4147
4148 2006-09-15  Martin Baulig  <martin@ximian.com>
4149
4150         * flowanalysis.cs: Merged from GMCS; added the generics code into
4151         a `GMCS_SOURCE' conditional so we can share this file.
4152
4153 2006-09-08  Martin Baulig  <martin@ximian.com>
4154
4155         * typemanager.cs (TypeManager.interlocked_type): New public field.
4156         (TypeManager.int_interlocked_compare-exchange): New public field.
4157         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4158         enumerator types here and call InitGenericCoreTypes().
4159         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4160         after calling InitEnumUnderlyingTypes().
4161
4162         * rootcontext.cs
4163         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4164         `classes_second_stage'. 
4165
4166 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4167
4168         * assign.cs, ecore.cs, expression.cs: Share error message text.
4169         * class.cs (FieldMember.Define): Check for varible of static type.
4170         * driver.cs (LoadAssembly): Uses error output for errors.
4171         * statement.cs: Updated.
4172
4173 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4174
4175         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4176         type instance.
4177
4178 2006-09-07  Martin Baulig  <martin@ximian.com>
4179
4180         * driver.cs
4181         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4182
4183 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4184
4185         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4186         
4187 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4188
4189         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4190         #52019 and #79064, the use of the \uXXXX sequence in source code
4191         to represent unicode characters.
4192
4193 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4194
4195         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4196         support.
4197         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4198
4199 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4200
4201         * assign.cs: Catch attempts to assign to a method groups in += and
4202         report as 1656
4203
4204 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4205
4206         A fix for #79056
4207         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4208
4209 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4210
4211         * class.cs (Method.Define): Issue a warning when generic method looks like
4212         an entry point.
4213         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4214         as well.
4215
4216 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4217  
4218         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4219         looking for ctor.
4220         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4221         search all base interfaces as a member can be ambiguous.
4222         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4223         Constructor member type filter. 
4224         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4225         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4226         reporting for returned memberinfos.
4227         * report.cs: Updated.
4228         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4229         version to work on all runtimes.
4230         (TypeManager.RealMemberLookup): Removed members filtering.
4231
4232 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4233
4234         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4235         (PropertyExpr.EmitAssign): Likewise.
4236         * expression.cs (Indirection.EmitAssign): Likewise.
4237         (LocalVariableReference.EmitAssign): Likewise.
4238         (ParameterReference.EmitAssign): Likewise.
4239         (Invocation.EmitArguments): Likewise.
4240         (ArrayAccess.EmitAssign): Likewise.
4241         (IndexerAccess.EmitAssign): Likewise.
4242         (This.EmitAssign): Likewise.
4243         (ConditionalLogicalOperator.Emit): Likewise.
4244
4245         Fix #79026
4246         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4247         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4248         leave it in after returning it.
4249         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4250
4251 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4254         message.
4255
4256 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4257
4258         Fix cs0146-3.cs and cs0146-4.cs.
4259         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4260         enclosing types don't depend on the current type.
4261
4262 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4263
4264         Fix #77963
4265         * class.cs (TypeContainer.DoDefineMembers): Use
4266         FindBaseMemberWithSameName on Parent, since we're interested in
4267         whether we hide inherited members or not.
4268         (FindBaseMemberWithSameName): Make slightly more robust.
4269
4270         Fix the non-generic testcase from #77396
4271         * decl.cs (DeclSpace.DeclContainer): Remove override.
4272
4273         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4274         declspaces for doppelgangers too.
4275         (UsingEntry): Implement IResolveContext.
4276         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4277         'this' as the resolve context.
4278         (LocalAliasEntry): Likewise.
4279
4280         Implement parts of #77403
4281         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4282         toplevel declaration space.  Each namespace declaration introduces
4283         a "partial" root declaretion space.
4284         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4285         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4286         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4287         from 'current_namespace.SlaveDeclSpace'.
4288         (namespace_declaration): Likewise.
4289         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4290         check.  It can't happen now.
4291         * decl.cs (DeclSpace.LookupType): Likewise.
4292         * driver.cs (MainDriver): Sanity check.
4293
4294 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4295
4296         * decl.cs (DeclSpace.FindNestedType): Remove.
4297         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4298         LookupTypeContainer to get the container of the nested type.
4299         * class.cs (TypeContainer.FindNestedType): Make non-override.
4300
4301 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4302
4303         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4304         * class.cs (TypeContainer.PartialContainer): ... here.
4305         (TypeContainer.AddBasesForPart): New helper.
4306         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4307         instead.
4308         * cs-parser.jay (current_class): Convert to DeclSpace.
4309         (struct_declaration, interface_declaration, class_declaration):
4310         Use AddBasesForPart instead of .Bases directly.
4311         * const.cs, iterators.cs: Update to changes.
4312
4313 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4314
4315         * class.cs (TypeContainer.AddMemberType): Rename from
4316         AddToTypeContainer.
4317         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4318         (AddTypeContainer): New.  Combine AddClassOrStruct and
4319         AddInterface.
4320         (AddPartial): Update.  Add 'is_partial' argument.
4321         * roottypes.cs: Update to changes.
4322         * cs-parser.jay (push_current_class): New helper for handling
4323         current_container and current_class.
4324         (struct_declaration, interface_declaration, class_declaration):
4325         Use it.
4326
4327 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4328
4329         * roottypes.cs: Rename from tree.cs.
4330
4331         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4332         * tree.cs (Tree, ITreeDump): Remove types.
4333         * rootcontext.cs (tree, Tree): Remove fields.
4334         (root, ToplevelTypes): New.
4335         * *.cs: Update to rename.
4336
4337         * tree.cs (Tree.RecordDecl): Remove.
4338         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4339         namespace here.
4340         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4341
4342 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4343
4344         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4345         DoFlowAnalysis and OmitStructFlowAnalysis here.
4346         (ec.With): Rename from WithUnsafe and generalize.
4347         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4348         (ec.WithFlowAnalyis): New.
4349         * ecore.cs, expression.cs, statement.cs: Update.
4350
4351 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4352
4353         * statement.cs (Block.ResolveMeta): Simplify slightly.
4354
4355         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4356         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4357         check_state to flags.
4358         (CheckState, ConstantCheckState): Update.
4359         (InUnsafe): New read-only property.
4360         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4361         arbitrary flags.
4362         (WithUnsafe): New helper similar to WithCheckState.
4363         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4364         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4365
4366 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4367
4368         Make comparisons use the same IL irrespective of whether they're
4369         in a 'checked' or 'unchecked' context: one of the issues in #78899
4370         * codegen.cs (EmitContext.CheckState): Make read-only property.
4371         (EmitContext.ConstantCheckState): Likewise.
4372         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4373         helper that implement a save/restore stack for CheckState
4374         values.  This is the only way to change check-state.
4375         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4376         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4377         (CheckedExpr.EmitBranchable): New forwarding method.
4378         (UnCheckedExpr): Likewise.
4379         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4380         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4381         (Checked.Resolve, checked.DoEmit): Likewise.
4382
4383 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4384
4385         * anonymous.cs: Cache the resolved anonymous delegate, and return
4386         this so that the ResolveTopBlock is only triggered once, not
4387         twice.
4388
4389         Currently we trigger ResolvetopBlock twice due to a first pass of
4390         argument check compatibility, and a second pass that does the
4391         actual resolution.   
4392         
4393 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4394
4395         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4396         modifiers.
4397         * rootcontext.cs (Reset): Add helper_classes.
4398
4399 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4400
4401         A fix for #78860
4402         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4403         correctly.
4404
4405 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4406
4407         * statement.cs (Lock): Handle expressions of type
4408         TypeManager.null_type specially.  Fixes #78770
4409
4410 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4411
4412         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4413         to an event.
4414
4415 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4416
4417         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4418         for accessors as well.
4419         * ecore.cs (EventExpr): Add AccessorTable.
4420
4421 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4422
4423         A fix for #78738
4424         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4425         for CS0122 where appropriate.
4426         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4427         level attributes.
4428         (Filter): Assembly can be null in the case of top level attributes.
4429
4430 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4431
4432         A fix for #78690
4433
4434         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4435         is done at global level.
4436
4437 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4438
4439         A fix for #77002, Implemented TypeForwarder support.
4440
4441         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4442         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4443         * typemanager.cs (): Add type_forwarder_attr_type.
4444
4445 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4446
4447         * report.cs: Add CS0469 warning.
4448
4449 2006-06-21  Martin Baulig  <martin@ximian.com>
4450
4451         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4452         the `try'-block, so we also report CS0016 etc. there.
4453
4454 2006-06-21  Martin Baulig  <martin@ximian.com>
4455
4456         * delegate.cs
4457         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4458
4459 2006-06-21  Martin Baulig  <martin@ximian.com>
4460
4461         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4462         also report CS1686 for parameters.
4463
4464 2006-06-21  Martin Baulig  <martin@ximian.com>
4465
4466         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4467         instead of an error if the value is not implicitly convertible to
4468         the switch types; fixes #77964.
4469
4470 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4471
4472         Fix #78673
4473         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4474         FieldBuilder is null.
4475
4476         Fix #78662
4477         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4478         'left' and 'right' before error-checking.
4479
4480 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4481
4482         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4483         Fixed bug #78601.
4484         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4485         (FieldExpr.DoResolve): likewise.
4486         (PropertyExpr.InstanceResolve): likewise.
4487         (EventExpr.InstanceResolve): likewise. 
4488
4489 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4490
4491         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4492         attribute applicable tests for attribute argument.
4493
4494 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4495
4496         Fix #78079
4497         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4498         (Binary.OverloadResolve_PredefinedIntegral): New.
4499         (Binary.OverloadResolve_PredefinedFloating): New.
4500         (Binary.OverloadResolve_PredefinedString): New.
4501         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4502         Follow the standard more closely, and treat numeric promotions in
4503         terms of overload resolution.
4504         (Binary.CheckShiftArguments): Simplify.
4505
4506 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4507
4508         * flowanalysis.cs (MyBitVector): Simplify representation.
4509         (MyBitVector.Clone): Avoid allocating BitArray.
4510         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4511         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4512         (*): Update.  Change all references to MyBitVector.And and
4513         MyBitVector.Or to &= and |=.
4514
4515 2006-05-29  Raja R Harinath  <rharinath@novell.com>
4516
4517         Fix cs0231-[34].cs.
4518         * cs-parser.jay (formal_parameter_list): Extend the pattern below
4519         to param arguments too.
4520
4521 2006-05-26  Miguel de Icaza  <miguel@novell.com>
4522
4523         * cs-parser.jay: Catch another parsing form for arglist being
4524         followed by other arguments.  Fixes #78313.
4525
4526 2006-05-24  Raja R Harinath  <rharinath@novell.com>
4527
4528         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4529         checking of out parameters to ...
4530         (FlowBranchingToplevel.Merge): ... here.
4531         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4532         set, propagate the origin upward, and only complain if there was
4533         no other error.
4534         (FlowBranchingException.AddContinueOrigin): Likewise.
4535         (FlowBranchingException.AddReturnOrigin): Likewise.
4536         (FlowBranchingException.AddGotoOrigin): Likewise.       
4537
4538 2006-05-23  Raja R Harinath  <rharinath@novell.com>
4539
4540         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4541         unreachable, skip it.
4542         (FlowBranchingException.Merge): Always propagate jumps, even if
4543         the finally block renders subsequent code unreachable.
4544
4545 2006-05-18  Raja R Harinath  <rharinath@novell.com>
4546
4547         Fix #77601
4548         * statement.cs (Goto.Resolve): Move responsibility for resolving
4549         'goto' to FlowBranching.AddGotoOrigin.
4550         (Goto.SetResolvedTarget): New.  Callback to set the
4551         LabeledStatement that's the target of the goto.
4552         (Goto.DoEmit): Use Leave instead of Br when crossing an
4553         unwind-protect boundary.
4554         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4555         LookupLabel and adjust to new semantics.
4556         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4557         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4558         Goto.SetResolvedTarget to update target.
4559         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4560         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4561         AddBreakOrigin & co.  Delay propagation until ...
4562         (FlowBranchingException.Merge): ... this.
4563
4564         * statement.cs (Block.Resolve): Always depend on flow-branching to
4565         determine unreachability.  Kill workaround that originally emitted
4566         only one statement after an "unreachable" label (see infloop in
4567         test-515.cs).
4568
4569         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4570         This is still "wrong", but anything better would probably need a
4571         multi-pass algorithm.
4572         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4573         usage vector.  Force current usage vector to be reachable, to
4574         optimistically signify backward jumps.
4575         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4576         detected.
4577         (FlowBranchingLabeled.Merge): New.  If no backward jump was
4578         detected, return the original salted-away usage vector instead,
4579         updated with appropriate changes.  Print unreachable warning if
4580         necessary.
4581         * statement.cs (Block.Resolve): Don't print unreachable warning on
4582         a labeled statement.
4583
4584 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
4585
4586         * driver.cs: Pass filename without path to AssemblyBuilder's 
4587         AddResourceFile. Fixes bug #78407.
4588
4589 2006-05-17  Raja R Harinath  <rharinath@novell.com>
4590
4591         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4592         * flowanalysis.cs (FlowBranchingLabeled): ... here.
4593         (FlowBranching.MergeChild): Overwrite
4594         reachability information from Labeled branchings too.
4595
4596 2006-05-16  Raja R Harinath  <rharinath@novell.com>
4597
4598         * statement.cs (Goto.Resolve): Merge jump origins here ...
4599         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4600
4601         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4602         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
4603         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
4604         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4605         here, ...
4606         * statement.cs (Goto.Resolve): ... not here.
4607         (Goto.Emit): Remove CS1632 check.
4608
4609 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
4610
4611         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4612         error message.
4613
4614 2006-05-11  Raja R Harinath  <rharinath@novell.com>
4615
4616         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4617         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4618         (FlowBranchingException.Label): Likewise.
4619
4620         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
4621         given value.
4622         (MyBitVector.Or): Use it to avoid losing information (Count).
4623         (FlowBranching.MergeOrigins): Likewise.
4624
4625         * flowanalysis.cs (UsageVector.IsDirty): Remove.
4626         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4627         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4628         (UsageVector.ToString): Simplify.
4629         (UsageVector.MergeSiblings): Move here from ...
4630         (FlowBranching.Merge): ... here.
4631         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4632         not a MyBitVector.
4633
4634 2006-05-10  Raja R Harinath  <rharinath@novell.com>
4635
4636         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4637         null bitvector is treated as all-true.
4638
4639         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4640         (MyBitVector): Rationalize invariants.  'vector != null' implies
4641         that we have our own copy of the bitvector.  Otherwise,
4642         'InheritsFrom == null' implies all inherited bits are true.
4643
4644 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * statement.cs (LocalInfo): Add IsConstant.
4647         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4648         local variable for constants.
4649
4650 2006-05-09  Raja R Harinath  <rharinath@novell.com>
4651
4652         * flowanalysis.cs (MyBitVector.Empty): New.
4653         (MyBitVector): Don't allow InheritedFrom to be null.
4654         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4655         (UsageVector, FlowBranching): Update to changes.
4656
4657         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4658         recursion.  The 'Parent == null' condition isn't sufficient for
4659         anonymous methods.
4660         (FlowBranching.AddBreakOrigin): Likewise.
4661         (FlowBranching.AddContinueOrigin): Likewise.
4662         (FlowBranching.AddReturnOrigin): Likewise.
4663         (FlowBranching.StealFinallyClauses): Likewise.
4664         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4665         (FlowBranching.CheckOutParameters): Likewise.
4666         (FlowBranchingToplevel): Terminate all the above recursions here.
4667         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4668         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4669
4670         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
4671         toplevel block.
4672         (FlowBranchingToplevel): New.  Empty for now.
4673         (FlowBranching.MergeTopBlock): Update.
4674         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4675         branching for the anonymous delegate.
4676         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4677
4678         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4679         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4680         information at the start of the merge.  Reorganize.
4681
4682 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4683
4684         * class.cs (MethodData.Define): Method cannot implement interface accessor.
4685
4686 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4687
4688         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4689         to newly introduced ctor.
4690
4691         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4692         message to one place.
4693         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4694         global namespace.
4695
4696 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4697
4698         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4699
4700         * ecore.cs (Expression.ResolveAsConstant): Updated.
4701
4702         * statement.cs (ResolveMeta): Updated.
4703
4704 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4705
4706         * cs-parser.jay: __arglist cannot be used in initializer.
4707
4708 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4709
4710         A fix for #77879
4711         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4712         private types.
4713
4714 2006-05-05  Raja R Harinath  <rharinath@novell.com>
4715
4716         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4717         (LabeledStatement): Add 'name' parameter.
4718         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4719         (Block.AddLabel): Update to changes.
4720         * cs-parser.jay (labeled_statement): Likewise.
4721
4722         * flowanalysis.cs (BranchingType.Labeled): New.
4723         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4724         (FlowBranchingLabeled): New.  Does nothing for now, but will
4725         eventually handle 'goto' flows.
4726         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4727         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4728         that's terminated ...
4729         (Block.Resolve): ... here.
4730
4731         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4732         (UsageVector.MergeFinallyOrigins): Likewise.
4733         (FlowBranching.InTryOrCatch): Likewise.
4734         (FlowBranching.AddFinallyVector): Likewise.
4735         (FlowBranchingException): Update to changes.
4736
4737         Fix #78290
4738         * statement.cs (Return.Resolve): Move error checking to ...
4739         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4740         (FlowBranchingException): Handle return origins like break and
4741         continue origins.
4742         (FlowBranching.UsageVector.CheckOutParameters): Remove.
4743
4744 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4745
4746         A fix for #76122
4747         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4748         filter.
4749
4750 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4751
4752         A fix for #77543
4753         * class.cs (MethodData.Define): Do public accessor check only when method
4754         implements an interface.
4755
4756 2006-05-04  Raja R Harinath  <rharinath@novell.com>
4757
4758         Remove special handling of 'break'
4759         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
4760         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
4761         (UsageVector.Break): Remove.
4762         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
4763         reachability.
4764         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
4765
4766         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
4767         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
4768
4769 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
4770
4771         A fix for #75726
4772         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
4773         be the interface member.
4774
4775 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
4776
4777         A fix for #60069
4778         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
4779         for emitting small (int) values.
4780
4781 2006-05-03  Raja R Harinath  <rharinath@novell.com>
4782
4783         Fix #59427
4784         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
4785         control-flow passes through the 'finally' after merging-in all the
4786         control-flows from 'try' and the 'catch' clauses.
4787
4788         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4789         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
4790         always true at the only non-recursive entry point.
4791         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
4792         FlowBranchingBreakable.
4793         (FlowBranchingLoop): Remove.
4794         * statement.cs (Return.DoResolve): Update to changes.
4795
4796         Fix #76471, #76665
4797         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
4798         (FlowBranching.CreateBranching): Handle it: create a
4799         FlowBranchingContinuable.
4800         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
4801         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
4802         except that it handles the 'continue' command.
4803         (FlowBranching.UsageVector.MergeOrigins): Rename from
4804         MergeBreakOrigins.
4805         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
4806         except that it overrides AddContinueOrigin.
4807         (FlowBranchingException): Override AddContinueOrigin, similar to
4808         AddBreakOrigin.
4809         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
4810         Create a new branching around the embedded statement.
4811         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
4812         control flow after the embedded statement.
4813         (Continue.Resolve): Move all error checking to AddContinueOrigin.
4814
4815         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
4816         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
4817         FlowBranchingBreakable.
4818         (FlowBranchingSwitch): Remove.
4819
4820         Fix test-503.cs
4821         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
4822         error reporting to ...
4823         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
4824         Rename from 'AddBreakVector'.  Add new location argument.  Return
4825         a bool indicating whether the 'break' crosses an unwind-protect.
4826         (FlowBranchingException.AddBreakOrigin): Add.
4827         (FlowBranchingException.Merge): Propagate 'break's to surrounding
4828         flowbranching after updating with the effects of the 'finally'
4829         clause.
4830         (FlowBranchingBreakable): New common base class for
4831         FlowBranchingLoop and FlowBranchingSwitch.
4832
4833         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
4834         embedded statement.
4835         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
4836
4837 2006-05-02  Raja R Harinath  <rharinath@novell.com>
4838
4839         * statement.cs (Do.Resolve): If the loop is infinite, set the
4840         barrier.
4841         (While.Resolve, For.Resolve): Set a barrier after the embedded
4842         statement.  There's no direct control flow that goes from the end
4843         of the embedded statement to the end of the loop.
4844         * flowanalysis.cs (FlowBranching.Infinite): Remove.
4845         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
4846         above ensure that the reachability is correctly computed.
4847
4848         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
4849         (UsageVector.MergeBreakOrigins): If the current path is
4850         unreachable, treat it as if all parameters/locals are initialized.
4851         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
4852         infinite loops before merging-in break origins.
4853
4854         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
4855         (Reachability.Reachable): Split part into ...
4856         (Reachability.Unreachable): ... this.  Simplify.
4857         (Reachability.IsUnreachable): Use 'Unreachable' instead.
4858
4859         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
4860         (Reachability.SetThrowsSometimes): Likewise.
4861         (FlowBranchingBlock.MergeTopBlock): Don't compare against
4862         TriState.Always, use corresponding property.
4863         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
4864         (Block.Resolve): Likewise.  Remove some redundant checks.
4865
4866 2006-05-02  Raja R Harinath  <harinath@gmail.com>
4867
4868         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
4869         (Reachability.Meet): Don't bother checking AlwaysThrows --
4870         barrier is always set.
4871         (FlowBranchingBlock.Merge): Likewise.
4872
4873 2006-05-01  Raja R Harinath  <harinath@gmail.com>
4874
4875         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
4876         checks for unreachable.
4877
4878 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
4879
4880         A fix for #77980
4881         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
4882
4883         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
4884         whether field is really assigned.
4885
4886 2006-04-30  Raja R Harinath  <harinath@gmail.com>
4887
4888         * flowanalysis.cs (Reachability): Make 4-argument constructor
4889         private.
4890         (Reachability.Meet): Rename from 'And'.  Remove static variant.
4891         (Reachability.Always): Rename from the highly misleading
4892         'Reachability.Never'.
4893         (FlowBranching.Merge): Update to changes.  Mark an impossible
4894         situation with a 'throw'.
4895         (*): Update to changes.
4896
4897 2006-04-29  Raja R Harinath  <harinath@gmail.com>
4898
4899         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
4900         Remove 'Undefined'.
4901         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
4902         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
4903         (*): Update to changes.
4904         * statement.cs: Update to changes.
4905
4906 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
4907
4908         A fix for #78049
4909         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
4910
4911 2006-04-28  Raja R Harinath  <harinath@gmail.com>
4912
4913         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
4914         dummy UsageVector.
4915
4916         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
4917         argument to two arguments: an usage-vector and a bool.  Move call
4918         to FlowBranching.Merge () ...
4919         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
4920
4921         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
4922         handling of loop and switch reachability to ...
4923         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
4924
4925 2006-04-27  Raja R Harinath  <harinath@gmail.com>
4926
4927         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
4928         handling to FlowBranchingLoop.InLoop.
4929         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
4930
4931 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
4932
4933         A fix for #78115
4934         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
4935         anonymous method is allowed from AnonymousContainer here.
4936
4937         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
4938
4939 2006-04-24  Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix #78156
4942         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
4943
4944 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
4945
4946         A fix for #49011.
4947         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
4948         (DoubleConstant.Reduce): Ditto.
4949
4950 2006-04-23  Raja R Harinath  <rharinath@novell.com>
4951
4952         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
4953         Remove 'lvalue_right_side' argument.  Move parts to ...
4954         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
4955         (LocalVariable.DoResolveLValue): ... these.
4956
4957 2006-04-21  Raja R Harinath  <rharinath@novell.com>
4958
4959         Fix cs1655.cs
4960         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
4961         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
4962         (LocalVariableReference.DoResolveBase): Use it to implement new
4963         CS1655 check.
4964         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
4965         (Argument.Resolve): Simplify.  Move CS1510 check ...
4966         * ecore.cs (Expression.ResolveLValue): ... here.
4967         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
4968         (PropertyExpr.DoResolveLValue): Likewise.
4969         (FieldExpr.Report_AssignToReadonly): Likewise.
4970         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
4971         LValueMemberAccess or LValueMemberOutAccess on instance depending
4972         on it.
4973         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
4974         DoResolve as appropriate.
4975
4976 2006-04-20  Raja R Harinath  <rharinath@novell.com>
4977
4978         Fix #75800
4979         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
4980         implicit conversions on 'out' and 'ref' arguments.
4981
4982         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
4983         improve clarity.  Remove dead code.
4984
4985         Fix #66031
4986         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
4987         (Catch.Resolve): Resolve VarBlock if it exists.
4988
4989 2006-04-19  Miguel de Icaza  <miguel@novell.com>
4990
4991         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
4992         twice, this was some residual code, the enumerator was emitted
4993         properly in the two branche of if later.
4994
4995 2006-04-19  Raja R Harinath  <rharinath@novell.com>
4996
4997         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
4998         cast is never an lvalue.
4999         (Cast.DoResolve, Cast.ResolveRest): Combine.
5000         (Argument.Emit): Simplify slightly.  Move 'Expr is
5001         IMemoryLocation' check ...
5002         (Argument.Resolve): ... here.
5003         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5004
5005         Simplifications.  Fix cs0191-2.cs
5006         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5007         CS1649 and CS1651 to ...
5008         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5009         the actual selection of the error code and message to a lookup
5010         table.  Add a dummy return value to simplify callsites.
5011         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5012         readonly fields of other instances of the same type.  Move CS0197
5013         warning from ...
5014         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5015         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5016         resolution of an out or ref argument.  The code simplification
5017         above uses this invariant.
5018
5019 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5020
5021         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5022         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5023         CheckMarshallByRefAccess.  Drop parameter.
5024         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5025         warning.
5026         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5027         InstanceExpression.
5028         * report.cs (AllWarnings): Add CS1690.
5029         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5030         for ref access too.
5031         (LocalVariableReference.DoResolveBase): Update.
5032
5033 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * class.cs (MethodOrOperator): Moved common parts from method class.
5036         detect obsolete attributes.
5037         (Method.Define): Simplified as it reuses code from base.
5038         (Constructor.ValidAttributeTargets): Fixed issue found during
5039         refactoring.
5040         (Destructor.ValidAttributeTargets): Fixed issue found during
5041         refactoring.
5042         (Operator): Finished refactoring set off by #78020. Operator class is now
5043         ordinary method class.
5044
5045         * anonymous.cs: Updated.
5046
5047         * decl.cs (DeclSpace): Add IsGeneric
5048
5049 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5052
5053 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5056         detect obsolete attributes.
5057         (Method.CreateEmitContext): Moved to MethodOrOperator.
5058
5059 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5060
5061         A fix for #78048.
5062         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5063         customized exception to make crash detection easier.
5064         (MethodOrOperator): Started to work on new base class for methods and
5065         operators.
5066         (Method): Derives from MethodOrOperator.
5067         (Constructor.Emit): Emits its own attributes.
5068         (AbstractPropertyEventMethod.Emit): Ditto.
5069         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5070         patch.
5071         (Operator.Emit): It's temporary more tricky than should be.
5072         
5073         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5074
5075         * report.cs (InternalErrorException): Add ctor with inner exception.
5076
5077 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5078
5079         A fix for #76744.
5080         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5081         only not visible.
5082
5083 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5084
5085         A fix for #77916.
5086         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5087         array.
5088
5089 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5090
5091         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5092         attribute is present and Guid not.
5093         (Interface.ApplyAttributeBuilder): Ditto.
5094
5095         * attribute.cs: Add error message.
5096
5097 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5098
5099         A fix for #78020.
5100
5101         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5102         sources (it's composite) so hold them in extra array as they are used in
5103         Emit phase only. It worked in the previous versions by mistake.
5104         (Attribute.Emit): Emit attribute for more owners when exist.
5105
5106         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5107         it has now different behaviour.
5108
5109 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5110
5111         * constant.cs (Constant.IsDefaultInitializer): New method.
5112
5113         * class.cs: Updated.
5114
5115         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5116         re-initialize default values. It saves KBs almost for every assembly.
5117         Thanks Zoltan for the idea.
5118         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5119         (ArrayCreation.DoResolve): Resolve only once.
5120         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5121         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5122
5123 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5124
5125         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5126         From #77961.
5127
5128 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5129
5130         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5131         in an embedded statement too.
5132
5133 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5134
5135         Fix #77958
5136         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5137
5138 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5139
5140         A fix for #77966.
5141
5142         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5143         was not specified.
5144
5145         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5146
5147 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5148
5149         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5150         phase.
5151
5152         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5153         LocalTemporary change.
5154
5155         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5156         TypeContainer.
5157         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5158         initializers optimization.
5159         (ClassOrStruct.TypeAttr): Moved from modifiers.
5160         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5161         (FieldBase.ResolveInitializer): Resolves initializer.
5162         (FieldBase.HasDefaultInitializer): New property.
5163
5164         * cs-parser.jay: Removed message.
5165
5166         * expression.cs (CompilerGeneratedThis): New specialization.
5167
5168         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5169
5170 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5171
5172         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5173
5174 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5175
5176         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5177         be now EnumConstants only.
5178
5179 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5180
5181         * attribute.cs, driver.cs: Reset more caches.
5182
5183 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5184
5185         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5186
5187 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5188
5189         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5190         for easier reuse. Updated all overrides.
5191         (IntegralConstant): New base class for all integral constants.
5192         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5193         of the constant range, report custom error.
5194         (UIntConstant.Reduce): Fixed uint conversion.
5195
5196         * ecore.cs, literal.cs: Reduce updates.
5197
5198 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5199
5200         A fix for #75813.
5201
5202         * class.cs (Constructor.Define): Removed extra if for default ctors.
5203         A patch from Atsushi Enomoto.
5204
5205 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5206
5207         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5208         GetAttributableValue.
5209
5210         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5211         when required.
5212
5213         * convert.cs (ImplicitConversionRequired): Error message moved to
5214         DoubleLiteral.
5215
5216         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5217         automatic implicit conversion of an output value.
5218         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5219
5220         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5221         conversion.
5222         (TypeOf.GetAttributableValue): Add extra handling for object type.
5223
5224         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5225         special error message.
5226
5227 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5228
5229         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5230         InternalCall.
5231         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5232         compatible with MS runtime.
5233
5234 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5235
5236         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5237         attribute arguments here.
5238
5239         * class.cs (Indexer.Define): The check was moved to attribute class.
5240
5241 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5242
5243         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5244         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5245         easier.
5246
5247 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5248
5249         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5250         mcs to keep code differences small.
5251         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5252         * typemanager.cs (parameter_default_value_attribute_type): New.
5253         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5254         CS1908 check.
5255
5256 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5257
5258         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5259
5260 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5263
5264         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5265         the blocks too.
5266
5267 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5268
5269         * doc-bootstrap.cs : fix build.
5270
5271 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5272
5273         * expression.cs (StringConcat.Append): Issue a warning when empty string
5274         is going to append.
5275
5276 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5277
5278         * assign.cs (CompoundAssign.ResolveSource): Removed.
5279
5280         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5281         clean up.
5282
5283         * class.cs (TypeContainer.FindMethods): Removed.
5284         (TypeContainer.CheckMemberUsage): Made static.
5285
5286         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5287
5288         * constant.cs (CheckRange): Removed unused type argument.
5289         (CheckUnsigned): Removed unused type argument.
5290
5291         * cs-parser.jay: Updated after MemberAccess clean up.
5292         Uses Length for empty string test.
5293
5294         * cs-tokenizer.cs: Uses Length for empty string test.
5295         (IsCastToken): Made static.
5296         (is_hex): Made static.
5297         (real_type_suffix): Made static.
5298
5299         * decl.cs (SetupCache): Made static.
5300         (OnGenerateDocComment): Removed unused ds argument.
5301
5302         * delegate.cs (VerifyDelegate): Removed unused argument.
5303
5304         * doc.cs: Uses Length for empty string test.
5305
5306         * driver.cs: Uses Length for empty string test.
5307
5308         * enum.cs (IsValidEnumType): Made static
5309
5310         * expression.cs (EnumLiftUp): Removed unused argument.
5311         (ResolveMethodGroup): Ditto.
5312         (BetterConversion): Ditto.
5313         (GetVarargsTypes): Ditto.
5314         (UpdateIndices): Ditto.
5315         (ValidateInitializers): Ditto.
5316         (MemberAccess.ctor): Ditto.
5317         (GetIndexersForType): Ditto.
5318
5319         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5320
5321         * iterators.cs: Updated after MemberAccess clean up.
5322
5323         * location.cs: Uses Length for empty string test.
5324
5325         * namespace.cs: Uses Length for empty string test.
5326
5327          * report.cs (CheckWarningCode): Made static.
5328
5329         * statement.cs (LabeledStatement): Removed unused argument.
5330
5331         * typemanager.cs (FilterNone): Removed.
5332
5333 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5334
5335         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5336         obsolete.
5337
5338         * class.cs: Updated.
5339
5340 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5341
5342         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5343
5344 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5345
5346         A fix for #77822.
5347
5348         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5349         reporting, it's more tricky than I thought.
5350
5351 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5352
5353         A fix for #77816.
5354
5355         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5356         host container.
5357         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5358         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5359         Add more error reporting; Fixed issue with params.
5360
5361         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5362
5363         * cs-parser.jay: AnonymousMethod requires host container.
5364
5365         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5366
5367 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5368
5369         * class.cs: Change 'TypeContainer ds' constructor argument to
5370         'DeclSpace parent'.  Some classes were missed below due to
5371         different naming convention.
5372
5373         * class.cs (MemberCore.Parent): Delete.  This makes the
5374         ParentContainer changes below enforceable by the compiler.
5375
5376         Treat pointers to enclosing declaration space as 'DeclSpace', not
5377         'TypeContainer'.
5378         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5379         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5380
5381         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5382         of TypeContainer.
5383         (Block.AddThisVariable): Likewise.
5384         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5385         (AbstractPropertyEventMethod.Emit): Likewise.
5386         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5387         (GetMethod.Define, SetMethod.Define): Likewise.
5388         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5389         (DelegateMethod.EmitMethod): Likewise.
5390
5391         Fix regression test-partial-13.cs.
5392         Rationalize use of PartialContainer.  Ensure that the partial
5393         class semantics can be tied to type-correctness, i.e., any
5394         violation will cause a compile error.
5395         * class.cs, const.cs: Access all fields that belong to class
5396         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5397         Resolve()-like functions still use 'Parent'.
5398
5399         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5400         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5401         (PropertyMethod.CheckModifiers): Remove unused argument.
5402         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5403         DeclSpace.
5404
5405 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5406
5407         Make semantics of PartialContainer simpler.
5408         * decl.cs (DeclSpace.IsPartial): Remove.
5409         * class.cs (TypeContainer.IsPartial): Likewise.
5410         (TypeContainer..ctor): Set PartialContainer to point to self.
5411         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5412         (TypeContainer.FindNestedType): Likewise.
5413         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5414
5415 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5416
5417         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5418
5419 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5420
5421         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5422         classes.
5423
5424 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5425
5426         * class.cs (Operator.Define): An error for base conversion was not
5427         reported correctly.
5428
5429 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5430
5431         * iterator.cs : yield break is allowed in try statement which has
5432           catch clauses. Fixed bug #77767.
5433
5434 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5435
5436         A fix for #77593, #77574.
5437
5438         * class.cs (MethodCore.CheckBase): Another if for operator.
5439
5440 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5441
5442         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5443         were not resolved
5444
5445         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5446         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5447         conversion test.
5448         
5449         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5450         not needed.
5451
5452         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5453         Updated after another emitcontext usage was clean up. It should help us to
5454         synchronize with gmcs easier.
5455
5456 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5457
5458         A fix for #77353.
5459
5460         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5461         (Event.Define): ditto
5462         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5463
5464         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5465         Removed redundant code and set NewSlot for Invoke method too.
5466
5467         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5468         (Parameters.MergeGenerated): New method. Use this method when you merge
5469         compiler generated argument with user arguments.
5470
5471 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * attribute.cs (ResolveAsTypeTerminal): Removed.
5474
5475         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5476         specialization for predefined types; 30% speed up.
5477         Finally placed obsolete check to right place.
5478         (Expression.ResolveType): Removed.
5479
5480         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5481         Updated after ResolveType was removed.
5482
5483         * expression.cs (Cast.ctor): Check void cast.
5484         (Binary.ResolveAsTypeTerminal): Is never type.
5485         (Conditional.ResolveAsTypeTerminal): Is never type.
5486
5487         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5488
5489 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5490
5491         Fix #77679.
5492         * expression.cs (ParameterReference.DoResolveBase): Change return
5493         type to bool.
5494         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5495         Update.
5496
5497         Fix #77628.
5498         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5499
5500         Fix #77642.
5501         * typemanager.cs (GetFullNameSignature): Don't nullref on
5502         protected accessors.
5503
5504 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5505
5506         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5507         these two separated members to simplify the code.
5508         (Attribute.Resolve): Refactored to use new fields and methods.
5509         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5510         implemented obsolete attribute checking.
5511         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5512         implemented obsolete checking again. It look line never ending quest ;-)
5513         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5514
5515         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5516
5517         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5518
5519         *class.cs (Property.Define): Add RegisterProperty call.
5520
5521         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5522         argument groups (only 2).
5523
5524         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5525         encoding expression to arguments.
5526         (Expression.ExprClassToResolveFlags): Just turned to property.
5527
5528         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5529         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5530         optimized as well as implemented support for zero-length attributes.
5531
5532         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5533         Add caching of PropertyInfo's.
5534
5535 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5536
5537         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5538         error multiple times.
5539
5540 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5541
5542         New partial class implementation.
5543         A fix for #77027, #77029, #77403
5544
5545         * attribute.cs (Attributable): Made attributes protected.
5546
5547         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5548         the replacements of ClassPart and PartialContainer.
5549         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5550         (TypeContainer.AddInterface): Ditto.
5551         (TypeContainer.AddPartial): The main method for partial classes. It checks
5552         for errors and merges ModFlags and attributes. At the end class is added to
5553         partial_parts list.
5554         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5555         required here.
5556         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5557         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5558         from the rest of partial classes.
5559         (TypeContainer.GetClassBases): Simplified.
5560         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5561         DefineType.
5562         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5563         (TypeContainer.HasExplicitLayout): Uses Flags now.
5564         (PartialContainer): Removed.
5565         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5566         (StaticClass): Was merged with Class.
5567         (Class.GetClassBases): class and static class bases are verified here.
5568         (Class.TypeAttr): Added static attributes when class is static.
5569         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5570         (MemberBase): In some cases we need to call parent container for partial
5571         class. It should be eliminated but it's not easy now.
5572
5573         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5574
5575         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5576         partial classed to accumulate class comments.
5577         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5578
5579         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5580
5581         * driver.cs (MainDriver): Tree.GetDecl was removed.
5582
5583         * modifiers.cs (Modifiers): Add partial modifier.
5584
5585         * tree.cs (Tree.decl): Removed.
5586         (RootTypes): Started to use this class more often for root types
5587         specializations.
5588
5589 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5590
5591         A fix for #77615
5592
5593         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5594         external interface does not have an attribute.
5595
5596 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5597
5598         Another prerequisites for new partial classs implementation.
5599         
5600         * attribute.cs (Attribute.Equal): Implemented.
5601         (Attribute.Emit): Changed as attributes can be applied more than twice.
5602         (Attributes.Emit): Check for duplicate attributes here.
5603
5604         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5605         as a parameter, clean-up.
5606
5607 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5608
5609         A fix for #77485
5610
5611         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5612         contains obsolete attribute check which can in some cases look for base
5613         type of current class which is not initialized yet.
5614         (TypeContainer.BaseType): Replacement of ptype.
5615
5616         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5617
5618 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5619
5620         First of prerequisites for new partial classs implemention.
5621         
5622         * attribute.cs (Attributable): Extended by ResolveContext;
5623         Attributes finally have correct context for resolving in all cases.
5624         (AttachTo): Attribute owner is assigned here.
5625
5626         * codegen.cs (IResolveContext): Introduce new interface to hold
5627         all information needed in resolving phase.
5628         (EmitContext): Implements IResolveContext; more clean-up needed here.
5629         
5630         * decl.cs (MemberCore): Implemented IResolveContext.
5631
5632         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5633         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5634         parameter.cs, statement.cs, tree.cs, typemanager.cs:
5635         Refactored to use new IResolveContext instead of EmitContext; cleanup
5636
5637 2006-02-06  Miguel de Icaza  <miguel@novell.com>
5638
5639         * codegen.cs (EmitScopeInitFromBlock): check here the
5640         capture_context, there is no need to make two calls to the
5641         EmitContext. 
5642
5643         * anonymous.cs: Add some debugging messages that might help me
5644         track other instances of this problem in the future (the
5645         regression of test 467).
5646
5647         * cs-parser.jay: track the variable block, as we need to initalize
5648         any captured variables declared in this block for the "catch"
5649         portion of the "Try" statement.
5650
5651         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5652         scope initialization for captured variables. 
5653
5654         Also, move the emit for the variables after the block location has
5655         been marked.
5656
5657 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
5658
5659         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5660
5661 2006-02-02  Miguel de Icaza  <miguel@novell.com>
5662
5663         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5664         commit yesterday, the initialization for the roots is necessary.
5665         What is not necessary is the scope activation.
5666
5667 2006-02-02  Raja R Harinath  <rharinath@novell.com>
5668
5669         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5670         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5671         CS0206 checks.
5672         (Argument.Resolve): Remove CS0206 checks.
5673
5674 2006-02-01  Miguel de Icaza  <miguel@novell.com>
5675
5676         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5677         scopes for all the roots, the scopes will now be emitted when the
5678         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
5679
5680         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5681         code.  This reduces a lot of existing cruft.
5682         
5683         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5684         that the ScopeInfo is generated as we enter the scope, not at the
5685         time of use, which is what we used to do before.
5686
5687         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5688         every time a Block is about to be emitted if we have a
5689         CaptureContext. 
5690
5691 2006-02-01  Raja R Harinath  <rharinath@novell.com>
5692
5693         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5694         (Reset): Update.
5695         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5696
5697         * typemanager.cs (cons_param_array_attribute): Make private.
5698         (Reset): Set it to null.
5699         (InitCoreHelpers): Don't initialize it.
5700         (ConsParamArrayAttribute): New.  Initialize it as needed.
5701         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5702
5703 2006-01-31  Miguel de Icaza  <miguel@novell.com>
5704
5705         * expression.cs: There might be errors reported during the
5706         selection of applicable methods.  If there are errors, do not
5707         continue execution as it will lead the compiler to crash.
5708
5709 2006-01-30  Miguel de Icaza  <miguel@novell.com>
5710
5711         * expression.cs: Member access is not allowed on anonymous
5712         methods.  Fixes #77402.
5713
5714 2006-01-30  Raja R Harinath  <rharinath@novell.com>
5715
5716         Fix #77401
5717         * cs-parser.jay (VariableDeclaration): Don't set
5718         current_array_type to null.
5719         (field_declaration, event_declaration, declaration_statement):
5720         Set it to null here.
5721
5722 2006-01-28  Raja R Harinath  <harinath@gmail.com>
5723
5724         * typemanager.cs (GenericParameterPosition): New.
5725         * doc.cs: Use it.
5726
5727 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
5728
5729         * doc.cs : To process "include" elements, first we should create
5730           another list than XmlNodeList, because it could result in node
5731           removal, which could result in that the XmlNodeList gives up
5732           yielding next node.
5733
5734           (Also made code identical to gmcs again.)
5735
5736 2006-01-25  Miguel de Icaza  <miguel@novell.com>
5737
5738         * ecore.cs: Introduce an error report that we were not catching
5739         before, if not silent, we must report the error.  Gonzalo ran into
5740         it.
5741
5742 2006-01-23  Miguel de Icaza  <miguel@novell.com>
5743
5744         A fix for bug: #76957
5745         
5746         * iterators.cs (MoveNextMethod.CreateMethodHost): call
5747         ComputeMethodHost before creating the method, this is a new
5748         requirement. 
5749
5750         * anonymous.cs (AnonymousContainer): Now we track all the scopes
5751         that this method references (RegisterScope).  The actual scope
5752         where the method is hosted is computed with the ComputeMethodHost
5753         before we create the method.
5754
5755         Moved the Deepest routine here.
5756
5757         (AnonymousContainer.ComputeMethodHost): New routine used to
5758         compute the proper ScopeInfo that will host the anonymous method.
5759
5760         (ScopeInfo): Deal with multiple roots.  The problem was that we
5761         did not have a unique root where all ScopeInfos could be hanged
5762         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
5763         of roots.  
5764
5765         Remove AdjustMethodScope which is now computed at the end.  Remove
5766         LinkScope which did a partial link, instead link all ScopeInfos
5767         before code generation from the new "LinkScopes" routine. 
5768
5769         Simplify all the Add* routines as they no longer need to maintain
5770         the tree, they just need to record that they are using variables
5771         from a ScopeInfo.
5772
5773         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
5774         routines to produce the forest of ScopeInfo trees.
5775
5776         * class.cs (TypeContainer.AppendMethod): This is just like
5777         AddMethod, but ensures that an interface implementation method
5778         (IEnumerable.XXX) is not inserted at the beginning of the queue of
5779         methods, but at the end.
5780
5781         We use this functionality to ensure that the generated MoveNext
5782         method in the iterator class is resolved/emitted before the
5783         enumerator methods created.   
5784
5785         This is required because the MoveNext method computes the right
5786         ScopeInfo for the method.  And the other methods will eventually
5787         need to resolve and fetch information computed from the anonymous
5788         method. 
5789
5790 2006-01-21  Raja R Harinath  <harinath@gmail.com>
5791             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
5792
5793         Fix rest of #76995.
5794         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
5795         the 'aliases' hash.
5796         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
5797         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
5798
5799 2006-01-18  Raja R Harinath  <rharinath@novell.com>
5800
5801         Fix #76656, cs0231-2.cs.
5802         * cs-parser.jay (formal_parameter_list): Make error case catch
5803         more issues.
5804         (parenthesized_expression_0): Add CS1026 check.
5805         (invocation_expression): Remove unused { $$ = lexer.Location }.
5806
5807 2006-01-17  Raja R Harinath  <rharinath@novell.com>
5808
5809         Fix #76824.
5810         * cs-parser.jay (statement_expression): Don't list out the
5811         individual statement-expressions.  Convert syntax error into
5812         CS0201 check.
5813
5814 2006-01-16  Raja R Harinath  <rharinath@novell.com>
5815
5816         Fix #76874.
5817         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
5818         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
5819         CheckIntermediateModification.
5820         (FieldExpr.DoResolve): Add new two-argument version that
5821         allows us to resolve the InstanceExpression as an lvalue.
5822         The one-argument variant is now just a wrapper.
5823         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
5824         Resolve the lhs as an lvalue if the it has a value type.
5825         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
5826         from Assign.DoResolve.
5827         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
5828         resolved as an lvalue.
5829         (PropertyExpr.DoResolve): Update.
5830         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
5831         has a value type.  Move CS1612 check here from
5832         CheckIntermediateModification.
5833         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
5834         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
5835         'right_side' of a ResolveLValue on an 'out' argument.
5836         (EmptyExpression.LValueMemberAccess): New.  Used as the
5837         'right_side' of a propagated ResolveLValue on a value type.
5838         (LocalVariableReference.DoResolveBase): Recognize
5839         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
5840         Add CS1654 check.
5841         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
5842         EmptyExpression.Null.
5843
5844 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
5845
5846         * typemanager.cs : added IsGenericParameter(). In mcs it always
5847           return false.
5848         * doc.cs : for generic parameters, use GenericParameterPosition,
5849           not FullName.
5850
5851 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
5852
5853         * expression.cs: Fix Console.WriteLine ((this = x).foo);
5854
5855 2006-01-12  Miguel de Icaza  <miguel@novell.com>
5856
5857         This fixes the problem where we used ldfld instead of ldflda to
5858         load the "THIS" pointer on captured parameters, when THIS is a
5859         value type.  See bug #77205.
5860         
5861         * iterators.cs (CapturedThisReference.Emit): Pass false to
5862         EmitThis (we do not need the address).
5863
5864         * codegen.cs (EmitThis): it needs to know whether we need the
5865         address of `this' or not.  This is used by value types.  
5866
5867         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
5868         every other call passes false.
5869
5870 2006-01-12  Raja R Harinath  <rharinath@novell.com>
5871
5872         Fix #77221.
5873         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
5874         GetOverride.
5875         * expression.cs (Invocation.OverloadResolve): Update.
5876         (Invocation.DoResolve): Avoid double resolution of invocation.
5877
5878 2006-01-11  Raja R Harinath  <rharinath@novell.com>
5879
5880         Fix #77180.
5881         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
5882         unary negation of floating point types as 0-expr; negation cannot
5883         overflow in floating point types.
5884
5885         Fix #77204.
5886         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
5887         on operands of 'void' type.
5888
5889         Fix #77200.
5890         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
5891         and ExclusiveOr for boolean constants too.
5892
5893 2006-01-09  Raja R Harinath  <rharinath@novell.com>
5894
5895         Fix #75636.
5896         * expression.cs (Invocation.OverloadResolve): Replace reflected
5897         override methods with their base virtual methods, rather than
5898         skipping over them.
5899         * typemanager.cs (TypeManager.GetOverride): New.
5900
5901 2006-01-05  Jb Evain  <jbevain@gmail.com>
5902
5903         * class.cs (Property.Define, Indexer.Define): do not tag the
5904         properties as SpecialName | RTSpecialName.
5905
5906 2006-01-04  Miguel de Icaza  <miguel@novell.com>
5907
5908         * class.cs (MethodCore.IsDuplicateImplementation): This method was
5909         doing a low-level comparission of parameter types.  It was lacking
5910         a check for __argslist. 
5911
5912 2005-12-30  Miguel de Icaza  <miguel@novell.com>
5913
5914         * expression.cs (ParameterReference.DoResolveBase): Allow
5915         reference parameters if they are local to this block. 
5916
5917         This allows the ref and out parameters of a delegate to be used in
5918         an anonymous method, for example:
5919
5920         delegate void set (out int x);
5921
5922         set s = delegate (out int x){
5923                 x = 0;
5924         };
5925
5926         This is used by functionality introduced late in the C# language.
5927         
5928         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
5929         method that take ref and out parameters. 
5930
5931         Fixes #77119 which was a late change in the spec.
5932
5933 2005-12-23  Miguel de Icaza  <miguel@novell.com>
5934
5935         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
5936         parent if its the same scope.  Fixes #77060.
5937
5938 2005-12-21  Miguel de Icaza  <miguel@novell.com>
5939
5940         * driver.cs: Report the case of no source files and no -out:
5941         argument provided.
5942
5943 2005-12-20  Raja R Harinath  <rharinath@novell.com>
5944
5945         Fix #77035.
5946         * expression.cs (ComposedCast.GetSignatureForError): Define.
5947
5948 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5949
5950         Fix #76995
5951
5952         * namespace.cs (NamespaceEntry): Add extern_aliases as a
5953         ListDictionary, to contain the ExternAliasEntry entries (in
5954         addition to the NamespaceEntry.aliases hashtable). This field is
5955         shared between the original entry and its doppelganger (bodyless 
5956         copy of it).
5957         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
5958         extern_aliases field.
5959         (NamespaceEntry.Lookup): Move the IsImplicit check after the
5960         lookup in extern_aliases.
5961
5962 2005-12-16  Raja R Harinath  <rharinath@novell.com>
5963
5964         Fix #77006.
5965         * class.cs (TypeContainer.Mark_HasEquals): New.
5966         (TypeContainer.Mark_HasGetHashCode): New.
5967         (ClassPart): Override them.
5968         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
5969
5970         Fix #77008.
5971         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
5972         'parent' argument to the base constructor.
5973
5974         Remove all mention of TypeContainer from decl.cs.
5975         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
5976         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
5977         (DeclSpace.DeclSpace): Likewise.
5978         (DeclSpace.DefineMembers): Remove unused argument.
5979         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
5980         debugging check -- we don't care if the debug code throws an
5981         InvalidCastException instead of an InternalErrorException.
5982         * class.cs (TypeContainer.DefineMembers): Update to changes.
5983         (TypeContainer.DoDefineMembers): Likewise.
5984         (TypeContainer.GetMethods): Likewise.
5985         (PropertyMember.Define): Likewise.
5986         (MemberBase.Parent): New property that forwards to
5987         MemberCore.Parent, but ensures that we get a TypeContainer.
5988         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
5989         (RootContext.PopulateTypes): Likewise.  Remove special case code
5990         for !RootContext.StdLib: DefineMembers is idempotent.
5991
5992 2005-12-14  Miguel de Icaza  <miguel@novell.com>
5993
5994         * convert.cs (ExplicitConversionCore): Check the return value from
5995         ExplicitConversionCore which can return null on failure.  Fixes #76914
5996
5997 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
5998
5999         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6000
6001 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6002
6003         * doc.cs : The search for referenced namespace was insufficient to
6004           get global one as it used to do. Fixed bug #76965.
6005
6006 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6007
6008         * doc.cs : check name in cref in the last phase that whether it is
6009           namespace or not.
6010
6011 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6012
6013         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6014           Mono.C5.
6015
6016 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6017
6018         * doc.cs : so it turned out that we cannot skip override check for 
6019           interface members. Fixed bug #76954.
6020
6021 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6022
6023         * cs-tokenizer.cs : fixed bug #75984:
6024           - #warning and #error should not be handled when the source line
6025             is disabled.
6026           - #line is not checked strictly when the source line is disabled.
6027           - #define and #undef is on the other hand checked strictly at any
6028             state.
6029
6030 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6031
6032         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6033           CS1027 report.
6034
6035 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6036
6037         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6038
6039         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6040         event initializers.
6041         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6042         (FieldBase.Initializer): Initializer is now optional.
6043         (EventField.Define): Only event field can have initializer.
6044
6045         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6046
6047         * const.cs (Const): Reuse initializer.
6048
6049         * cs-parser.jay: Updated after FieldBase changes.
6050         Added current_array_type to simplify array initializers.
6051
6052         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6053
6054         * expression.cs, iterators.cs: Updated.
6055
6056         * namespace.cs (NamespaceEntry): Made UsingFound private.
6057
6058 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * parameterCollection.cs: Obsolete, removed.
6061         * parser.cs: Obsolete, removed.
6062
6063 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6064
6065         Fix #76849.
6066         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6067
6068         * enum.cs (Enum.Define): Set obsolete context here.
6069
6070 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6071
6072         * doc.cs :
6073           - FindDocumentedMember() now expects 1) paramList as null
6074             when "we don't have to check the number of parameters" and
6075             2) Type.EmptyTypes when "there is no arguments".
6076           - Introduced FoundMember struct to hold the exact type which was
6077             used to find the documented member (the above change broke
6078             test-xml-044; it might be better just to use DeclaringType than
6079             what MS does, like this change does, but it depends on usage.)
6080
6081 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6082
6083         * doc.cs : documented member might be from DeclaringType for nested
6084           types. Fixed bug #76782.
6085
6086 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6087
6088         * anonymous.cs: Have the param code handle leaving copies on the
6089         stack etc. Allows anonymous params to take part in the assignment
6090         code (++, +=, etc). Fixes bug #76550
6091
6092         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6093         it down to the anon code.
6094
6095         * iterators.cs: Use dummy var here
6096
6097         * codegen.cs: Handle new vars
6098
6099 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6100
6101         Fix #76849.
6102         * class.cs (MethodData.Define): Set proper Obsolete context.
6103
6104         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6105         obsolete context.
6106         (FieldExpr.DoResolve): Ditto.
6107
6108 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6109
6110         Fix #76849.
6111         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6112         parent is not obsolete.
6113
6114 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6115
6116         * doc.cs : (FindDocumentedMember) find parameterless members first
6117           and get CS0419 in the early stage. Fixed first case of bug #76727.
6118
6119 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6120
6121         Fix #76859.
6122         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6123         no error was reported.
6124
6125         *expression.cs (Binary.DoResolve): left can be null.
6126
6127 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6128
6129         Fix #76783.
6130         * class.cs (MethodData.Emit): Parameters should be labeled first.
6131
6132 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6133
6134         Fix #76761.
6135         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6136
6137 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6138
6139         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6140
6141         * class.cs (MethodCore): Parameter clean up.
6142         (IMethodData): Added ParameterInfo.
6143         (MethodData): Parameter clean up.
6144         (Indexer.Define): Parameter clean up.
6145
6146         * anonymous.cs,
6147         * codegen.cs,
6148         * cs-parser.jay,
6149         * decl.cs,
6150         * doc.cs,
6151         * ecore.cs,
6152         * flowanalysis.cs,
6153         * iterators.cs,
6154         * pending.cs,
6155         * statement.cs,
6156         * typemanager.cs: Parameter clean up.
6157
6158         * delegate.cs (Define): Get rid of duplicated code.
6159
6160         * expression.cs (ParameterReference): Removed useless parameters
6161         and simplified.
6162         (Invocation): Ditto.
6163
6164         * parameter.cs (ParamsParameter): New class, params specialization.
6165         (ArglistParameter): Attemp to separate arglist.
6166         (Parameter): Refactored to be reusable and faster.
6167         (Parameter.Modifier): Made understandable.
6168         (Parameters): Changed to be used as a class for `this' assembly
6169         parameters. Refactored to use new specialized classes.
6170
6171         * support.cs (ParameterData): Added Types property.
6172         (InternalParameters): Deleted.
6173
6174 2005-08-20  Martin Baulig  <martin@ximian.com>
6175
6176         Merging this patch from GMCS to fix #75867.
6177
6178         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6179         scope if we don't already have it.
6180
6181 2005-11-17  Martin Baulig  <martin@ximian.com>
6182
6183         * anonymous.cs
6184         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6185         inherit the scope from our parent.  Fixes #76653.
6186
6187 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6188
6189         * doc.cs : the previous patch does not actually fix the bug.
6190           PropertyInfo override check is now implemented and really fixed it.
6191         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6192
6193 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6194
6195         * doc.cs : apply "override filter" also to properties.
6196           Fixed bug #76730.
6197
6198 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6199
6200         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6201           no need to check overrides. For classes, omit those results from 
6202           interfaces since they must exist in the class. Fixed bug #76726.
6203
6204 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6205
6206         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6207           with different parameters. Fixed the second problem in #76685.
6208
6209 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6210
6211         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6212           get expected 'protected' access in CheckValidFamilyAccess()).
6213           Fixed bug #76692.
6214
6215 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6216
6217         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6218           Fixed bug #76705.  CS1569 was incorrectly commented out.
6219
6220 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6221
6222         * doc.cs : use Invocation.IsOverride() to do real override check.
6223         * expression.cs : made Invocation.IsOverride() internal.
6224
6225 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6226
6227         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6228           TypeBuilder.FindMembers() and filter overriden base members out.
6229           Fixed bug #76990.
6230
6231 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6232
6233         * doc.cs : ref/out parameters are represented as '@' (instead of
6234           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6235
6236 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6237
6238         * doc.cs : when there was no '.' in cref to methods in doc comment,
6239           then parameters were missing in the output. Fixed bug #76691.
6240
6241 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6242
6243         * driver.cs : don't output docs when there is an error.
6244           Fixed bug #76693.
6245
6246 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6247
6248         * doc.cs :
6249           Now it should detect indexers. Fixed primary concern in bug #76685.
6250           Fixed CS0419 message to not show the identical member signature in
6251           the message.
6252
6253 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6254
6255         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6256           instead of Type.FindMembers() since it does not handle events.
6257           Fixed bug #71604.
6258
6259 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6260
6261         * codegen.cs: Fixed typo (speficied -> specified).
6262
6263 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6264
6265         Fix #76369.
6266         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6267
6268 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6269
6270         * attribute.cs: Changed error message.
6271
6272         * cs-tokenizer.cs: One more check.
6273
6274 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6275
6276         * statement.cs (Block.Resolve): Ignore empty statement.
6277
6278 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6279
6280         * report.cs: Made error/warning methods more strict to avoid
6281         their misuse.
6282
6283         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6284         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6285         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6286         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6287
6288 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6289
6290         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6291         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6292
6293         * class.cs (TypeContainer.IsComImport): New property.
6294         (Constructor.Define): Create proper ctor for ComImport types.
6295
6296         * expression.cs (New.CheckComImport): Fixed.
6297
6298 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6299
6300         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6301         that a parameter has been captured does not mean that we do not
6302         have to do the rest of the processing.  This fixes the second part
6303         of #76592.  If there was another anonymous method capturing
6304         values in the past, the Scope would never be set for the second
6305         method that captured the same parameter.
6306
6307         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6308         properly manipulate the stack.   Second part of fix for #76592.
6309
6310         * expression.cs (New): Add support for invoking "new" on
6311         interfaces that have been flagged with the ComImport attribute and
6312         the CoClass.  Fixes #76637 
6313
6314         * statement.cs (Try.DoEmit): When a variable is captured, do not
6315         try to emit the vi.LocalBuilder variable as it has been captured.
6316         Create a temporary variable and store the results on the
6317         FieldBuilder.  Fixes #76642
6318
6319 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6320
6321         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6322
6323         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6324
6325         * expression.cs (Binary.DoResolve): Added && optimalization.
6326     
6327         * typemanager.cs (AddUserType): Removed useless argument.
6328
6329 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6330
6331         * statement.cs (Block.variables): Uses ListDictionary.
6332
6333 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6334
6335         Fix #75969.
6336         * class.cs (PartialContainer.EmitType): Customized to emit
6337         security attributes.
6338         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6339         for partial classes.
6340
6341 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6342
6343         Fix #76599.
6344         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6345         access has to be fixed.
6346         
6347         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6348
6349 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6350
6351         Fix #76590.
6352         * ecore.cs (NullCast.Reduce): Implemented.
6353
6354         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6355         constant type.
6356         
6357         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6358         properly.
6359         (Foreach.Resolve): Catch null properly.
6360
6361 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6362  
6363         * cs-tokenizer.cs: Warning text fix.
6364
6365         * driver.cs: AllWarningNumbers exposed on public interface.
6366
6367         * report.cs (): Reviewed warning numbers.
6368         (IsValidWarning): Use binary search.
6369
6370 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6371  
6372         * driver.cs: Implemeted resource visibility.
6373         (Resources): New class for code sharing between /res: and
6374         /linkres:
6375  
6376 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6377
6378         Fix #76568.
6379         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6380         folding.
6381         
6382         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6383         contants only.
6384         
6385         * ecore.cs (NullCast): Child is contant only.
6386         
6387         * literal.cs (NullLiteral.Reduce): null can be converted to any
6388         reference type.
6389
6390 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6391
6392         * driver.cs: Use Encoding.Default as default code page instead
6393           of ISO-28591.
6394
6395 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6396
6397         Fix #76085.
6398         * expression.cs (Invocation.Error_InvalidArguments): Handle
6399         __arglist parameters.
6400         (Invocation.VerifyArgumentsCompat): Likewise.
6401         * support.cs (ReflectionParameters.GetSignatureForError): Print
6402         __arglist parameters.
6403         (InternalParamters.GetSignatureForError): Likewise.
6404         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6405
6406 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6407
6408         * attribute.cs (GetPropertyValue): Made public.
6409
6410         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6411         Resolve.
6412         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6413         attribute.
6414         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6415         is not defined.
6416         
6417         * driver.cs: Reflect method name change.
6418         
6419         * statement.cs (Try.Resolve): Warn when try has both general
6420         exception handlers.
6421         
6422         * typemanager.cs: runtime_compatibility_attr_type new predefined
6423         type.
6424
6425 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6426
6427         Fix #76419.
6428         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6429         treat it as an empty parameter list.
6430
6431 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6432
6433         Fix #76271.     
6434         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6435         ResolveAsTypeStep silent.
6436         * statement.cs (Block.AddConstant): Mark block as used.
6437         (Block.ResolveMeta): Avoid piling on error messages
6438         if a constant initializer resolution fails.
6439
6440 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6441
6442         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6443         Remove.
6444         (NamespaceEntry.VerifyAllUsing): New.
6445         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6446         behaviour.  Delegates actual resolution of alias to ...
6447         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6448         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6449         Update.
6450         * driver.cs (Driver.MainDriver): Update.
6451         
6452         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6453         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6454         property.
6455         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6456         Remove.
6457         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6458         RootNamespace.DefineNamespacesForAll.
6459
6460 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6461
6462         * typemanager.cs (assemblies, external_aliases, modules)
6463         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6464         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6465         overhead.  Move resposibility ...
6466         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6467         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6468
6469 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6470
6471         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6472         cached_namespaces.  Improve usage.
6473         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6474         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6475         Move from GlobalRootNamespace and simplify.
6476         (RootNamespace.Global): Make instance variable.
6477         (RootNamespace.RootNamespace): Add "alias name" parameter.
6478         (GlobalRootNamespace): Simplify drastically.
6479         (Namespace.Lookup): Don't use GetNamespace.
6480         * typemanager.cs (GetRootNamespace): Rename from
6481         ComputeNamespaceForAlias.
6482         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6483
6484 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6485
6486         * anonymous.cs (AnonymousContainer): Don't crash when container
6487         doesn't exist.
6488
6489 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6490
6491         * expression.cs (Binary.DoResolve): Warn when comparing same
6492         values.
6493
6494 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6495
6496         Fix #76486.
6497         * expression.cs (Binary.DoResolve): It looks like there are no
6498         convetsion rules in enum context.
6499
6500 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6501
6502         Add support for extern alias qualifiers.
6503         * typemanager.cs: Move some LookupTypeReflection code
6504         to namespace.cs, to have cleaner code. Added some methods
6505         to help us keep track of the extern aliased references.
6506         * driver.cs: Add suport for extern alias assemblies on command
6507         line and check for their warnings/errors. Also keep track of the
6508         extern aliased assemblies.
6509         * namespace.cs: Move the global functionality of Namespace
6510         to GlobalRootNamespace/RootNamespace. Now the global namespace
6511         is GlobalRootNamespace.Globa. Also the code moved from 
6512         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
6513         Finally added LocalAliasEntry (AliasEntry before) and
6514         ExternAliasEntry, to handle alias statements.
6515         * cs-parser.jay: Add support in the grammar for extern alias
6516         statement.
6517         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
6518         Update callings to Namespace (now in GlobalRootNamespace).
6519
6520 2005-10-18  Raja R Harinath  <rharinath@novell.com>
6521
6522         Fix #76371.
6523         * class.cs (TypeContainer.DefineType): Move updating of
6524         topological sort earlier in the code.
6525         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6526
6527 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
6528
6529         Fix #76273.
6530         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6531         
6532         * constant.cs (Constant.TryReduce): Moved from Cast class.
6533         (Reduce): Made little bit more OO and fixed missing conversions.
6534         
6535         * ecore.cs (Reduce): Implemented.
6536         (Binary.EnumLiftUp): New method to upgrade values to enum values.
6537         
6538         * literal.cs (Reduce): Implemented.
6539         
6540         * class.cs: Reverted Miguel's wrong commit.
6541
6542 2005-10-14  Miguel de Icaza  <miguel@novell.com>
6543
6544         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6545
6546 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6547
6548         * cs-parser.jay, expression.cs : CS0214 was missing error location
6549           for constants. Fixed bug #76404.
6550
6551 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
6552
6553         Fix #76370.
6554         * convert.cs (ExplicitConversionCore): Fixed object->enum
6555         conversion.
6556
6557 2005-10-10  Raja R Harinath  <rharinath@novell.com>
6558
6559         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6560         InstanceExpression.
6561         (PropertyExpr.EmitCall): Likewise.
6562         * expression.cs (Invocation.EmitArguments): Handle case where
6563         arguments == null.
6564         (Invocation.EmitCall): Avoid allocating temporary variable if
6565         there are no arguments.
6566
6567 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6568
6569         Fix #76323.
6570         * convert.cs (ImplicitConversionStandard): Move conversion of
6571         void* to arbitrary pointer types ...
6572         (ExplicitConversionStandard): .. here.
6573         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6574         error to always print typenames.
6575
6576 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6577
6578         * convert.cs (GetConversionOperator): Rename from
6579         GetConversionOperators.  Move operator selection code from ...
6580         (UserDefinedConversion): ... here.
6581
6582 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
6583
6584         * convert.cs (ExplicitConversionCore): Removed duplicate enum
6585         conversion.
6586
6587 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
6588
6589         * assign.cs (Assign.DoResolve): Error method changed.
6590
6591         * cfold.cs (DoConstantNumericPromotions): Error method changed.
6592         
6593         * const.cs (ResolveValue): Reset in_transit immediately.
6594         
6595         * constant.cs: Error method changed.
6596         
6597         * convert.cs: Removed useless location parameter.
6598         (ExplicitNumericConversion): Don't do double enum check.
6599         (ExplicitConversionCore): Renamed from ExplicitConversion.
6600         (ExplicitUnsafe): Extracted from ExplicitConversion.
6601         (ExplicitConversion): Uses for error reporting.
6602         
6603         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6604         error messages.
6605         (ResolveBoolean): Uses common error method.
6606         (CastToDecimal): Get rid of ec.
6607         (CastFromDecimal): Optimized.
6608         (ConvCast): Get rid of ec.
6609         
6610         * enum.cs (ResolveValue): Reset in_transit immediately.
6611         (Emit): Return after first error.
6612         
6613         * expression.cs: Convert changes.
6614         
6615         * literal.cs: Error method changed.
6616         
6617         * statement.cs: Error method changed.
6618
6619 2005-10-03  Raja R Harinath  <rharinath@novell.com>
6620
6621         * support.cs (SeekableStreamReader.Position): Don't error out when
6622         the requested position is just beyond the end of the current
6623         buffered data.
6624
6625 2005-09-28  Raja R Harinath  <rharinath@novell.com>
6626
6627         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
6628         try to keep in sync with the byte count of the underlying Stream.
6629         However, this limits us to a window size of 2048 characters: i.e.,
6630         the maximum lookahead of our lexer/parser can be 2048 characters.
6631
6632 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
6633
6634         Fix #76255.
6635         * driver.cs: Fix compilation files with full root path.
6636
6637 2005-09-25  Miguel de Icaza  <miguel@novell.com>
6638
6639         * report.cs (SymbolRelatedToPreviousError): Format the output so
6640         it does not use an open parenthesis that is never closed. 
6641
6642         * driver.cs: Follow coding guidelines
6643
6644 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6645
6646         Fix #72930.
6647         * const.cs (Const.ResolveValue): Check for assigning non-null
6648         value to reference type.
6649
6650 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6651
6652         * anonymous.cs: Implemented ExprClassName.
6653         
6654         * assign.cs (Assign.DoResolve): Don't chrash when type is not
6655         delegate.
6656         
6657         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6658         check.
6659         
6660         * class.cs (StaticClass.DefineContainerMembers): Report protected
6661         members as error.
6662         
6663         * codegen.cs: if(ed) PRODUCTION.
6664         
6665         * convert.cs (Error_CannotImplicitConversion): Better error
6666         distinction.
6667         
6668         * cs-parser.jay: More error checks.
6669         
6670         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6671         
6672         * driver.cs (CSCParseOption): Enabled wrong option check.
6673         
6674         * ecore.cs (Expression.ExprClassName): Turned to property.
6675         (MemberExpr.CheckIntermediateModification): For checking boxed
6676         value types     modification.
6677         
6678         * statement.cs (Fixed.Resolve): Expression type must be
6679         convertible to fixed type.
6680         (CollectionForeach.GetEnumeratorFilter,TryType):
6681         Small refactoring for easier error checking.
6682
6683 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
6684
6685         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6686         attributes.
6687         
6688         * class.cs (GeneratedBaseInitializer): New class for customization
6689         compiler generated initializers.
6690         (MemberBase.DoDefine): Check Obsolete attribute here.
6691         (FieldMember.DoDefine): Ditto.
6692         
6693         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6694         constants.
6695         
6696         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6697         (MemberCore.GetObsoleteAttribute): Removed argument.
6698         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6699         (MemberCore.CheckObsoleteType): New helper.
6700         
6701         * delegate.cs,
6702         * enum.cs,
6703         * statement.cs: Updates after MemberCore changes.
6704         
6705         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6706         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6707         
6708         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6709         obsolete attribute for compiler construct.
6710         (As.DoResolve): Cache result.
6711         
6712         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6713
6714 2005-09-26  Raja R Harinath  <rharinath@novell.com>
6715
6716         Fix #76133.
6717         * expression.cs (This.VerifyFixed): In a value type T, the type of
6718         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
6719         value type R, 'this' is treated as a value parameter.
6720
6721 2005-09-22  Miguel de Icaza  <miguel@novell.com>
6722
6723         * statement.cs (Lock): Use the TemporaryVariable class instead of
6724         manually using local variables as those do not work when variables
6725         are captured.
6726
6727         * ecore.cs: Moved the TemporaryVariable class from being a nested
6728         class inside Foreach to be a public class that can be employed in
6729         other places. 
6730
6731 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
6732
6733         * cs-parser.jay: interface_accessors replaced by
6734         accessor_declarations.
6735
6736         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6737         location.
6738         
6739         * statement.cs (GotoCase.Resolve): Convert null constant to
6740         null case.
6741         (SwitchLabel.ResolveAndReduce): Ditto.
6742         (SwitchLabel.NullStringCase): Custom null stamp.
6743         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6744         
6745         typemanager.cs (CSharpSignature): Don't skip first argument
6746         for full names.
6747
6748 2005-09-18  Miguel de Icaza  <miguel@novell.com>
6749
6750         * driver.cs: Set InEmacs based on the environment variable EMACS. 
6751
6752         * location.cs (InEmacs): in this mode, do not report column
6753         location as it confuses Emacs.
6754
6755 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
6756
6757         * cfold.cs, constant.cs, convert.cs, ecore.cs,
6758         expression.cs, iterators.cs, literal.cs: Store constants and
6759         literals location.
6760         
6761         * class.cs (MemberBase.ShortName): Pass location.
6762         
6763         * cs-parser.jay: Some location fixes.
6764         
6765         * ecore.cs (Expression.Location): Made virtual.
6766
6767 2005-09-05  Miguel de Icaza  <miguel@novell.com>
6768
6769         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
6770         if the underlying types are the same, otherwise we need to produce
6771         code that will do the proper cast.
6772
6773         This was exposed by Marek's constant rewrite which produced
6774         invalid code for the call site:
6775
6776         enum X : long { a }
6777         void Method (X v) {}
6778
6779         Method ((X) 5)
6780
6781         This fixes test-49.cs
6782
6783 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
6784
6785         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
6786           Type/Object should be allowed as well. Fixed bug #75968.
6787
6788 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
6789
6790         * expression.cs : (Binary.DoResolve): when one is enum constant and
6791           another is constant 0, then return enum one *as enum type*.
6792           Fixed bug 74846.
6793
6794 2005-09-02  Raja R Harinath  <rharinath@novell.com>
6795
6796         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
6797         internal.
6798
6799         Fix #75941.
6800         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
6801         flow-branching for LocalVariableReferences in case we were invoked
6802         from a MemberAccess.
6803         * expression.cs (LocalVariableReference.VerifyAssigned): New.
6804         Carved out of ...
6805         (LocalVariableReference.DoResolveBase): ... this.
6806         (MemberAccess.Resolve): Do the check that was disabled during
6807         SimpleNameResolve.
6808
6809 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
6810
6811         * class.cs :
6812           (PartialContainer.Create): check abstract/sealed/static strictly
6813           but abstract/sealed can exist only at one side. Fixed bug #75883.
6814
6815 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
6816
6817         Fix #75945.
6818         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
6819         specified, don't default to UnmanagedType.I4.
6820
6821 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
6822
6823         * expression.cs : conditional operator should check possibly
6824           incorrect assign expression. Fixed bug #75946.
6825
6826 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
6827
6828         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
6829           Reverting the change. gmcs is much complex than mcs on this matter.
6830
6831 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
6832
6833         * cs-tokenizer.cs : To read another token ahead of the actual 
6834           consumption, use new SavedToken and cache token instead of moving
6835           back the stream with SeekableStreamReader (it seemed problematic).
6836         * cs-parser.jay,
6837           driver.cs : Thus use StreamReader directly.
6838         * support.cs : Thus removed SeekableStreamReader.
6839
6840 2005-08-30  Raja R Harinath  <rharinath@novell.com>
6841
6842         Fix #75934.
6843         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
6844         (ScopeInfo.EmitScopeType): Use it to construct field names from
6845         names of captured locals.
6846
6847         Fix #75929.
6848         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
6849         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
6850         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
6851         (ExplicitConversion): Remove enum cases already handled by
6852         implicit conversion.  Move implicit conversion check to the beginning.
6853         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
6854         * expression.cs (ArrayCreation.EmitDynamicInitializers):
6855         Don't treat System.Enum as a struct.
6856
6857 2005-08-30  Jb Evain  <jbevain@gmail.com>
6858
6859         * attribute.cs: handles as expression in parameters.
6860
6861 2005-08-30  Raja R Harinath  <rharinath@novell.com>
6862
6863         Fix #75802.
6864         * class.cs (TypeContainer.VerifyClsName): Don't use a
6865         PartialContainer when verifying CLS compliance.
6866         (AbstractPropertyEventMethod): Set Parent here, ...
6867         (PropertyMethod): ... not here.
6868
6869 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
6870
6871         * attribute.cs : escaped attribute name should not be allowed to be
6872           resolved (e.g. @class as classAttribute). Fixed bug #75930.
6873
6874 2005-08-29  Raja R Harinath  <rharinath@novell.com>
6875
6876         Fix #75927.
6877         * convert.cs (ImplicitStandardConversionExists): Allow zero also
6878         when converting a long constant to unsigned long.
6879         * expression.cs (Invocation.OverloadResolve): Add sanity check to
6880         detect where IsApplicable and VerifyArgumentsCompat disagree.
6881
6882 2005-08-29  Raja R Harinath  <rharinath@novell.com>
6883         and Carlos Alberto Cortez  <carlos@unixmexico.org>
6884
6885         Fix #75848.
6886         * class.cs (TypeContainer.CanElideInitializer): New helper.
6887         (TypeContainer.EmitFieldInitializers): Use it to determine if we
6888         can safely emitting the initializer of a field.
6889
6890 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6891
6892         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
6893           allowed inside a switch (without loop). Fixed bug #75433.
6894
6895 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
6896
6897         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
6898         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
6899
6900 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6901
6902         * driver.cs : kinda reverting the default encoding changes (not exact 
6903           revert since I noticed that "codepage:reset" might not work fine).
6904
6905 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6906
6907         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
6908           Location. Now getter and setter store location correctly.
6909           (errors/cs0111-12.cs now reports the expected location.)
6910
6911 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6912
6913         * driver.cs : Use default encoding on the environment.
6914           Removed (now that) extra parameter for SeekableStreamReader.
6915         * support.cs : (SeekableStreamReader) third .ctor() argument for
6916           StreamReader is not required (always true). preamble size could
6917           be acquired in simpler and safe way.
6918
6919 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
6920
6921         * cs-parser.jay: report CS0642 at warning level 3
6922           and report CS0642 for an if else statement also
6923           fixes bug #74745. Patch by John Luke (and a bit
6924           modified by me).
6925           Removed extra CS0642 warning check for "while",
6926           "for" and "fixed".
6927         * statement.cs: In Block.Resolve(), CS0642 check
6928           is reimplemented to check a sequence of an empty
6929           statement and a block.
6930
6931           Both fix bug #66777.
6932
6933 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
6934
6935         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
6936         detection until I fix it.
6937         
6938         * cs-tokenizer.cs: Changed error message.
6939         
6940         * cs-parser.jay: Fixed 2 error locations.
6941         
6942         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
6943         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
6944         properties.
6945         
6946         * enum.cs (GetSignatureForError): Fixed.
6947         
6948         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
6949         method detection.
6950         
6951         * class.cs,
6952         * typemanager.cs (RegisterProperty): Removed.
6953         
6954         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
6955
6956 2005-08-24  Raja R Harinath  <rharinath@novell.com>
6957
6958         Fix #75874.
6959         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
6960         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
6961
6962 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6963
6964         * expression.cs : tiny fix is required for not warning positive ulong.
6965           See test-441.cs.
6966
6967 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6968
6969         * expression.cs : add CS0652 check for constant and integral
6970           expression. Fixed bug #53974.
6971
6972 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6973
6974         * expression.cs : in DoNumericPromotions(), check if there is implicit
6975           conversion overload for string (to check CS0034). Fixed bug #52492.
6976
6977 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6978
6979         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
6980
6981 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6982
6983         * ecore.cs : report location when it is *not* Null.
6984
6985 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
6986
6987         * codegen.cs,
6988           ecore.cs,
6989           flowanalysis.cs,
6990           expression.cs:
6991           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
6992           correctly. Fixed bug #75721.
6993
6994 2005-08-23  Raja R Harinath  <rharinath@novell.com>
6995
6996         * support.cs (SeekableStreamReader.Position): Avoid an expensive
6997         loop that performs 'min (pos, char_count)'.
6998
6999         Fix #75862.
7000         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7001         converted value in Operator.OnesComplement.
7002
7003 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7004
7005         * anonymous.cs: If the anon method is pulled into a helper class,
7006         it needs to be `internal' not `private'. Fixes runtime behavior on
7007         msft. bug #75704
7008
7009 2005-08-20  Martin Baulig  <martin@ximian.com>
7010
7011         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7012         scope if we don't already have it.
7013
7014         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7015         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7016         fixes #75867.
7017
7018 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7019
7020         Fix #75803
7021         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7022         is a partial class.
7023
7024 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7025
7026         The big constants rewrite
7027         Fix #75746, #75685 and more
7028         As a side effect saved 1MB for MWF ;-)
7029         
7030         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7031         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7032         enum based for corlib compilation.
7033         
7034         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7035         subtractions.
7036         
7037         * class.cs (FixedField.Define): Use ResolveAsConstant.
7038         
7039         * const.cs (IConstant): Interface constants and enums.
7040         (Const.ResolveValue): New method for constant resolvning.
7041         (ExternalConstant): Constants from imported assemblies.
7042         
7043         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7044         conversion; like enums.
7045         (Constant.ToType): Converts this constant to different type.
7046         (Constant.Increment): Adds 1.
7047         
7048         * convert.cs (ImplicitConversionRequired): Simplified.
7049         
7050         * cs-parser.jay: Create EnumMember directly.
7051         
7052         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7053         
7054         * doc.cs (GenerateEnumDocComment): Removed.
7055         
7056         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7057         (ConvertIntLiteral): Removed.
7058         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7059         
7060         * enum.cs (EnumMember): Implement IConstant.
7061         (Enum.IsValidEnumConstant): Removed.
7062         (Enum.GetNextDefaultValue): Removed.
7063         (Enum.FindMembers): Updated.
7064         (Enum.GenerateDocComment): Iterate enum members.
7065         
7066         * expression.cs (Cast.TryReduce): Handle enums correctly.
7067         (New.Constantify): Made public.
7068         (MemberAccess.DoResolve): Removed contant specific if(s).
7069         
7070         * literal.cs (NullLiteral): Implement new abstract methods.
7071         
7072         * statement.cs (GotoCase.Resolve): Use new constant methods.
7073         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7074         
7075         * typemanager.cs (LookupEnum): Removed.
7076         (IsEnumType): Fixed to work with corlib.
7077         (RegisterConstant): Removed.
7078         (LookupConstant): Removed.
7079         (GetConstant): Changed to work with IConstant.
7080
7081 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7082
7083         * location.cs : Fixed overflown (>255) column number.
7084
7085 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7086
7087         First cut of the qualified-alias-member feature.
7088         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7089         token.
7090         * cs-parser.jay (DOUBLE_COLON): New token.
7091         (namespace_or_type_name): Add rule for recognizing
7092         qualified-alias-members.
7093         (primary_expression): Likewise.
7094         (element_access): Allow QualifiedAliasMember as a possible
7095         type-bearing expression.
7096         (local_variable_type, local_variable_pointer_type): Likewise.
7097         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7098         aliases in the current and enclosing namespace declarations.
7099         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7100         * decl.cs (MemberName.is_double_colon): New.
7101         (MemberName.MemberName): Add new constructor for alias-member.
7102         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7103         * expression.cs (QualifiedAliasMember): New expression type.
7104
7105 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7106
7107         * location.cs : it borked when no argument was specified.
7108
7109 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7110
7111         * location.cs : tiny ToString() format fix.
7112
7113 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7114
7115         * statement.cs : oops, it was missing.
7116
7117 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7118
7119         A set of fixes for precise line/column location.
7120
7121         * location.cs :
7122           "token" field now holds a file/line "delta", a line number offset 
7123           from the segment, and a column number. See also:
7124           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7125           December/009508.html
7126           Removed static IsNull. Use instance IsNull property instead.
7127         * cs-tokenizer.cs :
7128           For some tokens it stores Location. For Identifier it stores
7129           LocatedToken which is a pair of string name and location.
7130           Column numbers are adjusted only at getChar().
7131         * report.cs :
7132           Use Location.ToString() for reporting (it now contains column).
7133         * cs-parser.jay :
7134           Largely modified to use LocatedToken instead of
7135           string (IDENTIFIER), and to acquire Location from some tokens.
7136         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7137           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7138           codegen.cs :
7139           Now MemberName holds Location. DeclSpace.ctor() receives Location
7140           as a parameter. Removed extra parameters to all derived classes.
7141           Replaced Location.IsNull() with instance property.
7142         * assign.cs, expression.cs :
7143           Added .ctor() overload that omits Location.
7144         * attribute.cs :
7145           Added "nameEscaped" flag that indicates the identifier was escaped
7146           in the source file. This fixes bug #57047.
7147
7148 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7149
7150         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7151         New method, looking for lo-case imported cls type.
7152
7153         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7154         here.
7155
7156         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7157
7158         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7159
7160         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7161         all_imported_types.
7162         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7163
7164         Optimized to save 3.5 MB for SWF compilation.
7165
7166 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7167
7168         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7169         (PartialContainer.Create): Moved logic AddToContainer.
7170         (PartialContainer.MarkForDuplicationCheck): Shares name.
7171         
7172         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7173         place.
7174         
7175         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7176         initialization.
7177         (Namespace.GetSignatureForError): New method.
7178         
7179         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7180         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7181
7182 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7183
7184         Fix #75669.
7185         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7186         member lookup rather than qualifier_type, since qualifier_type can
7187         be null.
7188
7189 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7190
7191         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7192         enum member.
7193
7194 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7195
7196         * statement.cs: Copy the local exception into the exception
7197         captured local.  Fixes 75674
7198
7199 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7200
7201         Fix #75658.
7202         * expression.cs (Invocation.OverloadResolve): Don't report error
7203         CS1501 if error CS1502 has been reported.
7204         (New.DoResolve): Delegate CS1501 reporting to
7205         Invocation.OverloadResolve.
7206
7207         Fix #75656.
7208         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7209         invariant-meaning-in-block property in an enclosing block if
7210         necessary.
7211
7212 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7213
7214         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7215         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7216         (Switch.CheckSwitch): Just save 50kb for SWF.
7217
7218 2005-07-27  Martin Baulig  <martin@ximian.com>
7219
7220         * anonymous.cs (CaptureContext.AddField): Added
7221         `AnonymousContainer am' argument; compute its toplevel scope if
7222         it's not already computed.  Fixes #75649.
7223
7224 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7225
7226         Fix #75628.
7227         * class.cs (Constructor.Emit): Reset block to null if the block
7228         resolve fails.
7229
7230 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7231
7232         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7233
7234 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7235
7236         * class.cs (MethodData.Define): Check whether accessor implementing
7237         interface is public.
7238
7239         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7240
7241 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7242
7243         Fix #57245
7244         * namespace.cs (LookupType): Moved same type check to...
7245         
7246         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7247         with the same name.
7248
7249 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7250
7251         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7252         already found a typebuilder.
7253         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7254         MemberNames, not strings.
7255
7256         * const.cs (Error_ExpressionMustBeConst): 
7257         Rename from Error_EpressionMustBeConst.
7258         * const.cs, class.cs, statement.cd: Update.
7259
7260 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7261
7262         Fix #65573
7263
7264         * const.cs (Const.LookupConstantValue): Report missing contant expression
7265         everytime.
7266         (Error_EpressionMustBeConstant): Only one error method.
7267
7268         * class.cs, statement.c: Updated.
7269
7270 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7271
7272         * statement.cs (Block.Flags): Add back HasVarargs.
7273         (Block.flags): Make protected.
7274         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7275
7276         * typemanager.cs (types, typecontainers, user_types): Remove.
7277         (UserTypes, TypeContainers): Likewise.
7278         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7279         (CleanUp, Reset): Update.
7280         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7281         (GetNestedType): Use Type.GetNestedType.
7282         (CoreLookupType): Take two arguments, the namespace and the
7283         basename of the type.  Update to use the Namespace.Lookup
7284         mechanism.
7285         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7286         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7287         string concatenation and substring matches.
7288         * class.cs, enum.cs, delegate.cs: Update to changes.
7289
7290 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7291
7292         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7293         Expression and made virtual.
7294
7295         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7296         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7297
7298         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7299
7300         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7301         error message.
7302
7303         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7304         change.
7305
7306 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7307
7308         Fix #57707
7309         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7310         AssemblyCultureAttribute is not used on executable.
7311
7312         * rootcontext.cs,
7313         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7314
7315 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7316
7317         Fix #60638.
7318         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7319         New.  Reports CS0252/CS0253.
7320         Mostly taken from preliminary patch by Duncak Mak.
7321         (Binary.DoResolveOperator): Store results of operator lookup.
7322         Use them to detect if we need to warn about unintended reference
7323         comparisons.
7324
7325 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7326
7327         Fix #72969.
7328         * namespace.cs (Namespace.Lookup): Add back location parameter.
7329         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7330         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7331
7332         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7333         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7334         (Namespace.LookupType): ... this.
7335         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7336         of namespaces.
7337         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7338         purported to handle pointers.
7339         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7340         CoreLookupType.
7341
7342 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7343
7344         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7345         type as namespace.
7346
7347 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7348
7349         * namespace.cs (Namespace.Lookup): Drop location parameter.
7350         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7351         (NamespaceEntry.Lookup): ... this.
7352         (NamespaceEntry.Error_AmbiguousTypeReference):
7353         Move here from DeclSpace.
7354         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7355         names ...
7356         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7357         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7358         Move to NamespaceEntry.
7359         * delegate.cs, expression.cs: Update to changes.
7360
7361 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7362
7363         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7364         CheckAttributeType and refactored.
7365         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7366         ResolveAsTypeTerminal error handling.
7367         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7368         handling.
7369         (GetSignatureForError): Print errors in same way.
7370
7371         * class.cs,
7372         * codegen.cs: Reflect attribute GetSignatureForError change.
7373
7374         * ecore.cs,
7375         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7376
7377         * namespace.cs (UsingEntry): Refactored to make fields private.
7378
7379         * assign.cs,
7380         statement.cs: Error_UnexpectedKind has extra parameter.
7381
7382 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7383
7384         * ecore.cs (IAlias): Remove.
7385         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7386         that implement the interface.
7387         * namespace.cs (Namespace): Likewise.
7388         (Namespace.declspaces): Renamed from 'defined_names'.
7389         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7390         DeclSpace instead of an IAlias.
7391         * tree.cs (Tree.AddDecl): Update.
7392
7393 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7394
7395         * statement.cs (Block.Flags); Remove HasVarargs.
7396         (Block.HasVarargs): Move to ToplevelBlock.
7397         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7398         (Block.Variables): Make protected.  Initialize variable hashtable
7399         if necessary.
7400         (Block.AddVariable): Update.
7401         (Block.Resolve): Update to changes.
7402         (ToplevelBlock.HasVarargs): New boolean.
7403         (ToplevelBlock.ThisVariable): Move here from Block.
7404         (ToplevelBlock.AddThisVariable): Likewise.
7405         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7406         * expression.cs (This.ResolveBase): Update to changes.
7407         (ArglistAccess.DoResolve): Likewise.
7408
7409 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7410
7411         Fix #75321
7412         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7413
7414         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7415         not used and not used & assigned.
7416         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7417
7418 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7419
7420         Fix #75053
7421         * expression.cs (Is.DoResolve): null is never provided type.
7422
7423 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7424
7425         Fix #52496
7426         * cs-parser.jay: Less strict event error rule to catch more errors.
7427
7428 2005-07-08  Martin Baulig  <martin@ximian.com>
7429
7430         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7431         gettter (allowed) or setter (not allowed).
7432
7433         * class.cs (Accessor): Implement IIteratorContainer.
7434         (Accessor.Yields): New public field.
7435         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7436         per-accessor basis.
7437
7438         * cs-parser.jay
7439         (get_accessor_declaration, set_accessor_declaration): Set the
7440         `yields' flag on the accessor, not the property.
7441         (property_declaration): Do the iterators check on a per-accessor
7442         basis and not for the whole property.
7443
7444 2005-07-08  Martin Baulig  <martin@ximian.com>
7445
7446         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7447         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7448
7449 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7450
7451         Fix #74975
7452         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7453         (ExtractSecurityPermissionSet): Cope with self referencing security
7454         attributes properly.
7455
7456         * driver.cs (SetOutputFile): Made public property OutputFile.
7457
7458 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7459
7460         Fix #75486.
7461         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7462         has_nonstatic_fields.  Make into a FieldBase pointer.
7463         (TypeContainer.AddField): Add CS0282 check.
7464         (TypeContainer.EmitType): Update.
7465
7466 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7467
7468         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7469         compare if they start with __.
7470
7471 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7472
7473         * statement.cs (Switch.SwitchGoverningType): Only look at
7474         UserCasts that don't need implicit standard conversions to one of
7475         the allowed switch types (Fixes test-322.cs).
7476         (LocalInfo.Resolve): Re-enable sanity-test.
7477
7478 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7479
7480         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7481         
7482         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7483         
7484         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7485
7486 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7487
7488         Fix #75472.
7489         * ecore.cs (SimpleName.GetSignatureForError): Add.
7490         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7491         (MemberAccess.GetSignatureForError): Add.
7492
7493 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7494  
7495         The big error and warning messages review.
7496         
7497         * anonymous.cs,
7498         * assign.cs,
7499         * attribute.cs,
7500         * class.cs,
7501         * codegen.cs,
7502         * convert.cs,
7503         * cs-parser.jay,
7504         * cs-tokenizer.cs,
7505         * decl.cs,
7506         * delegate.cs,
7507         * doc.cs,
7508         * driver.cs,
7509         * ecore.cs,
7510         * enum.cs,
7511         * expression.cs,
7512         * flowanalysis.cs,
7513         * iterators.cs,
7514         * literal.cs,
7515         * location.cs,
7516         * modifiers.cs,
7517         * namespace.cs,
7518         * parameter.cs,
7519         * pending.cs,
7520         * report.cs,
7521         * rootcontext.cs,
7522         * statement.cs,
7523         * support.cs,
7524         * tree.cs,
7525         * typemanager.cs: Updated.
7526         
7527         * class.cs: (MethodCore.SetYields): Moved here to share.
7528         (PropertyMethod.Define): Moved iterator setup here.
7529         
7530         * iterators.cs: Add orig_method to have full access to parent
7531         container.
7532
7533 2005-07-05  Raja R Harinath  <rharinath@novell.com>
7534
7535         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7536         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7537         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7538         variable of struct type.
7539         * expression.cs (Unary.ResolveOperator): Update to change.
7540         (Indirection.VerifyFixed): Likewise.
7541         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7542         (ParameterReference.VerifyFixed): Value parameters are fixed.
7543         (This.VerifyFixed): Treat 'this' as a value parameter.
7544         * statement.cs (LocalInfo.IsFixed): Remove.
7545
7546 2005-07-01  Martin Baulig  <martin@ximian.com>
7547
7548         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7549         `ec.EmitThis ()' to get the correct scope.
7550
7551 2005-07-01  Martin Baulig  <martin@ximian.com>
7552
7553         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7554         instance is a ParameterReference; fixes #75299.
7555
7556 2005-07-01  Martin Baulig  <martin@ximian.com>
7557
7558         Reverted Marek's latest patch (r46725):
7559         - it contains structural changes which are neither mentioned in
7560           the ChangeLog nor explained anywhere; for example the additional
7561           argument of EmitContext's and Iterator's .ctor's and the
7562           TypeContainer.DefineMembers() change.
7563         - structural changes like this should go in in seperate patches
7564           and not be hidden in a huge patch which just seems to affect
7565           warnings and errors.
7566           a big and hard to understand patch.
7567         - it breaks iterators and causes regressions, for instance in
7568           test-iter-03.cs.      
7569
7570 2005-06-30  Raja R Harinath  <rharinath@novell.com>
7571
7572         Fix #75412.
7573         * expression.cs (Indexers.map): Remove.
7574         (Indexers.Append): Filter out inaccessible setters and getters.
7575         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7576
7577         Fix #75283.
7578         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
7579         Refactored from ...
7580         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7581         (FieldExpr.Emit, PropertyExpr.Emit): Update.
7582         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7583         * expression.cs (Invocation.EmitCall): Add CS0120 check.
7584
7585 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
7586
7587         Fix #75322
7588         * class.cs (FieldBase.GetInitializerExpression): One more field
7589         for backup.
7590
7591 2005-06-28  Miguel de Icaza  <miguel@novell.com>
7592
7593         * pending.cs: Do not define a proxy if the base method is virtual,
7594         it will be picked up by the runtime (bug 75270).
7595
7596 2005-06-08  Martin Baulig  <martin@ximian.com>
7597
7598         The big Iterators rewrite :-)
7599
7600         * iterators.cs: Rewrite this to use the anonymous methods framework.
7601
7602         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7603         before the TypeContainers; see 2test-21.cs.
7604
7605         * class.cs
7606         (TypeContainer.DefineType): Don't create a new EmitContext if we
7607         already have one (this only happens if we're an Iterator).
7608         (TypeContainer.Define): Also call Define() on all our iterators.
7609         (Method.CreateEmitContext): Added support for iterators.
7610
7611         * anonymous.cs
7612         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7613         (AnonymousContainer.CreateMethodHost): Moved here from
7614         AnonymousMethod and made abstract.
7615         (AnonymousContainer.CreateScopeType): New abstract method.
7616         (AnonymousContainer.IsIterator): New public property.
7617         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7618         get the ScopeTypeBuilder rather than manually defining it here. 
7619         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7620         iterators here.
7621
7622         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7623         before RootContext.DefineTypes().
7624
7625         * codegen.cs (EmitContext.RemapToProxy): Removed.
7626         (EmitContext.CurrentAnonymousMethod): Changed type from
7627         AnonymousMethod -> AnonymousContainer.
7628         (EmitContext.ResolveTopBlock): Protect from being called twice.
7629         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7630         (EmitContext.EmitThis): Removed the iterators hacks; use the
7631         anonymous methods framework for that.
7632
7633         * statement.cs
7634         (ToplevelBlock.Container): Make this a property, not a field.
7635         (ToplevelBlock.ReParent): New public method; move the
7636         ToplevelBlock into a new container.
7637         (Foreach.TemporaryVariable): Simplify.
7638
7639 2005-06-05  Martin Baulig  <martin@ximian.com>
7640
7641         * statement.cs (LocalInfo.CompilerGenerated): New flag.
7642         (Block.AddTemporaryVariable): New public method; creates a new
7643         `LocalInfo' for a temporary variable.
7644         (Block.EmitMeta): Create the LocalBuilders for all the temporary
7645         variables here.
7646         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7647         non-iterator variables.
7648
7649 2005-06-05  Martin Baulig  <martin@ximian.com>
7650
7651         * statement.cs (Foreach.TemporaryVariable): Create the
7652         LocalBuilder in the Emit phase and not in Resolve since in some
7653         situations, we don't have an ILGenerator during Resolve; see
7654         2test-19.cs for an example.
7655
7656 2005-06-04  Martin Baulig  <martin@ximian.com>
7657
7658         **** Merged r45395 from GCS ****
7659
7660         The big Foreach rewrite - Part II.
7661
7662         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7663         with `PropertyInfo ienumerator_getcurrent'.
7664
7665         * codegen.cs (VariableStorage): Removed.
7666
7667         * statement.cs
7668         (Foreach): Derive from Statement, not ExceptionStatement.
7669         (Foreach.CollectionForeach): New nested class.  Moved all the code
7670         dealing with collection foreach here.
7671         (Foreach.ForeachHelperMethods): Removed.
7672         (Foreach.TemporaryVariable): Implement IMemoryLocation.
7673
7674 2005-05-23  Martin Baulig  <martin@ximian.com>
7675
7676         * statement.cs (Try.DoResolve): Don't create a `finally' if we
7677         don't need to.  Fix #75014.
7678
7679 2005-05-20  Martin Baulig  <martin@ximian.com>
7680
7681         Merged r44808 from GMCS.
7682
7683         * class.cs (TypeContainer.CircularDepException): Removed.
7684         (TypeContainer.DefineType): Removed the `InTransit' stuff.
7685         (TypeContainer.CheckRecursiveDefinition): Check for circular class
7686         (CS0146) and interface (CS0529) dependencies here.
7687
7688 2005-06-21  Raja R Harinath  <rharinath@novell.com>
7689
7690         * expression.cs (Invocation.EmitCall): Fix initialization
7691         'this_call' to reflect current behaviour.  Fix indentation.
7692
7693         * convert.cs (FindMostEncompassedType): Add two trivial special
7694         cases (number_of_types == 0 || number_of_types == 1).
7695         (FindMostEncompasingType): Likewise.
7696
7697 2005-06-17  Raja R Harinath  <rharinath@novell.com>
7698
7699         Some cleanups preparing for the fix of #75283.
7700         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7701         error testing.
7702         (EventExpr.InstanceResolve): Likewise.
7703         (EventExpr.DoResolve): Remove redundant checks.
7704
7705 2005-06-10  Duncan Mak  <duncan@novell.com>
7706
7707         * cs-tokenizer.cs (process_directives): New flag for controlling
7708         the processing of preprocessor directives.
7709         (x_token): After seeing a '#', return Token.NONE instead of going
7710         to handle_preprocessing_directive() when not processing
7711         directives. This avoids unnecessary processing during the token peek in
7712         is_punct().
7713
7714         This fixes #74939.
7715
7716         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7717         the existing error reporting methods instead of Report.Error.
7718
7719         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7720         after Raja's rewrite.
7721
7722 2005-06-08  Miguel de Icaza  <miguel@novell.com>
7723
7724         * class.cs: Small fix.
7725
7726 2005-06-08  Raja R Harinath  <rharinath@novell.com>
7727
7728         Fix #75160.
7729         * class.cs (GetPartialBases): Fix return value check of
7730         part.GetClassBases.
7731
7732 2005-06-07  Raja R Harinath  <rharinath@novell.com>
7733
7734         Ensure that partial classes are registered in their enclosing
7735         namespace.  Initial part of fix of #75160.
7736         * tree.cs (Tree.RecordDecl): Add new namespace argument.
7737         Register declspace with namespace here, not in
7738         DeclSpace.RecordDecl.
7739         * cs-parser.jay: Pass namespace to RecordDecl.
7740         * class.cs (PartialContainer.Create): Likewise.
7741         (ClassPart.DefineType): New sanity-check.  Throws an exception if
7742         called.
7743         * decl.cs (Declspace.RecordDecl): Remove.
7744         * namespace.cs (NamespaceEntry.DefineName): Remove.
7745
7746 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
7747
7748         * rootcontext.cs: Reset TargetExt as well.
7749
7750 2005-06-03  Raja R Harinath  <rharinath@novell.com>
7751
7752         * ecore.cs (Expression.Resolve): Emit CS0654 error when
7753         -langversion:ISO-1.
7754
7755 2005-06-02  Raja R Harinath  <rharinath@novell.com>
7756
7757         Fix #75080, cs0119.cs.
7758         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
7759         of ...
7760         (Expression.Resolve): ... this.  Use it.  Remove bogus code
7761         allowing ExprClass.Type and ExprClass.Namespace for
7762         ResolveFlags.VariableOrValue.
7763         (Expression.Resolve) [1-argument variant]: Change default resolve
7764         flags based on language version.
7765         (Expression.Error_UnexpectedKind): Use a simple string array
7766         rather than an ArrayList.
7767         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
7768         not ExprClass.Type.
7769         (TypeOfVoid.DoResolve): Likewise.
7770         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
7771         flags argument -- it always has the same value.
7772
7773 2005-05-31  Raja R Harinath  <rharinath@novell.com>
7774
7775         Fix #75081.
7776         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
7777         Use it in the error message.
7778         * assign.cs, expression.cs, statement.cs: Update.
7779
7780 2005-05-30  Raja R Harinath  <rharinath@novell.com>
7781
7782         Fix #75088.
7783         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
7784         the "almostMatchedMember" case too.
7785         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
7786         that failed the accessibility checks to 'almost_match'.
7787
7788 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
7789
7790         * attribute.cs: Use internal MethodBuilder methods to set
7791         ExactSpelling and SetLastError on PInvoke methods, instead
7792         of passing them via charset.  Fixes #75060.
7793
7794 2005-05-27  Raja R Harinath  <rharinath@novell.com>
7795
7796         * parameter.cs (Parameter): Remove TODO comment.
7797         (Parameter.DefineParameter): Remove Location parameter.
7798         (Parameters.LabelParameters): Likewise.
7799         * class.cs (Constructor.Emit): Update to change.
7800         (MethodData.Emit): Likewise.
7801         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
7802         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
7803
7804 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
7805
7806         * parameter.cs,
7807           Removed Parameters.Location and added Parameter.Location instead.
7808           Removed Location parameter from Emit() and GetSignature().
7809         * anonymous.cs,
7810           class.cs,
7811           cs-parser.jay,
7812           delegate.cs,
7813           iterators.cs,
7814           statement.cs :
7815           Modified all related calls.
7816
7817 2005-05-26  Raja R Harinath  <rharinath@novell.com>
7818
7819         Improve user-defined conversion handling.
7820         * convert.cs (GetConversionOperators): Rewrite.  Return only the
7821         applicable operators.
7822         (AddConversionOperators): New.  Helper for GetConversionOperators.
7823         (FindMostEncompassedType, FindMostEncompassingType): Verify that
7824         there is only one most encompassed/encompassing type.
7825         (FindMostSpecificSource, FindMostSpecificTarget): Remove
7826         "applicable operator" handling.
7827         (UserConversion): Move cache here from GetConversionOperators.
7828         Directly cache the chosen operator, rather than the whole
7829         MethodGroup.
7830         (ExplicitNumericConversion): Fix buggy implementation of Decimal
7831         case.  Allow conversion of decimal to sbyte and byte too.
7832         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7833         New static methods.  Used to avoid allocating EmptyExpressions in
7834         convert.cs.
7835
7836 2005-05-24  Duncan Mak  <duncan@novell.com>
7837
7838         * ecore.cs (CastFromDecimal): New class for casting a decimal to
7839         another class, used in Convert.ExplicitNumericConversion.
7840         (CastToDecimal): New class, similar to above, but casts to
7841         System.Decimal, used in Convert.ImplicitNumericConversion and also
7842         in explicit convesion from double/float to decimal.
7843
7844         * convert.cs (ImplicitNumericConversion): Handle implicit
7845         conversions to System.Decimal.
7846         (ExplicitNumericConversion): handle explicit conversions to
7847         System.Decimal.
7848
7849         This fixes #68711.
7850         
7851 2005-05-20  Miguel de Icaza  <miguel@novell.com>
7852
7853         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
7854         know the type at this stage, just break through.   Fixes #75008 
7855
7856 2005-05-19  Martin Baulig  <martin@ximian.com>
7857
7858         * delegate.cs
7859         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
7860         to disable error reporting.
7861
7862         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
7863         here since we don't want to report an error; see the new test-336.cs.
7864
7865 2005-05-19  Raja R Harinath  <rharinath@novell.com>
7866
7867         * statement.cs (ToplevelBlock.GetParameterReference)
7868         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
7869         Move here from class Block.
7870         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
7871         * expression.cs (ParameterReference.DoResolveBase): Likewise.
7872
7873 2005-05-18  Martin Baulig  <martin@ximian.com>
7874
7875         Fix #74978.
7876
7877         * flowanalysis.cs
7878         (FlowBranching.Reachability): Add non-static public And() and Or()
7879         methods.
7880         (FlowBranchingSwitch): New class; do the `break_origins' thing
7881         like in FlowBranchingLoop.
7882         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
7883         reachability, not just locals and parameters.
7884         (FlowBranching.MergeChild): Remove some of the hacks for loop and
7885         switch; MergeBreakOrigins() now takes care of that.
7886
7887 2005-05-18  Martin Baulig  <martin@ximian.com>
7888
7889         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7890         a loop and may leave it, reset the barrier; fixes #74974.
7891
7892 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
7893         
7894         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
7895         is back.
7896         
7897         * cs-parser.jay: Catch more lexical errors.
7898         
7899         * report.cs: Add one more Error method.
7900         
7901         * rootcontext.cs,
7902         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
7903
7904 2005-05-17  Martin Baulig  <martin@ximian.com>
7905
7906         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
7907         #70970. 
7908
7909 2005-05-16  Raja R Harinath  <rharinath@novell.com>
7910
7911         Fix test-382.cs.  Emit values of decimal constants.
7912         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
7913         Carved out of ...
7914         (TypeContainer.AddField): ... this.
7915         (TypeContainer.EmitFieldInitializers): Allow the list of fields
7916         with initializers to include 'Const's.
7917         (ClassPart.RegisterFieldForInitialization): Forward to
7918         PartialContainer.
7919         * const.cs (Const.Const): Pass initializer to base class.
7920         (Const.Define): In case of decimal constants, register them for
7921         initialization in a static constructor.
7922
7923 2005-05-14  Martin Baulig  <martin@ximian.com>
7924
7925         * statement.cs (Block.Resolve): Correctly handle unreachable code;
7926         do not call ResolveUnreachable() on unreachable statements in
7927         here, see the comment in the source code.
7928
7929 2005-05-13  Raja R Harinath  <rharinath@novell.com>
7930
7931         Fix #74934.
7932         * expression.cs (BinaryResolveOperator): If one of the operands of
7933         an equality comparison is 'null' and the other is a pointer type,
7934         convert the null to a NullPointer.
7935         * convert.cs (ImplicitReferenceConversion): If the expression is a
7936         NullLiteral and the target type is a pointer type, return a
7937         NullPointer instead.
7938         (ImplicitConversionStandard): Likewise.
7939
7940 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
7941         
7942         * cs-parser.jay: Set readonly context based on special constructs.
7943         
7944         * expression.cs (LocalVariableReference.DoResolveBase): Improved
7945         readonly variable error handling.
7946         
7947         * rootcontext.cs (EmitCode): Don't verify members when error
7948         occurred.
7949         
7950         * statement.cs (LocalInfo): Add reaodnly context information.
7951         (SetReadOnlyContext, GetReadOnlyContext): New methods.
7952
7953 2005-05-13  Raja R Harinath  <rharinath@novell.com>
7954
7955         * statement.cs (Block.Resolve): Revert change below.  Modify fix
7956         for #74041 to initialize 'resolved' to false only for explicit
7957         blocks.  Fixes #74873.
7958
7959 2005-05-12  Raja R Harinath  <harinath@gmail.com>
7960
7961         Fix #74920.
7962         * typemanager.cs (unmanaged_enclosing_types): New.
7963         (IsUnmanagedType): Avoid infloops by using
7964         'unmanaged_enclosing_types' to talk with recursive invocations.
7965
7966 2005-05-13  Martin Baulig  <martin@ximian.com>
7967
7968         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
7969         instance variable, not a local.  Fix #74873.
7970         (Block.ResolveUnreachable): Set it to true here.
7971
7972 2005-05-11  Duncan Mak  <duncan@novell.com>
7973
7974         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
7975         continuing to process for 'arg'.
7976         (handle_preprocessing_directive): Check the argument of the #endif
7977         directive and report error CS1025 if there are any trailing
7978         characters.
7979
7980         According to the C# spec, having even whitespace after the #endif
7981         directive is illegal; however, because we call arg.TrimEnd ()
7982         beforehand, we have the same behavior as csc, allowing whitespace
7983         after the directive.
7984
7985         Fixes #74892.
7986
7987 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
7988
7989         Fix #74863.
7990         
7991         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
7992         (Constructor.GetObsoleteAttribute): Implemented correctly.
7993
7994 2005-05-10  Martin Baulig  <martin@ximian.com>
7995
7996         * support.cs (ReflectionParameters.ParameterModifier): Use
7997         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
7998         and `ParameterAttributes.In'.  Fixes #74884.
7999
8000 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8001
8002         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8003         
8004         * expression.cs (Argument.GetParameterModifier): Turned to property.
8005         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8006         
8007         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8008         its C# equivalent.
8009         
8010 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8011
8012         Fix #74852.
8013         * decl.cs (MemberCache.AddMethods): Register override methods,
8014         rather than non-override methods.
8015         * typemanager.cs (RegisterOverride): New.
8016         (IsOverride): Update.
8017
8018 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8019
8020         Fix #73105.
8021         
8022         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8023         recursive declaration.
8024         
8025         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8026         
8027 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8028
8029         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8030         
8031         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8032
8033 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8034
8035         Fix #74797.
8036         * decl.cs (DeclSpace.FamilyAccessible): 
8037         Use TypeManager.IsNestedFamilyAccessible.
8038
8039         Fix reopened #64812.
8040         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8041         internal'.
8042
8043 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8044             Abin Thomas  <projectmonokochi@rediffmail.com>
8045             Anoob V E  <projectmonokochi@rediffmail.com>
8046             Harilal P R  <projectmonokochi@rediffmail.com>
8047
8048         Fix #64812.
8049         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8050         allow access to all static members.
8051
8052 2005-05-04  Martin Baulig  <martin@ximian.com>
8053
8054         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8055
8056 2005-05-04  Martin Baulig  <martin@ximian.com>
8057
8058         Fix #74655.
8059
8060         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8061         section at the end; make things work if `default' is not the last
8062         section.        
8063
8064 2005-05-04  Martin Baulig  <martin@ximian.com>
8065
8066         Fix #70400.
8067
8068         * statement.cs (Switch): Replaced the `got_default' field with a
8069         `default_section' one.
8070         (Switch.CheckSwitch): Set `default_section' here.
8071         (Switch.Resolve): If we're a constant switch and the constant is
8072         not found, use the default section.
8073
8074 2005-05-03  Martin Baulig  <martin@ximian.com>
8075
8076         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8077
8078         * statement.cs (Foreach.ArrayForeach): New nested class.
8079         (Foreach.TemporaryVariable): New nested class.
8080         (Foreach.EmitArrayForeach): Removed; this is now in the new
8081         ArrayForeach class.
8082
8083 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8084
8085         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8086         more conservative.
8087         (VerifyPendingMethods): Revert change below.
8088
8089         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8090         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8091         that used to trigger warning -28.  Remove warning -28.
8092         * expression.cs (Invocation.OverloadResolve): Use
8093         TypeManager.IsOverride to distinguish override methods.
8094
8095         Fix #74773.
8096         * pending.cs (VerifyPendingMethods): If a base type implements the
8097         requested interface, don't bother checking individual methods of
8098         the base type.  As a side-effect, this prevents the creation of
8099         unnecessary proxies.
8100
8101 2005-05-02  Martin Baulig  <martin@ximian.com>
8102
8103         Fix #70182.
8104
8105         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8106         Also `And' the locals if the old vector is null.
8107         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8108         null; in this case we basically reset all the variables.        
8109
8110 2005-05-02  Martin Baulig  <martin@ximian.com>
8111
8112         Fix #74529.
8113
8114         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8115         Added `FlowBranching branching' argument; always `and' the
8116         variables instead of `or'ing them unless we're an infinite loop.
8117
8118         * statement.cs (While.Resolve): Create a new sibling unless we're
8119         infinite.       
8120
8121 2005-05-02  Martin Baulig  <martin@ximian.com>
8122
8123         Fix #70140.
8124
8125         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8126         arguments; use it instead of creating a new TopLevelBlock.
8127         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8128         our ConstructorInitializer.
8129
8130         * statement.cs
8131         (TopLevelBlock.TopLevelBranching): New public property.
8132         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8133         and create our `TopLevelBranching'.
8134
8135         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8136         anonymous method host, use `block.TopLevelBranching' rather than
8137         creating a new branching.
8138
8139 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8140
8141         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8142         a ScopeInfo, if any of the current children is a child of the new
8143         entry, move those children there.
8144
8145 2005-04-30  Martin Baulig  <martin@ximian.com>
8146
8147         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8148         at the beginning of a SwitchSection.  Fix #73335.
8149
8150 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8151
8152         Fix #74378
8153         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8154         
8155         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8156         (FieldExpr.DoResolve): Obsolete members are ignored for field
8157         initializers.
8158         
8159 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8160
8161         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8162         of arrays detection.
8163
8164         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8165         verification.
8166         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8167
8168         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8169         arrays report.
8170
8171 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8172
8173         * cs-parser.jay: Use the prefered version of -unsafe in error
8174         message.
8175
8176 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8177
8178         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8179         circumstances.
8180
8181 2005-04-20  John Luke  <john.luke@gmail.com>
8182
8183         * driver.cs: fix typo in error message, --outout to --output
8184
8185 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8186
8187         * codegen.cs (InRefOutArgumentResolving): New field.
8188         
8189         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8190         fields outside contructor.
8191         
8192         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8193         
8194 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8195
8196         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8197         parameter code was not completed ever, so it was not as up-to-date
8198         as local variables.  Must finish it.
8199
8200         The bug fix was to compare the Toplevel of the block, not the
8201         current block.  Thanks for Ben for pointing this out. 
8202
8203 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8204
8205         * decl.cs (AddMethods): Use the declaring type of the problem
8206         method to determine if we want to squash a warning.
8207
8208 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * attribute.cs: Removed debug output.
8211
8212         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8213         
8214         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8215         Report.Stderr.
8216         
8217 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8218
8219         Fix #74481.
8220         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8221         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8222         all null comparisons against reference types.
8223
8224 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8225
8226         Fix# 74565
8227         * class.cs (TypeContainer.CircularDepException) New nested
8228         exception class.
8229         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8230         (TypeContainer.DefineType): Removed error, reset InTransit before
8231         exit.
8232         (Class.DefineType): Throw exception when is in Transit.
8233         Catch exception and report error.
8234         (Struct.DefineType): Throw exception when is in Transit.
8235         Catch exception and report error.
8236         (Interface.DefineType): Throw exception when is in Transit.
8237         Catch exception and report error.
8238
8239         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8240         handle nested exception handlers.
8241
8242         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8243         a catch.
8244
8245         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8246         InFinally and InCatch storage.
8247
8248         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8249         (Catch.Resolve): Set and Restore ec.InCatch.
8250         (Try.Resolve): Set and Restore ec.InFinally.
8251         (Try.HasCatch): True when try has catch.
8252
8253 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8254
8255         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8256           for the same event member, so exclude such cases from warning 419.
8257           Fixed bug #74633.
8258
8259 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8260
8261         * expression.cs (Binary.ResolveOperator): Apply patch from John
8262         Luke to fix bug 59864: operators &, | and ^ on enumerations
8263         require that the same enum type on both sides.
8264
8265         * driver.cs: Add warnings to old flag usage, this is to assist
8266         people who produce Makefiles and hope that the Makefiles will be
8267         used on Windows.
8268
8269         * class.cs (TypeContainer.EmitType): Moved the definition of the
8270         special $PRIVATE$ field from the resolve phase to the Emit phase.
8271         During resolve we do not know if we are a struct with
8272         HasExplicitLayout, we know this only after the attributes for the
8273         type are emitted.
8274
8275         Set the FieldOffset to zero on the dummy field that we create for
8276         the class.   Fixes 74590.
8277
8278 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8279
8280         Fix #73834.
8281         * ecore.cs (PropertyExpr.resolved): New.
8282         (DoResolve): Use it to handle a case of double resolution here.
8283         Handle a case of identical-name-and-type-name.
8284         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8285         resolution by storing the results of expression resolution back
8286         into the "probes" array.
8287
8288 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8289
8290         Fix cs0208-7.cs and cs0208-8.cs.
8291         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8292         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8293         error reporting to point out the reason a struct is not unmanaged.
8294
8295 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8296
8297         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8298           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8299
8300 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8301
8302         Fix #74528.
8303         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8304         IdenticalNameAndTypeName here.
8305         (EventExpr.InstanceResolve): Likewise.
8306
8307 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8308
8309         C# 2.0 DefaultCharSetAttribute implementation
8310         
8311         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8312         which allows us to set GlobalNamespace for every resolve.
8313         (Attribute.ResolveArguments): Cut from Resolve.
8314         (Attribute.GetCharSetValue): Returns CharSet named argument.
8315         (Attribute.DefinePInvokeMethod): Gets default charset from
8316         module settings.
8317         (GlobalAttribute.ResolveAsTypeStep): Override.
8318         (GlobalAttribute.ResolveArguments): Override.
8319         
8320         * class.cs (TypeAttr): Is protected.
8321         
8322         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8323         (ModuleClass.DefaultCharSetType): New memeber.
8324         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8325         
8326         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8327         charset from module.
8328         
8329         * delegate.cs (TypeAttr): Override.
8330         (Delegate.DefineType): Use this TypeAttr.
8331         
8332         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8333         at very early stage (before types are defined) to resolve model
8334         module attributes. It will probably not work with corlib but it
8335         should be ok.
8336         
8337         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8338         charset from module.
8339         
8340         * typemanager.cs (default_charset_type): New type.
8341
8342 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8343
8344         * decl.cs (MemberCache.AddMethods): Don't warn if
8345         System.Object.Finalize has buggy MethodAttributes.
8346
8347         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8348         removed below.
8349
8350 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8351
8352         * doc.cs : detect ambiguous reference to overloaded members.
8353           Fixed bug #71603. MS 1.1 csc does not detect it.
8354
8355 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8356
8357         * doc.cs : delegates must not be referenced with parameters.
8358           Fixed bug #71605.
8359
8360 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8361
8362         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8363
8364 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8365
8366         * driver.cs (MainDriver): Stop processing if the CLS stage found
8367         errors. 
8368
8369         (CompilerCallableEntryPoint.InvokeCompiler): Always
8370         reset after execution;   Take a TextWriter argument for the
8371         output.
8372
8373         * report.cs: Use the error stream instead of hardcoding stderr. 
8374
8375 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8376
8377         * class.cs: Reduce code paths to test, too small of an
8378         optimization to make it worth the extra testing.  Always perform
8379         it. 
8380
8381 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8382
8383         Fix #74510.
8384         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8385         operators that had errors reported on them.
8386
8387 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8388
8389         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8390         argument types.
8391         (Attribute.Resolve): Add named argument type checking.
8392         
8393         * class.cs (FixedField.Define): Use IsPrimitiveType
8394         
8395         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8396         
8397         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8398         unsafe parameter types.
8399         
8400         * statement.cs (Using.ResolveExpression): Add better error description.
8401         
8402         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8403         
8404 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8405
8406         Fix #74484.
8407         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8408         AttributeUsageAttribute in the emitcontext of the attribute class,
8409         not in the emitcontext of the attributable entity it was attached to.
8410         * cs-parser.jay: Use 'current_class', not 'current_container',
8411         when creating a GlobalAttribute.
8412
8413 2005-04-08  Alp Toker  <alp@atoker.com>
8414
8415         * pending.cs: The fix to #58413 failed to compile methods implementing
8416         interfaces with/without params modifiers and vice versa, even though
8417         params modifiers aren't part of the signature. Make the modifier check
8418         less strict as in csc.
8419
8420 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8421             Anoob V E  <projectmonokochi@rediffmail.com>
8422             Harilal P R  <projectmonokochi@rediffmail.com>
8423
8424         Fix #58413.
8425         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8426         modifiers of pending methods.
8427         (PendingImplementation.PendingImplementation): Initialize it.
8428         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8429         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8430         with ParameterData.  Add check for modifiers.
8431         * class.cs (MethodData.Define): Update to changes.
8432
8433 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8434
8435         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8436
8437 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8438
8439         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8440         property.
8441         
8442         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8443         
8444         * rootcontext.cs,
8445         * typemanager.cs: Registered RequiredAttributeAttribute.
8446         
8447 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8448
8449         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8450         Warning CS0169 is back at level 3.
8451         (IMethodData.SetMemberIsUsed): New method.
8452         
8453         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8454         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8455         
8456         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8457
8458         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8459         contants.
8460         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8461         is used.
8462         
8463         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8464         is used.
8465         
8466         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8467         to avoid the problems with nested types.
8468
8469 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8470             Anoob V.E  <projectmonokochi@rediffmail.com>
8471             Harilal P.R  <projectmonokochi@rediffmail.com>
8472             Raja R Harinath  <rharinath@novell.com>
8473
8474         Fix #73820.
8475         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8476         attribute.
8477         * typemanager (GetConstructor): Make public.
8478
8479 2005-04-05  John Luke  <john.luke@gmail.com>
8480             Raja R Harinath  <rharinath@novell.com>
8481
8482         Fix #62232.
8483         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8484         struct too.  Return false quicker in a few cases.
8485         (VerifyUnManaged): Use it.
8486
8487 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8488
8489         Fix #74041.
8490         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8491         not 'unreachable_seen'.
8492
8493 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8494
8495         * attribute.cs (Attribute.GetValue): Removed unused.
8496         
8497         * codegen.cs (CodeGen.TrimExt): Removed unused.
8498         
8499         * cs-parser.jay (output): Removed unused.
8500         
8501         * cs-tokenizer.cs (hex_digits): Removed unused.
8502         
8503         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8504         
8505         * expression.cs (Indirection.LoadExprValue): Removed unused.
8506         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8507         
8508         * iterators.cs (Iterator.param_types): Removed unused.
8509         
8510         * statement.cs (Goto.block): Removed unused.
8511         (ToplevelBlock.did): Removed unused.
8512         (Switch.ResolveConstantSwitch): Removed unused.
8513
8514 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
8515
8516         * rootcontext.cs: Allow mcs to bootstrap with the compilation
8517         resetting thingy.
8518
8519 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8520
8521         Fix #74232 and cs0208-3.cs.
8522         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8523         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8524         unmanaged type.  Don't use FieldBuilders when 't' is a
8525         TypeBuilder.  Use ModFlags and MemberType fields.
8526         * class.cs (MemberBase.member_type): Rename from MemberType.
8527         (MemberBase.MemberType): New property.  Determines member_type on
8528         demand.
8529         (MemberBase.DoDefine): Don't initialize MemberType here.
8530         (FieldMember.Define): Likewise.
8531
8532 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
8533
8534         Fix #74241
8535         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8536         Attributes are emitted there.
8537         
8538 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8539
8540         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8541         keyword in 'partial enum' too.
8542         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8543         is not allowed).
8544         Report from Kamil Skalski <nazgul@omega.pl>.
8545
8546         Fix #74309.
8547         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8548         have partial containers too.
8549
8550         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8551         in block' checks to Block.CheckInvariantMeaningInBlock.
8552         * statement.cs (Block.GetKnownVariableInfo): Make private.
8553         (Block.IsVariableUsedInChildBlock): Remove.
8554         (Block.IsVariableUsedInBlock): Likewise.
8555         (Block.CheckInvariantMeaningInBlock): New.  Show location of
8556         conflicting declaration.
8557         (Block.AddVariable): Make error messages less long-winded and more
8558         specific.  Show location of conflicting declaration.
8559         * parameter.cs (Parameters.Location): New readonly property.
8560
8561 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8562
8563         Clean up semantics of invoking ResolveMemberAccess.
8564         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8565         can have an instance, ensure that we pass in a non-TypeExpression
8566         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
8567         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8568         argument.  Update to changes and simplify.
8569         (FieldExpr.Emitinstance): Remove CS0120 check.
8570         (PropertyExpr.EmitInstance): Likewise.
8571         * expression.cs (Argument.Resolve): Likewise.
8572         (Invocation.DoResolve): Update to changes in semantics of
8573         InstanceExpression.
8574
8575 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
8576
8577         Fix #74241
8578         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8579         customization.
8580         
8581         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8582
8583 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8584
8585         Fix difference in behaviour with commandline invocation.
8586         * driver.cs (Driver.Reset): New.
8587         (CompilerCallableEntryPoint): Call it.
8588
8589         * statement.cs (If.Resolve): Avoid spurious "uninitialized
8590         variable" warnings if the boolean expression failed to resolve.
8591
8592 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
8593
8594         * attribute.cs: Fix the union of several permissions when some of them
8595         are unrestricted (so the result isn't an unrestricted permission set).
8596         Fix #74036.
8597
8598 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8599
8600         * ecore.cs (MemberExpr): New class.  Convert from interface
8601         IMemberExpr.
8602         (MemberExpr.ResolveMemberAccess): Refactor and move here from
8603         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
8604         error checks.
8605         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8606         (MethodGroupExpr.IsExplicitImpl): Remove.
8607         (Expression.GetFieldFromEvent): Remove.
8608         (SimpleName.MemberStaticCheck): Remove.
8609         (SimpleName.DoSimpleNameResolve): Update to changes.
8610         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8611         (MemberAccess.IdenticalNameAndTypeName): Remove.
8612         (MemberAccess.error176): Move to MemberExpr.
8613         (MemberAccess.DoResolve): Update to changes.
8614         (BaseAccess.DoResolve): Likewise.
8615
8616 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
8617
8618         C# 2.0 Conditional attribute class implementation
8619         
8620         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8621         Analyzes class whether it has attribute which has ConditionalAttribute
8622         and its condition is not defined.
8623         
8624         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8625         (Class.IsExcluded): New method. Search for at least one defined
8626         condition in ConditionalAttribute of attribute class.
8627
8628 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8629
8630         * ecore.cs (PropertyExpr): Derive from Expression, not
8631         ExpressionStatement.
8632         (PropertyExpr.EmitStatement): Remove.
8633
8634 2005-03-29  Raja R Harinath  <rharinath@novell.com>
8635
8636         Fix #74060.
8637         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8638         internal field "value__" of an enum be private.  The examples for
8639         "value__" that I found on MSDN all used FieldAttributes.Private.
8640
8641         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8642         Don't mention IL method attribute names.
8643
8644         Fix #47991.  Remove a TODO.
8645         * statement.cs (Block.Toplevel): Make into a field.
8646         (Block.Parameters): Move into ToplevelBlock.
8647         (Block.known_variables): Rename from child_variable_names.
8648         (Block.Block): Remove variants that take Parameters.  Initialize
8649         'Toplevel' with the immediately surrounding toplevel block.
8650         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
8651         LocalInfo parameter.
8652         (Block.GetKnownVariableInfo): New.
8653         (Block.IsVariableNameUsedInChildBlock): Update.
8654         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
8655         the block, even though it may not be in scope.
8656         (Block.AddVariable): Remove Parameters parameter.  Use
8657         Toplevel.Parameters instead.
8658         (Block.AddConstant): Remove Parameters parameter.
8659         (Block.GetParameterReference): Update to use Toplevel.Parameters.
8660         (Block.IsParamaterReference): Likewise.
8661         (Block.IsLocalParameter): Likewise.  Simplify a lot.
8662         (ToplevelBlock.Parameters): New.  Moved from Block.
8663         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
8664         initialize Parameters to a non-null value.
8665         * cs-parser.jay: Update to changes.
8666         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8667         simple names that mean different things in the same block.  Use
8668         Block.IsVariableNameUsedInBlock.
8669
8670 2005-03-28  Raja R Harinath  <rharinath@novell.com>
8671
8672         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8673         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8674         GetTypeHandle.  It is possible for a reflected type to derive from
8675         a TypeBuilder (e.g., int[] derives from the TypeBuilder
8676         System.Array during mscorlib compilation).
8677         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8678         contain a method_hash, don't create one either.  Don't create a
8679         deep copy of the base cache's method_hash.
8680         (MemberCache.SetupCache): Rename back from DeepCopy.
8681         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8682         already initialized.  If we see an override function, add its
8683         underlying base virtual function to the member_hash too.
8684
8685         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8686
8687 2005-03-26  Raja R Harinath  <harinath@acm.org>
8688
8689         Fix #73038.
8690         * assign.cs (Assign.DoResolve): When the RHS of an assignment
8691         fails to resolve, ensure that the LHS is still resolved as an
8692         lvalue.
8693
8694 2005-03-25  Raja R Harinath  <harinath@acm.org>
8695
8696         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8697         ec.ContainerType.
8698         (Enum.current_ec): Remove.
8699         (Enum.LookupEnumValue): Remove EmitContext argument.
8700         Just uses the one created during DefineType.
8701         (Enum.FindMembers): Update.
8702         * expression.cs (MemberAccess.DoResolve): Update.
8703
8704 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
8705
8706         * assign.cs (Assign.DoResolve): Check for CS1717 when
8707         source and target are same (uses Equals).
8708
8709         * expression.cs (LocalVariableReference, ParameterReference,
8710         This): Implemented Equals, GetHashCode.
8711
8712         * statement.cs (Block.GetParameterReference): Removed useless
8713         local variable.
8714
8715 2005-03-22  Raja R Harinath  <rharinath@novell.com>
8716
8717         Fix cs0128.cs
8718         * statement.cs (Block.AddVariable): Ensure that we skip implicit
8719         blocks before deciding whether the error is cs0136 or cs0128.
8720
8721         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8722         (using_alias_directive, using_namespace_directive): Pass
8723         MemberName, not an expression to Namespace.UsingAlias and
8724         Namespace.Using.
8725         (MakeName): Use the MemberName of the namespace.
8726         * namespace.cs (Namespace.MemberName): New.
8727         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8728         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8729         Likewise.
8730         * decl.cs (MemberName.Name): Make readonly.
8731         (MemberName.FromDotted): New "constructor".
8732         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8733         (MemberCore.Name): Compute from MemberName on demand.
8734         (MemberCore.SetMemberName): Provide a way to change the
8735         MemberName.
8736         (MemberCore.AddToContainer): Don't take a fullname parameter.
8737         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8738         fully qualified name of the container to the member name.
8739         (TypeContainer.AddToTypeContainer): Use a fully qualified name
8740         only if the type is a member of the root container.
8741         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8742         MemberName.Left rather than searching for an embedded ".".
8743         (PartialContainer.CreatePart): Update to changes in RootContext.
8744         (MemberBase.ShortName): Turn into a property.  Use
8745         MemberCore.SetMemberName.
8746         (MemberBase.ExplicitInterfaceName): Remove.
8747         (MemberBase.UpdateMemberName): Remove.
8748         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8749         (PropertyBase.SetMemberName): New override.
8750         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8751         (Tree.GetDecl): New.
8752         (Tree.AllDecls): Rename from Decls.
8753         * attribute.cs, enum.cs, report.cs: Update to changes.
8754         * driver.cs (MainDriver): Use MemberName.FromDotted on
8755         RootContext.MainClass.
8756
8757 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
8758
8759         * class.cs (FixedField.Define): Check for CS1664 and more sanity
8760         checks.
8761
8762         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
8763
8764 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
8765
8766         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
8767         property accessor modifiers.
8768
8769         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
8770         fixed buffer attribute (CS1716).
8771         (PropertyMethod.HasCustomAccessModifier): When property accessor
8772         has custom modifier.
8773
8774         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
8775         modifiers.
8776         (PropertyExpr.DoResolveLValue): Add CS0272.
8777
8778 2005-03-17  Miguel de Icaza  <miguel@novell.com>
8779
8780         * convert.cs: When converting to a pointer, use the proper Conv.U
8781         or Conv.I depending on the source data type.
8782
8783         * cs-tokenizer.cs: Make the size for large decimal constants,
8784         fixes #72957.
8785
8786 2005-03-17  Martin Baulig  <martin@ximian.com>
8787
8788         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
8789         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
8790
8791 2005-03-17  Martin Baulig  <martin@ximian.com>
8792
8793         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
8794         to bool so we can return an error condition.
8795         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
8796         returned an error.
8797
8798 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
8799
8800         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
8801         attributes.
8802
8803 2005-03-16  Raja R Harinath  <rharinath@novell.com>
8804
8805         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
8806         Refactor to avoid traversing the list of assemblies, and to avoid
8807         string concatenation.
8808         * typemanager.cs (guid_attr_type): Remove.
8809         (negative_hits, pointers, references): Remove hashes.
8810         (type_hash): New.
8811         (GetConstructedType): New.  Uses type_hash to handle constructed
8812         types (arrays, references, pointers).
8813         (GetReferenceType, GetPointerType): Use it.
8814         (GetNestedType): New.  Uses type_hash to handle nested types of
8815         reflected types.
8816         (LookupType, LookupTypeDirect): Remove.
8817         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
8818         'types' hash and LookupTypeReflection directly.
8819         (params_string, params_object): Use GetConstructedType.
8820         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
8821         top-level types.
8822         (Namespace.Lookup): Use cached_types.
8823         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
8824         provided by old TypeManager.LookupType.
8825         * rootcontext.cs (MakeFQN): Remove.
8826         * decl.cs (DeclSpace.MakeFQN): Likewise.
8827         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
8828         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8829         TypeManager.GetConstructedType.
8830         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
8831
8832 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
8833
8834         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
8835         indexers.
8836
8837         * cs-parser.jay: Reports CS1527 for any namespace element.
8838
8839         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
8840         Added CS0407.
8841
8842         * expression.cs (ParameterReference.IsAssigned): Changed error to
8843         CS0269.
8844         (Error_WrongNumArguments): Moved CS0245 detection here.
8845
8846         * statement.cs (Return.Resolve): Add CS1622 report.
8847
8848 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
8849
8850         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
8851
8852 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
8853
8854         * attribute.cs expression.cs: Get rid of some allocations.
8855
8856 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
8857
8858         * doc.cs : just eliminate the latest change.
8859
8860 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8861
8862         * doc.cs : commented out the latest change. It breaks xml-030.cs
8863
8864 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8865
8866         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
8867           fail. So invoke CreateType() in FindDocumentedType().
8868
8869 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8870
8871         * cs-tokenizer.cs : added IsKeyword().
8872         * doc.cs : Detect keyword incorrectly used as identifier.
8873           Allow identifiers prefixed by @.
8874
8875 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
8876
8877         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
8878         It caused exception in namespace resolving (again!).
8879         
8880         * class.cs (Class.ctor): Removed exit.
8881         (PropertyMethod.ctor): ditto.
8882         
8883         * codegen.cs (Codegen.Reset): Reset static data.
8884         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
8885         
8886         * cs-tokenizer.cs (Cleanup): Removed.
8887         
8888         * driver.cs (GetSystemDir): Rewrote to one line command.
8889         It caused problem with unloaded dynamic modules.
8890         (UnixParseOption): Removed Exit.
8891         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
8892         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
8893         Now can be mcs used as library.
8894         
8895         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
8896         empty location.
8897         
8898         * location.cs (Reset): Reset static data.
8899         
8900         * namespace.cs (Reset): Reset static data.
8901         
8902         * report.cs (Report.Reset): Reset static data.
8903         
8904         * rootcontext.cs (RootContext.Reset): Reset static data.
8905         
8906         * tree.cs (RootTypes.ctor): Use Location.Null
8907         
8908         * typemanager.cs (TypeManager.Reset): Reset static data.
8909         (CoreLookupType): Removed Exit.
8910         (TypeHandle.Reset): Reset static data.
8911         
8912 2005-03-10  Raja R Harinath  <rharinath@novell.com>
8913
8914         Fix #73516.
8915         * typemanager.cs (ComputeNamespaces): Import namespaces from
8916         referenced modules too.
8917
8918 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8919
8920         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
8921         than '.'.
8922
8923 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8924
8925         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
8926         enclosing DeclSpace.  This ensures that a name-lookup populates
8927         more caches and there are fewer 'TypeExpression's.  Carve out
8928         nested type lookup into ...
8929         (LookupNestedTypeInHierarchy): ... this.
8930
8931 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8932
8933         Clean up a few partial-class semantics.  
8934         Fixes test-357.cs and cs1618-2.cs.
8935         * cs-parser.jay (struct_declaration): Use 'current_class' as
8936         parent of newly-created struct.  Remove call to Register ().
8937         Use 'pop_current_class' to complete handing the current struct.
8938         (interface_declaration): Likewise.
8939         (class_declaration): Likewise.
8940         (enum_declaration): Use 'current_class' as parent of newly created
8941         enum.
8942         (delegate_declaration): Likewise.
8943         (pop_current_class): New function.  This is used to handle closing
8944         up the 'current_class' and 'current_container', and pointing them
8945         to the enclosing class/container.
8946         (CSharpParser): Initialize 'current_class' too.
8947         * decl.cs (MemberCore): Add check for invariant: a partial
8948         container is not a parsed entity, and thus does not enclose any
8949         parsed members.
8950         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
8951         (DeclSpace.BaseTypeExpr): Use it.
8952         (DeclSpace.LookupType): Add check for invariant.
8953         * class.cs (TypeContainer): Add check for invariant: a nested
8954         class should have the same NamespaceEntry as its enclosing class.
8955         (TypeContainer.EmitFieldInitializers): Make virtual.
8956         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
8957         MemberCore.
8958         (TypeContainer.Register): Remove.
8959         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
8960         null.  Use TypeResolveEmitContext for resolving base types and
8961         interfaces.  Move initialization of Parts.TypeBuilder here from
8962         ...
8963         (TypeContainer.DefineNestedTypes): ... here.
8964         (PartialContainer): Take a Namespace not a NamespaceEntry.
8965         (PartialContainer.Create): Don't use Register.  Call the
8966         appropriate Add... function directly.
8967         (ClassPart): Take both the PartialContainer and the enclosing
8968         class as constructor arguments.
8969         (ClassPart.EmitFieldInitializers): Override.
8970         (ClassPart.PartFindNestedTypes): Remove.
8971         (FieldBase.GetInitializerExpression): Resolve the initializer
8972         expression in the emit context of the enclosing class.
8973         * tree.cs (RootTypes): Remove Register ().
8974         
8975 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
8976
8977         * cs-parser.jay: Removed CS0134.
8978         
8979         * driver.cs: Removed CS1901.
8980         
8981         * expression.cs (SizeOf.DoResolve): Don't report CS0233
8982         for predefined types.
8983
8984 2005-03-07  Duncan Mak  <duncan@novell.com>
8985
8986         * codegen.cs (Save):  Catch UnauthorizedAccessException as
8987         well. Fixes bug #73454.
8988
8989 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
8990
8991         * cs-tokenizer.cs (xtoken): Add CS1035.
8992         
8993         * class.cs (MethodData.Define): Add CS0683.
8994         (FieldMember.ctor): Add CS0681.
8995
8996 2005-03-07  Raja R Harinath  <rharinath@novell.com>
8997
8998         * ecore.cs (SimpleName.DoResolve): Rename from
8999         SimpleName.DoResolveAllowStatic.
9000         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9001         Pass 'intermediate' flag to MemberStaticCheck.
9002         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9003         of "intermediate" lookups via MemberAccess.
9004         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9005         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9006
9007 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9008
9009         Fix #73394.
9010         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9011         slipped in because of variable names that are identical to a
9012         builtin type's BCL equivalent ('string String;', 'int Int32;').
9013         (PropertyExpr.EmitInstance): Likewise.
9014
9015 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9016
9017         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9018         
9019         * report.cs (warning_ignore_table): Made public.
9020
9021 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9022
9023         Fix #73282.
9024         * class.cs (MethodData.Emit): Pass 'container' to
9025         container.GetObsoleteAttribute instead of 'container.Parent'.
9026
9027 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9028
9029         * cs-parser.jay: Add 1534 error test.
9030
9031         * iterators.cs (Yield.CheckContext): Add error 1629.
9032         (Iterator.ctor): Save unsafe modifier.
9033         (MoveNextMethod.DoEmit): Restore unsafe context.
9034
9035         * namespace.cs (UsingAlias): Better error message.
9036
9037 2005-03-03  Dan Winship  <danw@novell.com>
9038
9039         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9040         the warning message [#73219]
9041
9042 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9043
9044         Fix compile with MCS 1.0.0.0.
9045         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9046         w_restore to not depend on string constant folding.
9047
9048 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9049
9050         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9051         CS0246 check to users who passed 'silent = false'.
9052         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9053         check.
9054         (SimpleName.SimpleNameResolve): Update.
9055         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9056         (MemberAccess.IdenticalNameAndTypeName): Update.
9057         * doc.cs (FindDocumentedTypeNonArray): Update.
9058
9059 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9060
9061         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9062         * parameters.cs (ComputeAndDefineParameters): Remove.
9063         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9064         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9065         Use GetParameterInfo.
9066
9067 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9068
9069         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9070
9071 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9072
9073         Unify DeclSpace.LookupType and DeclSpace.FindType.
9074         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9075         is in charge of defining nested types on demand.
9076         (DeclSpace.LookupType): Use it when the current_type is a
9077         TypeBuilder.  Use LookupTypeDirect for reflected types.
9078         (DeclSpace.FindType): Remove.
9079         (DeclSpace.LookupInterfaceOrClass): Likewise.
9080         (DeclSpace.DefineTypeAndParents): Likewise.
9081         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9082         DeclSpace.LookupType.
9083         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9084         * typemanager.cs (LookupType): Simplify.
9085         (AddUserType): Remove type from negative_hits.
9086         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9087         * class.cs (TypeContainer.FindMembers): Move handling of nested
9088         types ...
9089         (TypeContainer.FindMembers_NestedTypes): ... here.
9090         (TypeContainer.FindNestedType): Implement override.
9091         (ClassPart.FindNestedType): Delegate to PartialContainer.
9092         (ClassPart.PartFindNestedType): Looks up the nested types of the
9093         part alone.
9094
9095 2005-03-02  Martin Baulig  <martin@ximian.com>
9096
9097         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9098         static constructor in static classes.
9099
9100 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9101
9102         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9103         sizeParamIndex is not specified.
9104
9105 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9106
9107         Fix #73117
9108         * report.cs (WarningMessage.IsEnabled): Missing null check.
9109
9110 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9111
9112         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9113         in the fields and not in the properties.
9114
9115 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9116
9117         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9118         fields as well.
9119
9120 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9121
9122         * attribute.cs: Small refactoring (improved robustness).
9123         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9124         (ValidateGuid): Removed.
9125         (Resolve): Removed referenced to above mentioned.
9126         (GetAttributeUsage): Made private and changed to work without
9127         class assistance.
9128         (GetIndexerAttributeValue): Don't crash.
9129         (GetConditionalAttributeValue): Ditto.
9130         (GetClsCompliantAttributeValue): Ditto.
9131         (ExtractSecurityPermissionSet): All attributes exceptions are
9132         error 648.
9133         (GetPropertyValue): New helper.
9134         (GetMethodImplOptions): New method.
9135         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9136         some missing properties.
9137         
9138         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9139         (Method.ApplyAttributeBuilder): Updated.
9140         
9141         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9142         exception.
9143
9144 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9145
9146         Fix #73052.
9147         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9148         non-simple types (array, pointer, reference).
9149
9150 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9151
9152         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9153
9154         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9155         for operators.
9156         (Method.CheckBase): Catch wrong destructor here.
9157         (MethodData.Define): Add errors 550, 668.
9158
9159         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9160
9161         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9162
9163         * pending.cs (VerifyPendingMethods): Add error 551.
9164
9165         * typemanager.cs (CSharpName): Next error report helper.
9166
9167 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9168
9169         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9170         attributes. Removed useless attribute double check.
9171         It saves almost 2MBs for corlib.
9172
9173 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9174
9175         Fix #72924.
9176         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9177         called twice in case of error.
9178
9179 2005-02-23  Chris Toshok  <toshok@ximian.com>
9180
9181         Fix compiler portions of #72827.
9182         * statement.cs (Block.Emit): call Begin/EndScope on the
9183         EmitContext instead of the ILGenerator.
9184
9185         * codegen.cs (EmitContext.BeginScope): new method, call
9186         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9187         we have one.)
9188         (EmitContext.BeginScope): same, but EndScope and CloseScope
9189
9190         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9191         offset and call the superclass's OpenScope(int) with it.
9192         (SymbolWriter.CloseScope): get the current il
9193         offset and call superclass's CloseScope(int) with it.
9194
9195 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9196
9197         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9198         CS1677 for out and ref as well.
9199
9200         * class.cs (Method.Define): Add error CS1599 detection.
9201         
9202         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9203         
9204         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9205         
9206         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9207         
9208         * support.cs.cs (ModifierDesc): New helper method.
9209
9210 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9211             Abin Thomas  <projectmonokochi@rediffmail.com>
9212             Anoob V E  <projectmonokochi@rediffmail.com>
9213             Harilal P R  <projectmonokochi@rediffmail.com>
9214
9215         Fix #57851, #72718.
9216         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9217         MemberLookup (used for error reporting) actually returns a result.
9218         Fix error report number (122, not 112).
9219
9220 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9221             Anoob V E  <projectmonokochi@rediffmail.com>
9222             Harilal P R  <projectmonokochi@rediffmail.com>
9223
9224         Fix #71134.
9225         * pending.cs (PendingImplementation.GetAbstractMethods):
9226         Find NonPublic members too.
9227
9228 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9229
9230         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9231         Fixed error 217.
9232         
9233         * class.cs (MethodCore.CheckMethodAgainstBase):
9234         Add error 239 report.
9235
9236 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9237
9238         Fix #68955.
9239         * expression.cs (Invocation.IsApplicable): Make public.
9240         (Invocation.IsParamsMethodApplicable): Likewise.
9241         * delegate.cs (Delegate.VerifyApplicability): Don't use
9242         Invocation.VerifyArgumentCompat for parameter applicability
9243         testing.  Use Invocation.IsApplicable and
9244         Invocation.IsParamsMethodApplicable.
9245
9246 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9247
9248         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9249         
9250         * class.cs (Operator.Define): Add error 217 report.
9251         
9252 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9253
9254         * namespace.cs (UsingEntry.Resolve): Undo change below.
9255
9256 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9257
9258         Fix #72756.
9259         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9260         disable the error message when the extended MemberLookup also
9261         fails.
9262         (Expression.MemberLookupFinal): Update.
9263         (SimpleName.DoSimpleNameResolve): Update.
9264         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9265         Don't use MemberLookupFinal.
9266         (New.DoResolve): Update.
9267         (BaseAccess.CommonResolve): Update.
9268
9269 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9270
9271         Fix #72732.
9272         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9273         occured previously, don't resolve again.
9274
9275 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9276
9277         Fix #69949
9278         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9279         argument. Call ResolveAttributeUsage for unresolved.
9280         when types doesn't match ctor arguments.
9281         
9282         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9283         for nested attribute classes.
9284         (Class.attribute_usage): Removed.
9285         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9286         for attribute class.
9287         
9288         * ecore.cs (IsAttribute): Removed.
9289         
9290         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9291         
9292         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9293         now normal types.
9294         (attribute_types): Removed.
9295         (EmitCode): Global attributes are emited as the latest.
9296
9297 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9298
9299         * class.cs (EmitFieldInitializers): Don't emit field initializer
9300         for default values when optimilization is on.
9301         
9302         * constant.cs (Constant.IsDefaultValue): New property.
9303         
9304         * driver.cs: Add /optimize handling.
9305         
9306         * constant.cs,
9307         * ecore.cs,
9308         * literal.cs: Implement new IsDefaultValue property.
9309         
9310         * rootcontext.cs (Optimize): New field, holds /optimize option.
9311
9312 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9313
9314         Fix crasher in re-opened #72347.
9315         * namespace.cs (Namespace.Lookup): Return null if
9316         DeclSpace.DefineType returns null.
9317
9318         Fix #72678.
9319         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9320
9321 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9322
9323         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9324         now returns null if it cannot resolve to an lvalue.
9325         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9326         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9327         returned null.  Remove check for SimpleName.
9328         (EventExpr.DoResolveLValue): New.
9329         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9330         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9331         error from ...
9332         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9333         avoid CS0131 error.
9334         (Unary.ResolveOperator): Move CS0211 check ...
9335         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9336         CS0131 error.
9337         (Unary.DoResolveLValue): Simplify.
9338         (AddressOf.DoResolveLValue): New.
9339         (ArrayAccess.DoResolveLValue): New.
9340
9341 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9342
9343         * attribute.cs (Attribute.Resolve): Add arguments casting for
9344         when types doesn't match ctor arguments.
9345
9346 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9347
9348         Fix parts of #63202.
9349         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9350         lookup of operator in base type.  Ensure that all checks happen
9351         when the operator resolves to an "op_..." method.
9352
9353 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9354
9355         Fix #71992.
9356         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9357         'ignore_cs0104' parameter.  Pass it to ...
9358         (NamespaceEntry.Lookup): ... this.
9359         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9360         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9361         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9362         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9363         Update.  Request that cs0104 errors be ignored.
9364         (ComposedCast.ResolveAsTypeStep): Update.
9365
9366 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9367
9368         Fix #59209.
9369         * expression.cs (Invocation.BetterFunction): Remove support for
9370         comparing virtual functions and their overrides.
9371         (Invocation.IsOverride): New.
9372         (Invocation.OverloadResolve): Don't consider 'override' functions
9373         during candidate selection.  Store them in a lookaside list.
9374         If the selected method is a 'virtual' function, use the list to
9375         find any overrides that are closer to the LHS type.
9376
9377 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9378
9379         * expression.cs (New.DoResolve): Add complex core type reduction.
9380         (New.Constantify): Converts complex core type syntax like 'new int ()'
9381         to simple constant.
9382         
9383 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9384
9385         * decl.cs (EntryType.EntryType): New constructor to create an
9386         updated copy of a cache entry.
9387         (MemberCache.AddMethods): Use it.
9388         (MemberCache.ClearDeclaredOnly): Remove.
9389         (MemberCache.MemberCache): Update.
9390
9391 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9392
9393         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9394         variable.  This one is represents the actual low-level declaration
9395         of the method, as opposed to the semantic level `IsStatic'.   
9396
9397         An anonymous method which is hosted into a static method might be
9398         actually an instance method.  IsStatic would reflect the
9399         container, while MethodIsStatic represents the actual code
9400         generated.
9401
9402         * expression.cs (ParameterReference): Use the new MethodIsStatic
9403         instead of IsStatic.
9404
9405         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9406         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9407         set on the current EmitContext. 
9408
9409         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9410         resolve our casted expression as an LValue.  This triggers the
9411         proper LValue processing that is later required by Assign.
9412
9413         This fixes 72347.
9414
9415         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9416
9417 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9418
9419         C# 2.0 Fixed buffer implementation
9420
9421         * anonymous.cs: Update after RegisterHelperClass renaming.
9422
9423         * attribute.cs (AttributeTester.fixed_buffer_cache):
9424         Cache of external fixed buffers.
9425         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9426         implementation if field is fixed buffer else null.
9427
9428         * class.cs
9429         (TypeContainer.AddField): Accept FieldMember instead of Field.
9430         (FieldBase.IsFieldClsCompliant): Extracted code from
9431         VerifyClsCompliance descendant customization.
9432         (FixedField): New class handles fixed buffer fields.
9433         (FixedFieldExternal): Keeps information about imported fixed
9434         buffer.
9435         (IFixedField): Make access to internal or external fixed buffer
9436         same.
9437
9438         * cs-parser.jay: Add fixed buffer parsing.
9439
9440         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9441         buffer.
9442
9443         * expression.cs (Indirection): Extended implementation to accept
9444         fixed buffer field.
9445         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9446         (ElementAccess.MakePointerAccess): Get type as parameter.
9447         (DoResolve): Add fixed buffer field expression conversion.
9448         (DoResolveLValue): Ditto.
9449         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9450         (ArrayPtr): Derives from FixedBufferPtr.
9451         (ArrayPtr.Emit): Add extra emit for array elements.
9452
9453         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9454
9455         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9456         for compiler generated types.
9457         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9458
9459         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9460         and consume less memory.
9461         (Fixed.Resolve): Add fixed buffer case.
9462
9463         * typemanager.cs (compiler_generated_attr_ctor,
9464         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9465         (HasElementType): Add our own implementation to work on every
9466         runtime.
9467
9468 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9469
9470         * anonymous.cs (CaptureContext): Track whether `this' has been
9471         referenced.   
9472
9473         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9474         only captured `this' if it was implicitly done (instance
9475         methods/variables were used). 
9476
9477         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9478         `this' must be captured.
9479
9480 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9481  
9482         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9483         is null it means that there has been no need to capture anything,
9484         so we just create a sibling.
9485
9486         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9487
9488         Just a partial fix.  The other half is fairly elusive.
9489         
9490 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9491
9492         Fix #52586, cs0121-4.cs.
9493         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9494         and return a hashtable.
9495         (MemberCache.ClearDeclaredOnly): New.
9496         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9497         the method_hash of a base type too.
9498         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9499         type methods.  Overwrite entries with the same MethodHandle so
9500         that the ReflectedType is correct.  The process leaves in base
9501         virtual functions and their overrides as distinct entries.
9502         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9503         matters since it was boxed in a ArrayList before.
9504         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9505         modifier.
9506         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9507         case of a virtual function and its override (choose the overload
9508         as better).
9509         (Invocation.OverloadResolve): Avoid 'override' members during
9510         'applicable_type' calculation.
9511
9512 2005-02-09  Raja R Harinath  <rharinath@novell.com>
9513
9514         Combine two near-redundant caches.
9515         * typemanager.cs (method_params): Rename from method_internal_params.
9516         (TypeManager.GetParameterData): New.  Replace
9517         Invocation.GetParameterData.
9518         (TypeManager.LookupParametersByBuilder): Remove.
9519         * expression.cs (Invocation.method_parameter_cache): Remove.
9520         (Invocation.GetParameterData): Remove.
9521         Update to changes.
9522         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9523         Update to changes.
9524
9525 2005-02-08  Raja R Harinath  <rharinath@novell.com>
9526
9527         Fix #72015.
9528         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9529         TypeManager.multicast_delegate_type is null, resolve it by looking
9530         up "System.MulticastDelegate".
9531         * rootcontext.cs (RootContext.ResolveCore): Simplify.
9532
9533 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
9534             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
9535             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
9536
9537         Fix cs0164.cs.
9538         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9539         (LabeledStatement.AddReference): New.  Set 'referenced'.
9540         (Goto.Resolve): Use it.
9541
9542 2005-02-05  John Luke  <john.luke@gmail.com>
9543
9544         * driver.cs: remove duplicate -doc line in Usage ()
9545
9546 2005-02-04  Raja R Harinath  <rharinath@novell.com>
9547
9548         * location.cs (Location.AddFile): Fix CS2002 error report.
9549
9550 2005-02-02  Martin Baulig  <martin@ximian.com>
9551
9552         * delegate.cs (Delegate.DefineType): Report an internal error if
9553         TypeManager.multicast_delegate_type is null.  See bug #72015 for
9554         details.        
9555
9556 2005-02-02  Raja R Harinath  <rharinath@novell.com>
9557
9558         Fix a crasher in a variant of #31984.
9559         * const.cs (Constant.CheckBase): New override that defers the
9560         new-or-override check in case the base type hasn't been populated
9561         yet.
9562         (Constant.Define): Ensure the new-or-override check is performed.
9563
9564 2005-02-01  Duncan Mak  <duncan@ximian.com>
9565
9566         * const.cs (LookupConstantValue): Check that `ce' is not null
9567         before calling GetValue ().
9568
9569 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9570
9571         Fix test-334.cs (#69519).
9572         * cs-parser.jay (using_alias_directive): Pass in an expression to
9573         NamespaceEntry.UsingAlias.
9574         (using_namespace_directive): Pass in an expression to
9575         NamespaceEntry.Using.
9576         (namespace_name): Don't flatten to a string.
9577         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9578         (NamespaceEntry.AliasEntry.Resolve): Lookup using
9579         ResolveAsTypeStep.
9580         (NamespaceEntry.UsingEntry): Likewise.
9581         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9582         changes.
9583         (NamespaceEntry.LookupForUsing): Remove.
9584         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9585         names.
9586         (NamespaceEntry.Lookup): Remove support for dotted names.
9587
9588 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9589
9590         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9591         split into two.
9592         (NamespaceEntry.ImplicitParent): Compute on demand.
9593         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9594         parallels the current.
9595         (NamespaceEntry.LookupForUsing): Use it.
9596         (NamespaceEntry.Lookup): If the current namespace-entry is
9597         implicit, don't search aliases and using tables.
9598
9599 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9600
9601         Fix #31984.
9602         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9603         BaseCache here.
9604         (TypeContainer.BaseCache): Compute on demand.
9605         (TypeContainer.FindMembers): Define constants and types if they're
9606         not already created.
9607         (FieldMember.Define): Move resetting of ec.InUnsafe before error
9608         check.
9609         * const.cs (Constant.Define): Make idempotent.
9610
9611 2005-01-29  Miguel de Icaza  <miguel@novell.com>
9612
9613         * pending.cs: Produce better code (no nops produced by using Ldarg
9614         + value).
9615         
9616         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9617         i - 1' it should be arg + 1.
9618
9619         Fixes bug #71819.
9620
9621 2005-01-28  Raja R Harinath  <rharinath@novell.com>
9622
9623         * attribute.cs (Attribute.CheckAttributeType): Make private
9624         non-virtual.
9625         (Attribute.ResolveType): Make virtual.
9626         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9627         handling of RootContext.Tree.Types.
9628
9629 2005-01-27  Raja R Harinath  <rharinath@novell.com>
9630
9631         Update attribute-handling to use the SimpleName/MemberAccess
9632         mechanisms.
9633         * cs-parser.jay (attribute): Pass in an expression to the
9634         constructors of Attribute and GlobalAttribute.
9635         * attribute.cs (Attribute): Take an expression for the name.
9636         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
9637         passed in attribute name expression.
9638         (Attribute.CheckAttributeType): Use it.
9639         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9640         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9641         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
9642         argument to prevent error messages if the lookup fails.
9643
9644 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
9645
9646         * expression.cs (Indirection): Implemented IVariable interface
9647         to support indirection in AddressOf operator.
9648         (PointerArithmetic.Emit): Add optimalization for case where
9649         result can be precomputed.
9650
9651 2005-01-26  Martin Baulig  <martin@ximian.com>
9652
9653         * class.cs (TypeContainer.AttributeTargets): Return the correct
9654         AttributeTargets depending on our `Kind' instead of throwing an
9655         exception; fixes #71632.
9656
9657 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
9658
9659         Fix #71257
9660         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9661         constant members.
9662
9663 2005-01-25  Raja R Harinath  <rharinath@novell.com>
9664
9665         Fix #71602.
9666         * expression.cs (MemberAccess.DoResolve): Don't complain with
9667         cs0572 when the LHS of a member access has identical name and type
9668         name.
9669
9670 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
9671
9672         Fix #71651, #71675
9673         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9674         CreatePermission.
9675         Create custom PermissionSet only for PermissionSetAttribute.
9676
9677 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
9678
9679         Fix #71649
9680         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9681         delegates in static class.
9682
9683 2005-01-24  Martin Baulig  <martin@ximian.com>
9684
9685         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9686         merging an implicit block, just use its reachability.
9687
9688         * statement.cs (Block.Resolve): Make the unreachable code check
9689         work wrt. implicit blocks; see test-337 from #63842.
9690
9691 2005-01-21  Alp Toker  <alp@atoker.com>
9692  
9693         * cs-parser.jay: destructor_declaration's container is PartialContainer
9694         not Class when partial types are used, so use Kind prop instead of
9695         'is'.
9696         
9697 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
9698
9699         * cs-parser.jay: Improve error reporting when an interface
9700         declares new types.
9701
9702 2005-01-20  Dick Porter  <dick@ximian.com>
9703
9704         * support.cs: SeekableStreamReader fix from Sandor Dobos
9705         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9706         chars are read.  Fixes bug 70369.
9707
9708 2005-01-20  Raja R Harinath  <rharinath@novell.com>
9709
9710         * cs-parser.jay (catch_clause): Simplify current_block handling
9711         somewhat.
9712
9713 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
9714
9715         * convert.cs (ImplicitStandardConversionExists): Synchronize the
9716         code with ImplicitStandardConversion to handle the implicit
9717         conversion of method groups into valid delegate invocations. 
9718
9719         The problem is that in parameter handling we were using this code
9720         path.  Fixes bug #64698
9721
9722 2005-01-19  Raja R Harinath  <rharinath@novell.com>
9723
9724         * cs-parser.jay: Fix several infelicities.
9725         - Avoid assigning to the parser value stack.  Code like 
9726           '$3 = null' is unclean.  Synthesize a value for the code block
9727           instead. 
9728         - Avoid using oob_stack for storing location information.  Use ...
9729         (_mark_): ... this.  New (empty) rule.  Saves the current location
9730         in $$.
9731         (foreach_statement): Avoid using oob_stack for current_block
9732         handling.  Use technique used in for_statement and
9733         using_statement.  Synthesize a value for the code block to store
9734         additional intermediate information.
9735
9736 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
9737
9738         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9739         of a different type is only allowed to private fields of a
9740         containing type, not on fields of a base class.
9741
9742         See test-174.cs and error cs0122-9.cs
9743
9744 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9745
9746         Fix test-335.cs (bug #58126).
9747         * cs-parser.jay (argument): Split out non-expression parts of the
9748         rule into 'non_simple_argument'.
9749         (invocation_expression): Support parenthesized invocations with
9750         multiple arguments, and with single non-simple arguments.
9751
9752 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9753
9754         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9755         places.
9756
9757 2005-01-12  Raja R Harinath  <rharinath@novell.com>
9758
9759         Fix cs0038-1.cs, cs1640-6.cs.
9760         * ecore.cs (Expression.Resolve): Remove special-case for
9761         SimpleName in error-handling.
9762         (Expression.almostMatchedMembers): Relax access permission to
9763         protected.
9764         (Expression.MemberLookupFailed): Handle duplicates in
9765         almostMatchedMembers list.
9766         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
9767         * expression.cs (New.DoResolve): Report CS1540 for more cases.
9768         * typemanager.cs (GetFullNameSignature): Use the MethodBase
9769         overload if the passed in MemberInfo is a MethodBase.
9770
9771 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
9772
9773         Fix #70749
9774         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
9775         for non-CAS & merge permission sets properly.
9776
9777 2005-01-11  Raja R Harinath  <rharinath@novell.com>
9778
9779         Improve standard-compliance of simple name and member access 
9780         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
9781         * ecore.cs (FullNamedExpression): New abstract base class 
9782         for Namespaces and TypeExpressions.
9783         (ResolveFlags.SimpleName): Remove.
9784         (SimpleName): Remove support for dotted names.
9785         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
9786         DeclSpace.FindType and DeclSpace.LookupType.
9787         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
9788         (Expression.ExprClassName): Make member function.
9789         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
9790         a namespace.  Remove creation of dotted "SimpleName"s.
9791         (MemberAccess.DoResolve): Likewise.
9792         * decl.cs (DeclSpace.Cache): Make private.
9793         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
9794         (DeclSpace.FindType): Update.
9795         (DeclSpace.LookupType): Move here from RootContext.  Return a 
9796         FullNamedExpression.
9797         * namespace.cs (Namespace): Derive from FullNamedExpression
9798         so that it can be part of expression resolution.
9799         (Namespace.Lookup): Return an FullNamedExpression.
9800         (NamespaceEntry.LookupAlias): Lookup aliases only in current
9801         namespace.
9802         * rootcontext.cs (NamespaceLookup): Remove.
9803         (LookupType): Move to DeclSpace.
9804         * attribute.cs (CheckAttributeType): Update.
9805         * doc.cs (FindDocumentedType): Remove allowAlias argument.
9806         (FindDocumentedTypeNonArray): Likewise.
9807
9808 2005-01-11  Raja R Harinath  <rharinath@novell.com>
9809
9810         Fix cs0509.cs, cs1632.cs.
9811         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
9812         is the same as IsInterface.
9813         (TypeContainer.GetClassBases): Likewise.
9814         * statement.cs (LabeledStatement.ig): New field.
9815         (LabeledStatement.LabelTarget): Save ILGenerator which created the
9816         label.
9817         (LabeledStatement.DoEmit): Check that the label was created with
9818         the same ILGenerator.
9819
9820 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
9821
9822         Fix #71058
9823         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
9824         accessors to its properties.
9825
9826         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
9827         from accessors to property.
9828         
9829 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
9830
9831         Fix #70722
9832         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
9833         only for overrides.
9834         
9835 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
9836
9837         * attribute.cs: Check for null and empty strings.  
9838
9839         I have lost another battle to Paolo.
9840
9841 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
9842
9843         Fix #70942
9844         * class.cs (PropertyMethod): Set Parent field in ctors.
9845         (SetMethod.InternalParameters): Add unsafe switch hack.
9846         Override MarkForDuplicationCheck where it is appropriate.
9847
9848         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
9849         It says whether container allows members with the same name.
9850         Base default is no.
9851         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
9852         Removed is_method parameter.
9853
9854 2005-01-06  Duncan Mak  <duncan@ximian.com>
9855
9856         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
9857         because the previous change led to incorrect reporting of CS1032
9858         ("Cannot define/undefine preprocessor symbols after first token in
9859         file"). Instead of using `tokens_seen' as the only flag that
9860         triggers CS1040, introduce `comments_seen'. This new flag is used
9861         to signify having seen comments on the current line, so it is
9862         unset after a newline.
9863
9864 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
9865
9866         * doc.cs : When searching for a type, find nested type too.
9867           This fixes bug #71040.
9868
9869 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
9870
9871         * doc.cs :
9872           - Warn missing member comment on those classes which also does not
9873             have doc comments. Fixed bug #71041.
9874           - Don't warn missing doc comment on default constructor.
9875             Fixed bug #71042.
9876
9877 2005-01-06  Duncan Mak  <duncan@ximian.com>
9878
9879         * cs-tokenizer.cs (xtoken): After handling traditional C-style
9880         comments, set `tokens_seen' to true. This allows us to detect
9881         misplaced preprocessor directives (i.e. not at the beginning of
9882         the a line, nor after whitespaces). In that case, report error
9883         CS1040. This fixes bug #56460.
9884
9885         * cs-parser.jay (interface_member_declaration): Add checks for
9886         IsExplicitImpl, and report CS0541 error if an interface member is
9887         defined as an explicit interface declaration.
9888
9889 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
9890
9891         Fix #70817
9892         * class.cs (PropertyMethod): Set Parent field in ctors.
9893         (SetMethod.InternalParameters): Add unsafe switch hack.
9894         
9895         * decl.cs (MemberCore.Parent): Cannot be readonly.
9896
9897 2005-01-06  Raja R Harinath  <rharinath@novell.com>
9898
9899         * decl.cs (DeclSpace.ResolveType): Remove.
9900         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
9901         Merge in code from ...
9902         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
9903         * class.cs, enum.cs: Update to changes.
9904
9905 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
9906
9907         * anonymous.cs: Ensure that we init the scope of our parent if it
9908         has not been initialized yet.
9909
9910 2004-12-30  Duncan Mak  <duncan@ximian.com>
9911
9912         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
9913         if field.FieldBuilder is null. Fixes #70758.
9914
9915         * convert.cs: Fixed some typos and updated some of the comments.
9916         (ImplicitStandardConversionExists):
9917         (TryImplicitIntConversion): If `target_type' is an interface and
9918         the type of `ic' implements this interface, return true or a new
9919         BoxedCast instead of null. This fixes #70468.
9920
9921 2004-12-29  Duncan Mak  <duncan@ximian.com>
9922
9923         * expression.cs (Argument.Emit): Check that Expr is
9924         IMemoryLocation before casting to it, and report CS1510 otherwise.
9925
9926         This fixes #70402.
9927
9928 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
9929
9930         * statement.cs (Block.ThisVariable): remove the recursion here, to
9931         make the --profile more sane.
9932
9933 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
9934
9935         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
9936         assembly, by JB Evain.
9937
9938 2004-12-17  Raja R Harinath  <rharinath@novell.com>
9939
9940         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
9941           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
9942         "parent" refers to enclosing type/class.  "base" refers to superclass.
9943
9944 2004-12-17  Raja R Harinath  <rharinath@novell.com>
9945
9946         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9947         Ensure that we only have GlobalAttributes.
9948         * attribute.cs (Attribute.Emit): Make non-virtual.
9949         (GlobalAttribute.Emit): Remove.
9950         (Attribute.Resolve): Make virtual.
9951         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
9952         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
9953         the argument. Don't create one.
9954         (Attribute.GetObsoleteAttribute): Likewise.
9955         (Attribute.GetClsCompliantAttributeValue): Likewise.
9956         * class.cs, decl.cs: Update to changes.
9957
9958 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
9959
9960         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
9961         
9962         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
9963         
9964         * statement.cs (Foreach.Resolve): Add error 186 report.
9965
9966 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
9967
9968         * expression.cs (Conditional.DoResolve): Add warning 429.
9969         
9970         * statement.cs (If.Resolve): Add warning 665.
9971
9972 2004-12-16  Raja R Harinath  <rharinath@novell.com>
9973
9974         New invariant: RootContext.Tree.Types.NamespaceEntry == null
9975         except when in the parser, and in GlobalAttribute.
9976         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
9977         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
9978         RootContext.Tree.Types.NamespaceEntry once work is done.
9979         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
9980         and resets RootContext.Tree.Types.NamespaceEntry.
9981
9982 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
9983
9984         * cs-parser.jay: Don't create a block for every variable.
9985
9986 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
9987
9988         * location.cs: Provide extra information.
9989
9990         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
9991         variables from the captured environment, it is the ldarg_0.
9992
9993 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
9994
9995         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
9996         find a conclusion.
9997         
9998         * class.cs: Changed warning level for 169 to avoid developer
9999         displeasure from warning flooding. It will be changed back when they
10000         fix most of current BCL warnings.
10001         
10002         * RootContext.cs: Pushed default WarningLevel to 3.
10003         
10004         * statement.cs: Removed unused variable.
10005
10006 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10007
10008         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10009         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10010         Add error 502 report.
10011         (StaticClass.DefineType): Add error 441 report.
10012         (Class.AllowedModifiersProp): New virtual property as temporary
10013         extension to AllowedModifiers.
10014         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10015         to share implementation with StaticClass and don't call virtual
10016         methods from ctor.
10017         
10018         * driver.cs (MainDriver): Add error 1558 test.
10019
10020         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10021         report. Moved error 36 test here.
10022
10023         * statement.cs (Throw.Resolve): Add error 724 report.
10024
10025         * typemanager.cs: Add out_attribute_type core type.
10026         
10027 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10028
10029         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10030         3018 report.
10031         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10032
10033         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10034         3017 report.
10035         
10036         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10037
10038         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10039         Add error 3023 report.
10040         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10041
10042         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10043         implementation.
10044
10045 2004-12-12  John Luke  <john.luke@gmail.com>
10046
10047         * driver.cs (AddArgs): take -- into account when
10048         adding arguments, fixes bug 65710 
10049
10050 2004-12-12  Martin Baulig  <martin@ximian.com>
10051
10052         * expression.cs (Unary.TryReduceNegative): Added support for
10053         SByteConstant and ByteConstant.
10054         (Unary.Reduce): Check error values from TryReduceNegative().
10055
10056 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10057
10058         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10059         and report exception as error 182.
10060
10061 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10062
10063         * driver.cs (Main): Fix message when there are warnings.
10064
10065 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10066
10067         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10068
10069 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10070
10071         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10072         Reduced number of warnings.
10073         
10074         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10075
10076 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10077
10078         * driver.cs: Removed message.
10079
10080         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10081
10082 2004-12-08    <vargaz@freemail.hu>
10083
10084         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10085
10086 2004-12-08  Martin Baulig  <martin@ximian.com>
10087
10088         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10089         instead of a CS3002 for properties and indexer.
10090
10091 2004-12-08  Martin Baulig  <martin@ximian.com>
10092
10093         * decl.cs (MemberName.ToString): Make this work again.
10094
10095 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10096
10097         * attribute.cs (Resolve): Add error 591 detection.
10098
10099         * class.cs (FieldMember.Define): Add error 1547 detection.
10100         (Indexer.Define): Add error 620 detection.
10101         (Operator.Define): Add error 590 detection.
10102
10103         * ecore.cs: Missing argument for error 79.
10104
10105         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10106         detection.
10107
10108 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10109
10110         Fix #70106
10111         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10112         only.
10113
10114 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10115
10116         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10117           Some operator comments were suppressed.
10118         * doc.cs : Implicit/explicit operator name in doc comments are like
10119           "op_Explicit(type)~returnType", so added suffix handling.
10120
10121 2004-12-07  Martin Baulig  <martin@ximian.com>
10122
10123         * decl.cs
10124         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10125         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10126         (DeclSpace.ec): New protected field; store the EmitContext here.
10127         (DeclSpace.EmitContext): New public property; moved here from
10128         `TypeContainer'.
10129         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10130         EmitContext.
10131
10132         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10133         (Enum.Emit): Don't create a new EmitContext.
10134
10135         * delegate.cs (Delegate.DefineType): Always create the
10136         EmitContext.
10137
10138         * iterators.cs (Iterators.DefineIterator): Create a new
10139         EmitContext and store it in `ec'.
10140
10141 2004-08-24  Martin Baulig  <martin@ximian.com>
10142
10143         * typemanager.cs
10144         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10145         this for accessibility checks.
10146         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10147         IsNestedFamilyAccessible.
10148         (TypeManager.IsSubclassOf): New method, do what the name actually
10149         says.   
10150
10151 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10152
10153         Fix crash on cs0657-17.cs.
10154         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10155         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10156         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10157         the case where the NamespaceEntry gets overwritten.
10158
10159 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10160
10161         Fixed #69195, #56821
10162         * ecore.cs (ResolveBoolean): Tiny refactoring.
10163
10164         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10165         of right expression resolving when left is false constant and
10166         operator is LogicalAnd OR true constant and operator is LogicalOr.
10167
10168         * statement.cs (ResolveUnreachable): Always reports warning.
10169
10170 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10171
10172         * class.cs: Distinguish between 1721 and 1722 (just a little help
10173         for the programmer).
10174
10175 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10176
10177         * delegate.cs: Only allow this on new versions of the language. 
10178
10179 2004-12-02  Duncan Mak  <duncan@ximian.com>
10180
10181         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10182         Expression class.
10183         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10184         here as a static method. Take an additional bool out parameter
10185         `must_do_cs1540_check' for signaling to InstanceResolve.
10186         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10187         member field from PropertyExpr class and made it an argument of
10188         the method instead.
10189         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10190         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10191         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10192         and `remove_accessor' as well as InstanceResolve: report CS0122
10193         where applicable.
10194
10195         Fixes #70129.
10196
10197 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10198
10199         Fix test-327.cs, test-328.cs, and put in early infrastructure
10200         for eventually fixing #52697.
10201         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10202         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10203         from other methods.
10204         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10205         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10206         (VerifyUsing, error246): Update.
10207         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10208         'NamespaceEntry.LookupNamespaceOrType'.
10209
10210 2004-12-03  Martin Baulig  <martin@ximian.com>
10211
10212         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10213         method as our child, call AnonymousMethod.Compatible() on it.
10214
10215 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10216
10217         Disable XML documentation support in 'basic' profile.
10218         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10219         Redirect XmlElement to System.Object.
10220         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10221         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10222         * mcs.exe.sources: Add doc-bootstrap.cs.
10223         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10224         of doc.cs.
10225
10226 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10227
10228         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10229           comments are allowed.
10230
10231 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10232
10233         * delegate.cs: Add checks for subtypes in paramaters and return values
10234         in VerifyMethod () to add support for Covariance/Contravariance
10235         in delegates.
10236         
10237 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10238
10239         * report.cs: Remove extra closing parenthesis.
10240
10241         * convert.cs (Error_CannotImplicitConversion): If the name of the
10242         types are the same, provide some extra information.
10243
10244         * class.cs (FieldBase): Use an unused bit field from the field to
10245         encode the `has_offset' property from the FieldMember.  This saves
10246         a couple of Ks on bootstrap compilation.
10247
10248         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10249         method as our child, return the AnonymousMethod resolved
10250         expression.
10251
10252         * expression.cs (New.DoResolve): Allow return values from
10253         NewDelegate to also include AnonymousMethods.
10254
10255         Fixes #70150.
10256
10257 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10258
10259         Fix bug #70102
10260         * attribute.cs (Resolve): Improved implementation of params
10261         attribute arguments.
10262
10263         * support.cs (ParameterData): Add HasParams to be faster.
10264
10265 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10266
10267         all things are for /doc support:
10268
10269         * doc.cs: new file that supports XML documentation generation.
10270         * mcs.exe.sources: added doc.cs.
10271         * driver.cs:
10272           Handle /doc command line option.
10273           Report error 2006 instead of 5 for missing file name for /doc.
10274           Generate XML documentation when required, after type resolution.
10275         * cs-tokenizer.cs:
10276           Added support for picking up documentation (/// and /** ... */),
10277           including a new XmlCommentState enumeration.
10278         * cs-parser.jay:
10279           Added lines to fill Documentation element for field, constant,
10280           property, indexer, method, constructor, destructor, operator, event
10281           and class, struct, interface, delegate, enum.
10282           Added lines to warn incorrect comment.
10283         * rootcontext.cs :
10284           Added Documentation field (passed only when /doc was specified).
10285         * decl.cs:
10286           Added DocComment, DocCommentHeader, GenerateDocComment() and
10287           OnGenerateDocComment() and some supporting private members for
10288           /doc feature to MemberCore.
10289         * class.cs:
10290           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10291         * delegate.cs:
10292           Added overriden DocCommentHeader.
10293         * enum.cs:
10294           Added overriden DocCommentHeader and GenerateDocComment().
10295
10296 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10297
10298         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10299         unwrapping the enumeration values, chain to
10300         DoConstantNumericPromotions again, so we can promote things to the
10301         fundamental types (takes care of enums that are bytes, sbytes).
10302
10303         Fixes bug #62054.
10304
10305 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10306
10307         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10308         Fix long-standing bug in type-lookup.  Use FindType instead of
10309         LookupType when ec.ResolvingTypeTree.
10310         (Attribute.ResolveType, Attribute.Resolve)
10311         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10312         Update to changes.
10313         (Attributes.Search): Remove internal version.  Update.
10314         (Attributes.SearchMulti): Update.
10315         (Attributes.GetClsCompliantAttribute): Remove.
10316         (Attributes.GetIndexerNameAttribute): Remove.
10317         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10318         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10319         * class.cs (Indexer.Define): Likewise.
10320
10321 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10322
10323         Fix bug #68790
10324         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10325         MarshallByReference members access.
10326
10327         * expression.cs: Use CheckMarshallByRefAccess;
10328         Better error CS0197 message.
10329
10330         * report.cs: Print whole related error message.
10331
10332 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10333
10334         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10335         the current directory to help debugging.
10336
10337 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10338
10339         * class (GetClassBases): Better error 60 report.
10340         (EventProperty): Disabled warning 67 detection.
10341
10342 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10343
10344         Fix bug #60324
10345         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10346
10347         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10348         precise values.
10349
10350 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10351
10352         Fix bug #49488
10353         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10354
10355         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10356
10357 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10358
10359         * attribute.cs (Attribute.Resolve): Refine error reporting and
10360         report a cs0117 if the identifier does not exist, to distinguish
10361         from 0617 which is a miss-use of the actual identifier.
10362
10363         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10364         between cs0070 and cs0079.
10365
10366         * class.cs (MemberBase.DoDefine): When reporting a wrong
10367         accessibility level, we use MethodCore to compare instead of
10368         Method (this was a regression in some refactoring effort).
10369
10370         So now we correctly report cs0056 again.
10371
10372         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10373         testing the target_type (which was known to be object_type) and
10374         not the source type (which is anonymous_method).
10375
10376         Fixed reporting of error cs1660.
10377
10378         * expression.cs (UserCast.Source): Expose the underlying cast.
10379
10380         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10381         allowed types to find a match to int32 first (most common).
10382
10383         In addition, it ignores any ImplicitUserConversions that did an
10384         internal implicit conversion (as the switch statement allows only
10385         one integral conversion to exist).
10386
10387         * class.cs (PartialContainer.Create): rename `name' to
10388         `member_name' for clarity.  Then replace the string calls with a
10389         call to MemberName.GetPartialName, as now using
10390         MemberName.ToString is an error (this is due to the side effects
10391         it had, that were fixed in the past).
10392
10393         This will restore the error reporting on a number of partial class
10394         errors that were missusing this (and getting an exception as a
10395         results, which is now just a plain textual warning, because
10396         yyparse debug output would crash otherwise).
10397
10398 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10399
10400         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10401
10402 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10403
10404         * rootcontext.cs (LookupType): Make sure to cache lookups that
10405         don't give us a negative result. This saves about 5% of corlib
10406         compilation time.
10407
10408 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10409
10410         * report.cs (AbstractMessage.Print): messages are sent to stderr
10411
10412         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10413         non-interface in the list of interfaces (at this point, either
10414         parent was properly set, or a base class is being listed in the
10415         interfaces section).
10416
10417         This flags error 1722, and resolves the crash from bug 69259.
10418
10419 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10420
10421         * statement.cs (Using.EmitExpressionFinally): make this work right
10422         for valuetypes. Fixes 69926.
10423
10424 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10427         converted to an enum" here, before we try to change the underlying
10428         type.  This code exists, but it is a different code path than the
10429         one used while encoding constants.
10430
10431         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10432         old bug: when converting from the null literal to a pointer,
10433         return an EmptyCast, not the NullLiteral.
10434
10435         This fixes #69921, the recent null_type changes probably made this
10436         bug more prominent.
10437
10438         (ImplicitReferenceConversionExists): In addition, resynchronized
10439         the code here, so it matches the same code in
10440         ImplicitReferenceConversionExists for the `from any class-type S
10441         to any interface-type T'.
10442         
10443
10444 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10445
10446         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10447
10448 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * cs-parser.jay: Use verbosity accordingly. 
10451
10452 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10453
10454         * expression.cs (Unary.ResolveOperator): Do not report warning;
10455         AddressOf reads from variable.
10456         
10457         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10458
10459 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10460
10461         Fix bug #69462
10462
10463         * attribute.cs (Attributable): Removed CheckTargets.
10464         (Attributes.Emit): Explicit attribute targets are tested here.
10465
10466         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10467         not enabled for interfaces.
10468
10469         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10470         (GetAssemblyName): Ouch next bug there.
10471
10472 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10473
10474         * expression.cs: Error 275 added.
10475         
10476 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10477
10478         Fix bug #69177 (Implemented decimal constant support)
10479
10480         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10481         (BinaryFold): Add DecimalConstant.
10482
10483         * const.cs (Define): Decimal constant 
10484         (is not constant.
10485         (ChangeType): Add decimal type handling.
10486         (LookupConstantValue): Don't set value for decimal type but
10487         emit DecimalConstantAttribute. Needed for constant optimization.
10488
10489         * constant.cs (ToDecimal): New method.
10490         (ConvertToDecimal): New method.
10491         (IntConstant): Implemented ConvertToDecimal.
10492         (DecimalConstant.Emit): Emit optimized version for decimals in
10493         int range.
10494
10495         * expression.cs (ResolveOperator): Changed order of constant
10496         reduction to work correctly with native types which have
10497         overloaded operators.
10498         (ResolveMemberAccess): Extract constant value from attribute
10499         for decimal type.
10500
10501         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10502
10503         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10504         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10505         (ChangeType): Decimal is special.
10506         (TypeToCoreType): Add decimal type.
10507
10508 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10509
10510         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10511         decimal types.
10512
10513 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10514
10515         * class.cs (EventField.ApplyAttributeBuilder): Fix error
10516         test cs1667-5.cs.
10517
10518 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10519
10520         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10521
10522         * pending.cs (PendingImplementation): Grab only interfaces.
10523
10524 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10525
10526         * statement.cs (ForeachHelperMethods): Add location member and
10527         error 202 detection.
10528
10529 2004-11-19  Raja R Harinath  <rharinath@novell.com>
10530
10531         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
10532         automatically handled by executable.make.
10533         (PROGRAM): Make profile-specific.
10534
10535 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
10536
10537         * expression.cs (DoResolveBase): Fixed wrong warning for out
10538         variables.
10539
10540 2004-11-18  Martin Baulig  <martin@ximian.com>
10541
10542         Merged latest changes into gmcs.  Please keep this comment in
10543         here, it makes it easier for me to see what changed in MCS since
10544         the last time I merged.
10545
10546 2004-11-17  Raja R Harinath  <rharinath@novell.com>
10547
10548         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10549         (TypeHandle.GetMemberCache): New.
10550         (TypeHandle.TypeHandle): Update.
10551         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10552         (TypeManager.LookupParentInterfacesCache):
10553         Rename from LookupInterfaceCache.  Optimize slightly.
10554         (TypeManager.MemberLookup_FindMembers): Update.
10555         * decl.cs (MemberCache.MemberCache): Set Container to null in the
10556         multi-type variant.
10557         (AddCacheContents): Rename from AddHashtable.
10558         * class.cs (TypeContainer.parent_container): Remove.
10559         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10560         (TypeContainer.DoDefineMembers): Don't initialize it.
10561         Update to name changes.
10562         
10563 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
10564
10565         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10566         that factors the code to check access modifiers on override.  
10567
10568         (PropertyBase): Use the code here.
10569
10570         Patch from Lluis S'anchez, fixes bug #69361.
10571
10572 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
10573
10574         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10575         routine that is used to report the use of a captured variable
10576         whose address has been taken.
10577
10578         There are two checks: one when variables are being captured and
10579         the other check is when the address of a variable is taken. 
10580         
10581         (because an anonymous methods might be resolved before *or* after
10582         the address has been taken) and 
10583
10584         * expression.cs (Conditional.DoResolve): Remove the special
10585         casing that Martin added to trueExpr and falseExpr being both
10586         NullLiteral.  We get the right behavior now just by introducing
10587         the null_type into the compiler. 
10588
10589         * convert.cs (ExplicitConversion): Change the code to use
10590         null_type instead of testing `expr is NullLiteral'.
10591         (ImplicitConversionStandard): use null_type too.
10592         (ImplicitReferenceConversionExists): use null_type too.
10593         (ImplicitReferenceConversion): use null_type too.
10594
10595         * literal.cs: The type of `NullLiteral' is now null_type instead
10596         of object_type. 
10597         (Resolve): Set the type here.
10598
10599         * typemanager.cs: Introduce null_type.
10600
10601 2004-11-17  Martin Baulig  <martin@ximian.com>
10602
10603         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10604         direction, like FindMembers() does.  Fixes #69546, testcase is in
10605         test-315.cs.    
10606
10607 2004-11-16  Martin Baulig  <martin@ximian.com>
10608
10609         This is based on a patch from Marek Safar, see bug #69082.
10610         Fixes bugs #63705 and #67130.
10611
10612         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10613         method; create a MemberCache for an interface type and cache the
10614         result.
10615
10616         * decl.cs (IMemberContainer.ParentContainer): Removed.
10617         (IMemberContainer.ParentCache): New property.
10618         (MemberCache.SetupCacheForInterface): Removed.
10619         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10620         to create a cache for an interface's "parent".
10621
10622         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10623         interfaces too.
10624
10625 2004-11-16  Martin Baulig  <martin@ximian.com>
10626
10627         Merged back from gmcs; these changes already went into gmcs a
10628         couple of weeks ago.
10629
10630         * typemanager.cs
10631         (TypeManager.AddUserType): Removed the `ifaces' argument.
10632         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10633         `TypeExpr []'.
10634         (TypeManager.AddUserInterface): Removed.
10635         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10636         `TypeExpr []'.
10637         (TypeManager.GetInterfaces): Likewise.
10638         (TypeManager.GetExplicitInterfaces): Likewise.
10639
10640         * ecore.cs (TypeExpr.GetInterfaces): Removed.
10641
10642         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10643         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10644
10645 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
10646
10647         * statement.cs: Avoid adding bools to a hashtable.
10648
10649 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * expression.cs (Invocation.OverloadResolve): Flag error if we are
10652         calling an unsafe method from a safe location.
10653
10654 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
10655
10656         Fix #69167
10657         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10658
10659 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
10660
10661         * namespace.cs (VerifyUsing): use GetPartialName instead of
10662         ToString. 
10663
10664 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
10665
10666         * statement.cs (Return.Resolve): Fix regression in typo: if
10667         `in_exc', we have to request a NeedReturnLabel, this was a typo
10668         introduced in the anonymous method check-in.  Fixes #69131.
10669
10670         * Indexers were using the ShortName when defining themselves,
10671         causing a regression in the compiler bootstrap when applying the
10672         patch from 2004-11-02 (first part), now they use their full name
10673         and the bug is gone.
10674
10675 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
10676
10677         * driver.cs: Strip the path from the names of embedded resources. Fixes
10678         #68519.
10679
10680 2004-11-04  Raja R Harinath  <rharinath@novell.com>
10681
10682         Fix error message regression: cs0104-2.cs.
10683         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10684         (AliasEntry.Resolve): Update.
10685         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
10686         'silent' flag.
10687         (RootContext.LookupType): Update.
10688
10689 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
10690
10691         * cs-parser.jay: Add support for handling accessor modifiers
10692         * class: Add support port accessor modifiers and error checking,
10693         define PropertyMethod.Define as virtual (not abstract anymore)
10694         * ecore.cs: Add checking for proeprties access with access modifiers
10695         * iterators.cs: Modify Accessor constructor call based in the modified
10696         constructor
10697 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
10698
10699         * expression.cs (StringConcat): Handle being called twice,
10700         as when we have a concat in a field init with more than two
10701         ctors in the class
10702
10703 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10706         special case explicit implementations, we should always produce
10707         the .property or .event declaration.
10708         
10709         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10710         since it will not return correct data if people use this
10711         unresolved in the presence of using statements (see test-313).
10712
10713         * class.cs (MethodData.Define): If we are an explicit interface
10714         implementation, set the method name to the full name of the
10715         interface plus the name of the method.  
10716
10717         Notice that using the method.MethodName.GetFullName() does not
10718         work, as it will only contain the name as declared on the source
10719         file (it can be a shorthand in the presence of using statements)
10720         and not the fully qualifed type name, for example:
10721
10722         using System;
10723
10724         class D : ICloneable {
10725                 object ICloneable.Clone ()  {
10726                 }
10727         }
10728
10729         Would produce a method called `ICloneable.Clone' instead of
10730         `System.ICloneable.Clone'.
10731
10732         * namespace.cs (Alias.Resolve): Use GetPartialName.
10733         
10734 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10735
10736         * cs-parser.jay: Add error 1055 report.
10737
10738 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * assign.cs (Assign.DoResolve): Only do the transform of
10741         assignment into a New if the types are compatible, if not, fall
10742         through and let the implicit code deal with the errors and with
10743         the necessary conversions. 
10744
10745 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10746
10747         * cs-parser.jay: Add error 1031 report.
10748
10749         * cs-tokenizer.cs: Add location for error 1038.
10750
10751 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10752
10753         * cs-parser.jay: Add error 1016 report.
10754
10755 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10756
10757         * cs-parser.jay: Add errors 1575,1611 report.
10758
10759 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10760
10761         * cs-parser.jay: Add error 1001 report.
10762
10763 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10764
10765         Fix #68850
10766         * attribute.cs (GetMarshal): Add method argument for
10767         caller identification.
10768
10769         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
10770         agument for GetMarshal and RuntimeMissingSupport.
10771
10772 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10773
10774         * attribute.cs (ExtractSecurityPermissionSet): Removed
10775         TypeManager.code_access_permission_type.
10776
10777         * typemanager.cs: Removed TypeManager.code_access_permission_type.
10778
10779 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * expression.cs (LocalVariableReference.DoResolveLValue): Check
10782         for obsolete use of a variable here.   Fixes regression on errors
10783         cs0619-25 and cs0619-26.
10784
10785 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
10786
10787         Fix #62358, implemented security attribute encoding.
10788
10789         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
10790         Tests permitted SecurityAction for assembly or other types.
10791         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
10792         data from SecurityPermissionAttribute to PermisionSet class.
10793
10794         * class.cs (ApplyAttributeBuilder): Added special handling
10795         for System.Security.Permissions.SecurityAttribute based types.
10796
10797         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
10798         special handling for System.Security.Permissions.SecurityAttribute
10799         based types.
10800
10801         * enum.cs (ApplyAttributeBuilder): Added special handling
10802         for System.Security.Permissions.SecurityAttribute based types.
10803
10804         * parameter.cs (ApplyAttributeBuilder): Added special handling
10805         for System.Security.Permissions.SecurityAttribute based types.
10806
10807         * rootcontext.cs: Next 2 core types.
10808
10809         * typemanager.cs (TypeManager.security_permission_attr_type):
10810         Built in type for the SecurityPermission Attribute.
10811         (code_access_permission_type): Build in type.
10812
10813 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
10814
10815         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
10816         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
10817         all of this information into
10818         EmitContext.EmitCapturedVariableInstance.
10819         
10820         * codegen.cs (EmitCapturedVariableInstance): move here the
10821         funcionality of emitting an ldarg.0 in the presence of a
10822         remapping.   This centralizes the instance emit code.
10823
10824         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
10825         then emit a load of this: it means that we have reached the
10826         topmost ScopeInfo: the one that contains the pointer to the
10827         instance of the class hosting the anonymous method.
10828
10829         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
10830         captures to the topmost CaptureContext.
10831
10832 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
10833
10834         * expression.cs (LocalVariableReference): Move the knowledge about
10835         the iterators into codegen's EmitCapturedVariableInstance.
10836
10837 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
10838
10839         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
10840         all code paths return a value from an anonymous method (it is the
10841         same as the 161 error, but for anonymous methods).
10842
10843 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
10844
10845         The introduction of anonymous methods in the compiler changed
10846         various ways of doing things in the compiler.  The most
10847         significant one is the hard split between the resolution phase
10848         and the emission phases of the compiler.
10849
10850         For instance, routines that referenced local variables no
10851         longer can safely create temporary variables during the
10852         resolution phase: they must do so from the emission phase,
10853         since the variable might have been "captured", hence access to
10854         it can not be done with the local-variable operations from the runtime.
10855         
10856         * statement.cs 
10857
10858         (Block.Flags): New flag `IsTopLevel' to indicate that this block
10859         is a toplevel block.
10860
10861         (ToplevelBlock): A new kind of Block, these are the blocks that
10862         are created by the parser for all toplevel method bodies.  These
10863         include methods, accessors and anonymous methods.
10864
10865         These contain some extra information not found in regular blocks:
10866         A pointer to an optional CaptureContext (for tracking captured
10867         local variables and parameters).  A pointer to the parent
10868         ToplevelBlock.
10869         
10870         (Return.Resolve): Catch missmatches when returning a value from an
10871         anonymous method (error 1662).
10872         Invoke NeedReturnLabel from the Resolve phase instead of the emit
10873         phase.
10874
10875         (Break.Resolve): ditto.
10876
10877         (SwitchLabel): instead of defining the labels during the
10878         resolution phase, we now turned the public ILLabel and ILLabelCode
10879         labels into methods called GetILLabelCode() and GetILLabel() that
10880         only define the label during the Emit phase.
10881
10882         (GotoCase): Track the SwitchLabel instead of the computed label
10883         (its contained therein).  Emit the code by using
10884         SwitchLabel.GetILLabelCode ().
10885
10886         (LocalInfo.Flags.Captured): A new flag has been introduce to track
10887         whether the Local has been captured or not.
10888
10889         (LocalInfo.IsCaptured): New property, used to tell whether the
10890         local has been captured.
10891         
10892         * anonymous.cs: Vastly updated to contain the anonymous method
10893         support.
10894
10895         The main classes here are: CaptureContext which tracks any
10896         captured information for a toplevel block and ScopeInfo used to
10897         track the activation frames for various local variables.   
10898
10899         Each toplevel block has an optional capture context associated
10900         with it.  When a method contains an anonymous method both the
10901         toplevel method and the anonymous method will create a capture
10902         context.   When variables or parameters are captured, they are
10903         recorded on the CaptureContext that owns them, for example:
10904
10905         void Demo () {
10906              int a;
10907              MyDelegate d = delegate {
10908                  a = 1;
10909              }
10910         }
10911
10912         Here `a' will be recorded as captured on the toplevel
10913         CapturedContext, the inner captured context will not have anything
10914         (it will only have data if local variables or parameters from it
10915         are captured in a nested anonymous method.
10916
10917         The ScopeInfo is used to track the activation frames for local
10918         variables, for example:
10919
10920         for (int i = 0; i < 10; i++)
10921                 for (int j = 0; j < 10; j++){
10922                    MyDelegate d = delegate {
10923                         call (i, j);
10924                    }
10925                 }
10926
10927         At runtime this captures a single captured variable `i', but it
10928         captures 10 different versions of the variable `j'.  The variable
10929         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
10930         recorded on a child.  
10931
10932         The toplevel ScopeInfo will also track information like the `this'
10933         pointer if instance variables were referenced (this is necessary
10934         as the anonymous method lives inside a nested class in the host
10935         type of the method). 
10936
10937         (AnonymousMethod): Expanded to track the Toplevel, implement
10938         `AnonymousMethod.Compatible' to tell whether an anonymous method
10939         can be converted to a target delegate type. 
10940
10941         The routine now also produces the anonymous method content
10942
10943         (AnonymousDelegate): A helper class that derives from
10944         DelegateCreation, this is used to generate the code necessary to
10945         produce the delegate for the anonymous method that was created. 
10946
10947         * assign.cs: API adjustments for new changes in
10948         Convert.ImplicitStandardConversionExists.
10949
10950         * class.cs: Adjustments to cope with the fact that now toplevel
10951         blocks are of type `ToplevelBlock'. 
10952
10953         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
10954         insteda of standard blocks.
10955
10956         Flag errors if params arguments are passed to anonymous methods.
10957
10958         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
10959         `CurrentAnonymousMethod' which points to the current Anonymous
10960         Method.  The variable points to the AnonymousMethod class that
10961         holds the code being compiled.  It is set in the new EmitContext
10962         created for the anonymous method.
10963
10964         (EmitContext.Phase): Introduce a variable and an enumeration to
10965         assist in enforcing some rules about when and where we are allowed
10966         to invoke certain methods (EmitContext.NeedsReturnLabel is the
10967         only one that enfonces this right now).
10968
10969         (EmitContext.HaveCaptureInfo): new helper method that returns
10970         whether we have a CapturedContext initialized.
10971
10972         (EmitContext.CaptureVariable): New method used to register that a
10973         LocalInfo must be flagged for capturing. 
10974
10975         (EmitContext.CapturedParameter): New method used to register that a
10976         parameters must be flagged for capturing. 
10977         
10978         (EmitContext.CapturedField): New method used to register that a
10979         field must be flagged for capturing. 
10980
10981         (EmitContext.HaveCapturedVariables,
10982         EmitContext.HaveCapturedFields): Return whether there are captured
10983         variables or fields. 
10984
10985         (EmitContext.EmitMethodHostInstance): This is used to emit the
10986         instance for the anonymous method.  The instance might be null
10987         (static methods), this (for anonymous methods that capture nothing
10988         and happen to live side-by-side with the current method body) or a
10989         more complicated expression if the method has a CaptureContext.
10990
10991         (EmitContext.EmitTopBlock): Routine that drives the emission of
10992         code: it will first resolve the top block, then emit any metadata
10993         and then emit the code.  The split is done so that we can extract
10994         any anonymous methods and flag any captured variables/parameters.
10995         
10996         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
10997         during this phase, the ILGenerator should not be used as labels
10998         and local variables declared here might not be accessible to any
10999         code that is part of an anonymous method.  
11000
11001         Exceptions to this include the temporary variables that are
11002         created by some statements internally for holding temporary
11003         variables. 
11004         
11005         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11006         metadata for a cb
11007
11008         (EmitContext.TemporaryReturn): This method is typically called
11009         from the Emit phase, and its the only place where we allow the
11010         ReturnLabel to be defined other than the EmitMeta.  The reason is
11011         that otherwise we would have to duplicate a lot of logic in the
11012         Resolve phases of various methods that today is on the Emit
11013         phase. 
11014
11015         (EmitContext.NeedReturnLabel): This no longer creates the label,
11016         as the ILGenerator is not valid during the resolve phase.
11017
11018         (EmitContext.EmitThis): Extended the knowledge in this class to
11019         work in anonymous methods in addition to iterators. 
11020
11021         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11022         code is necessary on the stack to access the instance to a local
11023         variable (the variable will be accessed as a field).
11024
11025         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11026         EmitContext.EmitAddressOfParameter): Routines to support
11027         parameters (not completed at this point). 
11028         
11029         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11030         will also remove the parameters.
11031
11032         * convert.cs (Convert): Define a `ConstantEC' which points to a
11033         null.  This is just to prefity some code that uses
11034         ImplicitStandardConversion code and do not have an EmitContext
11035         handy.
11036
11037         The idea is to flag explicitly that at that point in time, it is
11038         known that the conversion will not trigger the delegate checking
11039         code in implicit conversions (which requires a valid
11040         EmitContext). 
11041
11042         Everywhere: pass new EmitContext parameter since
11043         ImplicitStandardConversionExists now requires it to check for
11044         anonymous method conversions. 
11045
11046         (Convert.ImplicitStandardConversionExists): If the type of an
11047         expression is the anonymous_method_type, and the type is a
11048         delegate, we invoke the AnonymousMethod.Compatible method to check
11049         whether an implicit conversion is possible. 
11050
11051         (Convert.ImplicitConversionStandard): Only do implicit method
11052         group conversions if the language level is not ISO_1.
11053
11054         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11055         MethodInfo for the Invoke method.  used by Delegate and
11056         AnonymousDelegate.
11057
11058         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11059         method conversions if the target type is a delegate.
11060
11061         Removed extra debugging nops.
11062
11063         (LocalVariableReference): Turn the `local_info' into a public
11064         field. 
11065
11066         Add `prepared' field, the same hack used for FieldExprs to cope
11067         with composed assignments, as Local variables do not necessarily
11068         operate purely on the stack as they used to: they can be captured
11069         fields. 
11070
11071         Add `temp' for a temporary result, like fields.
11072
11073         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11074
11075         It now copes with Local variables that are captured and emits the
11076         proper instance variable to load it from a field in the captured
11077         case. 
11078
11079         (ParameterReference.DoResolveBase): During the resolve phase,
11080         capture parameters if we are in an anonymous method.
11081
11082         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11083         anonymous method, use the EmitContext helper routines to emit the
11084         parameter reference.
11085
11086         * iterators.cs: Set RemapToProxy to true/false during the
11087         EmitDispose class.
11088
11089         * parameters.cs (GetParameterByName): New helper method. 
11090
11091         * typemanager.cs (anonymous_method_type) a new type that
11092         represents an anonyous method.  This is always an internal type,
11093         used as a fencepost to test against the anonymous-methodness of an
11094         expression. 
11095         
11096 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11097
11098         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11099         561 report.
11100         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11101
11102 2004-10-18  Martin Baulig  <martin@ximian.com>
11103
11104         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11105         `Type' directly, but call ResolveType() on it.
11106         (Catch.Resolve): Likewise.
11107         (Foreach.Resolve): Likewise.
11108
11109 2004-10-18  Martin Baulig  <martin@ximian.com>
11110
11111         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11112         `Type' directly, but call ResolveType() on it.
11113         (Probe.DoResolve): Likewise.
11114         (ArrayCreation.LookupType): Likewise.
11115         (TypeOf.DoResolve): Likewise.
11116         (SizeOf.DoResolve): Likewise.
11117
11118 2004-10-18  Martin Baulig  <martin@ximian.com>
11119
11120         * expression.cs (Invocation.BetterFunction): Put back
11121         TypeManager.TypeToCoreType().
11122
11123 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11124
11125         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11126         the ResolveType.
11127
11128 2004-10-18  Martin Baulig  <martin@ximian.com>
11129
11130         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11131         `Type' directly, but call ResolveType() on it.
11132
11133 2004-10-18  Martin Baulig  <martin@ximian.com>
11134
11135         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11136         `Type' directly, but call ResolveType() on it.
11137         (MemberBase.DoDefine): Likewise.
11138
11139         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11140         `Type' directly, but call ResolveType() on it.
11141         (ComposedCast.DoResolveAsTypeStep): Likewise.
11142
11143         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11144         `Type' directly, but call ResolveType() on it.
11145
11146 2004-10-17  John Luke  <john.luke@gmail.com>
11147
11148         * class.cs (Operator.GetSignatureForError): use CSharpName
11149
11150         * parameter.cs (Parameter.GetSignatureForError): Returns
11151         correct name even if was not defined.
11152
11153 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11154
11155         Fix #65816.
11156         * class.cs (TypeContainer.EmitContext): New property.
11157         (DefineNestedTypes): Create an emitcontext for each part.
11158         (MethodCore.DoDefineParameters): Use container's emitcontext.
11159         Pass type array to InternalParameters.
11160         (MemberBase.DoDefine): Use container's emitcontext.
11161         (FieldMember.Define): Likewise.
11162         (Event.Define): Likewise.
11163         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11164         Pass type array to InternalParameters.
11165         (SetIndexerMethod.GetParameterInfo): Likewise.
11166         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11167         * delegate.cs (Define): Pass emitcontext to
11168         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11169         array to InternalParameters.
11170         * expression.cs (ParameterReference.DoResolveBase): Pass
11171         emitcontext to GetParameterInfo.
11172         (ComposedCast.DoResolveAsTypeStep): Remove check on
11173         ec.ResolvingTypeTree.
11174         * parameter.cs (Parameter.Resolve): Change argument to
11175         EmitContext.  Use ResolveAsTypeTerminal.
11176         (Parameter.GetSignature): Change argument to EmitContext.
11177         (Parameters.ComputeSignature): Likewise.
11178         (Parameters.ComputeParameterTypes): Likewise.
11179         (Parameters.GetParameterInfo): Likewise.
11180         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11181         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11182         * support.cs (InternalParameters..ctor): Remove variant that takes
11183         a DeclSpace.
11184         * typemanager.cs (system_intptr_expr): New.
11185         (InitExpressionTypes): Initialize it.
11186
11187 2004-10-12  Chris Toshok  <toshok@ximian.com>
11188
11189         * cs-parser.jay: fix location for try_statement and catch_clause.
11190
11191 2004-10-11  Martin Baulig  <martin@ximian.com>
11192
11193         * report.cs: Don't make --fatal abort on warnings, we have
11194         -warnaserror for that.
11195
11196 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11197
11198         More DeclSpace.ResolveType avoidance.
11199         * decl.cs (MemberCore.InUnsafe): New property.
11200         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11201         with newly created EmitContext.
11202         (FieldMember.Define): Likewise.
11203         * delegate.cs (Delegate.Define): Likewise.
11204         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11205         only if normal name-lookup fails.
11206         (TypeExpr.DoResolve): Enable error-checking.
11207         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11208         (SizeOf.DoResolve): Likewise.
11209         (ComposedCast.DoResolveAsTypeStep): Likewise.
11210         (StackAlloc.DoResolve): Likewise.
11211         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11212         (Block.Unsafe): New property.
11213         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11214         (Unsafe): Set 'unsafe' flag of contained block.
11215         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11216         (Fixed.Resolve): Likewise.
11217         (Catch.Resolve): Likewise.
11218         (Using.ResolveLocalVariableDecls): Likewise.
11219         (Foreach.Resolve): Likewise.
11220
11221 2004-10-05  John Luke <john.luke@gmail.com>
11222
11223         * cs-parser.jay: add location to error CS0175
11224
11225 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * ecore.cs (Expression.Constantity): Add support for turning null
11228         into a constant.
11229
11230         * const.cs (Const.Define): Allow constants to be reference types
11231         as long as the value is Null.
11232
11233 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11234
11235         * namespace.cs (NamespaceEntry.Using): No matter which warning
11236         level is set, check if this namespace name has already been added.
11237
11238 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11239
11240         * expression.cs: reftype [!=]= null should always use br[true,false].
11241         # 67410
11242
11243 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11244
11245         Fix #67108
11246         * attribute.cs: Enum conversion moved to 
11247         GetAttributeArgumentExpression to be applied to the all
11248         expressions.
11249
11250 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11251
11252         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11253         * class.c (TypeContainer.DefineType): Flag error if
11254         base types aren't accessible due to access permissions.
11255         * decl.cs (DeclSpace.ResolveType): Move logic to
11256         Expression.ResolveAsTypeTerminal.
11257         (DeclSpace.ResolveTypeExpr): Thin layer over
11258         Expression.ResolveAsTypeTerminal.
11259         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11260         Refactor code into NestedAccess.  Use it.
11261         (DeclSpace.NestedAccess): New.
11262         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11263         argument to silence errors.  Check access permissions.
11264         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11265         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11266         (Cast.DoResolve): Likewise.
11267         (New.DoResolve): Likewise.
11268         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11269         (TypeOf.DoResolve): Likewise.
11270
11271         * expression.cs (Invocation.BetterConversion): Return the Type of
11272         the better conversion.  Implement section 14.4.2.3 more faithfully.
11273         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11274         section 14.4.2.2 explicit.
11275         (Invocation.OverloadResolve): Update.
11276         (Invocation): Remove is_base field.
11277         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11278         (Invocation.Emit): Likewise.
11279
11280 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11281
11282         * README: Update to changes.
11283
11284 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11285
11286         * cs-parser.jay: Reverted 642 warning fix.
11287
11288 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11289
11290         Fix bug #66615
11291         * decl.cs (FindMemberWithSameName): Indexer can have more than
11292         1 argument.
11293
11294 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11295
11296         * expression.cs (LocalVariableReference.DoResolveLValue):
11297         Do not report warning 219 for out values.
11298         (EmptyExpression.Null): New member to avoid extra allocations.
11299
11300 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11301
11302         * cs-parser.jay: Fix wrong warning 642 report.
11303
11304         * cs-tokenizer.cs (CheckNextToken): New helper;
11305         Inspect next character if is same as expected.
11306
11307 2004-09-23  Martin Baulig  <martin@ximian.com>
11308
11309         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11310         (Convert.ImplicitReferenceConversionExists): Likewise.
11311
11312 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11313
11314         * class.cs (Operator.Define): Add error 448 and 559 report.
11315
11316 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11317
11318         * class.cs (MemberBase.IsTypePermitted): New protected
11319         method for checking error CS0610.
11320
11321 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11322
11323         * class.cs (TypeContainer.HasExplicitLayout): New property
11324         Returns whether container has StructLayout attribute set Explicit.
11325         (FieldMember): New abstract class for consts and fields.
11326         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11327         (Field): Reuse FieldMember.
11328
11329         * const.cs (Const): Reuse FieldMember.
11330
11331         * rootcontext.cs: EmitConstants call moved to class.
11332
11333 2004-09-22  Martin Baulig  <martin@ximian.com>
11334
11335         Thanks to Peter Sestoft for this bug report.
11336
11337         * expression.cs (Conditional): If both the `trueExpr' and the
11338         `falseExpr' is a NullLiteral, return a NullLiteral.
11339
11340 2004-09-22  Martin Baulig  <martin@ximian.com>
11341
11342         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11343         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11344         for the "get_Current" call.
11345
11346 2004-09-22  Martin Baulig  <martin@ximian.com>
11347
11348         Marek and me just fixed one of our oldest bugs: #28562 :-)
11349
11350         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11351
11352         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11353         we're an EnumConstant, just return that.
11354         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11355         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11356         to get the value which'll actually be written into the attribute.
11357         However, we have to use GetValue() to access the attribute's value
11358         in the compiler.        
11359
11360 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11361
11362         * constant.cs (Constant.IsNegative): New abstract property
11363         IsNegative.
11364
11365         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11366         (StackAlloc.DoResolve): Reused IsNegative.
11367
11368 2004-09-21  Martin Baulig  <martin@ximian.com>
11369
11370         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11371         if we're used in an iterator, we may be called from different
11372         methods.
11373
11374         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11375         we actually have an exception block.
11376
11377 2004-09-20  John Luke <jluke@cfl.rr.com>
11378
11379         * class.cs, cs-parser.jay: Improve the error report for 1520:
11380         report the actual line where the error happens, not where the
11381         class was declared.
11382
11383         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11384         Pass location information that was available elsewhere.
11385
11386 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11387
11388         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11389         runtime to delay sign assemblies.
11390
11391 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11392
11393         * cs-parser.jay: Do not report the stack trace, this is barely
11394         used nowadays.
11395
11396 2004-08-22  John Luke  <john.luke@gmail.com>
11397  
11398         * driver.cs : check that a resource id is not already used
11399         before adding it, report CS1508 if it is, bug #63637
11400
11401 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11402
11403         * ecore.cs: Removed dead code.
11404
11405 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11406
11407         * class.cs: Do not report warning CS0067 on the interfaces.
11408
11409 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11410
11411         * cs-parser.jay: Add error 504 report.
11412
11413 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11414
11415         * rootcontext.cs: WarningLevel is 4 by default now.
11416
11417         * statement.cs (Fixed.Resolve): Do not null
11418         VariableInfo.
11419
11420 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11421
11422         Fixed bug #55780
11423         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11424         deep search when property is not virtual.
11425         (PropertyExpr.ResolveAccessors): Make one call for both
11426         accessors.
11427
11428 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11429
11430         Fixed bug #65766
11431         * statement.cs: Error 152 report constains also location.
11432
11433 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11434
11435         Fixed bug #65766
11436         * const.cs: Explicitly set constant as static.
11437
11438 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11439
11440         Fixed bug #64226
11441         * cs-parser.jay: Add error 1017 report.
11442
11443 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11444
11445         Fixed bug #59980, #64224
11446         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11447
11448         * typemanager.cs (IsSpecialMethod): Simplified
11449
11450 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11451
11452         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11453         condition with better params.
11454
11455 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11456
11457         Fixed bug #65238
11458         * attribute.cs (Resolve): Property has to have both
11459         accessors.
11460
11461 2004-09-14  Martin Baulig  <martin@ximian.com>
11462
11463         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11464
11465 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11466
11467         Fixed bug #61902
11468         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11469         called and is obsolete then this member suppress message
11470         when call is inside next [Obsolete] method or type.
11471
11472         * expression.cs: Use TestObsoleteMethodUsage member.
11473
11474 2004-09-14  Martin Baulig  <martin@ximian.com>
11475
11476         * cs-parser.jay: Sync a bit with the GMCS version.
11477
11478 2004-09-14  Martin Baulig  <martin@ximian.com>
11479
11480         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11481         (CSharpParser.yacc_verbose_flag): New public field.
11482
11483         * genericparser.cs: Removed.
11484
11485 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11486
11487         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11488
11489 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11490
11491         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11492
11493 2004-09-10  Martin Baulig  <martin@ximian.com>
11494
11495         Backported my MemberName changes from GMCS into MCS.
11496
11497         - we are now using a special `MemberName' class instead of using
11498         strings; in GMCS, the `MemberName' also contains the type
11499         arguments.
11500
11501         - changed the grammar rules a bit:
11502           * the old `member_name' is now a `namespace_or_type_name':
11503             The rule is that we use `namespace_or_type_name' everywhere
11504             where we expect either a "member name" (GetEnumerator) or a
11505             "member name" with an explicit interface name
11506             (IEnumerable.GetEnumerator).
11507             In GMCS, the explicit interface name may include type arguments
11508             (IEnumerable<T>.GetEnumerator).
11509           * we use `member_name' instead of just `IDENTIFIER' for
11510             "member names":
11511             The rule is that we use `member_name' wherever a member may
11512             have type parameters in GMCS.       
11513
11514         * decl.cs (MemberName): New public class.
11515         (MemberCore.MemberName): New public readonly field.
11516         (MemberCore.ctor): Take a `MemberName' argument, not a string.
11517         (DeclSpace): Likewise.
11518
11519         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11520         * enum.cs (Enum.ctor): Likewise.
11521
11522         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11523         MemberName.     
11524         (AliasEntry.ctor): Take a MemberName, not an Expression.
11525         (AliasEntry.UsingAlias): Likewise.
11526
11527         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11528         (IMethodData.MemberName): Changed type from string to MemberName.
11529         (MemberBase.ExplicitInterfaceName): Likewise.
11530         (AbstractPropertyEventMethod.SetupName): Make this private.
11531         (AbstractPropertyEventMethod.ctor): Added `string prefix'
11532         argument; compute the member name here.
11533         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11534         on the `member.MemberName' and the `prefix'.
11535
11536         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11537         not `type_name'.
11538         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11539         thus, we get a `MemberName' instead of a `string'.  These
11540         declarations may have type parameters in GMCS.
11541         (interface_method_declaration, delegate_declaration): Likewise.
11542         (class_declaration, interface_declaration): Likewise.
11543         (method_header): Use `namespace_or_type_name' instead of
11544         `member_name'.  We may be an explicit interface implementation.
11545         (property_declaration, event_declaration): Likewise.
11546         (member_name): This is now just an `IDENTIFIER', not a
11547         `namespace_or_type_name'.
11548         (type_name, interface_type): Removed.
11549         (namespace_or_type_name): Return a MemberName, not an Expression.
11550         (primary_expression): Use `member_name' instead of `IDENTIFIER';
11551         call GetTypeExpression() on the MemberName to get an expression.
11552         (IndexerDeclaration.interface_type): Changed type from string to
11553         MemberName.
11554         (MakeName): Operate on MemberName's instead of string's.
11555
11556 2004-09-13  Raja R Harinath  <rharinath@novell.com>
11557
11558         Fix bug #55770.
11559         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11560         (NamespaceEntry.Lookup): Add new argument to flag if we want the
11561         lookup to avoid symbols introduced by 'using'.
11562         * rootcontext.cs (NamespaceLookup): Update.
11563
11564 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11565
11566         * class.cs (TypeContainer.DoDefineMembers): Do not call
11567         DefineDefaultConstructor for static classes.
11568
11569 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11570
11571         * attribute.cs (Attribute.Resolve): Add error 653 report.
11572
11573         * class.cs (Class.ApplyAttributeBuilder): Add error 641
11574         report.
11575         (Method.ApplyAttributeBuilder): Add error 685 report.
11576         (Operator.Define): Add error 564 report.
11577
11578         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11579
11580         * expression.cs (Invocation.DoResolve): Add error
11581         245 and 250 report.
11582
11583         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11584         error 674 report.
11585
11586 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11587
11588         * class.cs (ConstructorInitializer.Resolve):
11589         Wrong error number (515->516).
11590
11591 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11592
11593         * class.cs (Indexer.Define): Add error 631 report.
11594
11595 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11596
11597         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11598
11599 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11600
11601         * expression.cs (Probe.DoResolve): Add error CS0241 report.
11602
11603 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
11604
11605         * cs-parser.jay: Added error CS0241 report.
11606
11607 2004-09-10  Raja R Harinath  <rharinath@novell.com>
11608
11609         * cs-parser.jay (fixed_statement): Introduce a scope for the
11610         declaration in the 'fixed' statement.
11611
11612 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11613
11614         * cs-parser.jay: Added CS0230 error report.
11615
11616 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11617
11618         * cs-parser.jay: Added errors CS0231 and CS0257 report.
11619
11620 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11621
11622         * expression.cs (Argument.Resolve): Added error CS0192 and
11623         CS0199 report.
11624
11625 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11626
11627         C# 2.0 #pragma warning feature
11628
11629         * cs-tokenizer.cs (PreProcessPragma): New method; 
11630         Handles #pragma directive.
11631
11632         * report.cs (WarningRegions): New class; Support
11633         class for #pragma warning directive. It tests whether
11634         warning is enabled for a given line.
11635
11636 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
11637
11638         * const.cs: Add more descriptive error report, tahnks to
11639         Sebastien. 
11640
11641 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
11642
11643         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11644
11645 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
11646
11647         * expression.cs: Apply patch from Ben: Remove dead code from
11648         ArrayCreation, and remove the TurnintoConstant call in const.cs,
11649         as that code just threw an exception anwyays.
11650
11651         * const.cs: Remove the call to the turnintoconstant, for details
11652         see bug: #63144
11653         
11654         * literal.cs: The type of the null-literal is the null type;  So
11655         we use a placeholder type (literal.cs:System.Null, defined here)
11656         for it.
11657
11658         * expression.cs (Conditional.DoResolve): Remove some old code that
11659         is no longer needed, conversions have been fixed.
11660
11661         (ArrayCreationExpression.DoResolve): Return false if we fail to
11662         resolve the inner expression.
11663
11664 2004-09-07  Raja R Harinath  <rharinath@novell.com>
11665
11666         Fix test-290.cs.
11667         * cs-parser.jay (delegate_declaration): Record a delegate
11668         declaration as a type declaration.
11669         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11670
11671 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
11672
11673         * parameter.cs: Do not crash if the type can not be resolved. 
11674
11675         * expression.cs: Report errors with unsafe pointers, fixes #64896
11676
11677 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11678
11679         * expression.cs: Pointer arith always needs to do a conv.i
11680         if the operand is a long. fix 65320
11681
11682 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11683
11684         Fixed cs0619-37.cs, cs0619-38.cs
11685
11686         * enum.cs (GetObsoleteAttribute): Removed.
11687
11688         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11689         on Enum member is double staged. The first is tested member
11690         and then enum.
11691
11692 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11693
11694         Fixed #56986, #63631, #65231
11695
11696         * class.cs: (TypeContainer.AddToMemberContainer): New method,
11697         adds member to name container.
11698         (TypeContainer.AddToTypeContainer): New method, adds type to
11699         name container.
11700         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11701         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11702         AddOperator): Simplified by reusing AddToMemberContainer.
11703         (TypeContainer.UserDefinedStaticConstructor): Changed to property
11704         instead of field.
11705         (Method.CheckForDuplications): Fixed implementation to test all
11706         possibilities.
11707         (MemberBase): Detection whether member is explicit interface
11708         implementation is now in constructor.
11709         (MemberBase.UpdateMemberName): Handles IndexerName.
11710         (Accessor): Changed to keep also location information.
11711         (AbstractPropertyEventMethod): Is derived from MemberCore.
11712         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11713         will be emited or not.
11714         (PropertyBase.AreAccessorsDuplicateImplementation):
11715         Tests whether accessors are not in collision with some method.
11716         (Operator): Is derived from MethodCore to simplify common
11717         operations.
11718
11719         * decl.cs (Flags.TestMethodDuplication): Test for duplication
11720         must be performed.
11721         (DeclSpace.AddToContainer): Adds the member to defined_names
11722         table. It tests for duplications and enclosing name conflicts.
11723
11724         * enum.cs (EnumMember): Clean up to reuse the base structures
11725
11726 2004-09-03  Martin Baulig  <martin@ximian.com>
11727
11728         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11729         into TypeContainer, to make partial classes work again.
11730
11731 2004-09-03  Martin Baulig  <martin@ximian.com>
11732
11733         * rootcontext.cs (RootContext.V2): Removed.
11734
11735 2004-03-23  Martin Baulig  <martin@ximian.com>
11736
11737         * expression.cs (Invocation.OverloadResolve): Added `bool
11738         may_fail' argument and use it instead of the Location.IsNull() hack.
11739
11740 2004-09-03  Martin Baulig  <martin@ximian.com>
11741
11742         Merged latest changes into gmcs.  Please keep this comment in
11743         here, it makes it easier for me to see what changed in MCS since
11744         the last time I merged.
11745
11746 2004-09-03  Raja R Harinath  <rharinath@novell.com>
11747
11748         Fix #61128.
11749         * expression.cs (BetterConversion): Don't allow either conversion 
11750         to be null.  Remove redundant implicit conversion test when 'q ==
11751         null' -- when this function is invoked, we already know that the
11752         implicit conversion exists.
11753         (BetterFunction): Assume that 'best' is non-null.  Remove
11754         redundant reimplementation of IsApplicable when 'best' is null.
11755         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11756         number of arguments.
11757         (IsAncestralType): Extract from OverloadResolve.
11758         (OverloadResolve): Make robust to the MethodGroupExpr being
11759         unsorted.  Implement all the logic of Section 14.5.5.1, and
11760         support overloading of methods from multiple applicable types.
11761         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
11762
11763         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
11764         (RealError, Warning): Append type of report to related symbol.
11765
11766 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
11767
11768         * enum.cs: Fixed CLS-Compliance checks for enum members.
11769         Error tests cs3008-8.cs, cs3014-8.cs
11770
11771 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
11772
11773         Fixed bug #62342, #63102
11774         * class.cs: ImplementIndexer uses member.IsExplicitImpl
11775         like ImplementMethod.
11776
11777 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
11778
11779         * attribute.cs (Attribute.GetAttributeArgumentExpression):
11780         Fixed bug #65170.
11781
11782 2004-09-02  Martin Baulig  <martin@ximian.com>
11783
11784         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
11785         TypeManager.GetArgumentTypes() rather than calling GetParameters()
11786         on the MethodBase.
11787
11788 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
11789
11790         C# 2.0 Static classes implemented
11791
11792         * class.cs (TypeContainer): instance_constructors,
11793         initialized_fields, initialized_static_fields,
11794         default_constructor, base_inteface_types are protected to be
11795         accessible from StaticClass.
11796         (TypeContainer.DefineDefaultConstructor): New virtual method
11797         for custom default constructor generating
11798         (StaticClass): New class to handle "Static classes" feature.
11799
11800         * cs-parser.jay: Handle static keyword on class like instance
11801         of StaticClass.
11802
11803         * driver.cs: Added "/langversion" command line switch with two
11804         options (iso-1, default).
11805
11806 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
11807
11808         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
11809
11810 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
11811
11812         * delegate.cs: Style.
11813
11814 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11815
11816         * delegate.cs: Add seperate instance expr field for miguel.
11817
11818 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11819
11820         * PointerArithmetic (Resolve): make sure we are not doing
11821         pointer arith on void*. Also, make sure we are resolved
11822         by not setting eclass until resolve.
11823
11824         All callers: Make sure that PointerArithmetic gets resolved.
11825
11826 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11827
11828         * ArrayCreation (LookupType): If the type does not resolve 
11829         to an array, give an error.
11830
11831 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
11832
11833         * statement.cs (Try.Resolve): Fixed bug #64222
11834
11835 2004-08-27  Martin Baulig  <martin@ximian.com>
11836
11837         * class.cs
11838         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
11839         crash here.     
11840
11841 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
11842
11843         * ecore.cs (Constantify): Get underlying type via
11844         System.Enum.GetUnderlyingType to avoid StackOverflow on the
11845         Windows in special cases.
11846
11847 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
11848
11849         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
11850         for obtaining also private methods.
11851         (GetRemoveMethod): Used GetRemoveMethod (true)
11852         for obtaining also private methods.
11853
11854 2004-08-24  Martin Baulig  <martin@ximian.com>
11855
11856         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
11857         MethodAttributes.HideBySig for operators.
11858
11859 2004-08-23  Martin Baulig  <martin@ximian.com>
11860
11861         Back to the old error reporting system :-)
11862
11863         * report.cs (Message): Removed.
11864         (Report.MessageData, ErrorData, WarningData): Removed.
11865         (Report.Error, Warning): Back to the old system.
11866
11867 2004-08-23  Martin Baulig  <martin@ximian.com>
11868
11869         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
11870
11871         * class.cs (TypeContainer.ParentContainer): New public virtual
11872         method; replaces the explicit interface implementation.
11873         (ClassPart.ParentContainer): Override.
11874
11875 2004-08-23  Martin Baulig  <martin@ximian.com>
11876
11877         * statement.cs (Switch): Added support for constant switches; see
11878         #59428 or test-285.cs.
11879
11880 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
11881
11882         Fixed bug #62740.
11883         * statement.cs (GetEnumeratorFilter): Removed useless
11884         logic because C# specs is strict. GetEnumerator must be
11885         public.
11886
11887 2004-08-22  Martin Baulig  <martin@ximian.com>
11888
11889         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11890         a switch and may break, reset the barrier.  Fixes #59867.
11891
11892 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
11893
11894         CLS-Compliance speed up (~5% for corlib)
11895
11896         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
11897         New method. Tests container for CLS-Compliant names
11898
11899         * class.cs (TypeContainer.VerifyClsName): New method.
11900         Checks whether container name is CLS Compliant.
11901         (Constructor): Implements IMethodData.
11902
11903         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
11904         low-case table for CLS Compliance test.
11905         (MemberCache.VerifyClsParameterConflict): New method.
11906         Checks method parameters for CS3006 error.
11907
11908         * enum.cs (EnumMember): Is derived from MemberCore.
11909         (Enum.VerifyClsName): Optimized for better performance.
11910
11911 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
11912
11913         * report.cs: Renamed Error_T to Error and changed all
11914         references.
11915
11916 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
11917
11918         * class.cs (TypeContainer.IndexerArrayList): New inner class
11919         container for indexers.
11920         (TypeContainer.DefaultIndexerName): New constant for default
11921         indexer name. Replaced all "Item" with this constant.
11922         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
11923
11924         * typemanager.cs (TypeManager.default_member_ctor): Cache here
11925         DefaultMemberAttribute constructor.
11926
11927 2004-08-05  Martin Baulig  <martin@ximian.com>
11928
11929         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11930         Fix bug #59429.
11931
11932 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
11933
11934         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
11935         multi platforms problem.
11936
11937         * compiler.csproj: Included shared files.
11938
11939 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
11940
11941         Fix bug 60333, 55971 in the more general way
11942         * attribute.cs (Attribute.GetAttributeArgumentExpression):
11943         Added arg_type argument for constant conversion.
11944         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
11945
11946 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
11947
11948         Fix bug #59760
11949         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
11950         OperatorArrayList, MethodCoreArrayList for typecontainer
11951         containers. Changed class member types to these new types.
11952         (MethodArrayList.DefineMembers): Added test for CS0659.
11953
11954 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * cfold.cs: Synchronize the folding with the code in expression.cs
11957         Binary.DoNumericPromotions for uint operands.
11958
11959         * attribute.cs: Revert patch from Raja, it introduced a regression
11960         while building Blam-1.2.1 (hard to isolate a test case).
11961
11962 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
11963
11964         Fix for #55382
11965         * class.cs:
11966         (TypeContainer.Define): Renamed to DefineContainerMembers because of
11967         name collision.
11968         (MethodCore.parent_method): New member. The method we're overriding
11969         if this is an override method.
11970         (MethodCore.CheckBase): Moved from Method class and made common.
11971         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
11972         private.
11973         (MethodCore.CheckForDuplications): New abstract method. For custom
11974         member duplication search in a container
11975         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
11976         method and its return type.
11977         (Event.conflict_symbol): New member. Symbol with same name in the
11978         parent class.
11979
11980         * decl.cs:
11981         (MemberCache.FindMemberWithSameName): New method. The method
11982         is looking for conflict with inherited symbols.
11983
11984 2004-08-04  Martin Baulig  <martin@ximian.com>
11985
11986         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
11987
11988         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
11989
11990 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
11991
11992         * report.cs (Message): New enum for better error, warning reference in
11993         the code.
11994         (MessageData): New inner abstract class. It generally handles printing of
11995         error and warning messages.
11996         Removed unused Error, Warning, Message methods.
11997
11998 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
11999
12000         Fix for cs0592-8.cs test
12001         * attribute.cs
12002         (Attributable.ValidAttributeTargets): Made public.
12003         (Attribute.ExplicitTarget): New member for explicit target value.
12004         (Attribute.CheckTargets): Now we translate explicit attribute
12005         target to Target here.
12006
12007 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12008
12009         * ecore.cs (MethodGroupExpr): new IsBase property.
12010
12011         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12012
12013         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12014         rather than an instance expr.
12015
12016         (DelegateCreation.Emit): Use the method group rather than
12017         the instance expression. Also, if you have base.Foo as the
12018         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12019
12020         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12021
12022         (NewDelegate.DoResolve): Only check for the existance of Invoke
12023         if the method is going to be needed. Use MethodGroupExpr.
12024
12025         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12026
12027         * expression.cs: For pointer arith., make sure to use
12028         the size of the type, not the size of the pointer to
12029         the type.
12030
12031 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12032
12033         Fix for #60722
12034         * class.cs (Class): Added error CS0502 test.
12035
12036 2004-08-03  John Luke  <jluke@cfl.rr.com>
12037             Raja R Harinath  <rharinath@novell.com>
12038
12039         Fix for #60997.
12040         * attribute.cs (Attribute.complained_before): New flag.
12041         (Attribute.ResolveType, Attribute.Resolve),
12042         (Attribute.DefinePInvokeMethod): Set it.
12043         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12044         
12045 2004-08-03  Martin Baulig  <martin@ximian.com>
12046
12047         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12048         use a user-defined operator; we still need to do numeric
12049         promotions in case one argument is a builtin type and the other
12050         one has an implicit conversion to that type.  Fixes #62322.
12051
12052 2004-08-02  Martin Baulig  <martin@ximian.com>
12053
12054         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12055         (LocalInfo.IsThis): New public property.
12056         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12057
12058 2004-08-01  Martin Baulig  <martin@ximian.com>
12059
12060         * class.cs (TypeContainer.GetClassBases): Don't set the default
12061         here since we may get called from GetPartialBases().
12062         (TypeContainer.DefineType): If GetClassBases() didn't return a
12063         parent, use the default one.
12064
12065 2004-07-30  Duncan Mak  <duncan@ximian.com>
12066
12067         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12068
12069 2004-07-30  Martin Baulig  <martin@ximian.com>
12070
12071         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12072
12073         * class.cs (SourceMethod): New public class, derive from the
12074         symbol writer's ISourceMethod.
12075         (Method): Use the new symbol writer API.
12076
12077         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12078         as argument and use the new symbol writer.
12079
12080         * location.cs
12081         (SourceFile): Implement the symbol writer's ISourceFile.
12082         (Location.SymbolDocument): Removed.
12083         (Location.SourceFile): New public property.
12084
12085         * symbolwriter.cs: Use the new symbol writer API.
12086
12087 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12088
12089         * Makefile (install-local): Remove.  Functionality moved to
12090         executable.make.
12091
12092 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12093
12094         * Makefile: Install mcs.exe.config file together with mcs.exe.
12095         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12096         correct runtime version.
12097         
12098 2004-07-25  Martin Baulig  <martin@ximian.com>
12099
12100         * class.cs
12101         (TypeContainer.RegisterOrder): Removed, this was unused.
12102         (TypeContainer, interface_order): Removed.
12103         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12104         TypeContainer as argument since we can also be called with a
12105         `PartialContainer' for a partial class/struct/interface.
12106         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12107         of checking whether we're an `Interface' - we could be a
12108         `PartialContainer'.
12109         (PartialContainer.Register): Override; call
12110         AddClass()/AddStruct()/AddInterface() on our parent.
12111
12112         * cs-parser.jay (interface_member_declaration): Add things to the
12113         `current_container', not the `current_class'.
12114
12115         * rootcontext.cs (RegisterOrder): The overloaded version which
12116         takes an `Interface' was unused, removed.
12117
12118         * typemanager.cs (TypeManager.LookupInterface): Return a
12119         `TypeContainer', not an `Interface'.
12120         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12121         contain a `PartialContainer' for an interface, so check it's
12122         `Kind' to figure out what it is.
12123
12124 2004-07-25  Martin Baulig  <martin@ximian.com>
12125
12126         * class.cs (Class.DefaultTypeAttributes): New public constant.
12127         (Struct.DefaultTypeAttributes): Likewise.
12128         (Interface.DefaultTypeAttributes): Likewise.
12129         (PartialContainer.TypeAttr): Override this and add the
12130         DefaultTypeAttributes.
12131
12132 2004-07-25  Martin Baulig  <martin@ximian.com>
12133
12134         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12135         we can just use the `Parent' field instead.
12136
12137 2004-07-25  Martin Baulig  <martin@ximian.com>
12138
12139         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12140
12141 2004-07-25  Martin Baulig  <martin@ximian.com>
12142
12143         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12144         our parts before defining any methods.
12145         (TypeContainer.VerifyImplements): Make this virtual.
12146         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12147         on our PartialContainer.
12148
12149 2004-07-25  Martin Baulig  <martin@ximian.com>
12150
12151         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12152
12153         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12154         argument, we can just use the `Parent' field instead.
12155
12156         * class.cs
12157         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12158         (MemberBase.DoDefine): Likewise.
12159
12160 2004-07-24  Martin Baulig  <martin@ximian.com>
12161
12162         * decl.cs (MemberCore.Parent): New public field.
12163         (DeclSpace.Parent): Moved to MemberCore.
12164
12165         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12166         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12167         parent's .ctor.
12168         (FieldBase, Field, Operator): Likewise.
12169         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12170         (EventField, Event): Likewise.
12171
12172 2004-07-23  Martin Baulig  <martin@ximian.com>
12173
12174         * class.cs (PartialContainer): New public class.
12175         (ClassPart): New public class.
12176         (TypeContainer): Added support for partial classes.
12177         (TypeContainer.GetClassBases): Splitted some of the functionality
12178         out into GetNormalBases() and GetPartialBases().
12179
12180         * cs-tokenizer.cs (Token.PARTIAL): New token.
12181         (Tokenizer.consume_identifier): Added some hacks to recognize
12182         `partial', but only if it's immediately followed by `class',
12183         `struct' or `interface'.
12184
12185         * cs-parser.jay: Added support for partial clases.
12186
12187 2004-07-23  Martin Baulig  <martin@ximian.com>
12188
12189         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12190         a `DeclSpace' and also made it readonly.
12191         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12192         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12193         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12194
12195         * cs-parser.jay: Pass the `current_class', not the
12196         `current_container' (at the moment, this is still the same thing)
12197         to a new Method, Property, Event, Indexer or Constructor.
12198
12199 2004-07-23  Martin Baulig  <martin@ximian.com>
12200
12201         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12202         and removed the `current_interface' one.
12203         (struct_declaration, class_declaration, interface_declaration):
12204         Set `current_class' to the newly created class/struct/interface;
12205         set their `Bases' and call Register() before parsing their body.
12206
12207 2004-07-23  Martin Baulig  <martin@ximian.com>
12208
12209         * class.cs (Kind): New public enum.
12210         (TypeContainer): Made this class abstract.
12211         (TypeContainer.Kind): New public readonly field.
12212         (TypeContainer.CheckDef): New public method; moved here from
12213         cs-parser.jay.
12214         (TypeContainer.Register): New public abstract method.
12215         (TypeContainer.GetPendingImplementations): New public abstract
12216         method.
12217         (TypeContainer.GetClassBases): Removed the `is_class' and
12218         `is_iface' parameters.
12219         (TypeContainer.DefineNestedTypes): Formerly known as
12220         DoDefineType().
12221         (ClassOrStruct): Made this class abstract.
12222
12223         * tree.cs (RootTypes): New public type. 
12224
12225 2004-07-20  Martin Baulig  <martin@ximian.com>
12226
12227         * tree.cs (Tree.RecordNamespace): Removed.
12228         (Tree.Namespaces): Removed.
12229
12230         * rootcontext.cs (RootContext.IsNamespace): Removed.
12231
12232         * cs-parser.jay (namespace_declaration): Just create a new
12233         NamespaceEntry here.
12234
12235 2004-07-20  Martin Baulig  <martin@ximian.com>
12236
12237         * statement.cs (ExceptionStatement): New abstract class.  This is
12238         now used as a base class for everyone who's using `finally'.
12239         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12240         our local variables before using them.
12241
12242         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12243         virtual method.  This is used by Yield.Resolve() to "steal" an
12244         outer block's `finally' clauses.
12245         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12246         argument.
12247
12248         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12249         version which takes an ExceptionStatement.  This version must be
12250         used to create exception branchings.
12251
12252         * iterator.cs
12253         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12254         (Iterator.EmitMoveNext): Added exception support; protect the
12255         block with a `fault' clause, properly handle 'finally' clauses.
12256         (Iterator.EmitDispose): Run all the `finally' clauses here.
12257
12258 2004-07-20  Martin Baulig  <martin@ximian.com>
12259
12260         * iterator.cs: This is the first of a set of changes in the
12261         iterator code.  Match the spec more closely: if we're an
12262         IEnumerable, then GetEnumerator() must be called.  The first time
12263         GetEnumerator() is called, it returns the current instance; all
12264         subsequent invocations (if any) must create a copy.
12265
12266 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * expression.cs: Resolve the constant expression before returning
12269         it. 
12270
12271 2004-07-19  Martin Baulig  <martin@ximian.com>
12272
12273         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12274         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12275         the return type of the new EmitContext.
12276
12277 2004-07-18  Martin Baulig  <martin@ximian.com>
12278
12279         * class.cs (Property.Define): Fix iterators.
12280
12281         * iterators.cs (Iterator.Define): Moved the
12282         `container.AddInterator (this)' call here from the .ctor; only do
12283         it if we resolved successfully.
12284
12285 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12288         `true' for preprocessing directives that we parse.  The return
12289         value indicates whether we should return to regular tokenizing or
12290         not, not whether it was parsed successfully.
12291
12292         In the past if we were in: #if false ... #line #endif, we would
12293         resume parsing after `#line'.  See bug 61604.
12294
12295         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12296         building: IsEnumType should return true only for enums, not for
12297         enums or System.Enum itself.  This fixes #61593.
12298
12299         Likely what happened is that corlib was wrong: mcs depended on
12300         this bug in some places.  The bug got fixed, we had to add the
12301         hack, which caused bug 61593.
12302
12303         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12304         that was a workaround for the older conditions.
12305
12306 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12307
12308         * assign.cs: IAssignMethod has a new interface, as documented
12309         inline. All assignment code now uses this new api.
12310
12311         * ecore.cs, expression.cs: All classes which implement
12312         IAssignMethod now use the new interface.
12313
12314         * expression.cs (Invocation): add a hack to EmitCall so that
12315         IndexerAccess can be the target of a compound assignment without
12316         evaluating its arguments twice.
12317
12318         * statement.cs: Handle changes in Invocation api.
12319
12320 2004-07-16  Martin Baulig  <martin@ximian.com>
12321
12322         * iterators.cs: Rewrote this.  We're now using one single Proxy
12323         class for both the IEnumerable and the IEnumerator interface and
12324         `Iterator' derives from Class so we can use the high-level API.
12325
12326         * class.cs (TypeContainer.AddIterator): New method.
12327         (TypeContainer.DoDefineType): New protected virtual method, which
12328         is called from DefineType().
12329         (TypeContainer.DoDefineMembers): Call DefineType() and
12330         DefineMembers() on all our iterators.
12331         (TypeContainer.Emit): Call Emit() on all our iterators.
12332         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12333
12334         * codegen.cs (EmitContext.CurrentIterator): New public field.
12335
12336 2004-07-15  Martin Baulig  <martin@ximian.com>
12337
12338         * typemanager.cs
12339         (TypeManager.not_supported_exception_type): New type.   
12340
12341 2004-07-14  Martin Baulig  <martin@ximian.com>
12342
12343         * iterators.cs: Use real error numbers.
12344
12345 2004-07-14  Martin Baulig  <martin@ximian.com>
12346
12347         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12348         requires this to be a System.Collection.IEnumerable and not a
12349         class implementing that interface.
12350         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12351
12352 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12353
12354         * class.cs: Fixed previous fix, it broke some error tests.
12355
12356 2004-07-12  Martin Baulig  <martin@ximian.com>
12357
12358         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12359         Fixes #61293.
12360
12361 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * assign.cs (LocalTemporary): Add new argument: is_address,If
12364         `is_address' is true, then the value that we store is the address
12365         to the real value, and not the value itself.
12366         
12367         * ecore.cs (PropertyExpr): use the new local temporary
12368         stuff to allow us to handle X.Y += z (where X is a struct)
12369
12370 2004-07-08  Martin Baulig  <martin@ximian.com>
12371
12372         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12373         not always return, just like we're doing in Using.Resolve().
12374
12375 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * cs-parser.jay (fixed_statement): flag this as Pinned.
12378
12379 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12380
12381         * typemanager.cs (TypeManager): Removed MakePinned method, this
12382         mechanism is replaced with the .NET 2.x compatible mechanism of
12383         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12384
12385         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12386         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12387         `IsFixed' property which has a different meaning.
12388
12389 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12390
12391         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12392         visible from inside a nested class, not just the names of the
12393         immediately enclosing class.
12394         Fix for bug #60730.
12395
12396 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12397
12398         * expression.cs (BetterConversion): Remove buggy special-case
12399         handling of "implicit constant expression conversions".  At this
12400         point, we already know that the conversion is possible -- we're
12401         only checking to see which is better.
12402
12403 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12404
12405         * cs-parser.jay: Added error CS0210 test.
12406
12407 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12408
12409         * cs-parser.jay: Added error CS0134 test.
12410
12411 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12412
12413         Fix bug #52507
12414         * cs-parser.jay: Added error CS0145 test.
12415
12416 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12417
12418         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12419
12420 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12421         
12422         * expression.cs (StackAlloc.Resolve): The argument may not
12423         be a constant; deal with this case.
12424         
12425 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12426
12427         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12428         GetIndexerAttributeValue.
12429         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12430
12431         * class.cs (Indexer.Define): Added error tests for CS0415,
12432         CS0609.
12433
12434 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12435
12436         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12437         property code.
12438
12439 2004-06-23  Martin Baulig  <martin@ximian.com>
12440
12441         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12442         neither return nor throw, reset the barrier as well.  Fixes #60457.
12443
12444 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12445
12446         * class.cs : EventAttributes is now set to None by default.
12447           This fixes bug #60459.
12448
12449 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12450
12451         Fix bug #60219
12452         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12453         Don't throw exception but return null (it's sufficient now).
12454
12455 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12456
12457         * typemanager.cs (GetArgumentTypes): Faster implementation.
12458
12459 2004-06-18  Martin Baulig  <martin@ximian.com>
12460
12461         * attribute.cs (Attribute.Resolve): Check whether we're an
12462         EmptyCast which a Constant child.  Fixes #60333.
12463
12464 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12465
12466         * statement.cs (EmitCollectionForeach): Account for the fact that
12467         not all valuetypes are in areas which we can take the address of.
12468         For these variables, we store to a temporary variable. Also, make
12469         sure that we dont emit a `callvirt' on a valuetype method.
12470
12471 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12472
12473         * expression.cs (StackAlloc.DoReSolve): Added test for
12474         negative parameter (CS0247).
12475
12476 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12477
12478         Fix bug #59792
12479         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12480
12481 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12482
12483         Fix bug #59781
12484         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12485         ulong.
12486
12487 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12488
12489         Fix bug #58254 & cs1555.cs, cs1556.cs
12490         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12491
12492 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12493
12494         * cs-parser.jay: Added error CS1669 test for indexers.
12495
12496 2004-06-11  Martin Baulig  <martin@ximian.com>
12497
12498         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12499         call this twice: for params and varargs methods.
12500
12501 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12502
12503         * class.cs:
12504         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12505
12506 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12507
12508         * attribute.cs (Attribute.GetValidTargets): Made public.
12509
12510         * class.cs: 
12511         (AbstractPropertyEventMethod): New class for better code sharing.
12512         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12513         CS1667 report.
12514         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12515
12516 2004-06-11  Raja R Harinath  <rharinath@novell.com>
12517
12518         Fix bug #59477.
12519         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12520         that the call to Resolve is part of a MemberAccess.
12521         (Expression.Resolve): Use it for SimpleName resolution.
12522         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12523         Add 'intermediate' boolean argument.
12524         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
12525         error message when the SimpleName can be resolved ambiguously
12526         between an expression and a type.
12527         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12528         public.
12529         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12530         call on the left-side.
12531
12532 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12533
12534         * class.cs:
12535         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12536
12537 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12538
12539         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12540
12541 2004-06-11  Martin Baulig  <martin@ximian.com>
12542
12543         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12544         varargs methods if applicable.
12545
12546 2004-06-11  Martin Baulig  <martin@ximian.com>
12547
12548         * expression.cs (Invocation.EmitCall): Don't use
12549         `method.CallingConvention == CallingConventions.VarArgs' since the
12550         method could also have `CallingConventions.HasThis'.
12551
12552 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12553
12554         * class.cs (Event.GetSignatureForError): Implemented.
12555         Fixed crash in error test cs3010.cs
12556
12557 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
12558
12559         * cs-tokenizer.cs: Change the way we track __arglist to be
12560         consistent with the other keywords.
12561
12562 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
12563
12564         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12565         tomorrow.
12566
12567 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
12568
12569         * codegen.cs: Check that all referenced assemblies have a strongname
12570         before strongnaming the compiled assembly. If not report error CS1577.
12571         Fix bug #56563. Patch by Jackson Harper.
12572         * typemanager.cs: Added a method to return all referenced assemblies.
12573         Fix bug #56563. Patch by Jackson Harper.
12574
12575 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12576
12577         * class.cs:
12578         (Method.ApplyAttributeBuilder): Moved and added conditional
12579         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12580
12581         * delegate.cs:
12582         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12583
12584 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12585
12586         Fixed #59640
12587         * class.cs: (EventField.attribute_targets): Changed default target.
12588
12589 2004-06-08  Martin Baulig  <martin@ximian.com>
12590
12591         * expression.cs (Invocation.EmitCall): Enable varargs methods.
12592
12593 2004-06-08  Martin Baulig  <martin@ximian.com>
12594
12595         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12596
12597 2004-06-07  Martin Baulig  <martin@ximian.com>
12598
12599         Added support for varargs methods.
12600
12601         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12602         keyword.
12603
12604         * cs-parser.jay: Added support for `__arglist'.
12605
12606         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12607
12608         * expression.cs (Argument.AType): Added `ArgList'.
12609         (Invocation): Added support for varargs methods.
12610         (ArglistAccess): New public class.
12611         (Arglist): New public class.
12612
12613         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12614
12615         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
12616         a method's top-level block if the method has varargs.
12617
12618         * support.cs (ReflectionParameters, InternalParameters): Added
12619         support for varargs methods.    
12620
12621 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * class.cs: Provide location in indexer error report.
12624
12625         * driver.cs: Use standard names.
12626
12627         * namespace.cs: Catch the use of using after a namespace has been
12628         declared also on using aliases.
12629
12630 2004-06-03  Raja R Harinath  <rharinath@novell.com>
12631
12632         Bug #50820.
12633         * typemanager.cs (closure_private_ok, closure_invocation_type)
12634         (closure_qualifier_type, closure_invocation_assembly)
12635         (FilterWithClosure): Move to ...
12636         (Closure): New internal nested class.
12637         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12638         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12639         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12640         (MemberLookup, MemberLookupFailed): Use it.
12641         * expression.cs (New.DoResolve): Treat the lookup for the
12642         constructor as being qualified by the 'new'ed type.
12643         (Indexers.GetIndexersForTypeOrInterface): Update.
12644
12645 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
12646
12647         * attribute.cs
12648         (GetConditionalAttributeValue): New method. Returns
12649         condition of ConditionalAttribute.
12650         (SearchMulti): New method.  Returns all attributes of type 't'.
12651         Use it when attribute is AllowMultiple = true.
12652         (IsConditionalMethodExcluded): New method.
12653
12654         * class.cs
12655         (Method.IsExcluded): Implemented. Returns true if method has conditional
12656         attribute and the conditions is not defined (method is excluded).
12657         (IMethodData): Extended interface for ConditionalAttribute support.
12658         (PropertyMethod.IsExcluded): Implemented.
12659
12660         * decl.cs
12661         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12662
12663         * expression.cs
12664         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12665         on the method.
12666
12667 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12668
12669         * expression.cs (ArrayCreationExpression): Make this just an
12670         `expression'. It can't be a statement, so the code here was
12671         dead.
12672
12673 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12674
12675         Fixed #59072
12676         * typemanager.cs (GetFullNameSignature): New method for
12677         MethodBase types.
12678
12679 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12680
12681         Fixed #56452
12682         * class.cs (MemberBase.GetSignatureForError): New virtual method.
12683         Use this method when MethodBuilder is null.
12684         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12685         Added test for error CS0626 (MONO reports error for this situation).
12686         (IMethodData.GetSignatureForError): Extended interface.
12687
12688 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12689
12690         * attribute.cs
12691         (AttributeTester.GetObsoleteAttribute): Returns instance of
12692         ObsoleteAttribute when type is obsolete.
12693
12694         * class.cs
12695         (TypeContainer.VerifyObsoleteAttribute): Override.
12696         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12697         (MethodCode.VerifyObsoleteAttribute): Override.
12698         (MemberBase.VerifyObsoleteAttribute): Override.
12699
12700         * decl.cs
12701         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12702         and report proper error.
12703
12704         *delegate.cs
12705         Delegate.VerifyObsoleteAttribute): Override.
12706
12707         * ecore.cs
12708         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12709         and report proper error.
12710         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12711
12712         * enum.cs
12713         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12714         and enum member.
12715
12716         * expression.cs
12717         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12718         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12719         Added test for ObsoleteAttribute.
12720
12721         * statement.cs
12722         (Catch): Derived from Statement.
12723
12724 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12725  
12726         Fixed bug #59071 & cs0160.cs
12727  
12728         * statement.cs (Try.Resolve): Check here whether order of catch
12729         clauses matches their dependencies.
12730
12731 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
12732
12733         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
12734         caused a regression: #59343.  Referencing nested classes from an
12735         assembly stopped working.
12736
12737 2004-05-31  Martin Baulig  <martin@ximian.com>
12738
12739         MCS is now frozen for beta 2.
12740
12741 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12742
12743         * convert.cs: add a trivial cache for overload operator resolution.
12744
12745 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12746
12747         * decl.cs: If possible, use lookuptypedirect here. We can only do
12748         this if there is no `.' after the namespace. Avoids using
12749         LookupType, which does lots of slow processing.
12750         (FindNestedType) New method, does what it says :-).
12751         * namespace.cs: use LookupTypeDirect.
12752         * rootcontext.cs: use membercache, if possible.
12753         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12754
12755 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12756
12757         * expression.cs:
12758         According to the spec, 
12759
12760         In a member access of the form E.I, if E is a single identifier,
12761         and if the meaning of E as a simple-name (§7.5.2) is a constant,
12762         field, property, localvariable, or parameter with the same type as
12763         the meaning of E as a type-name (§3.8), then both possible
12764         meanings of E are permitted.
12765
12766         We did not check that E as a simple-name had the same type as E as
12767         a type name.
12768
12769         This trivial check gives us 5-7% on bootstrap time.
12770
12771 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12772
12773         * expression.cs (Invocation.OverloadResolve): Avoid the
12774         use of hashtables and boxing here by allocating on demand.
12775
12776 2004-05-30  Martin Baulig  <martin@ximian.com>
12777
12778         * rootcontext.cs (RootContext.LookupType): Don't cache things if
12779         we're doing a silent lookup.  Don't try to lookup nested types in
12780         TypeManager.object_type (thanks to Ben Maurer).
12781
12782 2004-05-30  Martin Baulig  <martin@ximian.com>
12783
12784         Committing a patch from Ben Maurer.
12785
12786         * rootcontext.cs (RootContext.LookupType): Cache negative results.
12787
12788 2004-05-29  Martin Baulig  <martin@ximian.com>
12789
12790         * class.cs (IMethodData.ShouldIgnore): New method.
12791
12792         * typemanager.cs (TypeManager.MethodFlags): Don't take a
12793         `Location' argument, we don't need it anywhere.  Use
12794         `IMethodData.ShouldIgnore ()' instead of
12795         `MethodData.GetMethodFlags ()'.
12796         (TypeManager.AddMethod): Removed.
12797         (TypeManager.AddMethod2): Renamed to AddMethod.
12798
12799 2004-05-29  Martin Baulig  <martin@ximian.com>
12800
12801         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
12802
12803         * convert.cs (Convert.ImplicitReferenceConversion): If we're
12804         converting from a class type S to an interface type and we already
12805         have an object on the stack, don't box it again.  Fixes #52578.
12806
12807 2004-05-29  Martin Baulig  <martin@ximian.com>
12808
12809         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12810         Added support for `params' parameters.  Fixes #59267.
12811
12812 2004-05-29  Martin Baulig  <martin@ximian.com>
12813
12814         * literal.cs (NullPointer): Provide a private .ctor which sets
12815         `type' to TypeManager.object_type.  Fixes #59048.
12816
12817 2004-05-29  Martin Baulig  <martin@ximian.com>
12818
12819         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
12820         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
12821
12822         * ecore.cs (EventExpr.instance_expr): Make the field private.
12823
12824 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
12825
12826         Fixed bug #50080 & cs0214-2.cs
12827         * expression.cs (Cast.DoResolve): Check unsafe context here.
12828         
12829         * statement.cs (Resolve.DoResolve): Likewise.
12830
12831 2004-05-26  Martin Baulig  <martin@ximian.com>
12832
12833         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
12834
12835         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
12836         (RootContext.LookupType): Pass down the `silent' flag.
12837
12838 2004-05-25  Martin Baulig  <martin@ximian.com>
12839
12840         * expression.cs
12841         (MethodGroupExpr.IdenticalTypeName): New public property.
12842         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
12843         expression actually refers to a type.
12844
12845 2004-05-25  Martin Baulig  <martin@ximian.com>
12846
12847         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
12848         for #56176 and made it actually work.
12849
12850 2004-05-25  Martin Baulig  <martin@ximian.com>
12851
12852         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
12853         (FieldExpr, PropertyExpr): Override and implement
12854         CacheTemporaries.  Fixes #52279.
12855
12856 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
12857
12858         * location.cs: In the new compiler listing a file twice is a
12859         warning, not an error.
12860
12861 2004-05-24  Martin Baulig  <martin@ximian.com>
12862
12863         * enum.cs (Enum.DefineType): For the `BaseType' to be a
12864         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
12865
12866 2004-05-24  Martin Baulig  <martin@ximian.com>
12867
12868         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
12869         walking the `using' list.  Fixes #53921.
12870
12871 2004-05-24  Martin Baulig  <martin@ximian.com>
12872
12873         * const.cs (Const.LookupConstantValue): Added support for
12874         EmptyCast's; fixes #55251.
12875
12876 2004-05-24  Martin Baulig  <martin@ximian.com>
12877
12878         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
12879         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
12880         which does the CS0135 check.  The reason is that we first need to
12881         check whether the variable actually exists.
12882
12883 2004-05-24  Martin Baulig  <martin@ximian.com>
12884
12885         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
12886         than RootContext.LookupType() to find the explicit interface
12887         type.  Fixes #58584.
12888
12889 2004-05-24  Raja R Harinath  <rharinath@novell.com>
12890
12891         * Makefile: Simplify.  Use executable.make.
12892         * mcs.exe.sources: New file.  List of sources of mcs.exe.
12893
12894 2004-05-24  Anders Carlsson  <andersca@gnome.org>
12895
12896         * decl.cs:
12897         * enum.cs:
12898         Use the invariant culture when doing String.Compare for CLS case
12899         sensitivity.
12900         
12901 2004-05-23  Martin Baulig  <martin@ximian.com>
12902
12903         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
12904         don't have any dots.  Fixes #52622, added cs0246-8.cs.
12905
12906         * namespace.cs (NamespaceEntry.Lookup): Likewise.
12907         
12908 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
12909
12910         * class.cs (MemberBase.Define): Reuse MemberType member for 
12911         resolved type. Other methods can use it too.
12912
12913 2004-05-23  Martin Baulig  <martin@ximian.com>
12914
12915         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
12916         the variable also exists in the current block (otherwise, we need
12917         to report a CS0103).  Fixes #58670.
12918
12919 2004-05-23  Martin Baulig  <martin@ximian.com>
12920
12921         * flowanalysis.cs (Reachability.Reachable): Compute this
12922         on-the-fly rather than storing it as a field.
12923
12924 2004-05-23  Martin Baulig  <martin@ximian.com>
12925
12926         * flowanalysis.cs (Reachability.And): Manually compute the
12927         resulting `barrier' from the reachability.      
12928        
12929 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
12930
12931         Fix bug #57835
12932         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
12933         instance of ObsoleteAttribute when symbol is obsolete.
12934
12935         * class.cs
12936         (IMethodData): Extended interface for ObsoleteAttribute support.
12937
12938 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
12939
12940         * attribute.cs: Fix bug #55970
12941
12942 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
12943
12944         Fix bug #52705
12945         * attribute.cs
12946         (GetObsoleteAttribute): New method. Creates the instance of
12947         ObsoleteAttribute.
12948         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
12949         ObsoleteAttribute when member is obsolete.
12950         (AttributeTester.Report_ObsoleteMessage): Common method for
12951         Obsolete error/warning reporting.
12952
12953         * class.cs
12954         (TypeContainer.base_classs_type): New member for storing parent type.
12955
12956         * decl.cs
12957         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
12958         for this MemberCore.
12959
12960 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
12961
12962         * attribute.cs, const.cs: Fix bug #58590
12963
12964 2004-05-21  Martin Baulig  <martin@ximian.com>
12965
12966         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
12967         out parameters if the end of the method is unreachable.  Fixes
12968         #58098. 
12969
12970 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
12971
12972         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
12973         Hari was right, why extra method.
12974
12975 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
12976
12977         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
12978
12979 2004-05-20  Martin Baulig  <martin@ximian.com>
12980
12981         Merged this back from gmcs to keep the differences to a minumum.
12982
12983         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
12984         instead of a Declspace.
12985         (Attribute.ResolveType): Likewise.
12986         (Attributes.Search): Likewise.
12987         (Attributes.Contains): Likewise.
12988         (Attributes.GetClsCompliantAttribute): Likewise.
12989
12990         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
12991         argument.
12992         (MethodData.ApplyAttributes): Take an EmitContext instead of a
12993         DeclSpace.
12994
12995 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
12996
12997         Fix bug #58688 (MCS does not report error when the same attribute
12998         is assigned twice)
12999
13000         * attribute.cs (Attribute.Emit): Distinction between null and default.
13001
13002 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13003
13004         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13005         of a top-level attribute without an attribute target.
13006         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13007         Make non-static.
13008         (Attribute.Conditional_GetConditionName), 
13009         (Attribute.Obsolete_GetObsoleteMessage): Update.
13010         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13011         part of ScanForIndexerName.
13012         (Attribute.CanIgnoreInvalidAttribute): New function.
13013         (Attribute.ScanForIndexerName): Move to ...
13014         (Attributes.ScanForIndexerName): ... here.
13015         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13016         (Attributes.Search): New internal variant that can choose not to
13017         complain if types aren't resolved.  The original signature now
13018         complains.
13019         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13020         complaints suppressed.
13021         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13022         only if it not useful.
13023         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13024         top-level for attributes that are shared between the assembly
13025         and a top-level class.
13026         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13027         * class.cs: Update to reflect changes.
13028         (DefineIndexers): Fuse loops.
13029         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13030         a couple more variants of attribute names.
13031
13032 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13033
13034         Fix bug #52585 (Implemented explicit attribute declaration)
13035
13036         * attribute.cs:
13037         (Attributable.ValidAttributeTargets): New abstract method. It gets
13038         list of valid attribute targets for explicit target declaration.
13039         (Attribute.Target): It holds target itself.
13040         (AttributeSection): Removed.
13041         (Attribute.CheckTargets): New method. It checks whether attribute
13042         target is valid for the current element.
13043
13044         * class.cs:
13045         (EventProperty): New class. For events that are declared like
13046         property (with add and remove accessors).
13047         (EventField): New class. For events that are declared like field.
13048         class.cs
13049
13050         * cs-parser.jay: Implemented explicit attribute target declaration.
13051
13052         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13053         Override ValidAttributeTargets.
13054
13055         * parameter.cs:
13056         (ReturnParameter): Class for applying custom attributes on 
13057         the return type.
13058         (ParameterAtribute): New class. Class for applying custom
13059         attributes on the parameter type.
13060
13061 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13062
13063         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13064         definitions. 
13065
13066         (Method): Allow UNSAFE here.
13067
13068         * modifiers.cs: Support unsafe reporting.
13069
13070 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13071
13072         * decl.cs: Fix bug #58478.
13073
13074 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13075
13076         * statement.cs: When checking for unreachable code on an EmptyStatement,
13077         set the location. Fixes bug #58488.
13078
13079 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13080
13081         * driver.cs: Add -pkg handling.
13082
13083         From Gonzalo: UseShelLExecute=false
13084
13085 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13086
13087         * attribute.cs:
13088         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13089         for attribute.
13090         (Attribute.IsClsCompliaceRequired): Moved to base for better
13091         accesibility.
13092         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13093         when attribute is AttributeUsageAttribute.
13094         (Attribute.GetValidTargets): Simplified.
13095         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13096         attribute for this type.
13097         (Attribute.ApplyAttributes): Method renamed to Emit and make
13098         non-static.
13099         (GlobalAttributeSection): New class for special handling of global
13100         attributes (assembly, module).
13101         (AttributeSection.Emit): New method.
13102
13103         * class.cs: Implemented Attributable abstract methods.
13104         (MethodCore.LabelParameters): Moved to Parameter class.
13105         (Accessor): Is back simple class.
13106         (PropertyMethod): Implemented Attributable abstract class.
13107         (DelegateMethod): Implemented Attributable abstract class.
13108         (Event): New constructor for disctintion between normal Event
13109         and Event with accessors.
13110
13111         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13112
13113         * codegen.cs, const.cs, decl.cs, delegate.cs:
13114         (CommonAssemblyModulClass): Implemented Attributable abstract class
13115         and simplified.
13116
13117         * enum.cs: Implement IAttributeSupport interface.
13118         (EnumMember): New class for emum members. Implemented Attributable
13119         abstract class
13120
13121         * parameter.cs:
13122         (ParameterBase): Is abstract.
13123         (ReturnParameter): New class for easier [return:] attribute handling.
13124
13125         * typemanager.cs: Removed builder_to_attr.
13126
13127 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13128
13129         Fix bug #57151.
13130         * attribute.cs (Attribute.GetPositionalValue): New function.
13131         * class.cs (TypeContainer.VerifyMembers): New function.
13132         (TypeContainer.Emit): Use it.
13133         (ClassOrStruct): New base class for Class and Struct.
13134         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13135         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13136         class.
13137         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13138         then each non-static field should have a FieldOffset attribute.
13139         Otherwise, none of the fields should have a FieldOffset attribute.
13140         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13141         and FieldOffset attributes.
13142         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13143         (TypeManager.field_offset_attribute_type): New core types.
13144         (TypeManager.InitCoreTypes): Initialize them.
13145
13146 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13147
13148         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13149         Return correct type.
13150         From bug #58270.
13151
13152 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13153
13154         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13155         be implicitly converted to ulong.
13156         
13157         * expression.cs: The logic for allowing operator &, | and ^ worked
13158         was wrong, it worked before because we did not report an error in
13159         an else branch.  Fixes 57895.
13160
13161         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13162         allow volatile fields to be reference types.
13163
13164 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * driver.cs: Add support for /debug-
13167
13168 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13169
13170         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13171         Add a 'complain' parameter to silence errors.
13172         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13173         silently overlooked type-resolutions.
13174         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13175         to reflect changes.
13176         (Attributes.Search): New function.
13177         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13178         (Attributes.GetAttributeFullName): Remove hack.
13179         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13180         Update to reflect changes.
13181         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13182         Use Attributes.Search instead of nested loops.
13183
13184 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13185
13186         * decl.cs:
13187         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13188         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13189         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13190
13191         * report.cs: (Report.Warning): Renamed to Warning_T because of
13192         parameter collision.
13193
13194 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13195
13196         * expression.cs (MemberAccess.ResolveMemberAccess):
13197         Exit with non-zero status after Report.Error.
13198         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13199         Likewise.
13200         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13201
13202 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13203
13204         * support.cs: Don't hang when the file is empty.
13205
13206 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13207
13208         * support.cs: In SeekableStreamReader, compute the preamble size of the
13209           underlying stream. Position changes should take into account that initial
13210           count of bytes.
13211
13212 2004-05-03  Todd Berman  <tberman@sevenl.net>
13213
13214         * driver.cs: remove unused GetSysVersion function.
13215
13216 2004-05-03  Todd Berman  <tberman@sevenl.net>
13217
13218         * driver.cs: Remove the hack from saturday, as well as the hack
13219         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13220         link_paths to get that bit proper.
13221
13222 2004-05-01  Todd Berman  <tberman@sevenl.net>
13223
13224         * driver.cs: Try a LoadFrom before a Load, this checks the current
13225         path. This is currently a bug in mono that is be fixed, however, this
13226         provides a workaround for now. This will be removed when the bug
13227         is fixed.
13228
13229 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13230
13231         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13232         incomplete key pairs (#57941).
13233
13234 2004-05-01  Todd Berman  <tberman@sevenl.net>
13235
13236         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13237         from the GAC
13238
13239 2004-04-30  Jackson Harper  <jackson@ximian.com>
13240
13241         * codegen.cs: Open keys readonly.
13242         
13243 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13244
13245         * typemanager.cs: don't report cyclic struct layout when a struct
13246         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13247         which has 2 Pango.Rectangle fields.
13248
13249 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13250
13251         * expression.cs: Handle IntPtr comparisons with IL code
13252         rather than a method call.
13253
13254 2004-04-29  Martin Baulig  <martin@ximian.com>
13255
13256         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13257         the list of PropertyInfo's in class hierarchy and find the
13258         accessor.  Fixes #56013.
13259
13260 2004-04-29  Martin Baulig  <martin@ximian.com>
13261
13262         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13263
13264 2004-04-29  Martin Baulig  <martin@ximian.com>
13265
13266         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13267
13268         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13269
13270 2004-04-29  Martin Baulig  <martin@ximian.com>
13271
13272         * class.cs (ConstructorInitializer.Resolve): Check whether the
13273         parent .ctor is accessible.  Fixes #52146.
13274
13275 2004-04-29  Martin Baulig  <martin@ximian.com>
13276
13277         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13278
13279         * statement.cs (Using.EmitLocalVariableDecls): Use
13280         TypeManager.idisposable_type, not typeof (IDisposable).
13281         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13282
13283 2004-04-29  Martin Baulig  <martin@ximian.com>
13284
13285         * class.cs (Event.Define): Don't emit the field and don't set
13286         RTSpecialName and SpecialName for events on interfaces.  Fixes
13287         #57703. 
13288
13289 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13290
13291         Refactor Attribute.ApplyAttributes.
13292         * attribute.cs (Attributable): New base class for objects that can
13293         have Attributes applied on them.
13294         (Attribute): Make AttributeUsage fields public.
13295         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13296         (Attribute.IsInternalCall): New property.
13297         (Attribute.UsageAttr): Convert to a public read-only property.
13298         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13299         (Attribute.ResolveType, Attribute.Resolve)
13300         (Attribute.ScanForIndexerName): Update to reflect changes.
13301         (Attribute.CheckAttributeTarget): Re-format.
13302         (Attribute.ApplyAttributes): Refactor, to various
13303         Attributable.ApplyAttributeBuilder methods.
13304         * decl.cs (MemberCore): Make Attributable.
13305         * class.cs (Accessor): Make Attributable.
13306         (MethodData.ApplyAttributes): Use proper attribute types, not
13307         attribute names.
13308         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13309         (TypeContainer.ApplyAttributeBuilder)
13310         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13311         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13312         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13313         (Operator.ApplyAttributeBuilder): New factored-out methods.
13314         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13315         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13316         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13317         * parameter.cs (ParameterBase): New Attributable base class
13318         that can also represent Return types.
13319         (Parameter): Update to the changes.
13320
13321 2004-04-29  Jackson Harper  <jackson@ximian.com>
13322
13323         * driver.cs: Prefer the corlib system version when looking for
13324         assemblies in the GAC. This is still a hack, but its a better hack
13325         now.
13326         
13327 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13328
13329         * decl.cs, enum.cs: Improved error 3005 reporting.
13330   
13331         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13332         (related_symbols): New private member for list of symbols
13333         related to reported error/warning.
13334         
13335         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13336
13337 2004-04-29  Martin Baulig  <martin@ximian.com>
13338
13339         * ecore.cs (Expression.Constantify): If we're an enum and
13340         TypeManager.TypeToCoreType() doesn't give us another type, use
13341         t.UnderlyingSystemType.  Fixes #56178.  
13342
13343 2004-04-29  Martin Baulig  <martin@ximian.com>
13344
13345         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13346         interfaces and for each interface, only add members directly
13347         declared in that interface.  Fixes #53255.
13348
13349 2004-04-28  Martin Baulig  <martin@ximian.com>
13350
13351         * expression.cs (ConditionalLogicalOperator): Use a temporary
13352         variable for `left' to avoid that we evaluate it more than once;
13353         bug #52588.
13354
13355 2004-04-28  Martin Baulig  <martin@ximian.com>
13356
13357         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13358         `void[]' (CS1547).
13359
13360 2004-04-28  Martin Baulig  <martin@ximian.com>
13361
13362         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13363         void (CS1547).
13364
13365         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13366         whether the type is not void (CS1547).
13367
13368 2004-04-28  Martin Baulig  <martin@ximian.com>
13369
13370         * expression.cs (Unary.DoResolveLValue): Override this and report
13371         CS0131 for anything but Operator.Indirection.
13372
13373 2004-04-28  Martin Baulig  <martin@ximian.com>
13374
13375         Committing a patch from Ben Maurer; see bug #50820.
13376
13377         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13378         check for classes.
13379
13380         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13381         classes.        
13382
13383 2004-04-28  Martin Baulig  <martin@ximian.com>
13384
13385         Committing a patch from Ben Maurer; see bug #50820.
13386
13387         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13388         check for classes.
13389
13390         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13391         classes.        
13392
13393 2004-04-28  Martin Baulig  <martin@ximian.com>
13394
13395         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13396         (Block.AddLabel): Call DoLookupLabel() to only search in the
13397         current block.
13398
13399 2004-04-28  Martin Baulig  <martin@ximian.com>
13400
13401         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13402         comparing StringConstants and NullLiterals in Equality and Inequality.
13403
13404 2004-04-28  Jackson Harper  <jackson@ximian.com>
13405
13406         * driver.cs: Attempt to load referenced assemblies from the
13407         GAC. This is the quick and dirty version of this method that
13408         doesnt take into account versions and just takes the first
13409         canidate found. Will be good enough for now as we will not have more
13410         then one version installed into the GAC until I update this method.
13411
13412 2004-04-28  Martin Baulig  <martin@ximian.com>
13413
13414         * typemanager.cs (TypeManager.CheckStructCycles): New public
13415         static method to check for cycles in the struct layout.
13416
13417         * rootcontext.cs (RootContext.PopulateTypes): Call
13418         TypeManager.CheckStructCycles() for each TypeContainer.
13419         [Note: We only need to visit each type once.]
13420
13421 2004-04-28  Martin Baulig  <martin@ximian.com>
13422
13423         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13424
13425         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13426         success and added `out object value'.  Use a `bool resolved' field
13427         to check whether we've already been called rather than
13428         `ConstantValue != null' since this breaks for NullLiterals.
13429
13430 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13431
13432         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13433         setting of this flag, since the 'set' method may be non-public.
13434
13435 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13436
13437         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13438         check on current_vector.Block.
13439
13440 2004-04-27  Martin Baulig  <martin@ximian.com>
13441
13442         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13443         a field initializer.  Fixes #56459.
13444
13445 2004-04-27  Martin Baulig  <martin@ximian.com>
13446
13447         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13448         we're not attempting to use an indexer.  Fixes #52154.
13449
13450 2004-04-27  Martin Baulig  <martin@ximian.com>
13451
13452         * statement.cs (Return): Don't create a return label if we don't
13453         need it; reverts my change from January 20th.  Thanks to Ben
13454         Maurer for this.
13455
13456 2004-04-27  Martin Baulig  <martin@ximian.com>
13457
13458         According to the spec, `goto' can only leave a nested scope, but
13459         never enter it.
13460
13461         * statement.cs (Block.LookupLabel): Only lookup in the current
13462         block, don't recurse into parent or child blocks.
13463         (Block.AddLabel): Check in parent and child blocks, report
13464         CS0140/CS0158 if we find a duplicate.
13465         (Block): Removed this indexer for label lookups.
13466         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13467         this already does the error reporting for us.
13468
13469         * flowanalysis.cs
13470         (FlowBranching.UsageVector.Block): New public variable; may be null.
13471         (FlowBranching.CreateSibling): Added `Block' argument.
13472         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13473         label for the target of a `goto' and check whether we're not
13474         leaving a `finally'.
13475
13476 2004-04-27  Martin Baulig  <martin@ximian.com>
13477
13478         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13479         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13480         just for returns).
13481
13482 2004-04-27  Martin Baulig  <martin@ximian.com>
13483
13484         * statement.cs (Block.AddLabel): Also check for implicit blocks
13485         and added a CS0158 check.
13486
13487 2004-04-27  Martin Baulig  <martin@ximian.com>
13488
13489         * flowanalysis.cs (FlowBranchingLoop): New class.
13490         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13491         UsageVector's instead of an ArrayList.
13492         (FlowBranching.Label): Likewise.
13493         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13494         (FlowBranching.AddBreakVector): New method.
13495
13496 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13497
13498         * attribute.cs: Small regression fix: only convert the type if we
13499         the type is different, fixes System.Drawing build.
13500
13501 2004-04-27  Martin Baulig  <martin@ximian.com>
13502
13503         * attribute.cs (Attribute.Resolve): If we have a constant value
13504         for a named field or property, implicity convert it to the correct
13505         type.
13506
13507 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13508
13509         * statement.cs (Block.Block): Implicit blocks share
13510         'child_variable_names' fields with parent blocks.
13511         (Block.AddChildVariableNames): Remove.
13512         (Block.AddVariable): Mark variable as "used by a child block" in
13513         every surrounding block.
13514         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13515         been used in a child block, complain about violation of "Invariant
13516         meaning in blocks" rule.
13517         * cs-parser.jay (declare_local_variables): Don't use
13518         AddChildVariableNames.
13519         (foreach_statement): Don't create an implicit block: 'foreach'
13520         introduces a scope.
13521
13522 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
13523
13524         * convert.cs (ImplicitNumericConversion): 0 is also positive when
13525         converting from 0L to ulong.  Fixes 57522.
13526
13527 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13528
13529         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13530         derived class hides via 'new' keyword field from base class (test-242.cs).
13531         TODO: Handle this in the more general way.
13532         
13533         * class.cs (CheckBase): Ditto.
13534
13535 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13536
13537         * decl.cs (caching_flags): New member for storing cached values
13538         as bit flags.
13539         (MemberCore.Flags): New enum where bit flags for caching_flags
13540         are defined.
13541         (MemberCore.cls_compliance): Moved to caching_flags.
13542         (DeclSpace.Created): Moved to caching_flags.
13543
13544         * class.cs: Use caching_flags instead of DeclSpace.Created
13545         
13546 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
13547
13548         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13549         if we are only a derived class, not a nested class.
13550
13551         * typemanager.cs: Same as above, but do this at the MemberLookup
13552         level (used by field and methods, properties are handled in
13553         PropertyExpr).   Allow for the qualified access if we are a nested
13554         method. 
13555
13556 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
13557
13558         * class.cs: Refactoring.
13559         (IMethodData): New inteface; Holds links to parent members
13560         to avoid member duplication (reduced memory allocation).
13561         (Method): Implemented IMethodData interface.
13562         (PropertyBase): New inner classes for get/set methods.
13563         (PropertyBase.PropertyMethod): Implemented IMethodData interface
13564         (Event): New inner classes for add/remove methods.
13565         (Event.DelegateMethod): Implemented IMethodData interface.
13566
13567         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13568         EmitContext (related to class.cs refactoring).
13569
13570 2004-04-21  Raja R Harinath  <rharinath@novell.com>
13571
13572         * delegate.cs (Delegate.VerifyApplicability): If the number of
13573         arguments are the same as the number of parameters, first try to
13574         verify applicability ignoring  any 'params' modifier on the last
13575         parameter.
13576         Fixes #56442.
13577
13578 2004-04-16  Raja R Harinath  <rharinath@novell.com>
13579
13580         * class.cs (TypeContainer.AddIndexer): Use
13581         'ExplicitInterfaceName' to determine if interface name was
13582         explicitly specified.  'InterfaceType' is not initialized at this time.
13583         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
13584         Indexers array is already in the required order.  Initialize
13585         'IndexerName' only if there are normal indexers.
13586         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13587         (TypeContainer.Emit): Emit DefaultMember attribute only if
13588         IndexerName is initialized.
13589         Fixes #56300.
13590
13591 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
13592
13593         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13594         Fixes #57007
13595
13596 2004-04-15  Raja R Harinath  <rharinath@novell.com>
13597
13598         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13599         attributes.
13600         Fix for #56456.
13601
13602         * attribute.cs (Attribute.Resolve): Check for duplicate named
13603         attributes.
13604         Fix for #56463.
13605
13606 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
13607
13608         * iterators.cs (MarkYield): track whether we are in an exception,
13609         and generate code accordingly.  Use a temporary value to store the
13610         result for our state.
13611
13612         I had ignored a bit the interaction of try/catch with iterators
13613         since their behavior was not entirely obvious, but now it is
13614         possible to verify that our behavior is the same as MS .NET 2.0
13615
13616         Fixes 54814
13617
13618 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
13619
13620         * iterators.cs: Avoid creating temporaries if there is no work to
13621         do. 
13622
13623         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13624         Enumerations, use TypeManager.EnumToUnderlying and call
13625         recursively. 
13626
13627         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13628         bug #57013
13629
13630         (This.Emit): Use EmitContext.EmitThis to emit our
13631         instance variable.
13632
13633         (This.EmitAssign): Ditto.
13634
13635         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13636         codepaths, we will move all the functionality into
13637         Mono.CSharp.This 
13638
13639         (FieldExpr.EmitAssign): Ditto.
13640
13641         This fixes several hidden bugs that I uncovered while doing a code
13642         review of this today.
13643
13644         * codegen.cs (EmitThis): reworked so the semantics are more clear
13645         and also support value types "this" instances.
13646
13647         * iterators.cs: Changed so that for iterators in value types, we
13648         do not pass the value type as a parameter.  
13649
13650         Initialization of the enumerator helpers is now done in the caller
13651         instead of passing the parameters to the constructors and having
13652         the constructor set the fields.
13653
13654         The fields have now `assembly' visibility instead of private.
13655
13656 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
13657
13658         * expression.cs (Argument.Resolve): Check if fields passed as ref
13659         or out are contained in a MarshalByRefObject.
13660
13661         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13662         another compiler type.
13663
13664 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13665
13666         * class.cs (Indexer.Define): use the new name checking method.
13667         Also, return false on an error.
13668         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13669         (is_identifier_[start/part]_character): make static.
13670
13671 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * expression.cs (Binary.ResolveOperator): Do no append strings
13674         twice: since we can be invoked more than once (array evaluation)
13675         on the same concatenation, take care of this here.  Based on a fix
13676         from Ben (bug #56454)
13677
13678 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
13679
13680         * codegen.cs: Fix another case where CS1548 must be reported (when 
13681         delay-sign isn't specified and no private is available #56564). Fix
13682         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
13683         error when MCS is used on the MS runtime and we need to delay-sign 
13684         (which seems unsupported by AssemblyBuilder - see #56621).
13685
13686 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
13687
13688         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13689         (TypeManager.ComputeNamespaces): Faster implementation for
13690         Microsoft runtime.
13691
13692         * compiler.csproj: Updated AssemblyName to mcs.
13693
13694 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
13695
13696         * rootcontext.cs: Add new types to the boot resolution.
13697
13698         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13699         MulticastDelegate is not allowed.
13700
13701         * typemanager.cs: Add new types to lookup: System.TypedReference
13702         and ArgIterator.
13703
13704         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13705         check for TypedReference or ArgIterator, they are not allowed. 
13706
13707         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13708         makes us properly catch 1510 in some conditions (see bug 56016 for
13709         details). 
13710
13711 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
13712
13713         * CryptoConvert.cs: update from corlib version
13714         with endian fixes.
13715
13716 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
13717
13718         * class.cs (Indexer.Define): Check indexername declaration
13719
13720 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
13721
13722         * attribute.cs (IsClsCompliant): Fixed problem with handling
13723         all three states (compliant, not-compliant, undetected).
13724
13725 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
13726
13727         * attribute.cs (Attribute): Location is now public.
13728         (Resolve): Store resolved arguments (pos_values) in attribute class.
13729         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13730         (GetClsCompliantAttributeValue): New method that gets
13731         CLSCompliantAttribute value.
13732         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13733         if exists else null.
13734         (AttributeTester): New class for CLS-Compliant verification routines.
13735
13736         * class.cs (Emit): Add CLS-Compliant verification.
13737         (Method.GetSignatureForError): Implemented.
13738         (Constructor.GetSignatureForError): Implemented
13739         (Constructor.HasCompliantArgs): Returns if constructor has
13740         CLS-Compliant arguments.
13741         (Constructor.Emit): Override.
13742         (Construcor.IsIdentifierClsCompliant): New method; For constructors
13743         is needed to test only parameters.
13744         (FieldBase.GetSignatureForError): Implemented.
13745         (TypeContainer): New member for storing base interfaces.
13746         (TypeContainer.FindMembers): Search in base interfaces too.
13747
13748         * codegen.cs (GetClsComplianceAttribute): New method that gets
13749         assembly or module CLSCompliantAttribute value.
13750         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13751         for assembly.
13752         (ModuleClass.Emit): Add error 3012 test.
13753
13754         * const.cs (Emit): Override and call base for CLS-Compliant tests.
13755
13756         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
13757         state for all decl types.
13758         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
13759         if CLS-Compliant tests are required.
13760         (IsClsCompliaceRequired): New method. Analyze whether code
13761         must be CLS-Compliant.
13762         (IsExposedFromAssembly): New method. Returns true when MemberCore
13763         is exposed from assembly.
13764         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
13765         value or gets cached value.
13766         (HasClsCompliantAttribute): New method. Returns true if MemberCore
13767         is explicitly marked with CLSCompliantAttribute.
13768         (IsIdentifierClsCompliant): New abstract method. This method is
13769         used to testing error 3005.
13770         (IsIdentifierAndParamClsCompliant): New method. Common helper method
13771         for identifier and parameters CLS-Compliant testing.
13772         (VerifyClsCompliance): New method. The main virtual method for
13773         CLS-Compliant verifications.
13774         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
13775         null. I don't know why is null (too many public members !).
13776         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
13777         and get value of first CLSCompliantAttribute that found.
13778
13779         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
13780         (VerifyClsCompliance): Override and add extra tests.
13781
13782         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
13783         clscheck- disable CLS-Compliant verification event if assembly is has
13784         CLSCompliantAttribute(true).
13785
13786         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
13787         ApllyAttribute is now called in emit section as in the other cases.
13788         Possible future Emit integration.
13789         (IsIdentifierClsCompliant): New override.
13790         (VerifyClsCompliance): New override.
13791         (GetEnumeratorName): Returns full enum name.
13792
13793         * parameter.cs (GetSignatureForError): Implemented.
13794
13795         * report.cs (WarningData): New struct for Warning message information.
13796         (LocationOfPreviousError): New method.
13797         (Warning): New method. Reports warning based on the warning table.
13798         (Error_T): New method. Reports error based on the error table.
13799
13800         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
13801         verifications are done here.
13802
13803         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
13804
13805         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
13806         CLSCompliantAttribute.
13807         (all_imported_types): New member holds all imported types from other
13808         assemblies.
13809         (LoadAllImportedTypes): New method fills static table with exported types
13810         from all referenced assemblies.
13811         (Modules): New property returns all assembly modules.
13812
13813 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
13814
13815         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
13816         throwing a parser error.
13817
13818         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
13819         which removes the hardcoded get_/set_ prefixes for properties, as
13820         IL allows for the properties to be named something else.  
13821
13822         Bug #56013
13823
13824         * expression.cs: Do not override operand before we know if it is
13825         non-null.  Fix 56207
13826
13827 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13828
13829         * typemanager.cs: support for pinned variables.
13830
13831 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13832
13833         * decl.cs, typemanager.cs: Avoid using an arraylist
13834         as a buffer if there is only one result set.
13835
13836 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13837
13838         * expression.cs: Make sure you cant call a static method
13839         with an instance expression, bug #56174.
13840
13841 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
13842
13843         * class.cs (IsDuplicateImplementation): Improve error reporting to
13844         flag 663 (method only differs in parameter modifier).
13845
13846         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
13847         in preprocessor directives.
13848
13849         * location.cs (LookupFile): Allow for the empty path.
13850
13851         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
13852         better approach for some of that patch, but its failing with the
13853         CharSet enumeration.  For now try/catch will do.
13854
13855         * typemanager.cs: Do not crash if a struct does not have fields.
13856         Fixes 56150.
13857
13858 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13859
13860         * expression.cs: cs0213, cant fix a fixed expression.
13861         fixes 50231.
13862
13863 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13864
13865         * cs-parser.jay: detect invalid embeded statements gracefully.
13866         bug #51113.
13867
13868 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13869
13870         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
13871         As a regex:
13872         s/
13873         the invocation type may not be a subclass of the tye of the item/
13874         The type of the item must be a subclass of the invocation item.
13875         /g
13876
13877         Fixes bug #50820.
13878
13879 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
13880
13881         * attribute.cs: Added methods to get a string and a bool from an
13882         attribute. Required to information from AssemblyKeyFileAttribute,
13883         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
13884         * codegen.cs: Modified AssemblyName creation to include support for
13885         strongnames. Catch additional exceptions to report them as CS1548.
13886         * compiler.csproj: Updated include CryptoConvert.cs.
13887         * compiler.csproj.user: Removed file - user specific configuration.
13888         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
13889         Mono.Security assembly. The original class is maintained and tested in
13890         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
13891         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
13892         like CSC 8.0 (C# v2) supports.
13893         * Makefile: Added CryptoConvert.cs to mcs sources.
13894         * rootcontext.cs: Added new options for strongnames.
13895
13896 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
13897
13898         * driver.cs: For --expect-error, report error code `2'
13899         if the program compiled with no errors, error code `1' if
13900         it compiled with an error other than the one expected.
13901
13902 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
13903
13904         * compiler.csproj: Updated for Visual Studio .NET 2003.
13905         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
13906         * compiler.sln: Updated for Visual Studio .NET 2003.
13907
13908 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
13909
13910         * expression.cs: Fix bug #47234. We basically need to apply the
13911         rule that we prefer the conversion of null to a reference type
13912         when faced with a conversion to 'object' (csc behaviour).
13913
13914 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13915
13916         * statement.cs: Shorter form for foreach, eliminates
13917         a local variable. r=Martin.
13918
13919 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13920
13921         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
13922         checks if we can use brtrue/brfalse to test for 0.
13923         * expression.cs: use the above in the test for using brtrue/brfalse.
13924         cleanup code a bit.
13925
13926 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13927
13928         * expression.cs: Rewrite string concat stuff. Benefits:
13929
13930         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
13931         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
13932         rather than a concat chain.
13933
13934         * typemanager.cs: Add lookups for more concat overloads.
13935
13936 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13937
13938         * expression.cs: Emit shorter il code for array init.
13939
13940         newarr
13941         dup
13942         // set 1
13943
13944         // set 2
13945
13946         newarr
13947         stloc.x
13948
13949         ldloc.x
13950         // set 1
13951
13952         ldloc.x
13953         // set 2
13954
13955 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
13956
13957         * statement.cs: Before, two switch blocks would be merged if the
13958         total size of the blocks (end_item - begin_item + 1) was less than
13959         two times the combined sizes of the blocks.
13960
13961         Now, it will only merge if after the merge at least half of the
13962         slots are filled.
13963
13964         fixes 55885.
13965
13966 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
13967
13968         * class.cs : csc build fix for GetMethods(). See bug #52503.
13969
13970 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
13971
13972         * expression.cs: Make sure fp comparisons work with NaN.
13973         This fixes bug #54303. Mig approved this patch a long
13974         time ago, but we were not able to test b/c the runtime
13975         had a related bug.
13976
13977 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
13978
13979         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
13980
13981 2004-03-19  Martin Baulig  <martin@ximian.com>
13982
13983         * class.cs (MemberCore.IsDuplicateImplementation): Report the
13984         error here and not in our caller.
13985
13986 2004-03-19  Martin Baulig  <martin@ximian.com>
13987
13988         * interface.cs: Completely killed this file.
13989         (Interface): We're now a TypeContainer and live in class.cs.
13990
13991         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
13992         argument; we're now also called for interfaces.
13993         (TypeContainer.DefineMembers): Allow this method being called
13994         multiple times.
13995         (TypeContainer.GetMethods): New public method; formerly known as
13996         Interface.GetMethod().  This is used by PendingImplementation.
13997         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
13998         it's now private and non-static.
13999         (Interface): Moved this here; it's now implemented similar to
14000         Class and Struct.
14001         (Method, Property, Event, Indexer): Added `bool is_interface'
14002         argument to their .ctor's.
14003         (MemberBase.IsInterface): New public field.
14004
14005         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14006         instances instead of InterfaceMethod, InterfaceProperty, etc.
14007         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14008         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14009
14010 2004-03-19  Martin Baulig  <martin@ximian.com>
14011
14012         * class.cs (MethodCore.IsDuplicateImplementation): New private
14013         method which does the CS0111 checking.
14014         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14015         Use IsDuplicateImplementation().
14016
14017 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14018
14019         * decl.cs (FindMemberToOverride): New method to find the correct
14020         method or property to override in the base class.
14021         * class.cs
14022             - Make Method/Property use the above method to find the
14023               version in the base class.
14024             - Remove the InheritableMemberSignatureCompare as it is now
14025               dead code.
14026
14027         This patch makes large code bases much faster to compile, as it is
14028         O(n) rather than O(n^2) to do this validation.
14029
14030         Also, it fixes bug 52458 which is that nested classes are not
14031         taken into account when finding the base class member.
14032
14033         Reviewed/Approved by Martin.
14034
14035 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14036
14037         * interface.cs: In all interface classes removed redundant
14038         member initialization.
14039
14040 2004-03-16  Martin Baulig  <martin@ximian.com>
14041
14042         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14043
14044 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14045
14046         * decl.cs (DefineTypeAndParents): New helper method to define a
14047         type's containers before the type itself is defined;  This is a
14048         bug exposed by the recent changes to Windows.Forms when an
14049         implemented interface was defined inside a class that had not been
14050         built yet.   
14051
14052         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14053
14054         (Check): Loop correctly to report errors modifiers
14055         (UNSAFE was not in the loop, since it was the same as TOP).
14056
14057         * interface.cs: Every interface member now takes a ModFlags,
14058         instead of a "is_new" bool, which we set on the base MemberCore. 
14059
14060         Every place where we called "UnsafeOk" in the interface, now we
14061         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14062         the unsafe settings from the member declaration instead of the
14063         container interface. 
14064
14065         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14066
14067         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14068         `set_indexer_name' to the pending bits (one per type).
14069
14070         We fixed a bug today that was picking the wrong method to
14071         override, since for properties the existing InterfaceMethod code
14072         basically ignored the method name.  Now we make sure that the
14073         method name is one of the valid indexer names.
14074
14075 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14076  
14077         * support.cs (SeekableStreamReader): Keep track of stream byte
14078         positions and don't mix them with character offsets to the buffer.
14079
14080         Patch from Gustavo Giráldez
14081
14082 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14083
14084         * interface.cs (InterfaceSetGetBase): Removed double member
14085         initialization, base class does it as well.
14086
14087 2004-03-13  Martin Baulig  <martin@ximian.com>
14088
14089         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14090         when compiling corlib.
14091
14092 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * convert.cs (ExplicitConversion): We were reporting an error on
14095         certain conversions (object_type source to a value type, when the
14096         expression was `null') before we had a chance to pass it through
14097         the user defined conversions.
14098
14099         * driver.cs: Replace / and \ in resource specifications to dots.
14100         Fixes 50752
14101
14102         * class.cs: Add check for duplicate operators.  Fixes 52477
14103
14104 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14105
14106         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14107         that are in the middle of the statements, not only at the end.
14108         Fixes #54987
14109
14110         * class.cs (TypeContainer.AddField): No longer set the
14111         `HaveStaticConstructor' flag, now we call it
14112         `UserDefineStaticConstructor' to diferentiate the slightly
14113         semantic difference.
14114
14115         The situation is that we were not adding BeforeFieldInit (from
14116         Modifiers.TypeAttr) to classes that could have it.
14117         BeforeFieldInit should be set to classes that have no static
14118         constructor. 
14119
14120         See:
14121
14122         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14123
14124         And most importantly Zoltan's comment:
14125
14126         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14127
14128         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14129          before its static fields are used', i.e. initialization does not need
14130          to be triggered by the first access to the type. Setting this flag
14131          helps the JIT to compile better code, since it can run the static
14132          constructor at JIT time, and does not need to generate code to call it
14133          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14134          this flag for lots of classes like String. 
14135          
14136          csc sets this flag if the type does not have an explicit static 
14137          constructor. The reasoning seems to be that if there are only static
14138          initalizers for a type, and no static constructor, then the programmer
14139          does not care when this initialization happens, so beforefieldinit
14140          can be used.
14141          
14142          This bug prevents the AOT compiler from being usable, since it 
14143          generates so many calls to mono_runtime_class_init that the AOT code
14144          is much slower than the JITted code. The JITted code is faster, 
14145          because it does not generate these calls if the vtable is type is
14146          already initialized, which is true in the majority of cases. But the
14147          AOT compiler can't do this."
14148
14149 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * class.cs (MethodData.Emit): Refactor the code so symbolic
14152         information is generated for destructors;  For some reasons we
14153         were taking a code path that did not generate symbolic information
14154         before. 
14155
14156 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14157
14158         * class.cs: Create a Constructor.CheckBase method that
14159         takes care of all validation type code. The method
14160         contains some code that was moved from Define.
14161
14162         It also includes new code that checks for duplicate ctors.
14163         This fixes bug #55148.
14164
14165 2004-03-09  Joshua Tauberer <tauberer@for.net>
14166
14167         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14168         a { ... }-style array creation invokes EmitStaticInitializers
14169         which is not good for reference-type arrays.  String, decimal
14170         and now null constants (NullCast) are not counted toward
14171         static initializers.
14172
14173 2004-03-05  Martin Baulig  <martin@ximian.com>
14174
14175         * location.cs (SourceFile.HasLineDirective): New public field;
14176         specifies whether the file contains or is referenced by a "#line"
14177         directive.
14178         (Location.DefineSymbolDocuments): Ignore source files which
14179         either contain or are referenced by a "#line" directive.        
14180
14181 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14182
14183         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14184         direct access to our parent, so check the method inline there.
14185
14186 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14187
14188         * expression.cs (Invocation.EmitCall): Miguel's last commit
14189         caused a regression. If you had:
14190
14191             T t = null;
14192             t.Foo ();
14193
14194         In Foo the implict this would be null.
14195
14196 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * expression.cs (Invocation.EmitCall): If the method is not
14199         virtual, do not emit a CallVirt to it, use Call.
14200
14201         * typemanager.cs (GetFullNameSignature): Improve the method to
14202         cope with ".ctor" and replace it with the type name.
14203
14204         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14205         as an argument the ConstructorBuilder where it is being defined,
14206         to catch the recursive constructor invocations.
14207
14208 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14209
14210         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14211         routines to check if a type is an enumerable/enumerator allow
14212         classes that implement the IEnumerable or IEnumerator interfaces.
14213
14214         * class.cs (Property, Operator): Implement IIteratorContainer, and
14215         implement SetYields.
14216
14217         (Property.Define): Do the block swapping for get_methods in the
14218         context of iterators.   We need to check if Properties also
14219         include indexers or not.
14220
14221         (Operator): Assign the Block before invoking the
14222         OperatorMethod.Define, so we can trigger the Iterator code
14223         replacement. 
14224
14225         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14226         Property and Operator classes are not created when we parse the
14227         declarator but until we have the block completed, so we use a
14228         singleton SimpleIteratorContainer.Simple to flag whether the
14229         SetYields has been invoked.
14230
14231         We propagate this setting then to the Property or the Operator to
14232         allow the `yield' to function.
14233
14234 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14235
14236         * codegen.cs: Implemented attribute support for modules.
14237         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14238         Assembly/Module functionality.
14239
14240         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14241         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14242         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14243
14244 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14245
14246         * interface.cs (FindMembers): The operation is performed on all base
14247         interfaces and not only on the first. It is required for future CLS Compliance patch.
14248
14249 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14250
14251         * statement.cs, codegen.cs:
14252         This patch deals with patterns such as:
14253
14254         public class List : IEnumerable {
14255
14256                 public MyEnumerator GetEnumerator () {
14257                         return new MyEnumerator(this);
14258                 }
14259
14260                 IEnumerator IEnumerable.GetEnumerator () {
14261                         ...
14262                 }
14263                 
14264                 public struct MyEnumerator : IEnumerator {
14265                         ...
14266                 }
14267         }
14268
14269         Before, there were a few things we did wrong:
14270         1) we would emit callvirt on a struct, which is illegal
14271         2) we emited ldarg when we needed to emit ldarga
14272         3) we would mistakenly call the interface methods on an enumerator
14273         type that derived from IEnumerator and was in another assembly. For example:
14274
14275         public class MyEnumerator : IEnumerator
14276
14277         Would have the interface methods called, even if there were public impls of the
14278         method. In a struct, this lead to invalid IL code.
14279
14280 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14281
14282         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14283           renamed to Emit.
14284
14285         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14286
14287 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14288
14289         * cs-parser.jay: Fix small regression: we were not testing V2
14290         compiler features correctly.
14291
14292         * interface.cs: If the emit context is null, then create one
14293
14294 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14295
14296         * decl.cs (GetSignatureForError): New virtual method to get full name
14297           for error messages.
14298
14299         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14300           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14301
14302         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14303           Duplicated members and code in these classes has been removed.
14304           Better encapsulation in these classes.
14305
14306 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14307
14308         * assign.cs (Assign.DoResolve): When dealing with compound
14309         assignments, there is a new rule in ECMA C# 2.4 (might have been
14310         there before, but it is documented here) that states that in:
14311
14312         a op= b;
14313
14314         If b is of type int, and the `op' is a shift-operator, then the
14315         above is evaluated as:
14316
14317         a = (int) a op b 
14318
14319         * expression.cs (Binary.ResolveOperator): Instead of testing for
14320         int/uint/long/ulong, try to implicitly convert to any of those
14321         types and use that in pointer arithmetic.
14322
14323         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14324         method to print information for from the type, not from the
14325         null-method we were given.
14326
14327 2004-02-01  Duncan Mak  <duncan@ximian.com>
14328
14329         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14330         parsing for cmd, fixes bug #53694.
14331
14332 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14333
14334         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14335         in the member name duplication tests. Property and operator name duplication
14336         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14337
14338 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14339
14340         * interface.cs (PopulateMethod): Fixed crash when interface method
14341         returns not existing type (error test cs0246-3.cs).
14342
14343 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14344
14345         * cs-parser.jay (interface_accessors): Re-write actions to also
14346         store attributes attached to get and set methods. Fix spelling
14347         while at it.
14348
14349         (inteface_property_declaration): Modify accordingly.
14350
14351         (InterfaceAccessorInfo): New helper class to store information to pass
14352         around between rules that use interface_accessors.
14353
14354         * interface.cs (Emit): Apply attributes on the get and set
14355         accessors of properties and indexers too.
14356
14357         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14358         right MethodBuilder when applying attributes to the get and set accessors.
14359
14360 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14363
14364 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14367
14368 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14369
14370         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14371         changes that treat `yield' specially when present before `break'
14372         or `return' tokens.
14373
14374         * cs-tokenizer.cs: yield is no longer a keyword.
14375
14376 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14377
14378         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14379         setting for default constructors.
14380         For default constructors are almost every time set wrong Modifier. The
14381         generated IL code has been alright. But inside mcs this values was
14382         wrong and this was reason why several of my CLS Compliance tests
14383         failed.
14384
14385 2004-01-22  Martin Baulig  <martin@ximian.com>
14386
14387         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14388         not a QualifiedIdentifier.  This is what `type_name_expression'
14389         was previously doing.
14390         (type_name_expression): Removed; the code is now in
14391         `namespace_or_type_name'.
14392         (qualified_identifier): Removed, use `namespace_or_type_name'
14393         instead.
14394         (QualifiedIdentifier): Removed this class.      
14395
14396 2004-01-22  Martin Baulig  <martin@ximian.com>
14397
14398         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14399         not a string as alias name.
14400
14401 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14402
14403         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14404         #52730 bug, and instead compute correctly the need to use a
14405         temporary variable when requesting an address based on the
14406         static/instace modified of the field and the constructor.
14407  
14408 2004-01-21  Martin Baulig  <martin@ximian.com>
14409
14410         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14411         class and namespace before looking up aliases.  Fixes #52517.
14412
14413 2004-01-21  Martin Baulig  <martin@ximian.com>
14414
14415         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14416         assinged in a 'try'; fixes exception4.cs.
14417
14418 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14419         * class.cs : Implemented parameter-less constructor for TypeContainer
14420
14421         * decl.cs: Attributes are now stored here. New property OptAttributes
14422
14423         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14424
14425         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14426
14427 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14428
14429         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14430           (CSharpSignature): New method for indexer and property signature.
14431
14432 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14433
14434         * pending.cs (IsVirtualFilter): Faster implementation.
14435
14436 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14437
14438         * typemanager.cs: Avoid inclusion of same assembly more than once.
14439
14440 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14441
14442         * cs-parser.jay: Fixed problem where the last assembly attribute
14443           has been applied also to following declaration (class, struct, etc.)
14444           
14445 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14446
14447         * class.cs: Added error CS0538, CS0539 reporting.
14448         Fixed crash on Microsoft runtime when field type is void.
14449
14450         * cs-parser.jay: Added error CS0537 reporting.
14451
14452         * pending.cs: Added error CS0535 reporting.
14453         Improved error report for errors CS0536, CS0534.
14454
14455 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14456
14457         Merge a few bits from the Anonymous Method MCS tree.
14458
14459         * statement.cs (ToplevelBlock): New class for toplevel methods,
14460         will hold anonymous methods, lifted variables.
14461
14462         * cs-parser.jay: Create toplevel blocks for delegates and for
14463         regular blocks of code. 
14464
14465 2004-01-20  Martin Baulig  <martin@ximian.com>
14466
14467         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14468         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14469         and `NeedExplicitReturn'; added `IsLastStatement'.
14470         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14471         have a `ReturnLabel' or we're not unreachable.
14472
14473         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14474         child's reachability; don't just override ours with it.  Fixes
14475         #58058 (lluis's example).
14476         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14477         InFinally(), InLoop(), InSwitch() and
14478         BreakCrossesTryCatchBoundary() methods.
14479
14480         * statement.cs (Return): Do all error checking in Resolve().
14481         Unless we are the last statement in a top-level block, always
14482         create a return label and jump to it.
14483         (Break, Continue): Do all error checking in Resolve(); also make
14484         sure we aren't leaving a `finally'.
14485         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14486         statement in a top-level block.
14487         (Block.Flags): Added `IsDestructor'.
14488         (Block.IsDestructor): New public property.
14489
14490 2004-01-20  Martin Baulig  <martin@ximian.com>
14491
14492         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14493
14494 2004-01-20  Martin Baulig  <martin@ximian.com>
14495
14496         * statement.cs (Statement.ResolveUnreachable): New public method.
14497         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14498         (Block.Resolve): Resolve unreachable statements.
14499
14500 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14501
14502         * expression.cs: We need to fix the case where we do
14503         not have a temp variable here.
14504
14505         * assign.cs: Only expression compound assignments need
14506         temporary variables.
14507
14508 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14509
14510         * flowanalysis.cs: Reduce memory allocation in a few ways:
14511           - A block with no variables should not allocate a bit
14512             vector for itself.
14513           - A method with no out parameters does not need any tracking
14514             for assignment of the parameters, so we need not allocate
14515             any data for it.
14516           - The arrays:
14517                 public readonly Type[] VariableTypes;
14518                 public readonly string[] VariableNames;
14519             Are redundant. The data is already stored in the variable
14520             map, so we need not allocate another array for it.
14521           - We need to add alot of checks for if (params | locals) == null
14522             due to the first two changes.
14523
14524 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
14525
14526         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14527         implement IMemoryLocation, we store a copy on a local variable and
14528         take the address of it.  Patch from Benjamin Jemlich
14529
14530         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14531         to use a special "type_name_expression" rule which reduces the
14532         number of "QualifiedIdentifier" classes created, and instead
14533         directly creates MemberAccess expressions.
14534
14535 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14538         that fixes #52853.  Null literal assignment to ValueType
14539
14540         * class.cs (MethodData.Emit): Instead of checking the name of the
14541         method to determine if its a destructor, create a new derived
14542         class from Method called Destructor, and test for that.  
14543
14544         * cs-parser.jay: Create a Destructor object instead of a Method.  
14545
14546         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14547
14548         Fixes: 52933
14549
14550 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14551
14552         * expression.cs (Binary.ResolveOperator): Perform an implicit
14553         conversion from MethodGroups to their delegate types on the
14554         Addition operation.
14555
14556         * delegate.cs: Introduce a new class DelegateCreation that is the
14557         base class for `NewDelegate' and `ImplicitDelegateCreation',
14558         factor some code in here.
14559
14560         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14561         conversion from MethodGroups to compatible delegate types. 
14562
14563         * ecore.cs (Expression.Resolve): Do not flag error 654
14564         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14565         we allow conversions from MethodGroups to delegate types now.
14566
14567         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14568         assignments in v2 either.
14569
14570 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
14571
14572         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14573         static read-only fields in ctors.
14574
14575         Applied patch from Benjamin Jemlich 
14576
14577         * expression.cs (UnaryMutator): Avoid leaking local variables. 
14578
14579 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
14580
14581         * cs-tokenizer.cs (IsCastToken): Allow the various native types
14582         here to return true, as they can be used like this:
14583
14584                 (XXX) int.MEMBER ()
14585
14586         Fixed 49836 and all the other dups
14587
14588 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
14589
14590         * driver.cs: Implement /win32res and /win32icon.
14591
14592 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
14593
14594         * cs-parser.jay: Add a rule to improve error handling for the
14595         common mistake of placing modifiers after the type.
14596
14597 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
14598
14599         * cs-parser.jay (interface_event_declaration): Catch
14600         initialization of events on interfaces, and report cs0068
14601
14602         * cs-parser.jay (interface_event_declaration): Catch
14603         initialization of events. 
14604
14605         * ecore.cs: Better report missing constructors.
14606
14607         * expression.cs (Binary.ResolveOperator): My previous bug fix had
14608         the error reporting done in the wrong place.  Fix.
14609
14610         * expression.cs (Binary.ResolveOperator): Catch the 
14611         operator + (E x, E y) error earlier, and later allow for implicit
14612         conversions in operator +/- (E e, U x) from U to the underlying
14613         type of E.
14614
14615         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14616         52596, if the container class is abstract, the default constructor
14617         is protected otherwise its public (before, we were always public).
14618
14619         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14620         fixed statement.
14621
14622         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14623         Jemlich that fixes bug #52597, MCS was generating invalid code for
14624         idisposable structs.   Thanks to Ben for following up with this
14625         bug as well.
14626
14627 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
14628
14629         * driver.cs: Allow assemblies without code to be generated, fixes
14630         52230.
14631
14632 2004-01-07  Nick Drochak <ndrochak@gol.com>
14633
14634         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14635
14636 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * cs-parser.jay: Add rules to improve error reporting if fields or
14639         methods are declared at the namespace level (error 116)
14640
14641         * Add rules to catch event add/remove
14642
14643 2004-01-04  David Sheldon <dave-mono@earth.li>
14644
14645   * expression.cs: Added matching ")" to error message for 
14646   CS0077
14647
14648 2004-01-03 Todd Berman <tberman@gentoo.org>
14649
14650         * ecore.cs, attribute.cs:
14651         Applying fix from #52429.
14652
14653 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14654
14655         * ecore.cs, expression.cs, statement.cs:
14656         Total rewrite of how we handle branching. We
14657         now handle complex boolean expressions with fewer
14658         jumps. As well if (x == 0) no longer emits a ceq.
14659
14660         if (x is Foo) is much faster now, because we generate
14661         better code.
14662
14663         Overall, we get a pretty big improvement on our benchmark
14664         tests. The code we generate is smaller and more readable.
14665
14666         I did a full two-stage bootstrap. The patch was reviewed
14667         by Martin and Miguel.
14668
14669 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14670
14671         * cs-parser.jay: Make primary_expression not take a QI.
14672         we dont need this because the member_access rule covers
14673         us here. So we replace the rule with just IDENTIFIER.
14674
14675         This has two good effects. First, we remove a s/r conflict.
14676         Second, we allocate many fewer QualifiedIdentifier objects.
14677
14678 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14679
14680         * attribute.cs: Handle MarshalAs attributes as pseudo, and
14681         set the correct information via SRE. This prevents
14682         hanging on the MS runtime. Fixes #29374.
14683
14684 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14685
14686         * convert.cs: correctly handle conversions to value types
14687         from Enum and ValueType as unboxing conversions.
14688
14689         Fixes bug #52569. Patch by Benjamin Jemlich.
14690
14691 2004-01-02  Ravi Pratap  <ravi@ximian.com>
14692
14693         * expression.cs (BetterConversion): Prefer int -> uint
14694         over int -> ulong (csc's behaviour). This fixed bug #52046.
14695
14696 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14697
14698         * decl.cs (MemberCache.FindMembers): now returns a
14699         MemberInfo [].
14700
14701         * typemanager.cs: In general, go with with ^^.
14702         (CopyNewMethods): take an IList.
14703         (RealMemberLookup): Only allocate an arraylist
14704         if we copy from two sets of methods.
14705
14706         This change basically does two things:
14707         1) Fewer array lists allocated due to CopyNewMethods.
14708         2) the explicit cast in MemberList costed ALOT.
14709
14710 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
14711
14712         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14713         a hashtable to avoid needless string allocations when an identifier is
14714         used more than once (the common case).
14715
14716 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14717
14718         * pending.cs: MS's TypeBuilder.GetInterfaces ()
14719         is broken, it will not return anything. So, we
14720         have to use the information we have in mcs to
14721         do the task.
14722
14723         * typemanager.cs: Add a cache for GetInterfaces,
14724         since this will now be used more often (due to ^^)
14725
14726         (GetExplicitInterfaces) New method that gets the
14727         declared, not effective, interfaces on a type
14728         builder (eg, if you have interface IFoo, interface
14729         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14730         { IBar }.
14731
14732         This patch makes MCS able to bootstrap itself on
14733         Windows again.
14734
14735 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14736
14737         * expression.cs: Remove the Nop's that Miguel put
14738         in by mistake.
14739
14740 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14741
14742         * report.cs, codegen.cs: Give the real stack trace to
14743         the error when an exception is thrown.
14744
14745 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14746
14747         * decl.cs: only allocate hashtables for ifaces if 
14748         it is an iface!
14749
14750 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14751
14752         * expression.cs: fix the error from cs0121-2.cs
14753         (a parent interface has two child interfaces that
14754         have a function with the same name and 0 params
14755         and the function is called through the parent).
14756
14757 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14758
14759         * class.cs, rootcontext.cs, typmanager.cs: do not
14760         leak pointers.
14761
14762 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14763
14764         * codegen.cs: remove stack for the ec flow branching.
14765         It is already a linked list, so no need.
14766
14767 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14768
14769         * Makefile: Allow custom profiler here.
14770
14771 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
14772
14773         * typemanager.cs (LookupType):
14774           - Use a static char [], because split takes
14775             a param array for args, so it was allocating
14776             every time.
14777           - Do not store true in a hashtable, it boxes.
14778
14779 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
14780
14781         * flowanalysis.cs: bytify common enums.
14782
14783 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14784
14785         * modifiers.cs: Add a new set of flags for the
14786         flags allowed on explicit interface impls.
14787         * cs-parser.jay: catch the use of modifiers in
14788         interfaces correctly.
14789         * class.cs: catch private void IFoo.Blah ().
14790
14791         All related to bug #50572.
14792
14793 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14794
14795         * decl.cs: Rewrite the consistant accessability checking.
14796         Accessability is not linear, it must be implemented in
14797         a tableish way. Fixes #49704.
14798
14799 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14800
14801         * expression.cs: Handle negation in a checked context.
14802         We must use subtraction from zero. Fixes #38674.
14803
14804 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14805
14806         * class.cs: Ignore static void main in DLLs.
14807         * rootcontext.cs: Handle the target type here,
14808         since we are have to access it from class.cs
14809         * driver.cs: account for the above.
14810
14811 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14812
14813         * report.cs: Give line numbers and files if available.
14814
14815 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
14816
14817         * driver.cs: Implement /addmodule.
14818
14819         * typemanager.cs:  Change 'modules' field so it now contains Modules not
14820         ModuleBuilders.
14821
14822 2003-12-20  Martin Baulig  <martin@ximian.com>
14823
14824         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
14825         (FieldBase.IsAssigned): Removed this field.
14826         (FieldBase.SetAssigned): New public method.
14827         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
14828
14829 2003-12-20  Martin Baulig  <martin@ximian.com>
14830
14831         * expression.cs (LocalVariableReference.DoResolve): Don't set
14832         `vi.Used' if we're called from DoResolveLValue().
14833
14834         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
14835         returns the usage vector it just merged into the current one -
14836         pass this one to UsageWarning().
14837         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
14838         of the `EmitContext', don't call this recursively on our children.
14839
14840 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
14841
14842         * driver.cs: Implement /target:module.
14843
14844 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
14845
14846         * support.cs (CharArrayHashtable): New helper class.
14847
14848         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
14849         char arrays, not strings, so we can avoid creating a string in
14850         consume_identifier if the identifier is a keyword.
14851
14852 2003-12-16  Martin Baulig  <martin@ximian.com>
14853
14854         * statement.cs (LocalInfo.Assigned): Removed this property.
14855         (LocalInfo.Flags): Removed `Assigned'.
14856         (LocalInfo.IsAssigned): New public method; takes the EmitContext
14857         and uses flow analysis.
14858         (Block.UsageWarning): Made this method private.
14859         (Block.Resolve): Call UsageWarning() if appropriate.
14860
14861         * expression.cs (LocalVariableReference.DoResolve): Always set
14862         LocalInfo.Used here.
14863
14864 2003-12-13  Martin Baulig  <martin@ximian.com>
14865
14866         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
14867         any value here; we're now using flow analysis to figure out
14868         whether a statement/block returns a value.
14869
14870 2003-12-13  Martin Baulig  <martin@ximian.com>
14871
14872         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
14873         working again.
14874         (FlowBranching.MergeFinally): Don't call
14875         `branching.CheckOutParameters()' here, this is called in
14876         MergeTopBlock().
14877         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
14878         when adding the `finally' vector.       
14879
14880 2003-12-13  Martin Baulig  <martin@ximian.com>
14881
14882         * flowanalysis.cs
14883         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
14884         actually work and also fix #48962.
14885
14886 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14887
14888         * decl.cs: Do not check System.Object for nested types,
14889         since we know it does not have any. Big bang for buck:
14890
14891         BEFORE:
14892            Run 1:   8.35 seconds
14893            Run 2:   8.32 seconds
14894            corlib:  17.99 seconds
14895         AFTER:
14896            Run 1:   8.17 seconds
14897            Run 2:   8.17 seconds
14898            corlib:  17.39 seconds
14899
14900 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14901
14902         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
14903         time we are returning 0 members, so we save alot here.
14904
14905 2003-12-11  Martin Baulig  <martin@ximian.com>
14906
14907         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
14908         `MergeChild()', also just take the `FlowBranching' as argument;
14909         call Merge() on it and return the result.
14910         (FlowBranching.Merge): We don't need to do anything if we just
14911         have one sibling.
14912
14913 2003-12-11  Martin Baulig  <martin@ximian.com>
14914
14915         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
14916         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
14917         Maurer for this idea.
14918
14919 2003-12-11  Martin Baulig  <martin@ximian.com>
14920
14921         * flowanalysis.cs (MergeResult): This class is now gone; we now
14922         use the `UsageVector' for this.  The reason for this is that if a
14923         branching just has one sibling, we don't need to "merge" them at
14924         all - that's the next step to do.
14925         (FlowBranching.Merge): We now return a `UsageVector' instead of a
14926         `MergeResult'.
14927
14928 2003-12-11  Martin Baulig  <martin@ximian.com>
14929
14930         Reworked flow analyis and made it more precise and bug-free.  The
14931         most important change is that we're now using a special `Reachability'
14932         class instead of having "magic" meanings of `FlowReturns'.  I'll
14933         do some more cleanups and optimizations and also add some more
14934         documentation this week.
14935
14936         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
14937         largely reworked this class.
14938         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
14939         the new `Reachability' class instead of having "magic" values here.
14940         (FlowBranching): We're now using an instance of `Reachability'
14941         instead of having separate `Returns', `Breaks' etc. fields.
14942
14943         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
14944         based on flow analysis; ignore the return value of block.Emit ().
14945
14946 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
14947
14948         * driver.cs typemanager.cs: Find the mono extensions to corlib even
14949         if they are private.
14950
14951 2003-12-09  Martin Baulig  <martin@ximian.com>
14952
14953         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
14954         call them directly on the UsageVector.
14955
14956 2003-12-09  Martin Baulig  <martin@ximian.com>
14957
14958         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
14959         Changed return type from `FlowReturns' to `Reachability'.
14960
14961 2003-12-09  Martin Baulig  <martin@ximian.com>
14962
14963         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
14964         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
14965         `Reachable' fields with a single `Reachability' one.
14966
14967 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
14968
14969         * class.cs (FindMembers): Remove foreach's.
14970
14971         Bootstrap times:
14972
14973         BEFORE
14974                 Run 1:   8.74 seconds
14975                 Run 2:   8.71 seconds
14976
14977         AFTER
14978                 Run 1:   8.64 seconds
14979                 Run 2:   8.58 seconds
14980
14981
14982 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
14983
14984         * cs-parser.jay:
14985         * gen-treedump.cs:
14986         * statement.cs:
14987         This patch does a few things:
14988                 1. EmptyStatement is now a singleton, so it is never reallocated.
14989                 2. All blah is EmptyStatement constructs have been changed to
14990                    blah == EmptyStatement.Value, which is much faster and valid
14991                    now that EmptyStatement is a singleton.
14992                 3. When resolving a block, rather than allocating a new array for
14993                    the non-empty statements, empty statements are replaced with
14994                    EmptyStatement.Value
14995                 4. Some recursive functions have been made non-recursive.
14996         Mainly the performance impact is from (3), however (1) and (2) are needed for
14997         this to work. (4) does not make a big difference in normal situations, however
14998         it makes the profile look saner.
14999
15000         Bootstrap times:
15001
15002         BEFORE
15003         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15004         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15005         Total memory allocated: 56397 KB
15006
15007         AFTER
15008         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15009         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15010         Total memory allocated: 55666 KB
15011
15012 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15013
15014         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15015         than the hashtable in a hashtable version
15016
15017         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15018         we always end up concating a string. This results in a huge perf
15019         loss, because many strings have to be tracked by the GC. In this
15020         patch, we first use a hashtable that works with two keys, so that
15021         the strings do not need to be concat'ed.
15022
15023         Bootstrap times:
15024         BEFORE
15025                 Run 1:   8.74 seconds
15026                 Run 2:   8.71 seconds
15027
15028         AFTER
15029                 Run 1:   8.65 seconds
15030                 Run 2:   8.56 seconds
15031
15032 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15033
15034         * Makefile: Add a new target `do-time' that does a quick and simple
15035         profile, leaving easy to parse output.
15036
15037 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15038
15039         * codegen.cs (Init): Create the dynamic assembly with 
15040         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15041
15042 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15043
15044         * support.cs: Make the PtrHashtable use only one
15045         instance of its comparer.
15046
15047 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15048
15049         * typemanager.cs: Fix lookup of GetNamespaces.
15050
15051 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * expression.cs: Removed redundant line.
15054
15055         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15056         ArrayLists, use for loops with bounds.  
15057
15058         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15059         arraylist.
15060
15061         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15062         arraylists, use for loop with bounds.
15063
15064         The above three changes give us a 0.071 second performance
15065         improvement out of 3.294 seconds down to 3.223.  On my machine
15066         the above changes reduced the memory usage by 1,387 KB during
15067         compiler bootstrap.
15068
15069         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15070         QualifiedIdentifiers.  Before we created a new string through
15071         concatenation, and mostly later on, the result would be
15072         manipulated by DecomposeQI through string manipulation.
15073
15074         This reduced the compiler memory usage for bootstrapping from
15075         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15076         compile times in 0.05 seconds.
15077
15078 2003-11-28  Dick Porter  <dick@ximian.com>
15079
15080         * support.cs: Do string compares with the Invariant culture.
15081
15082         * rootcontext.cs: 
15083         * gen-treedump.cs: 
15084         * expression.cs: 
15085         * driver.cs: 
15086         * decl.cs: 
15087         * codegen.cs: 
15088         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15089         the comparison is done with the Invariant culture.
15090
15091 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15092
15093         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15094         GetEnumerator method.
15095
15096         (ProbeCollectionType): Iterate starting at the most specific type
15097         upwards looking for a GetEnumerator
15098
15099         * expression.cs: Shift count can be up to 31 for int/uint and 63
15100         for long/ulong.
15101
15102 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * statement.cs (Block.LookupLabel): Also look for the label on the
15105         children blocks.  Use a hash table to keep track of visited
15106         nodes. 
15107
15108         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15109         we actually did transform the other operand, otherwise fall back
15110         to the common codepath that casts to long.
15111
15112         * cs-tokenizer.cs: Use the same code pattern as the int case.
15113         Maybe I should do the parsing myself, and avoid depending on the
15114         Parse routines to get this done.
15115
15116 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15119         which fixes bug 51347.  This time test it.
15120
15121         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15122         attributes for example can not tell the difference between these.
15123         The difference was only a syntax feature of the language. 
15124
15125         * attribute.cs: Apply attributes to delegates.
15126
15127         * delegate.cs: Call the apply attributes method.
15128
15129 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15130
15131         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15132         comparing 0 vs Byte.MinValue, not the value
15133
15134         (ImplicitConversionRequired): When reporting a conversion error,
15135         use error 31 to print out the constant error instead of the
15136         simpler 29.
15137
15138         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15139         which fixes bug 51347.
15140
15141 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15144         which fixes the -warnaserror command line option.
15145
15146 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * cfold.cs (DoNumericPromotions): During constant folding of
15149         additions on UIntConstant, special case intconstants with
15150         IntConstants like we do on the expression binary operator. 
15151
15152 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * convert.cs (ImplicitReferenceConversion): We were missing a case
15155         (System.Enum are not value types or class types, so we need to
15156         classify them separatedly).
15157
15158         * driver.cs: We do not support error 2007.
15159
15160 2003-11-12 Jackson Harper <jackson@ximian.com>
15161
15162         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15163         system directory. Also use the full file name so users can
15164         libraries names mscorlib-o-tron.dll in a non system dir.
15165
15166 2003-11-10  Martin Baulig  <martin@ximian.com>
15167
15168         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15169         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15170         calling `ResolveType()' on them, directly assign their `Type'.
15171
15172 2003-11-08  Martin Baulig  <martin@ximian.com>
15173
15174         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15175         return value and the `out parent' parameter.
15176         (TypeContainer.DefineType): Moved the CS0644 check into
15177         GetClassBases().  Don't pass the interface types to the
15178         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15179         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15180
15181         * ecore.cs (TypeExpr.IsAttribute): New property.
15182         (TypeExpr.GetInterfaces): New method.
15183
15184         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15185         TypeExpr instead of a Type.
15186         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15187         (Interface.DefineType): Don't pass the interface types to the
15188         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15189         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15190
15191         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15192         instead of a `Type[]'.
15193         (TypeManager.RegisterBuilder): Likewise.
15194         (TypeManager.AddUserInterface): Likewise.
15195         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15196         `Type[]' and also return a `TypeExpr[]'.
15197         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15198
15199 2003-11-08  Martin Baulig  <martin@ximian.com>
15200
15201         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15202         Expression.     
15203
15204 2003-11-08  Martin Baulig  <martin@ximian.com>
15205
15206         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15207         TypeManager.ResolveExpressionTypes().
15208
15209         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15210         instead of an Expression.
15211         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15212         (TypeExpression): New public class; formerly known as `TypeExpr'.
15213
15214         * expression.cs (ComposedCast): Derive from TypeExpr.
15215
15216         * typemanager.cs (TypeManager.system_*_expr): These are now
15217         TypExpr's instead of Expression's.
15218         (TypeManager.ResolveExpressionTypes): New public static function;
15219         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15220         of them.        
15221
15222 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * expression.cs (New.DoResolve): Do not dereference value that
15225         might be a null return.
15226
15227         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15228         sure that the constant value has the right type.  Fixes an
15229         unreported bug, similar to 50425.
15230
15231         * const.cs (Const.LookupConstantValue): Call
15232         ImplicitStandardConversionExists before doing a conversion to
15233         avoid havng the TypeManager.ChangeType do conversions.
15234
15235         Reduced the number of casts used
15236
15237         (Const.ChangeType): New routine to enable reuse of the constant
15238         type changing code from statement.
15239
15240         * typemanager.cs (ChangeType): Move common initialization to
15241         static global variables.
15242
15243         Fixes #50425.
15244
15245         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15246         every value type to go through, even if it was void.  Fix that. 
15247
15248         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15249         character of the define, and the is_identifier_part_character for
15250         the rest of the string.
15251
15252 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15253
15254         * expression.cs (UnaryMutator.EmitCode): When I updated
15255         LocalVariableReference.DoResolve, I overdid it, and dropped an
15256         optimization done on local variable references.
15257
15258 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15259
15260         * ecore.cs: Convert the return from Ldlen into an int.
15261
15262 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15263
15264         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15265         the accessibility, this is a special case for toplevel non-public
15266         classes (internal for instance).
15267
15268 2003-10-20  Nick Drochak <ndrochak@gol.com>
15269
15270         * ecore.cs: Fix typo and build.  Needed another right paren.
15271
15272 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15273
15274         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15275         `internal' case regular and protected, but not allowing protected
15276         to be evaluated later.  Bug 49840
15277
15278 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15281         to kb.Nlast, and not the kb.nFirst to isolate the switch
15282         statement.
15283
15284         Extract the underlying type, so enumerations of long/ulong are
15285         treated like long/ulong.
15286
15287 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15288
15289         * expression.cs (New): Overload the meaning of RequestedType to
15290         track the possible creation of the NewDelegate type, since
15291         DoResolve is invoked more than once for new constructors on field
15292         initialization.
15293
15294         See bugs: #48800 and #37014
15295
15296         * cs-parser.jay (declare_local_constants): Take an arraylist
15297         instead of a single constant.
15298
15299         (local_constant_declaration): It should take a
15300         constant_declarators, not a constant_declarator.  Fixes 49487
15301
15302         * convert.cs: Fix error report.
15303
15304 2003-10-13 Jackson Harper <jackson@ximian.com>
15305
15306         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15307         bug #49611
15308
15309 2003-10-09  Martin Baulig  <martin@ximian.com>
15310
15311         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15312         to the .ctor.
15313         (MethodCore.DoDefineParameters): Removed the TypeContainer
15314         argument; use the DeclSpace which was passed to the .ctor instead.
15315         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15316         TypeContainer; we only need a DeclSpace here.
15317
15318 2003-10-09  Martin Baulig  <martin@ximian.com>
15319
15320         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15321         to the .ctor.
15322         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15323         EmitContext's .ctor.    
15324
15325 2003-10-09  Martin Baulig  <martin@ximian.com>
15326
15327         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15328         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15329         AsAccessible(), moved them as well.
15330
15331         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15332
15333 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15334
15335         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15336
15337 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15340         generation for >=, as spotted by Paolo, bug 48679.  
15341         Patch from David Waite.
15342
15343         * cs-tokenizer.cs: Add handling for #pragma.
15344
15345         * cs-parser.jay: Allow for both yield and yield return in the
15346         syntax.  The anti-cobolization of C# fight will go on!
15347
15348         * class.cs (TypeBuilder.DefineType): Catch error condition here
15349         (Parent.DefineType erroring out and returning null).
15350
15351         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15352         coping with enumerations variables, we were mistakenly processing
15353         them as a regular value type instead of built-in types.  Fixes the
15354         bug #48063
15355
15356         * typemanager.cs (IsBuiltinOrEnum): New method.
15357
15358 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * cs-parser.jay: Upgrade: yield now needs the return clause.
15361
15362 2003-09-19  Martin Baulig  <martin@ximian.com>
15363
15364         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15365         `MemberCache parent' argument.  Normally, an interface doesn't
15366         have a parent type except System.Object, but we use this in gmcs
15367         for generic type parameters.
15368
15369 2003-09-18  Martin Baulig  <martin@ximian.com>
15370
15371         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15372         on `type.IsInterface'; don't check whether the type has a parent
15373         to determine whether it's an interface.
15374
15375 2003-09-15  Martin Baulig  <martin@ximian.com>
15376
15377         * class.cs (TypeContainer.DefineType): Added an error flag to
15378         avoid reporting duplicate CS0146's ("class definition is
15379         circular.").
15380
15381         * driver.cs (Driver.MainDriver): Abort if
15382         RootContext.ResolveTree() reported any errors.
15383
15384 2003-09-07  Martin Baulig  <martin@ximian.com>
15385
15386         * report.cs (Error, Warning): Added overloaded versions which take
15387         a `params object[] args' and call String.Format().
15388
15389 2003-09-07  Martin Baulig  <martin@ximian.com>
15390
15391         * decl.cs (DeclSpace..ctor): Don't call
15392         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15393         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15394         (DeclSpace.RecordDecl): New method.
15395
15396         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15397
15398 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15399
15400         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15401         value attributes to be applied to ParameterBuilders.
15402
15403         * class.cs (MethodCore.LabelParameters): Make static and more
15404         generic so that it can be used from other places - like interface
15405         methods, for instance.
15406
15407         * interface.cs (Interface.Emit): Call LabelParameters before
15408         emitting attributes on the InterfaceMethod.
15409
15410 2003-08-26  Martin Baulig  <martin@ximian.com>
15411
15412         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15413         resolving aliases; fixes #47927.
15414
15415 2003-08-26  Martin Baulig  <martin@ximian.com>
15416
15417         * statement.cs (Using.DoResolve): This is internally emitting a
15418         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15419         do not always return.  Fixes #47681.
15420
15421 2003-08-26  Martin Baulig  <martin@ximian.com>
15422
15423         * decl.cs (MemberCore): Moved WarningNotHiding(),
15424         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15425         into MemberBase.
15426         (AdditionResult): Make this nested in DeclSpace.
15427         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15428         argument; call NamespaceEntry.Define() unless we're nested in a
15429         class or struct.
15430
15431         * namespace.cs (Namespace.DefineName): New public function.  This
15432         is called from DeclSpace's .ctor to add 
15433         (Namespace.Lookup): Include DeclSpaces in the lookup.
15434
15435         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15436
15437         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15438
15439 2003-08-25  Martin Baulig  <martin@ximian.com>
15440
15441         * convert.cs (Convert.ExplicitReferenceConversion): When
15442         converting from an interface type to a class, unbox if the target
15443         type is a struct type.  Fixes #47822.
15444
15445 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15446
15447         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15448         #47854.
15449
15450 2003-08-22  Martin Baulig  <martin@ximian.com>
15451
15452         * class.cs (TypeManager.DefineType): When defining a nested type,
15453         call DefineType() on our parent; fixes #47801.
15454
15455 2003-08-22  Martin Baulig  <martin@ximian.com>
15456
15457         * class.cs (MethodData.Define): While checking if a method is an
15458         interface implementation, improve the test a bit more to fix #47654.
15459
15460 2003-08-22  Martin Baulig  <martin@ximian.com>
15461
15462         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15463         correctly; fixes #47722.
15464
15465 2003-08-22  Martin Baulig  <martin@ximian.com>
15466
15467         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15468         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15469
15470         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15471
15472 2003-08-22  Martin Baulig  <martin@ximian.com>
15473
15474         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15475         can only be assigned in static constructors.  Fixes #47161.
15476
15477 2003-08-22  Martin Baulig  <martin@ximian.com>
15478
15479         Rewrote and improved the flow analysis code.
15480
15481         * flowbranching.cs (FlowBranching): Make this class abstract.
15482         (FlowBranching.CreateBranching): New static function to create a
15483         new flow branching.
15484         (FlowBranchingBlock, FlowBranchingException): New classes.
15485         (FlowBranching.UsageVector.Type): New public readonly field.
15486         (FlowBranching.UsageVector.Breaks): Removed the setter.
15487         (FlowBranching.UsageVector.Returns): Removed the setter.
15488         (FlowBranching.UsageVector): Added Break(), Return(),
15489         NeverReachable() and Throw() methods to modify the reachability.
15490         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15491         done by FlowBranching.Merge().
15492         (FlowBranching.UsageVector.MergeChild): New method; merges the
15493         merge result into the current vector.
15494         (FlowBranching.Merge): New abstract method to merge a branching.
15495
15496 2003-08-12  Martin Baulig  <martin@ximian.com>
15497
15498         * expression.cs (Indirection.CacheTemporaries): Create the
15499         LocalTemporary with the pointer type, not its element type.
15500
15501 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15504         token was a keyword or not.
15505
15506         Add `error' options where an IDENTIFIER was expected;  Provide
15507         CheckToken and CheckIdentifierToken convenience error reporting
15508         functions. 
15509
15510         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15511
15512         * decl.cs: Rename `NamespaceEntry Namespace' public field into
15513         NameSpaceEntry NameSpaceEntry.
15514
15515         (LookupInterfaceOrClass): Avoid creating a full qualified name
15516         from namespace and name: avoid doing lookups when we know the
15517         namespace is non-existant.   Use new Tree.LookupByNamespace which
15518         looks up DeclSpaces based on their namespace, name pair.
15519
15520         * driver.cs: Provide a new `parser verbose' to display the
15521         exception thrown during parsing.  This is turned off by default
15522         now, so the output of a failure from mcs is more graceful.
15523
15524         * namespace.cs: Track all the namespaces defined in a hashtable
15525         for quick lookup.
15526
15527         (IsNamespace): New method
15528
15529 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
15532         we know that we need to concatenate (full typename can never be
15533         null). 
15534
15535         * class.cs: ditto.
15536
15537         * statement.cs: Use a bitfield;  Do not initialize to null things
15538         which are done by the constructor by default.
15539
15540         * cs-parser.jay: bug fix, parameter was 4, not 3.
15541
15542         * expression.cs: Just use the property;
15543
15544         * statement.cs: No need for GetVariableInfo method.
15545
15546 2003-08-08  Martin Baulig  <martin@ximian.com>
15547
15548         * flowanalysis.cs (FlowReturns): This is now nested in the
15549         `FlowBranching' class.
15550         (MyBitVector): Moved this here from statement.cs.
15551         (FlowBranching.SiblingType): New enum type.
15552         (FlowBranching.CreateSibling): Added `SiblingType' argument.
15553
15554 2003-08-07  Martin Baulig  <martin@ximian.com>
15555
15556         * flowanalysis.cs (FlowBranchingType): This is now nested in the
15557         `FlowBranching' class and called `BranchingType'.
15558
15559 2003-08-07  Martin Baulig  <martin@ximian.com>
15560
15561         * flowanalysis.cs: Moved all the control flow analysis code into
15562         its own file.
15563
15564 2003-08-07  Martin Baulig  <martin@ximian.com>
15565
15566         * assign.cs (Assign.DoResolve): `target' must either be an
15567         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
15568         #37319.
15569
15570 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * expression.cs (BinaryMethod): This kind of expression is created by the
15573         Binary class if it determines that the operator has to be handled
15574         by a method.
15575
15576         (BinaryDelegate): This kind of expression is created if we are
15577         dealing with a + or - operator on delegates.
15578
15579         (Binary): remove method, argumetns, and DelegateOperator: when
15580         dealing with methods, 
15581
15582         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15583
15584         * statement.cs (Block): use bitfields for the three extra booleans
15585         we had in use.   Remove unused topblock parameter.
15586
15587         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15588
15589         * assign.cs: Drop extra unneeded tests.
15590
15591 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15594
15595         * statement.cs (Foreach): Use VariableStorage instead of
15596         LocalBuilders.   
15597
15598         * codegen.cs (VariableStorage): New class used by clients that
15599         require a variable stored: locals or fields for variables that
15600         need to live across yield.
15601
15602         Maybe provide a convenience api for EmitThis+EmitLoad?
15603
15604         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15605         these bad boys.
15606
15607 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15610         RemapParameterLValue): New methods that are used to turn a
15611         precomputed FieldInfo into an expression like this:
15612
15613                 instance.FieldInfo
15614
15615         The idea is to use this instead of making LocalVariableReference
15616         have more than one meaning.
15617
15618         * cs-parser.jay: Add error production to BASE.
15619
15620         * ecore.cs: Deal with TypeManager.GetField returning null, which
15621         is now a valid return value.
15622
15623         (FieldExprNoAddress): New expression for Fields whose address can
15624         not be taken.
15625
15626         * expression.cs (LocalVariableReference): During the resolve
15627         phases, create new expressions if we are in a remapping context.
15628         Remove code that dealt with remapping here.
15629
15630         (ParameterReference): same.
15631
15632         (ProxyInstance): New expression, like the `This' expression, but
15633         it is born fully resolved.  We know what we are doing, so remove
15634         the errors that are targeted to user-provided uses of `this'.
15635
15636         * statement.cs (Foreach): our variable is now stored as an
15637         Expression;  During resolution, follow the protocol, dont just
15638         assume it will return this.
15639
15640 2003-08-06  Martin Baulig  <martin@ximian.com>
15641
15642         * support.cs (SeekableStreamReader.cs): New public class.
15643
15644         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15645         SeekableStreamReader instead of the normal StreamReader.
15646
15647 2003-08-04  Martin Baulig  <martin@ximian.com>
15648
15649         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15650         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15651         deambiguate casts and delegate invocations.
15652         (parenthesized_expression): Use the new tokens to ensure this is
15653         not a cast of method invocation.
15654
15655         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15656         when reading a `)' and Deambiguate_CloseParens () was previously
15657         called.
15658
15659         * expression.cs (ParenthesizedExpression): New class.  This is
15660         just used for the CS0075 test.
15661         (Binary.DoResolve): Check for CS0075.   
15662
15663 2003-07-29  Ravi Pratap  <ravi@ximian.com>
15664
15665         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15666         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15667         reference comparison.
15668
15669         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15670         examine the ReturnType for equality - this is necessary in the
15671         cases of implicit and explicit operators whose signature also
15672         includes the return type.
15673
15674 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
15675
15676         * namespace.cs: Cache the result of the namespace computation,
15677         instead of computing it every time.
15678
15679 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * decl.cs: Use a global arraylist that we reuse over invocations
15682         to avoid excesive memory consumption.  Reduces memory usage on an
15683         mcs compile by one meg (45 average).
15684
15685         * typemanager.cs (LookupTypeReflection): In .NET pointers are
15686         private, work around that.
15687
15688 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
15689
15690         * literal.cs (IntLiteral): Define Zero and One static literals. 
15691
15692         * cs-parser.jay (integer_literal): use static literals to reduce
15693         memory usage for the most used literals (0, 1 and -1).  211kb
15694         reduced in memory usage.
15695
15696         Replace all calls to `new ArrayList' with `new
15697         ArrayList(4)' which is a good average number for most allocations,
15698         and also requires only 16 bytes of memory for its buffer by
15699         default. 
15700
15701         This reduced MCS memory usage in seven megabytes for the RSS after
15702         bootstrapping.
15703
15704 2003-07-28  Ravi Pratap  <ravi@ximian.com>
15705
15706         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15707         handle params methods the correct way by forming only one
15708         applicable set with params and normal methods in them. Earlier we
15709         were looking at params methods only if we found no normal methods
15710         which was not the correct thing to do.
15711
15712         (Invocation.BetterFunction): Take separate arguments indicating
15713         when candidate and the best method are params methods in their
15714         expanded form.
15715
15716         This fixes bugs #43367 and #46199.
15717
15718         * attribute.cs: Documentation updates.
15719
15720         (CheckAttribute): Rename to CheckAttributeTarget.
15721         (GetValidPlaces): Rename to GetValidTargets.
15722
15723         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15724         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15725
15726         Fixes bug #44468.
15727
15728 2003-07-28  Martin Baulig  <martin@ximian.com>
15729
15730         * class.cs (TypeContainer.DefineMembers): Use the base type's full
15731         name when looking up the base class of a nested class.  Fixes #46977.
15732
15733 2003-07-26  Martin Baulig  <martin@ximian.com>
15734
15735         * expression.cs (Indexers.Indexer): New nested struct; contains
15736         getter, setter and the indexer's type.
15737         (Indexers.Properties): This is now an ArrayList of
15738         Indexers.Indexer's.
15739         (IndexerAccess.DoResolveLValue): Correctly set the type if the
15740         indexer doesn't have any getters.
15741
15742         * assign.cs (Assign.DoResolve): Also do the implicit conversions
15743         for embedded property and indexer assignments.
15744
15745 2003-07-26  Martin Baulig  <martin@ximian.com>
15746
15747         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15748         preprocessor directive is not the first non-whitespace character
15749         on a line.
15750
15751 2003-07-26  Martin Baulig  <martin@ximian.com>
15752
15753         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15754         namespace parsing, follow the spec more closely.
15755
15756         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
15757         NamespaceEntry.Lookup().
15758
15759 2003-07-25  Martin Baulig  <martin@ximian.com>
15760
15761         * MethodCore.cs (OverridesSomething): New public field; it's set
15762         from TypeContainer.DefineMembers if this method overrides
15763         something (which doesn't need to be a method).  Fix #39462.
15764
15765 2003-07-25  Ravi Pratap  <ravi@ximian.com>
15766
15767         * typemanager.cs (GetMembers): Ensure that the list of members is
15768         reversed. This keeps things in sync.
15769
15770         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
15771         find an AttributeUsage attribute.
15772
15773         * expression.cs (Invocation.OverloadResolve): Perform the check
15774         which disallows Invoke to be directly called on a Delegate.
15775
15776         (Error_InvokeOnDelegate): Report error cs1533.
15777
15778 2003-07-25  Martin Baulig  <martin@ximian.com>
15779
15780         * expression.cs (Indexers.GetIndexersForType): Only look in the
15781         interface hierarchy if the requested type is already an
15782         interface.  Fixes #46788 while keeping #46502 fixed.
15783
15784 2003-07-25  Martin Baulig  <martin@ximian.com>
15785
15786         * class.cs (TypeContainer.DefineMembers): Check whether all
15787         readonly fields have been assigned and report warning CS0649 if
15788         not.
15789
15790         * statement.cs (LocalInfo.IsFixed): Always return true if this is
15791         a valuetype.
15792
15793 2003-07-24  Ravi Pratap  <ravi@ximian.com>
15794
15795         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
15796         returned from GetMethods to make things consistent with the
15797         assumptions MCS makes about ordering of methods.
15798
15799         This should comprehensively fix bug #45127 and it does :-)
15800
15801         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
15802         ordering is actually reverse.
15803
15804         * Clean up some debug messages I left lying around.
15805
15806         * interface.cs (Populate*): Get rid of code which emits attributes
15807         since the stage in which we emit attributes is the 'Emit' stage,
15808         not the define stage.
15809
15810         (Emit): Move attribute emission for interface members here.
15811
15812 2003-07-22  Ravi Pratap  <ravi@ximian.com>
15813
15814         * expression.cs (Invocation.OverloadResolve): Follow the spec more
15815         closely: we eliminate methods in base types when we have an
15816         applicable method in a top-level type.
15817
15818         Please see section 14.5.5.1 for an exact description of what goes
15819         on. 
15820
15821         This fixes bug #45127 and a host of other related to corlib compilation.
15822
15823         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
15824         array is the method corresponding to the top-level type (this is
15825         because of the changes made to icall.c) so we change this
15826         accordingly.
15827
15828         (MethodGroupExpr.Name): This too.
15829
15830         * typemanager.cs (GetElementType): New method which does the right
15831         thing when compiling corlib. 
15832
15833         * everywhere: Make use of the above in the relevant places.
15834
15835 2003-07-22  Martin Baulig  <martin@ximian.com>
15836
15837         * cs-parser.jay (invocation_expression): Moved
15838         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
15839         `cast_expression', but create a InvocationOrCast which later
15840         resolves to either an Invocation or a Cast.
15841
15842         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
15843         method; call this before EmitStatement() to make sure that this
15844         expression can be used as a statement.
15845
15846         * expression.cs (InvocationOrCast): New class; resolves to either
15847         an Invocation or a Cast.
15848
15849         * statement.cs (StatementExpression): Call ResolveStatement() on
15850         the ExpressionStatement before emitting it.
15851
15852 2003-07-21  Martin Baulig  <martin@ximian.com>
15853
15854         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
15855         `ref' and `out' attributes match; fixes #46220.
15856         (MemberAccess.ResolveMemberAccess): You can't reference a type
15857         through an expression; fixes #33180.
15858         (Indexers.GetIndexersForType): Don't return the indexers from
15859         interfaces the class implements; fixes #46502.
15860
15861 2003-07-21  Martin Baulig  <martin@ximian.com>
15862
15863         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
15864         CS0661 checks; fixes bug #30442.
15865
15866 2003-07-21  Martin Baulig  <martin@ximian.com>
15867
15868         * decl.cs (AdditionResult): Added `Error'.
15869
15870         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
15871
15872         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
15873         makes cs0031.cs actually work.
15874
15875 2003-07-20  Martin Baulig  <martin@ximian.com>
15876
15877         * namespace.cs: Fixed that bug which caused a crash when compiling
15878         the debugger's GUI.
15879
15880 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * typemanager.cs (LookupTypeReflection): Never expose types which
15883         are NotPublic, NestedPrivate, NestedAssembly, or
15884         NestedFamANDAssem.  We used to return these, and later do a check
15885         that would report a meaningful error, but the problem is that we
15886         would not get the real match, if there was a name override.
15887
15888 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * namespace.cs (Namespace, Name): Do not compute the namespace
15891         name dynamically, compute it in the constructor.  This reduced
15892         memory usage by 1697 KB.
15893
15894         * driver.cs: Use --pause to pause at the end.
15895
15896 2003-07-17  Peter Williams  <peter@newton.cx>
15897
15898         * Makefile: Change the name of the test target so that it doesn't
15899         conflict with the recursive test target.
15900
15901 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
15902
15903         * expression.cs (LocalVariableReference.Emit, EmitAssign,
15904         AddressOf): Do not use EmitThis, that was wrong, use the actual
15905         this pointer.
15906
15907 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
15908
15909         * class.cs (MethodData.Define): While checking if a method is an
15910         interface implementation, improve the test: If we are not public
15911         (use new test here: use the computed MethodAttributes directly,
15912         instead of the parsed modifier flags) check if the `implementing'
15913         method comes from an interface or not.
15914
15915         * pending.cs (VerifyPendingMethods): Slightly better error
15916         message.
15917
15918         * makefile: add test target that does the mcs bootstrap.
15919
15920 2003-07-16  Ravi Pratap  <ravi@ximian.com>
15921
15922         * interface.cs (Define): Do nothing here since there are no
15923         members to populate etc. Move the attribute emission out of here
15924         since this was just totally the wrong place to put it. Attribute
15925         application happens during the 'Emit' phase, not in the 'Define'
15926         phase.
15927
15928         (Emit): Add this method and move the attribute emission here
15929
15930         * rootcontext.cs (EmitCode): Call the Emit method on interface
15931         types too.
15932
15933 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15934
15935         * expression.cs (OverloadResolve): Report error only if Location
15936         is not 'Null' which means that there was a probe going on.
15937
15938 2003-07-14  Martin Baulig  <martin@ximian.com>
15939
15940         * expression.cs (ConditionalLogicalOperator): New public class to
15941         implement user defined conditional logical operators.
15942         This is section 14.11.2 in the spec and bug #40505.
15943
15944 2003-07-14  Martin Baulig  <martin@ximian.com>
15945
15946         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15947
15948 2003-07-14  Martin Baulig  <martin@ximian.com>
15949
15950         * codegen.cs (EmitContext.InFixedInitializer): New public field.
15951
15952         * ecore.cs (IVariable.VerifyFixed): New interface method.
15953
15954         * expression.cs (Unary.ResolveOperator): When resolving the `&'
15955         operator, check whether the variable is actually fixed.  Fixes bug
15956         #36055.  Set a variable definitely assigned when taking its
15957         address as required by the spec.
15958
15959         * statement.cs (LocalInfo.IsFixed): New field.
15960         (LocalInfo.MakePinned): Set `IsFixed' to true.
15961
15962 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15963
15964         * attribute.cs (Attribute.Resolve): While doing a Member lookup
15965         for .ctors, ensure that we only ask for members declared in the
15966         attribute type (BindingFlags.DeclaredOnly).
15967
15968         Fixes bug #43632.
15969
15970         * expression.cs (Error_WrongNumArguments): Report error 1501
15971         correctly the way CSC does.
15972
15973 2003-07-13  Martin Baulig  <martin@ximian.com>
15974
15975         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15976         lookup on the fully qualified name, to make things like "X.X" work
15977         where "X.X" is a fully qualified type name, but we also have a
15978         namespace "X" in the using list.  Fixes #41975.
15979
15980 2003-07-13  Martin Baulig  <martin@ximian.com>
15981
15982         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15983         function. If we're a CompoundAssign, we need to create an embedded
15984         CompoundAssign, not an embedded Assign.
15985         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15986         Fixes #45854.
15987
15988 2003-07-13  Martin Baulig  <martin@ximian.com>
15989
15990         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15991         work to fix bug #46088.
15992
15993 2003-07-13  Ravi Pratap <ravi@ximian.com>
15994
15995         * class.cs (Operator.Emit): Do not emit attributes here - it is
15996         taken care of by the Method class that we delegate too. This takes
15997         care of bug #45876.
15998
15999 2003-07-10  Martin Baulig  <martin@ximian.com>
16000
16001         * expression.cs (TypeOfVoid): New class.
16002         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16003
16004 2003-07-10  Martin Baulig  <martin@ximian.com>
16005
16006         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16007         bug #35957.
16008
16009 2003-07-10  Martin Baulig  <martin@ximian.com>
16010
16011         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16012         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16013
16014         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16015
16016         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16017
16018 2003-07-10  Martin Baulig  <martin@ximian.com>
16019
16020         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16021         of decimal.  Fixes #42850.
16022
16023         NOTE: I also fixed the created byte blob, but this doesn't work on
16024         the MS runtime and csc never produces any byte blobs for decimal
16025         arrays.
16026
16027 2003-07-10  Martin Baulig  <martin@ximian.com>
16028
16029         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16030         structs; fixes #32068.
16031         (Block.AddChildVariableNames): Fixed #44302.
16032
16033 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16034
16035         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16036
16037 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * attribute.cs: And this test is onger needed.
16040
16041 2003-07-08  Martin Baulig  <martin@ximian.com>
16042
16043         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16044         inaccessible types.  Fixes #36313.
16045
16046         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16047
16048         * namespace.cs (NamespaceEntry): Create implicit entries for all
16049         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16050         implicit entries for N1.N2 and N1.
16051
16052 2003-07-08  Martin Baulig  <martin@ximian.com>
16053
16054         Rewrote the handling of namespaces to fix a lot of the issues
16055         wrt. `using' aliases etc.
16056
16057         * namespace.cs (Namespace): Splitted this class into a
16058         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16059
16060         * typemanager.cs (TypeManager.IsNamespace): Removed.
16061         (TypeManager.ComputeNamespaces): Only compute namespaces from
16062         loaded assemblies here, not the namespaces from the assembly we're
16063         currently compiling.
16064
16065 2003-07-08  Martin Baulig  <martin@ximian.com>
16066
16067         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16068
16069 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16070
16071         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16072         already fixed it.  
16073
16074         I thought about the memory savings here, but LookupTypeReflection
16075         is used under already very constrained scenarios.  Compiling
16076         corlib or mcs only exposes one hit, so it would not really reduce
16077         any memory consumption.
16078
16079 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16080
16081         * typemanager.cs: fixes bug #45889 by only adding public types from
16082         other assemblies to the list of known types.
16083
16084 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16085
16086         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16087         on the type we resolved.
16088
16089 2003-07-05  Martin Baulig  <martin@ximian.com>
16090
16091         * pending.cs (PendingImplementation.ParentImplements): Don't
16092         create the proxy if the parent is abstract.
16093
16094         * class.cs (TypeContainer.DefineIndexers): Process explicit
16095         interface implementations first.  Fixes #37714.
16096
16097 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16098
16099         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16100         defined recursively;  but since we modify the input parameters
16101         (left is set to `this' temporarily), we reset this value if the
16102         left_is_explicit is false, which gives the original semantics to
16103         the code.  
16104
16105         * literal.cs (NullPointer): new class used to represent a null
16106         literal in a pointer context.
16107
16108         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16109         type is a pointer, use a NullPointer object instead of a
16110         NullLiteral.   Closes 43687
16111
16112         (ExplicitConversion): Convert pointer values using
16113         the conv opcode to the proper type.
16114
16115         * ecore.cs (New): change ValueTypeVariable property into a method,
16116         that returns whether the valuetype is suitable for being used.
16117
16118         * expression.cs (Binary.DoNumericPromotions): Only return if we
16119         the int constant was a valid uint, and we can return both left and
16120         right as uints.  If not, we continue processing, to trigger the
16121         type conversion.  This fixes 39018.
16122
16123         * statement.cs (Block.EmitMeta): During constant resolution, set
16124         the CurrentBlock property on the emitcontext, so that we resolve
16125         constants propertly.
16126
16127 2003-07-02  Martin Baulig  <martin@ximian.com>
16128
16129         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16130         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16131
16132         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16133         than emitting it here.
16134
16135         * statement.cs: Fixed some more flow analysis bugs.
16136
16137 2003-07-02  Martin Baulig  <martin@ximian.com>
16138
16139         * class.cs (MethodData.Define): When implementing interface
16140         methods, set Final unless we're Virtual.
16141
16142         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16143         check work for interface methods.
16144
16145 2003-07-01  Martin Baulig  <martin@ximian.com>
16146
16147         * ecore.cs (EmitContext.This): Replaced this property with a
16148         GetThis() method which takes a Location argument.  This ensures
16149         that we get the correct error location for a CS0188.
16150
16151 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16152
16153         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16154         ImplicitStandardConversion.
16155
16156         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16157
16158 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16159
16160         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16161         optimization.
16162
16163 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16166         constructors.
16167
16168         (MethodData.Define): Turn off initlocals for unsafe methods.
16169
16170 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16171
16172         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16173         complete;  Fixes #37521.
16174
16175         * delegate.cs: Use Modifiers.TypeAttr to compute the
16176         TypeAttributes, instead of rolling our own.  This makes the flags
16177         correct for the delegates.
16178
16179 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16180
16181         * class.cs (Constructor.Define): Set the private flag for static
16182         constructors as well.
16183
16184         * cs-parser.jay (statement_expression): Set the return value to
16185         null, to avoid a crash when we catch an error.
16186
16187 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * cs-parser.jay: Applied patch from Jackson that adds support for
16190         extern and unsafe modifiers to destructor declarations.
16191
16192         * expression.cs: Report error 21 if the user is trying to index a
16193         System.Array.
16194
16195         * driver.cs: Add an error message, suggested by the bug report.
16196
16197         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16198         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16199
16200 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16201
16202         * namespace.cs: Add some information to reduce FAQs.
16203
16204 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16205
16206         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16207         underlying enumeration types.  Fixes #43915.
16208
16209         * expression.cs: Treat ushort/short as legal values to be used in
16210         bitwise operations.
16211
16212 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16213
16214         * delegate.cs: transfer custom attributes for paramenters from
16215         the delegate declaration to Invoke and BeginInvoke.
16216
16217 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16218
16219         * attribute.cs: handle custom marshalers and emit marshal info
16220         for fields, too.
16221
16222 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16223
16224         * makefile.gnu: Added anonymous.cs to the compiler sources.
16225
16226 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16227
16228         * iterators.cs: Change the name of the proxy class to include two
16229         underscores.
16230
16231         * cs-parser.jay: Update grammar to include anonymous methods.
16232
16233         * anonymous.cs: new file.
16234
16235 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * class.cs (Field.Define): Add missing test for pointers and
16238         safety. 
16239
16240 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16241
16242         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16243         we use the stobj opcode.
16244
16245         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16246         since it wasn't the correct fix. 
16247
16248         It still is puzzling that we are required to use stobj for IntPtr
16249         which seems to be a ValueType.
16250
16251 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16252
16253         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16254         during regular simple name resolution.   Now, the trick is that
16255         instead of returning for processing the simplename, we do a
16256         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16257         contextual lookup type).   If a match is found, return that, if
16258         not, return for further composition.
16259
16260         This fixes long-standing 30485.
16261
16262         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16263         using the address to initialize an object, do an Stobj instead of
16264         using the regular Stelem.
16265
16266         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16267         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16268         Because if we are a BaseIndexerAccess that value will be true.
16269         Fixes 43643.
16270
16271         * statement.cs (GotoCase.Resolve): Return after reporting an
16272         error, do not attempt to continue. 
16273
16274         * expression.cs (PointerArithmetic.Emit): If our operand is a
16275         long, convert our constants to match the operand before
16276         multiplying.  Convert to I type before adding.   Fixes 43670.
16277
16278 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16279
16280         * enum.cs (ImplicitConversionExists) : Rename to
16281         ImplicitEnumConversionExists to remove ambiguity. 
16282
16283         * ecore.cs (NullCast): New type of cast expression class which
16284         basically is very similar to EmptyCast with the difference being
16285         it still is a constant since it is used only to cast a null to
16286         something else
16287         (eg. (string) null)
16288
16289         * convert.cs (ImplicitReferenceConversion): When casting a null
16290         literal, we return a NullCast.
16291
16292         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16293         should be around anymore.
16294
16295         The renaming (reported was slightly wrong). Corrections:
16296
16297         ConvertImplicitStandard -> ImplicitConversionStandard
16298         ConvertExplicitStandard -> ExplicitConversionStandard
16299
16300         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16301         before passing them in !
16302
16303         * convert.cs (ImplicitConversionStandard): When comparing for
16304         equal expr and target types, ensure that expr is not a
16305         NullLiteral.
16306
16307         In general, we must not be checking (expr_type ==
16308         target_type) in the top level conversion methods
16309         (ImplicitConversion, ExplicitConversion etc). This checking is
16310         done in the methods that they delegate to.
16311
16312 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16313
16314         * convert.cs: Move Error_CannotConvertType,
16315         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16316         ImplicitNumericConversion, ImplicitConversionExists,
16317         ImplicitUserConversionExists, StandardConversionExists,
16318         FindMostEncompassedType, FindMostSpecificSource,
16319         FindMostSpecificTarget, ImplicitUserConversion,
16320         ExplicitUserConversion, GetConversionOperators,
16321         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16322         TryImplicitIntConversion, Error_CannotConvertImplicit,
16323         ConvertImplicitRequired, ConvertNumericExplicit,
16324         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16325         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16326         its own file.
16327
16328         Perform the following renames:
16329
16330         StandardConversionExists -> ImplicitStandardConversionExists
16331         ConvertImplicit -> ImplicitConversion
16332         ConvertImplicitStandard -> ImplicitStandardConversion
16333         TryImplicitIntConversion -> ImplicitIntConversion
16334         ConvertImplicitRequired -> ImplicitConversionRequired
16335         ConvertNumericExplicit -> ExplicitNumericConversion
16336         ConvertReferenceExplicit -> ExplicitReferenceConversion
16337         ConvertExplicit -> ExplicitConversion
16338         ConvertExplicitStandard -> ExplicitStandardConversion
16339
16340 2003-05-19  Martin Baulig  <martin@ximian.com>
16341
16342         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16343         (TypeInfo): Added support for structs having structs as fields.
16344
16345         * ecore.cs (FieldExpr): Implement IVariable.
16346         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16347         VariableInfo for the field.
16348
16349 2003-05-18  Martin Baulig  <martin@ximian.com>
16350
16351         * expression.cs (This.DoResolve): Report a CS0027 if we're
16352         emitting a field initializer.
16353
16354 2003-05-18  Martin Baulig  <martin@ximian.com>
16355
16356         * expression.cs (This.ResolveBase): New public function.
16357         (This.DoResolve): Check for CS0188.
16358
16359         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16360         This.Resolve().
16361
16362         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16363         `instance_expression' to null if we don't have any non-static
16364         methods.
16365
16366 2003-05-18  Martin Baulig  <martin@ximian.com>
16367
16368         Reworked the way how local variables and parameters are handled by
16369         the flow analysis code.
16370
16371         * statement.cs (TypeInfo, VariableMap): New public classes.
16372         (VariableInfo): New public class.  This is now responsible for
16373         checking whether a variable has been assigned.  It is used for
16374         parameters and local variables.
16375         (Block.EmitMeta): Take the InternalParameters as argument; compute
16376         the layout of the flow vectors here.
16377         (Block.LocalMap, Block.ParameterMap): New public properties.
16378         (FlowBranching): The .ctor doesn't get the InternalParameters
16379         anymore since Block.EmitMeta() now computes the layout of the flow
16380         vector.
16381         (MyStructInfo): This class is now known as `StructInfo' and nested
16382         in `TypeInfo'; we don't access this directly anymore.
16383
16384         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16385         property and removed IsAssigned(), IsFieldAssigned(),
16386         SetAssigned() and SetFieldAssigned(); we now call them on the
16387         VariableInfo so we don't need to duplicate this code everywhere.
16388
16389         * expression.cs (ParameterReference): Added `Block block' argument
16390         to the .ctor.
16391         (LocalVariableReference, ParameterReference, This): The new
16392         VariableInfo class is now responsible for all the definite
16393         assignment stuff.
16394
16395         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16396         IsParameterAssigned, SetParameterAssigned): Removed.
16397
16398 2003-05-18  Martin Baulig  <martin@ximian.com>
16399
16400         * typemanager.cs (InitCoreTypes): Try calling
16401         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16402         the 3-args-version.  Corlib now also needs our `void_type'.
16403         (GetMethod): Added overloaded version which takes an optional
16404         `bool report_errors' to allow lookups of optional methods.
16405
16406 2003-05-12  Martin Baulig  <martin@ximian.com>
16407
16408         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16409         only used for locals and not for parameters.
16410
16411 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16412
16413         * support.cs (InternalParameters.ParameterType): Return the
16414         ExternalType of the parameter.
16415
16416         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16417         they were unused.
16418
16419 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16420
16421         * class.cs (MethodData.Define): Do not set the `newslot' on
16422         interface members, if they are also flagged as "override".
16423
16424         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16425         better code for ++i and i++.  This only works for static fields
16426         and local variables.
16427
16428         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16429         want to pull the DeclSpace out of the builder_to_declspace instead
16430         of the TypeBuilder (like in TypeContainer.FindMembers).
16431
16432         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16433         instead of LookupTypeContainer.  Fixes the crash on .NET for
16434         looking up interface members.
16435
16436         * const.cs: Create our own emit context during the Definition
16437         stage, so that constants are evaluated in the proper context, when
16438         a recursive definition happens.
16439
16440 2003-05-11  Martin Baulig  <martin@ximian.com>
16441
16442         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16443         new block for a switch section.
16444         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16445         the adding/lookup in the switch block.  Fixes #39828.
16446
16447 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16450         functionality: I needed to convert the data after I had performed
16451         the add/sub operation into the operands type size.
16452
16453         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16454         pass the type for the box operation, otherwise the resulting
16455         object would have been of type object.
16456
16457         (BoxedCast): Add constructor to specify the type to box as.
16458
16459 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * iterators.cs: I was reusing the `count' variable inadvertently,
16462         take steps to not allow this to happen.
16463
16464 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16467         by creating an array at the point where the params starts and
16468         putting all those arguments there, then adjusting the size of the
16469         array.
16470
16471 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16472
16473         * expression.cs (New.AddressOf): Implement interface
16474         IMemoryLocation.  This is used when the `new' operator is used in
16475         the context of an invocation to a method on a value type.
16476
16477         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16478         example. 
16479
16480         * namespace.cs: Also check the using aliases here.
16481
16482         * driver.cs: Move the test for using validity after the types have
16483         been entered, so we do a single pass that also includes the using
16484         aliases. 
16485
16486         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16487         in the regular case.   CreateSiblingForFinally is doing extra
16488         error checking.
16489
16490         * attribute.cs (GetAttributeArgumentExpression): Store the result
16491         on an out value, and use the return value to indicate failure
16492         instead of using null (which is a valid return for Constant.GetValue).
16493
16494         * statement.cs: Perform the analysis flow for the increment
16495         portion after the statement, because this will be the real flow of
16496         execution.  Fixes #42385
16497
16498         * codegen.cs (EmitContext.EmitArgument,
16499         EmitContext.EmitStoreArgument): New helper functions when the
16500         RemapToProxy flag is set.
16501
16502         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16503         function.
16504
16505         Add support for remapping parameters. 
16506
16507         * iterators.cs: Propagate parameter values;  Store parameter
16508         values in the proxy classes.
16509
16510 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
16513         need a proxy reference;  I do not know what I was thinking
16514
16515         * cs-parser.jay (constructor_initializer): catch another error,
16516         and display nice message.
16517
16518         (field_declaration): catch void field declaration
16519         to flag a better error. 
16520
16521         * class.cs (MemberBase.CheckBase): Report an error instead of a
16522         warning if a new protected member is declared in a struct. 
16523         (Field.Define): catch the error of readonly/volatile.
16524
16525         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16526
16527         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
16528         volatile variable is taken
16529
16530 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
16531
16532         * statement.cs (Fixed.Resolve): Report an error if we are not in
16533         an unsafe context.
16534
16535 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * typemanager.cs: reuse the code that handles type clashes for
16538         delegates and enumerations.
16539
16540         * class.cs (Report28): Always report.
16541
16542         * expression.cs (EncodeAsAttribute): Allow nulls here.
16543
16544 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
16545
16546         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16547         the functionality for testing whether an expression is valid for
16548         an attribute here.  Also handle the case of arrays of elements
16549         being stored. 
16550
16551         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16552         encoding a linear array into an array of objects that are suitable
16553         to be passed to an CustomAttributeBuilder.
16554
16555         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16556
16557         * ecore.cs: (FieldExpr): Handle field remapping here.
16558
16559         * iteratators.cs: Pass the instance variable (if the method is an
16560         instance method) to the constructors, so we can access the field
16561         variables on the class.
16562
16563         TODO: Test this with structs.  I think the THIS variable on
16564         structs might have to be a pointer, and not a refenrece
16565
16566 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16569         local variables to fields in a proxy class.
16570
16571         * iterators.cs (PopulateProxy): Rename our internal fields to
16572         <XXX>.  
16573         Create a <THIS> field if we are an instance method, so we can
16574         reference our parent container variables.
16575         (MapVariable): Called back from the EmitContext code to enter a
16576         new variable to field mapping into the proxy class (we just create
16577         a FieldBuilder).
16578
16579         * expression.cs
16580         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16581         for using the remapped locals to fields.
16582
16583         I placed the code here, because that gives the same semantics to
16584         local variables, and only changes the Emit code.
16585
16586         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16587         statements inside iterators.
16588         (VariableInfo): Add a FieldBuilder for the cases when we are
16589         remapping local variables to fields in a proxy class
16590
16591         * ecore.cs (SimpleNameResolve): Avoid testing two times for
16592         current_block != null.
16593
16594         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16595         not cope with strings, as it has been moved to the
16596         TableSwitchEmit.  Fixed bug in switch generation.
16597
16598         * expression.cs (New.DoResolve): Provide more context for the user
16599         when reporting an error.
16600
16601         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16602         pointers. 
16603
16604         * expression.cs (MemberAccess.DoResolve): When we get a type back,
16605         check the permissions for it.  Note than in a type-resolution
16606         context the check was already present in DeclSpace.ResolveType,
16607         but was missing from the MemberAccess.
16608
16609         (ArrayCreation.CheckIndices): warn if the user has
16610         more nested levels of expressions, but there are no more
16611         dimensions specified.  Avoids crash on bug 41906.
16612
16613 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
16614
16615         * statement.cs (Block): replace Implicit bool, for a generic
16616         flags.   
16617         New flag: `Unchecked'.  This is used during the EmitMeta phase
16618         (which is out-of-line with the regular Resolve/Emit process for a
16619         statement, as this is done ahead of time, but still gets a chance
16620         to call constant resolve).
16621
16622         (Block.Flags): new enum for adding a new flag.
16623
16624         (Block.EmitMeta): track the state of unchecked.
16625
16626         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16627         to enable constant resolution to work there as well.
16628
16629 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
16630
16631         * typemanager.cs (ienumerable_type): Also look up
16632         System.Collections.IEnumerable. 
16633
16634 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
16635
16636         TODO: Test more than one conditional per method.
16637
16638         * class.cs (Indexer.Define): Report the location where the user is
16639         referencing the unsupported feature.
16640
16641         (MethodData): Overload the use of `conditionals' to
16642         minimize the creation of needless ArrayLists.   This saves roughly
16643         212kb on my machine.
16644
16645         (Method): Implement the new IIteratorContainer interface.
16646         (Method.SetYields): Implement the method by setting the ModFlags
16647         to contain METHOD_YIELDS.
16648
16649         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16650         which just got set to null.
16651
16652         * iterators.cs: New file.
16653
16654         (Yield, YieldBreak): New statements.
16655
16656         * statement.cs (Return.Resolve): Flag an error if we are used in
16657         an iterator method.
16658
16659         * codegen.cs (InIterator): New flag set if the code is being
16660         compiled in an iterator method.
16661
16662         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
16663         internal modifier, and we just use it to avoid adding extra
16664         fields, as this is seldom used.  
16665
16666         * cs-parser.jay: Add yield_statement (yield and yield break).
16667
16668         * driver.cs: New flag -v2 to turn on version 2 features. 
16669
16670         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16671         hashtable when v2 is enabled.
16672
16673 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
16674
16675         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16676         there is already a namespace defined with this name.
16677
16678         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16679         people upgraded their corlibs.
16680
16681         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16682         always use fully qualified types, no need to use the compiler
16683         front end.
16684
16685         (TypeManager.IsNamespace): Use binarysearch.
16686
16687         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16688         AddDelegate): I did not quite use the new IsValid API properly: I
16689         have to pass the short-name and the fullname.  I was passing only
16690         the basename instead of the fullname sometimes. 
16691
16692         (TypeContainer.DefineType): call NamespaceClash.
16693
16694         * interface.cs (Interface.DefineType): use NamespaceClash before
16695         defining the type.
16696
16697         * delegate.cs (Delegate.DefineType): use NamespaceClash before
16698         defining the type.
16699
16700         * enum.cs: (Enum.DefineType): use NamespaceClash before
16701         defining the type.
16702
16703         * typemanager.cs (: 3-line patch that gives us some tasty 11%
16704         speed increase.  First, use the negative_hits cache when we get a
16705         negative.  Second, add the type with its full original name
16706         instead of the new . and + encoded name (reflection uses + to
16707         separate type from a nested type).  Use LookupTypeReflection
16708         directly which bypasses the type->name hashtable (that we already
16709         know does not contain the type.
16710
16711         * decl.cs (DeclSpace.ResolveTypeExpr): track the
16712         location/container type. 
16713
16714         * driver.cs: When passing utf8, use directly the UTF8Encoding.
16715
16716 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16719
16720         * delegate.cs (NewDelegate.Resolve): Test whether an instance
16721         method is being referenced in the method group from a static
16722         context, and report error 120 if so.
16723
16724         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16725         Error118. 
16726
16727         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16728         is created, we create the A namespace).
16729
16730         * cs-parser.jay: A namespace also introduces a DeclarationFound.
16731         Fixes #41591
16732
16733 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
16734
16735         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16736         invocation to ModuleBuilder.GetType with the same values will
16737         return a new type instance, so we need to cache its return
16738         values. 
16739
16740         * expression.cs (Binary.ResolveOperator): Only allow the compare
16741         operators on enums if they are of the same type.
16742
16743         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16744         types of ValueType on their own case.  Before we were giving them
16745         the same treatment as objects.
16746
16747         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16748         fullname.  Short name is used to compare against container name.
16749         Fullname is used to check against defined namespace names.
16750
16751         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16752         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16753
16754         (Method.CheckBase): Call parent.
16755         (MemberBase.CheckBase): Check for protected members on sealed
16756         classes.
16757         (PropertyBase.CheckBase): Call parent.
16758         (Field.Define): Call parent.
16759
16760         * report.cs: Negative error codes are now mapped to 8000 - code,
16761         so that the display is render more nicely.
16762
16763         * typemanager.cs: Do not use try/catch, instead report a regular
16764         error. 
16765
16766         (GetPointerType, GetReferenceType): These methods provide
16767         mechanisms to obtain the T* and T& from a T.  We had the code
16768         previously scattered around the code base, and it also used
16769         TypeManager.LookupType that would go through plenty of caches.
16770         This one goes directly to the type source.
16771
16772         In some places we did the Type.GetType followed by
16773         ModuleBuilder.GetType, but not in others, so this unifies the
16774         processing as well.
16775
16776         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
16777         statements now that we have namespace information.
16778
16779         * typemanager.cs (IsNamespace): New method, returns whether the
16780         string presented is a namespace or not.
16781
16782         (ComputeNamespaces): New public entry point, computes the list of
16783         available namespaces, using the GetNamespaces API call in Mono, or
16784         the slower version in MS.NET.   
16785
16786         Now before we start the semantic analysis phase, we have a
16787         complete list of namespaces including everything that the user has
16788         provided.
16789
16790         Deleted old code to cache namespaces in .nsc files.
16791
16792 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
16795         class/struct location definition Location for the implicit
16796         constructor location.
16797
16798         (Operator.Define): Use the location of the operator for the
16799         implicit Method definition.
16800
16801         (Constructor.Emit): use the constructor location for the implicit
16802         base initializer constructor.
16803
16804         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
16805         and the Expression class now contains two new methods:
16806
16807         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
16808         isolate type lookup from the rest of the resolution process.
16809
16810         Since we use Expressions to hold type definitions due to the way
16811         we parse the input we have historically overloaded Resolve to
16812         perform the Type lookups if a special flag is passed.  Now this is
16813         eliminated and two methods take their place. 
16814
16815         The differences in the two methods between xStep and xTerminal is
16816         that xStep is involved in our current lookup system that uses
16817         SimpleNames to compose a name, while xTerminal is used just to
16818         catch the case where the simplename lookup failed.
16819
16820 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
16821
16822         * expression.cs (ResolveMemberAccess): Remove redundant code.
16823         TypeExpr expressions are always born fully resolved.
16824
16825         * interface.cs (PopulateMethod): Do not lookup the types twice.
16826         We were doing it once during SemanticAnalysis and once during
16827         PopulateMethod.
16828
16829         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
16830         in local variable type definitions, were being returned as a
16831         SimpleName (we decomposed everything into a string), that is
16832         because primary_expression was being used instead of a type in the
16833         grammar (reduce/reduce conflicts).
16834
16835         The part that was wrong is that we converted the expression into a
16836         string (an oversimplification in one hand, compounded with primary
16837         expressions doing string concatenation).
16838
16839         So things like:
16840
16841         A.B.C [] x;
16842
16843         Would return "A.B.C[]" as a SimpleName.  This stopped things like
16844         using clauses from working on this particular context.  And a type
16845         was being matched directly against "A.B.C[]".
16846
16847         We now use the correct approach, and allow for ComposedCast to be
16848         part of the unary expression.  So the "A.B.C []" become a composed
16849         cast of "A.B.C" (as a nested group of MemberAccess with a
16850         SimpleName at the end) plus the rank composition "[]". 
16851
16852         Also fixes 35567
16853
16854 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
16855
16856         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16857         for the access level checking.
16858
16859         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
16860         `TypeContainer container', because I kept getting confused when I
16861         was debugging this code.
16862
16863         * expression.cs (Indexers): Instead of tracking getters/setters,
16864         we now track them in parallel.  We create one arraylist less, but
16865         most importantly it is possible now for the LValue code to find a
16866         matching get for a set.
16867
16868         (IndexerAccess.DoResolveLValue): Update the code.
16869         GetIndexersForType has been modified already to extract all the
16870         indexers from a type.  The code assumed it did not.
16871
16872         Also make the code set the correct return type for the indexer.
16873         This was fixed a long time ago for properties, but was missing for
16874         indexers.  It used to be void_type.
16875
16876         (Binary.Emit): Test first for doubles instead of
16877         floats, as they are more common.
16878
16879         (Binary.EmitBranchable): Use the .un version of the branch opcodes
16880         when dealing with floats and the <=, >= operators.  This fixes bug
16881         #39314 
16882
16883         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16884         to load the array value by emitting a load on the foreach variable
16885         type.  This was incorrect.  
16886
16887         We now emit the code to load an element using the the array
16888         variable type, and then we emit the conversion operator.
16889
16890         Fixed #40176
16891
16892 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
16893
16894         * attribute.cs: Avoid allocation of ArrayLists in the common case.
16895
16896 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16899         test for protection before we test for signatures. 
16900
16901         (MethodSignature.ToString): implement.
16902
16903         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16904         to the case where we reduced into a LongConstant.
16905
16906         * decl.cs (CheckAccessLevel): If the type is an array, we can not
16907         depend on whether the information is acurrate, because the
16908         Microsoft runtime will always claim that the array type is public,
16909         regardless of the real state.
16910
16911         If the type is a pointer, another problem happens: the type is
16912         reported as non-public in Microsoft.  
16913
16914         In both cases we have to call CheckAccessLevel recursively with
16915         the underlying type as the argument to be tested.
16916
16917 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
16918
16919         * assign.cs (Assign.Emit): If we are dealing with a compound
16920         assignment expression, we should use the code path that stores the
16921         intermediate result in a temporary value.  This fixes #40903.
16922
16923         *expression.cs (Indirection.ToString): Provide ToString method for
16924         debugging. 
16925
16926 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
16927
16928         * class.cs: Null out fields holding references to Block objects so
16929         they can be garbage collected.
16930
16931         * expression.cs (OverloadResolve): Remove unused local.
16932
16933 2003-04-07  Martin Baulig  <martin@ximian.com>
16934
16935         * codegen.cs (EmitContext.CurrentFile): New public field.
16936         (EmitContext.Mark): Use the CurrentFile to check whether the
16937         location is in the correct file.
16938         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16939
16940 2003-04-07  Martin Baulig  <martin@ximian.com>
16941
16942         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16943
16944         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16945         location.  [FIXME: The location argument which gets passed to this
16946         method is sometimes wrong!]
16947
16948 2003-04-07  Nick Drochak <ndrochak@gol.com>
16949
16950         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16951
16952 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
16953
16954         * expression.cs (Indirection.EmitAssign): We were using the
16955         temporary, but returning immediately instead of continuing the
16956         EmitAssing flow.
16957
16958 2003-04-06  Martin Baulig  <martin@ximian.com>
16959
16960         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16961         if it's a nested child, but also deriving from the outer class.
16962         See test 190.cs.
16963
16964         * typemanager.cs (IsNestedChildOf): Make this work if it's a
16965         nested child, but also deriving from the outer class.  See
16966         test-190.cs.
16967         (FilterWithClosure): We may access private members of the outer
16968         class if we're a nested child and deriving from the outer class.
16969         (RealMemberLookup): Only set `closure_private_ok' if the
16970         `original_bf' contained BindingFlags.NonPublic.
16971
16972 2003-04-05  Martin Baulig  <martin@ximian.com>
16973
16974         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
16975
16976 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
16977
16978         * class.cs (Event.Define): Do not allow abstract events to have
16979         initializers. 
16980
16981 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
16982
16983         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16984         block in event declarations.
16985
16986         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16987         value type, get its address.
16988
16989         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16990         leaving a class on the stack instead of a boolean value (int
16991         0/1).  Change the code so we compare against null, and then the
16992         result against zero.
16993
16994         * class.cs (TypeContainer.GetClassBases): We were checking for the
16995         parent class being sealed too late.
16996
16997         * expression.cs (Binary.Emit): For <= and >= when dealing with
16998         floating point values, use cgt.un and clt.un instead of cgt and
16999         clt alone.
17000
17001 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17002
17003         * statement.cs: Apply the same optimization as MS: skip the 
17004         GetEnumerator returning an IEnumerator, and use the one returning a 
17005         CharEnumerator instead. This allows us to avoid the try-finally block 
17006         and the boxing.
17007
17008 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17009
17010         * cs-parser.jay: Attributes cannot be applied to
17011                          namespaces. Fixes #40473
17012
17013 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17014
17015         * class.cs:
17016         (Add*): check if the name is valid using the full name for constants,
17017         fields, properties and events.
17018
17019 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17022         char constants to be part of the enumeration.
17023
17024         * expression.cs (Conditional.DoResolve): Add support for operator
17025         true. Implements the missing functionality from 14.12
17026
17027         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17028         operator true/false as required by the spec.
17029
17030         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17031         implicit conversion to boolean.
17032
17033         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17034         also one where the type implements `operator true'. 
17035
17036         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17037         get an expression that will invoke operator true based on an
17038         expression.  
17039
17040         (GetConversionOperators): Removed the hack that called op_True
17041         here.  
17042
17043         (Expression.ResolveBoolean): Move this from Statement.
17044
17045 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17046
17047         * ecore.cs (FieldExpr): do not allow initialization of initonly
17048         fields on derived classes
17049
17050 2003-03-13  Martin Baulig  <martin@ximian.com>
17051
17052         * statement.cs (Block.Emit): Call ig.BeginScope() and
17053         ig.EndScope() when compiling with debugging info; call
17054         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17055
17056 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * expression.cs (Indexers): Do not construct immediately, allow
17059         for new members to be appended as we go.  Fixes 38143
17060
17061 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17062
17063         * expression.cs: save/restore context when resolving an unchecked
17064         expression.
17065
17066 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17067
17068         * cfold.cs: Catch division by zero in modulus operator during
17069         constant folding.
17070
17071 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17072
17073         * interface.cs (Interface.DefineMembers): Avoid defining members
17074         twice. 
17075
17076 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * driver.cs: handle the +/- options for -noconfig
17079
17080         * statement.cs (Unckeched.Resolve): Also track the state of
17081         unchecked in the Resolve phase.
17082
17083 2003-02-27  Martin Baulig  <martin@ximian.com>
17084
17085         * ecore.cs (Expression.MemberLookup): Don't create a
17086         MethodGroupExpr for something which is not a method.  Fixes #38291.
17087
17088 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17089
17090         * class.cs (MemberBase.CheckParameters): Also check that the type
17091         is unmanaged if it is a pointer.
17092
17093         * expression.cs (SizeOf.Resolve): Add location information.
17094
17095         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17096         a managed type is declared.
17097
17098         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17099         parameter modifiers as well.  Fixes bug 38606
17100
17101         * class.cs: Very sad.  Am backing out the speed up changes
17102         introduced by the ArrayList -> Array in the TypeContainer, as they
17103         were not actually that much faster, and introduced a bug (no error
17104         reports on duplicated methods).
17105
17106         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17107         source first, this will guarantee that we have a valid expression
17108         before calling in lower levels functions that will require a
17109         resolved object.  Then use this original_source in the
17110         target.ResolveLValue instead of the original source that was
17111         passed to us.
17112
17113         Another change.  Use target.Resolve instead of LValueResolve.
17114         Although we are resolving for LValues, we will let the Assign code
17115         take care of that (it will be called again from Resolve).  This
17116         basically allows code like this:
17117
17118         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17119         class Y { void A (X x) { x [0] += o; }
17120
17121         The problem was that the indexer was trying to resolve for
17122         set_Item (idx, object o) and never finding one.  The real set_Item
17123         was set_Item (idx, X).  By delaying the process we get the right
17124         semantics. 
17125
17126         Fixes bug 36505
17127
17128 2003-02-23  Martin Baulig  <martin@ximian.com>
17129
17130         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17131         while calling DoEmit ().
17132
17133         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17134         source files; if you use the #line directive inside a method, the
17135         compiler stops emitting line numbers for the debugger until it
17136         reaches the end of the method or another #line directive which
17137         restores the original file.
17138
17139 2003-02-23  Martin Baulig  <martin@ximian.com>
17140
17141         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17142
17143 2003-02-23  Martin Baulig  <martin@ximian.com>
17144
17145         * statement.cs (Block.AddChildVariableNames): We need to call this
17146         recursively, not just for our immediate children.
17147
17148 2003-02-23  Martin Baulig  <martin@ximian.com>
17149
17150         * class.cs (Event.Define): Always make the field private, like csc does.
17151
17152         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17153         actually work, fixes bug #37521.
17154
17155 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17156
17157         * delegate.cs: When creating the various temporary "Parameters"
17158         classes, make sure that we call the ComputeAndDefineParameterTypes
17159         on those new parameters (just like we do with the formal ones), to
17160         allow them to be resolved in the context of the DeclSpace.
17161
17162         This fixes the bug that Dick observed in Bugzilla #38530.
17163
17164 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17165
17166         * expression.cs (ResolveMemberAccess): When resolving a constant,
17167         do not attempt to pull a constant if the value was not able to
17168         generate a valid constant.
17169
17170         * const.cs (LookupConstantValue): Do not report more errors than required.
17171
17172 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17173
17174         * expression.cs: fixes bug #38328.
17175
17176 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17177
17178         * class.cs: Changed all the various members that can be part of a
17179         class from being an ArrayList to be an Array of the right type.
17180         During the DefineType type_list, interface_list, delegate_list and
17181         enum_list are turned into types, interfaces, delegates and enums
17182         arrays.  
17183
17184         And during the member population, indexer_list, event_list,
17185         constant_list, field_list, instance_constructor_list, method_list,
17186         operator_list and property_list are turned into their real arrays.
17187
17188         Although we could probably perform this operation earlier, for
17189         good error reporting we need to keep the lists and remove the
17190         lists for longer than required.
17191
17192         This optimization was triggered by Paolo profiling the compiler
17193         speed on the output of `gen-sample-program.pl' perl script. 
17194
17195         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17196         not crash in methods like MemberLookupFailed that use this field.  
17197
17198         This problem arises when the compiler fails to resolve a type
17199         during interface type definition for example.
17200
17201 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17204         inherit from System.Object, so we have to stop at null, not only
17205         when reaching System.Object.
17206
17207 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17208
17209         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17210         DeclaredOnly because the parent indexer might have had a different
17211         name, but did not loop until the top of the hierarchy was reached.
17212
17213         The problem this one fixes is 35492: when a class implemented an
17214         indexer from an interface, we were getting the interface method
17215         (which was abstract) and we were flagging an error (can not invoke
17216         abstract method).
17217
17218         This also keeps bug 33089 functioning, and test-148 functioning.
17219
17220         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17221         out if a method is special is to see if it is declared in a
17222         property or event, or whether it is one of the predefined operator
17223         names.   This should fix correctly #36804.
17224
17225 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17226
17227         The goal here is to remove the dependency on EmptyCast.Peel ().
17228         Killing it completely.
17229
17230         The problem is that currently in a number of places where
17231         constants are expected, we have to "probe" for an EmptyCast, and
17232         Peel, which is not the correct thing to do, as this will be
17233         repetitive and will likely lead to errors. 
17234
17235         The idea is to remove any EmptyCasts that are used in casts that
17236         can be reduced to constants, so we only have to cope with
17237         constants. 
17238
17239         This bug hunt was triggered by Bug 37363 and the desire to remove
17240         the duplicate pattern where we were "peeling" emptycasts to check
17241         whether they were constants.  Now constants will always be
17242         constants.
17243
17244         * ecore.cs: Use an enumconstant here instead of wrapping with
17245         EmptyCast.  
17246
17247         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17248         throwing me off.  By handling this we can get rid of a few hacks.
17249
17250         * statement.cs (Switch): Removed Peel() code.
17251
17252 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * class.cs: Location information for error 508
17255
17256         * expression.cs (New.DoResolve): Add a guard against double
17257         resolution of an expression.  
17258
17259         The New DoResolve might be called twice when initializing field
17260         expressions (see EmitFieldInitializers, the call to
17261         GetInitializerExpression will perform a resolve on the expression,
17262         and later the assign will trigger another resolution
17263
17264         This leads to bugs (#37014)
17265
17266         * delegate.cs: The signature for EndInvoke should contain any ref
17267         or out parameters as well.  We were not doing this in the past. 
17268
17269         * class.cs (Field.Define): Do not overwrite the type definition
17270         inside the `volatile' group.  Turns out that volatile enumerations
17271         were changing the type here to perform a validity test, which
17272         broke conversions. 
17273
17274 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17275
17276         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17277         and structs, we do not want to load the instance variable
17278
17279         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17280         enum_type has to be handled like an object reference (implicit
17281         conversions exists from this to object), but the regular IsClass
17282         and IsValueType tests will never return true for this one.
17283
17284         Also we use TypeManager.IsValueType instead of type.IsValueType,
17285         just for consistency with the rest of the code (this is only
17286         needed if we ever use the construct exposed by test-180.cs inside
17287         corlib, which we dont today).
17288
17289 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17290
17291         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17292         just InternalCall.
17293
17294 2003-02-09  Martin Baulig  <martin@ximian.com>
17295
17296         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17297         (Namespace.DefineNamespaces): New static public method; this is
17298         called when we're compiling with debugging to add all namespaces
17299         to the symbol file.
17300
17301         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17302         pass it to the Namespace's .ctor.
17303
17304         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17305         and MethodBase arguments; pass the namespace ID to the symwriter;
17306         pass the MethodBase instead of the token to the symwriter.
17307         (SymbolWriter.DefineNamespace): New method to add a namespace to
17308         the symbol file.
17309
17310 2003-02-09  Martin Baulig  <martin@ximian.com>
17311
17312         * symbolwriter.cs: New file.  This is a wrapper around
17313         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17314         methods here in near future.
17315
17316 2003-02-09  Martin Baulig  <martin@ximian.com>
17317
17318         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17319         ILGenerator.MarkSequencePoint() which are actually used by the
17320         symbol writer.
17321
17322 2003-02-09  Martin Baulig  <martin@ximian.com>
17323
17324         * location.cs (SourceFile): New public sealed class.  This
17325         contains the name and an index which is used in the location's token.
17326         (Location): Reserve an appropriate number of bits in the token for
17327         the source file instead of walking over that list, this gives us a
17328         really huge performance improvement when compiling with debugging.
17329
17330         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17331         `SourceFile' argument instead of a string.
17332         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17333         but don't parse/tokenize here, we need to generate the list of all
17334         source files before we do that.
17335         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17336         the files.
17337
17338         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17339         instead of a string.
17340
17341         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17342         of a string.
17343
17344 2003-02-09  Martin Baulig  <martin@ximian.com>
17345
17346         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17347         filename on `#line default'.
17348
17349 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17350
17351         * statement.cs: don't clear the pinned var when the fixed statement
17352         returns from the method (fixes bug#37752).
17353
17354 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17355
17356         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17357         to IsValueType.
17358
17359 2003-02-07  Martin Baulig  <martin@ximian.com>
17360
17361         * driver.cs: Removed the `--debug-args' command line argument.
17362
17363         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17364         automatically by the AsssemblyBuilder.
17365         (CodeGen.InitializeSymbolWriter): We don't need to call any
17366         initialization function on the symbol writer anymore.  This method
17367         doesn't take any arguments.
17368
17369 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17370
17371         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17372         from referenced assemblies as well.
17373
17374 2003-02-02  Martin Baulig  <martin@ximian.com>
17375
17376         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17377
17378 2003-02-02  Martin Baulig  <martin@ximian.com>
17379
17380         * class.cs (Constructor.Emit): Open the symbol writer before
17381         emitting the constructor initializer.
17382         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17383         single-stepping through constructor initializers.
17384
17385 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * class.cs: Handle error 549: do not allow virtual methods in
17388         sealed classes. 
17389
17390 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17391
17392         * decl.cs: Check access levels when resolving types
17393
17394 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17395
17396         * statement.cs: Add parameters and locals set in catch blocks that might 
17397         return to set vector
17398
17399 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * class.cs (Operator): Set the SpecialName flags for operators.
17402
17403         * expression.cs (Invocation.DoResolve): Only block calls to
17404         accessors and operators on SpecialName methods.
17405
17406         (Cast.TryReduce): Handle conversions from char constants.
17407
17408
17409 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17410
17411         * statement.cs: small memory and time optimization in FlowBranching.
17412
17413 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17414
17415         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17416         problem that the last fix but in the other sid (Set).
17417
17418         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17419         access when there is no indexer in the hierarchy.
17420
17421 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17422
17423         * class.cs: Combine some if statements.
17424
17425 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17426
17427         * driver.cs: fixed bug #37187.
17428
17429 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17430
17431         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17432         any indexer, it's needed to build a list with all the indexers in the
17433         hierarchy (AllGetters), else we have problems. Fixes #35653.
17434
17435 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17436
17437         * class.cs (MethodData.Define): It is wrong for an interface
17438         implementation to be static in both cases: explicit and implicit.
17439         We were only handling this in one case.
17440
17441         Improve the if situation there to not have negations.
17442
17443         * class.cs (Field.Define): Turns out that we do not need to check
17444         the unsafe bit on field definition, only on usage.  Remove the test.
17445
17446 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17447
17448         * driver.cs: use assembly.Location instead of Codebase (the latest
17449         patch made mcs fail when using MS assemblies).
17450
17451 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17452
17453         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17454         get the path to *corlib.dll.
17455
17456 2003-01-21  Nick Drochak <ndrochak@gol.com>
17457
17458         * cs-tokenizer.cs:
17459         * pending.cs:
17460         * typemanager.cs: Remove compiler warnings
17461
17462 2003-01-20  Duncan Mak  <duncan@ximian.com>
17463
17464         * AssemblyInfo.cs: Bump the version number to 0.19.
17465
17466 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17467
17468         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17469
17470 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17471
17472         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17473
17474 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17475
17476         * cs-parser.jay: Small fix: we were not comparing the constructor
17477         name correctly.   Thanks to Zoltan for the initial pointer.
17478
17479 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17480
17481         * cs-tokenizer.cs: Set file name when specified with #line
17482
17483 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17484
17485         * cs-parser.jay: Only perform the constructor checks here if we
17486         are named like the class;  This will help provider a better
17487         error.  The constructor path is taken when a type definition is
17488         not found, but most likely the user forgot to add the type, so
17489         report that rather than the constructor error.
17490
17491 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17492
17493         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17494         allocations.
17495
17496 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17497
17498         * cs-parser.jay: Add cleanup call.
17499
17500 2003-01-13  Duncan Mak  <duncan@ximian.com>
17501
17502         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17503         consistent with other methods.
17504
17505 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17506
17507         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17508
17509 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17510
17511         * attribute.cs: only set GuidAttr to true when we have a
17512         GuidAttribute.
17513
17514 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17515
17516         * ecore.cs:
17517         * expression.cs:
17518         * typemanager.cs: fixes to allow mcs compile corlib with the new
17519         Type.IsSubclassOf fix.
17520
17521 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
17522
17523         * expression.cs (LocalVariableReference.DoResolve): Classify a
17524         constant as a value, not as a variable.   Also, set the type for
17525         the variable.
17526
17527         * cs-parser.jay (fixed_statement): take a type instead of a
17528         pointer_type, so we can produce a better error message later.
17529
17530         * statement.cs (Fixed.Resolve): Flag types that are not pointers
17531         as an error.  
17532
17533         (For.DoEmit): Make inifinite loops have a
17534         non-conditional branch back.
17535
17536         (Fixed.DoEmit): First populate the pinned variables, then emit the
17537         statement, then clear the variables.  Before I was emitting the
17538         code once for each fixed piece.
17539
17540
17541 2003-01-08  Martin Baulig  <martin@ximian.com>
17542
17543         * statement.cs (FlowBranching.MergeChild): A break in a
17544         SWITCH_SECTION does not leave a loop.  Fixes #36155.
17545
17546 2003-01-08  Martin Baulig  <martin@ximian.com>
17547
17548         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17549         lives in the same number space than `param_map'.  Fixes #36154.
17550
17551 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
17552
17553         * cs-parser.jay (constructor_declaration): Set the
17554         Constructor.ModFlags before probing for it.  This makes the
17555         compiler report 514, 515 and 132 (the code was there, but got
17556         broken). 
17557
17558         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17559         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17560         (GotoCase.Resolve): Set `Returns' to ALWAYS.
17561
17562 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17563
17564         * enum.cs: create the enum static fields using the enum type.
17565
17566 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17567
17568         * class.cs: don't try to create the ParamBuilder for the return
17569         type if it's not needed (and handle it breaking for the ms runtime
17570         anyway).
17571
17572 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17573
17574         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17575
17576 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
17577
17578         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17579         the command.   This showed up while compiling the JANET source
17580         code, which used \r as its only newline separator.
17581
17582 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * class.cs (Method.Define): If we are an operator (because it
17585         reuses our code), then set the SpecialName and HideBySig.  #36128
17586
17587 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
17588
17589         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17590         exception, report error 120 `object reference required'.
17591
17592         * driver.cs: Add --pause option, used during to measure the size
17593         of the process as it goes with --timestamp.
17594
17595         * expression.cs (Invocation.DoResolve): Do not allow methods with
17596         SpecialName to be invoked.
17597
17598 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
17599
17600         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17601         number before adding it.
17602
17603 2002-12-21  Ravi Pratap  <ravi@ximian.com>
17604
17605         * ecore.cs (StandardImplicitConversion): When in an unsafe
17606         context, we allow conversion between void * to any other pointer
17607         type. This fixes bug #35973.
17608
17609 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17610
17611         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17612         is not thrown when extensionless outputs are used 
17613
17614 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17615
17616         * rootcontext.cs: fixed compilation of corlib.
17617
17618 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
17619
17620         * attribute.cs (Attributes.Contains): Add new method.
17621
17622         * class.cs (MethodCore.LabelParameters): if the parameter is an
17623         `out' parameter, check that no attribute `[In]' has been passed.
17624
17625         * enum.cs: Handle the `value__' name in an enumeration.
17626
17627 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
17628
17629         * decl.cs: Added special case to allow overrides on "protected
17630         internal" methods
17631
17632 2002-12-18  Ravi Pratap  <ravi@ximian.com>
17633
17634         * attribute.cs (Attributes.AddAttributeSection): Rename to this
17635         since it makes much more sense.
17636
17637         (Attributes.ctor): Don't require a Location parameter.
17638
17639         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17640
17641         * attribute.cs (ApplyAttributes): Remove extra Location parameters
17642         since we already have that information per attribute.
17643
17644         * everywhere : make appropriate changes.
17645
17646         * class.cs (LabelParameters): Write the code which actually
17647         applies attributes to the return type. We can't do this on the MS
17648         .NET runtime so we flag a warning in the case an exception is
17649         thrown.
17650
17651 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
17652
17653         * const.cs: Handle implicit null conversions here too.
17654
17655 2002-12-17  Ravi Pratap  <ravi@ximian.com>
17656
17657         * class.cs (MethodCore.LabelParameters): Remove the extra
17658         Type [] parameter since it is completely unnecessary. Instead
17659         pass in the method's attributes so that we can extract
17660         the "return" attribute.
17661
17662 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * cs-parser.jay (parse): Use Report.Error to flag errors instead
17665         of ignoring it and letting the compile continue.
17666
17667         * typemanager.cs (ChangeType): use an extra argument to return an
17668         error condition instead of throwing an exception.
17669
17670 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
17671
17672         * expression.cs (Unary.TryReduce): mimic the code for the regular
17673         code path.  Perform an implicit cast in the cases where we can
17674         implicitly convert to one of the integral types, and then reduce
17675         based on that constant.   This fixes bug #35483.
17676
17677 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17678
17679         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17680
17681 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17682
17683         * namespace.cs: fixed bug #35489.
17684
17685 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * class.cs: Remove some dead code.
17688
17689         * cs-parser.jay: Estimate the number of methods needed
17690         (RootContext.MethodCount);
17691
17692         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17693         numbers instead of StringBuilders.
17694
17695         * support.cs (PtrHashtable): Add constructor with initial size;
17696         We can now reduce reallocations of the method table.
17697
17698 2002-12-10  Ravi Pratap  <ravi@ximian.com>
17699
17700         * attribute.cs (ApplyAttributes): Keep track of the emitted
17701         attributes on a per-target basis. This fixes bug #35413.
17702
17703 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
17704
17705         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17706         default to the Windows 1252 encoding.
17707
17708         (UnixParseOption): Support version, thanks to Alp for the missing
17709         pointer. 
17710
17711         * AssemblyInfo.cs: Add nice assembly information.
17712
17713         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17714         (bug 35169).
17715
17716         * cs-parser.jay: Allow a trailing comma before the close bracked
17717         in the attribute_section production.
17718
17719         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17720         address of the instance was being taken, I will take this out,
17721         because we take the address of the object immediately here.
17722
17723 2002-12-09  Ravi Pratap  <ravi@ximian.com>
17724
17725         * typemanager.cs (AreMultipleAllowed): Take care of the most
17726         obvious case where attribute type is not in the current assembly -
17727         stupid me ;-)
17728
17729 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17732         definitions, instead of doing that afterwards.  
17733
17734         Also we use a nice little hack, depending on the constructor, we
17735         know if we are a "composed" name or a simple name.  Hence, we
17736         avoid the IndexOf test, and we avoid 
17737
17738         * codegen.cs: Add code to assist in a bug reporter to track down
17739         the source of a compiler crash. 
17740
17741 2002-12-07  Ravi Pratap  <ravi@ximian.com>
17742
17743         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17744         types have been emitted for a given element and flag an error
17745         if something which does not have AllowMultiple set is used more
17746         than once.
17747
17748         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17749         attribute types and their corresponding AllowMultiple properties
17750
17751         (AreMultipleAllowed): Check the property for a given type.
17752
17753         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17754         property in the case we have a TypeContainer.
17755
17756         (Attributes.AddAttribute): Detect duplicates and just skip on
17757         adding them. This trivial fix catches a pretty gross error in our
17758         attribute emission - global attributes were being emitted twice!
17759
17760         Bugzilla bug #33187 is now fixed.
17761
17762 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
17763
17764         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
17765         instead of pp_and).
17766
17767         * expression.cs (Binary.ResolveOperator): I can only use the
17768         Concat (string, string, string) and Concat (string, string,
17769         string, string) if the child is actually a concatenation of
17770         strings. 
17771
17772 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
17773
17774         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
17775         context where we need a 2-character lookahead.
17776
17777         * pending.cs (PendingImplementation): Rework so we can keep track
17778         of interface types all the time, and flag those which were
17779         implemented by parents as optional.
17780
17781 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
17782
17783         * expression.cs (Binary.ResolveOperator): Use
17784         String.Concat(string,string,string) or
17785         String.Concat(string,string,string,string) when possible. 
17786
17787         * typemanager: More helper methods.
17788
17789
17790 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
17791
17792         * pending.cs: remove the bogus return from GetMissingInterfaces()
17793         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
17794
17795 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17796
17797         * namespace.cs: avoid duplicated 'using xxx' being added to
17798         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
17799         when we get more than one 'using' statement for the same namespace.
17800         Report a CS0105 warning for it.
17801
17802 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * cs-tokenizer.cs (consume_identifier): use read directly, instead
17805         of calling getChar/putback, uses internal knowledge of it.    
17806
17807         (xtoken): Reorder tokenizer so most common patterns are checked
17808         first.  This reduces the compilation time in another 5% (from 8.11s
17809         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
17810
17811         The parsing time is 22% of the compilation in mcs, and from that
17812         64% is spent on the tokenization process.  
17813
17814         I tried using a binary search for keywords, but this is slower
17815         than the hashtable.  Another option would be to do a couple of
17816         things:
17817
17818                 * Not use a StringBuilder, instead use an array of chars,
17819                   with a set value.  Notice that this way we could catch
17820                   the 645 error without having to do it *afterwards*.
17821
17822                 * We could write a hand-parser to avoid the hashtable
17823                   compares altogether.
17824
17825         The identifier consumption process takes 37% of the tokenization
17826         time.  Another 15% is spent on is_number.  56% of the time spent
17827         on is_number is spent on Int64.Parse:
17828
17829                 * We could probably choose based on the string length to
17830                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
17831                   computations. 
17832
17833         Another 3% is spend on wrapping `xtoken' in the `token' function.
17834
17835         Handle 0xa0 as whitespace (#34752)
17836
17837 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
17838
17839         * typemanager.cs (IsCLRType): New routine to tell whether a type
17840         is one of the builtin types.  
17841
17842         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
17843         typecode in more places instead of doing pointer comparissions.
17844         We could leverage some knowledge about the way the typecodes are
17845         laid out.
17846
17847         New code to cache namespaces in assemblies, it is currently not
17848         invoked, to be used soon.
17849
17850         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17851
17852         * expression.cs (Binary.ResolveOperator): specially handle
17853         strings, and do not perform user-defined operator overloading for
17854         built-in types.
17855
17856 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17859         internalcall as it is a pretty simple operation;  Avoid whenever
17860         possible to call Char.IsLetter.
17861
17862         (consume_identifier): Cut by half the number of
17863         hashtable calls by merging the is_keyword and GetKeyword behavior.
17864
17865         Do not short-circuit, because if we do, we
17866         report errors (ie, #if false && true would produce an invalid
17867         directive error);
17868
17869
17870 2002-11-24  Martin Baulig  <martin@ximian.com>
17871
17872         * expression.cs (Cast.TryReduce): If we're in checked syntax,
17873         check constant ranges and report a CS0221.  Fixes #33186.
17874
17875 2002-11-24  Martin Baulig  <martin@ximian.com>
17876
17877         * cs-parser.jay: Make this work for uninitialized variable
17878         declarations in the `for' initializer.  Fixes #32416.
17879
17880 2002-11-24  Martin Baulig  <martin@ximian.com>
17881
17882         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17883         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
17884
17885 2002-11-24  Martin Baulig  <martin@ximian.com>
17886
17887         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17888         argument; if true, we also check for user-defined conversions.
17889         This is only needed if both arguments are of a user-defined type.
17890         Fixes #30443, added test-175.cs.
17891         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17892
17893         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17894
17895 2002-11-24  Martin Baulig  <martin@ximian.com>
17896
17897         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17898         function to get the store opcode.
17899         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17900         only emit the Ldelema if the store opcode is Stobj.  You must run
17901         both test-34 and test-167 to test this.  Fixes #34529.
17902
17903 2002-11-23  Martin Baulig  <martin@ximian.com>
17904
17905         * ecore.cs (Expression.MemberLookup): Added additional
17906         `qualifier_type' argument which is used when we're being called
17907         from MemberAccess.DoResolve() and null if we're called from a
17908         SimpleName lookup.
17909         (Expression.MemberLookupFailed): New method to report errors; this
17910         does the CS1540 check and reports the correct error message.
17911
17912         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17913         argument for the CS1540 check and redone the way how we're dealing
17914         with private members.  See the comment in the source code for details.
17915         (FilterWithClosure): Reverted this back to revision 1.197; renamed
17916         `closure_start_type' to `closure_qualifier_type' and check whether
17917         it's not null.  It was not this filter being broken, it was just
17918         being called with the wrong arguments.
17919
17920         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17921         and pass it the correct `qualifier_type'; this also does the error
17922         handling for us.
17923
17924 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
17925
17926         * expression.cs (Invocation.EmitParams): If the we are dealing
17927         with a non-built-in value type, load its address as well.
17928
17929         (ArrayCreation): Use a a pretty constant instead
17930         of the hardcoded value 2.   Use 6 instead of 2 for the number of
17931         static initializers.  
17932
17933         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17934         because they are not really value types, just glorified integers. 
17935
17936         * driver.cs: Do not append .exe, the CSC compiler does not do it.
17937
17938         * ecore.cs: Remove redundant code for enumerations, make them use
17939         the same code path as everything else, fixes the casting issue
17940         with enumerations in Windows.Forms.
17941
17942         * attribute.cs: Do only cast to string if it is a string, the
17943         validation happens later.
17944
17945         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17946         people upgrade their corlibs.
17947
17948         * ecore.cs: Oops, enumerations were not following the entire code path
17949
17950 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * typemanager.cs (FilterWithClosure): Commented out the test for
17953         1540 in typemanager.cs, as it has problems when accessing
17954         protected methods from a parent class (see test-174.cs). 
17955
17956         * attribute.cs (Attribute.ValidateGuid): new method.
17957         (Attribute.Resolve): Use above.
17958
17959 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
17960
17961         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17962
17963         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17964         handling for enumerations, as we only needed the TypeContainer
17965         functionality to begin with (this is required for the fix below to
17966         work for enums that reference constants in a container class for
17967         example). 
17968
17969         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17970
17971         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17972         a valid TypeBuilder to perform lookups on.o
17973
17974         * class.cs (InheritableMemberSignatureCompare): Use true in the
17975         call to GetGetMethod and GetSetMethod, because we are comparing
17976         the signature, and we need to get the methods *even* if they are
17977         private. 
17978
17979         (PropertyBase.CheckBase): ditto.
17980
17981         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17982         GotoCase.Resolve): Use Peel on EmpytCasts.
17983
17984         * ecore.cs (EmptyCast): drop child, add Peel method.
17985
17986 2002-11-17  Martin Baulig  <martin@ximian.com>
17987
17988         * ecore.cs (EmptyCast.Child): New public property.
17989
17990         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17991         label resolved to an EmptyCast.  Fixes #34162.
17992         (GotoCase.Resolve): Likewise.
17993         (Block.EmitMeta): Likewise.
17994
17995 2002-11-17  Martin Baulig  <martin@ximian.com>
17996
17997         * expression.cs (Invocation.BetterConversion): Prefer int over
17998         uint; short over ushort; long over ulong for integer literals.
17999         Use ImplicitConversionExists instead of StandardConversionExists
18000         since we also need to check for user-defined implicit conversions.
18001         Fixes #34165.  Added test-173.cs.
18002
18003 2002-11-16  Martin Baulig  <martin@ximian.com>
18004
18005         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18006         with the `true' and `false' literals.  Fixes #33151.
18007
18008 2002-11-16  Martin Baulig  <martin@ximian.com>
18009
18010         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18011         October 22nd; don't do the cs1540 check for static members.
18012
18013         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18014         now using our own filter here and doing the cs1540 check again.
18015
18016 2002-11-16  Martin Baulig  <martin@ximian.com>
18017
18018         * support.cs (InternalParameters): Don't crash if we don't have
18019         any fixed parameters.  Fixes #33532.
18020
18021 2002-11-16  Martin Baulig  <martin@ximian.com>
18022
18023         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18024         when looking up static methods to make this work on Windows.
18025         Fixes #33773.
18026
18027 2002-11-16  Martin Baulig  <martin@ximian.com>
18028
18029         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18030         a setter rather than using PropertyInfo.CanWrite.
18031
18032 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18033
18034         * class.cs: Allow acces to block member by subclasses. Fixes build
18035         breaker.
18036
18037 2002-11-14  Martin Baulig  <martin@ximian.com>
18038
18039         * class.cs (Constructor.Emit): Added the extern/block check.
18040         Fixes bug #33678.
18041
18042 2002-11-14  Martin Baulig  <martin@ximian.com>
18043
18044         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18045         iteration while looking for indexers, this is needed because the
18046         indexer may have a different name in our base classes.  Fixed the
18047         error reporting (no indexers at all, not get accessor, no
18048         overloaded match).  Fixes bug #33089.
18049         (IndexerAccess.DoResolveLValue): Likewise.
18050
18051 2002-11-14  Martin Baulig  <martin@ximian.com>
18052
18053         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18054         indexers.  Fixes the first part of bug #33089.
18055         (MethodSignature.InheritableMemberSignatureCompare): Added support
18056         for properties.
18057
18058 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18059
18060         * attribute.cs (Attribute.Resolve): Catch the
18061         NullReferenceException and report it since it isn't supposed to
18062         happen. 
18063
18064 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18065
18066         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18067         LogicalOr and LogicalAnd that can benefit from recursively
18068         handling EmitBranchable.  The code now should be nice for Paolo.
18069
18070 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18073         the Type lookups, as we perform quite a number of lookups on
18074         non-Types.  This can be removed once we can deterministically tell
18075         whether we have a type or a namespace in advance.
18076
18077         But this might require special hacks from our corlib.
18078
18079         * TODO: updated.
18080
18081         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18082         and double which avoids a conversion from an integer to a double.
18083
18084         * expression.cs: tiny optimization, avoid calling IsConstant,
18085         because it effectively performs the lookup twice.
18086
18087 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18088
18089         But a bogus return here to keep the semantics of the old code
18090         until the Mono runtime is fixed.
18091
18092         * pending.cs (GetMissingInterfaces): New method used to remove all
18093         the interfaces that are already implemented by our parent
18094         classes from the list of pending methods. 
18095
18096         * interface.cs: Add checks for calls after ResolveTypeExpr.
18097
18098 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18099
18100         * class.cs (Class.Emit): Report warning 67: event not used if the
18101         warning level is beyond 3.
18102
18103         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18104         being a NullLiteral.
18105
18106         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18107         specifiers. 
18108
18109         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18110         path that might fail if a type can not be resolved.
18111
18112         * expression.cs (Binary.Emit): Emit unsigned versions of the
18113         operators. 
18114
18115         * driver.cs: use error 5.
18116
18117 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18118
18119         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18120
18121 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18122
18123         * cs-parser.jay (switch_section): A beautiful patch from Martin
18124         Baulig that fixed 33094.
18125
18126 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18127
18128         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18129         Check whether the base is abstract and report an error if so.
18130
18131         * expression.cs (IndexerAccess.DoResolveLValue,
18132         IndexerAccess.DoResolve): ditto. 
18133
18134         (Invocation.DoResolve): ditto.
18135
18136         (Invocation.FullMethodDesc): Improve the report string.
18137
18138         * statement.cs (Block): Eliminate IsVariableDefined as it is
18139         basically just a wrapper for GetVariableInfo.
18140
18141         * ecore.cs (SimpleName): Use new 
18142
18143         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18144         type, as we return the actual parameter ref/unref state on a
18145         different call.
18146
18147 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18148
18149         * support.cs: Return proper flags REF/OUT fixing the previous
18150         commit.  
18151
18152         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18153         not used to mean `ref' but `ref or out' in ParameterReference
18154
18155         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18156         full type signature instead of calling TypeManger.CSharpName
18157         ourselves. 
18158
18159         * support.cs (InternalParameters.ParameterDesc): Do not compare
18160         directly to the modflags, because REF/OUT will actually be bitsets
18161         if set. 
18162
18163         * delegate.cs (VerifyMethod): Check also the modifiers.
18164
18165         * cs-tokenizer.cs: Fix bug where floating point values with an
18166         exponent where a sign was missing was ignored.
18167
18168         * driver.cs: Allow multiple assemblies to be specified in a single
18169         /r: argument
18170
18171 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18174         because identifiers after a parenthesis would end up in this kind
18175         of production, and we needed to desamiguate it for having casts
18176         like:
18177
18178                 (UserDefinedType *) xxx
18179
18180 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18181
18182         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18183         we should set on the Bindingflags.NonPublic, but not turn on
18184         private_ok.  private_ok controls whether a Private member is
18185         returned (this is chekced on the filter routine), while the
18186         BindingFlags.NonPublic just controls whether private/protected
18187         will be allowed.   This fixes the problem part of the problem of
18188         private properties being allowed to be used in derived classes.
18189
18190         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18191         so we can call the children DoResolveLValue method (this will
18192         properly signal errors on lvalue assignments to base properties)
18193
18194         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18195         getter are null, and we have a property info, we know that this
18196         happened because the lookup failed, so we report an error 122 for
18197         protection level violation.
18198
18199         We also silently return if setter and getter are null in the
18200         resolve functions, this condition only happens if we have flagged
18201         the error before.  This is the other half of the problem. 
18202
18203         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18204         not have accessibility information, that is why we were returning
18205         true in the filter function in typemanager.cs.
18206
18207         To properly report 122 (property is inaccessible because of its
18208         protection level) correctly, we report this error in ResolveAccess
18209         by failing if both the setter and the getter are lacking (ie, the
18210         lookup failed). 
18211
18212         DoResolve and DoLResolve have been modified to check for both
18213         setter/getter being null and returning silently, the reason being
18214         that I did not want to put the knowledge about this error in upper
18215         layers, like:
18216
18217         int old = Report.Errors;
18218         x = new PropertyExpr (...);
18219         if (old != Report.Errors)
18220                 return null;
18221         else
18222                 return x;
18223
18224         So the property expr is returned, but it is invalid, so the error
18225         will be flagged during the resolve process. 
18226
18227         * class.cs: Remove InheritablePropertySignatureCompare from the
18228         class, as we no longer depend on the property signature to compute
18229         whether it is possible to implement a method or not.
18230
18231         The reason is that calling PropertyInfo.GetGetMethod will return
18232         null (in .NET, in Mono it works, and we should change this), in
18233         cases where the Get Method does not exist in that particular
18234         class.
18235
18236         So this code:
18237
18238         class X { public virtual int A { get { return 1; } } }
18239         class Y : X { }
18240         class Z : Y { public override int A { get { return 2; } } }
18241
18242         Would fail in Z because the parent (Y) would not have the property
18243         defined.  So we avoid this completely now (because the alternative
18244         fix was ugly and slow), and we now depend exclusively on the
18245         method names.
18246
18247         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18248         reference method, instead of using the property.
18249
18250         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18251         routines are gone now.
18252
18253         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18254         names, they were incorrectly named.
18255
18256         * cs-tokenizer.cs: Return are more gentle token on failure. 
18257
18258         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18259         had an out-of-sync index variable, which caused it to remove from
18260         the list of pending methods the wrong method sometimes.
18261
18262 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18265         CanWrite, because those refer to this particular instance of the
18266         property, and do not take into account the fact that we can
18267         override single members of a property.
18268
18269         Constructor requires an EmitContext.  The resolution process does
18270         not happen here, but we need to compute the accessors before,
18271         because the resolution does not always happen for properties.
18272
18273         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18274         subclass, before we did not update this flag, but we did update
18275         bindingflags. 
18276
18277         (GetAccessors): Drop this routine, as it did not work in the
18278         presence of partially overwritten set/get methods. 
18279
18280         Notice that this broke the cs1540 detection, but that will require
18281         more thinking. 
18282
18283 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18284
18285         * class.cs:
18286         * codegen.cs:
18287         * driver.cs: issue a warning instead of an error if we don't support
18288         debugging for the platform. Also ignore a couple of errors that may
18289         arise when trying to write the symbols. Undo my previous patch.
18290
18291 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18292
18293         * driver.cs: ignore /debug switch except for Unix platforms.
18294
18295 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18296
18297         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18298
18299 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18300
18301         * driver.cs: Do not make mcs-debug conditional, so we do not break
18302         builds that use it.
18303
18304         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18305         review this patch.  But basically after all the children variables
18306         have been merged, the value of "Breaks" was not being set to
18307         new_breaks for Switch blocks.  I think that it should be set after
18308         it has executed.  Currently I set this to the value of new_breaks,
18309         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18310         conservative, but I do not understand this code very well.
18311
18312         I did not break anything in the build, so that is good ;-)
18313
18314         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18315
18316 2002-10-20  Mark Crichton  <crichton@gimp.org>
18317
18318         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18319
18320 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18321
18322         * cfold.cs: Fixed compile blocker.
18323
18324 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18325
18326         * driver.cs: I was chekcing the key, not the file.
18327
18328 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18329
18330         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18331         message that we were generating - we just need to silently return
18332         a null.
18333
18334 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * class.cs (Event.Define): Change my previous commit, as this
18337         breaks the debugger.  This is a temporary hack, as it seems like
18338         the compiler is generating events incorrectly to begin with.
18339
18340         * expression.cs (Binary.ResolveOperator): Added support for 
18341         "U operator - (E x, E y)"
18342
18343         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18344         y)".
18345
18346         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18347         init-only variables, but this path did not take into account that
18348         there might be also instance readonly variables.  Correct this
18349         problem. 
18350
18351         This fixes bug 32253
18352
18353         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18354         delegates as well.
18355
18356         * driver.cs: Change the extension for modules to `netmodule'
18357
18358         * cs-parser.jay: Improved slightly the location tracking for
18359         the debugger symbols.
18360
18361         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18362         modifiers that were specified instead of the hardcoded value
18363         (FamAndAssem).  This was basically ignoring the static modifier,
18364         and others.  Fixes 32429.
18365
18366         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18367         fixed a bug in the process (32476)
18368
18369         * expression.cs (ArrayAccess.EmitAssign): Patch from
18370         hwang_rob@yahoo.ca that fixes bug 31834.3
18371
18372 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18373
18374         * driver.cs: Make the module extension .netmodule.
18375
18376 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18377
18378         * driver.cs: Report an error if the resource file is not found
18379         instead of crashing.
18380
18381         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18382         false, like Emit does.
18383
18384 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18385
18386         * typemanager.cs: Remove unused private member.  Also reported mcs
18387         bug to report this as a warning like csc.
18388
18389 2002-10-15  Martin Baulig  <martin@gnome.org>
18390
18391         * statement.cs (Statement.Emit): Made this a virtual method; emits
18392         the line number info and calls DoEmit().
18393         (Statement.DoEmit): New protected abstract method, formerly knows
18394         as Statement.Emit().
18395
18396         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18397
18398 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18401         have fixed a remaining problem: not every AddXXXX was adding a
18402         fully qualified name.  
18403
18404         Now everyone registers a fully qualified name in the DeclSpace as
18405         being defined instead of the partial name.  
18406
18407         Downsides: we are slower than we need to be due to the excess
18408         copies and the names being registered this way.  
18409
18410         The reason for this is that we currently depend (on the corlib
18411         bootstrap for instance) that types are fully qualified, because
18412         we dump all the types in the namespace, and we should really have
18413         types inserted into the proper namespace, so we can only store the
18414         basenames in the defined_names array.
18415
18416 2002-10-10  Martin Baulig  <martin@gnome.org>
18417
18418         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18419         from bug #31834, see the bug report for a testcase which is
18420         miscompiled.
18421
18422 2002-10-10  Martin Baulig  <martin@gnome.org>
18423
18424         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18425         flow analysis code for this.
18426
18427         * statement.cs (Do, While, For): Tell the flow analysis code about
18428         infinite loops.
18429         (FlowBranching.UsageVector): Added support for infinite loops.
18430         (Block.Resolve): Moved the dead code elimination here and use flow
18431         analysis to do it.
18432
18433 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18434
18435         * class.cs (Field.Define): Catch cycles on struct type
18436         definitions. 
18437
18438         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18439         fields if the fields are static.  We only need to check instance
18440         fields. 
18441
18442         * expression.cs (As.DoResolve): Test for reference type.
18443
18444         * statement.cs (Using.ResolveExpression): Use
18445         ConvertImplicitRequired, not ConvertImplicit which reports an
18446         error on failture
18447         (Using.ResolveLocalVariableDecls): ditto.
18448
18449         * expression.cs (Binary.ResolveOperator): Report errors in a few
18450         places where we had to.
18451
18452         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18453
18454 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18455
18456         * expression.cs: Use StoreFromPtr instead of extracting the type
18457         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18458
18459         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18460         an enumeration value to a System.Enum, but System.Enum is not a
18461         value type, but an class type, so we need to box.
18462
18463         (Expression.ConvertExplicit): One codepath could return
18464         errors but not flag them.  Fix this.  Fixes #31853
18465
18466         * parameter.cs (Resolve): Do not allow void as a parameter type.
18467
18468 2002-10-06  Martin Baulig  <martin@gnome.org>
18469
18470         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18471         if it's a class type and not a struct.  Fixes #31815.
18472
18473 2002-10-06  Martin Baulig  <martin@gnome.org>
18474
18475         * statement.cs: Reworked the flow analysis code a bit to make it
18476         usable for dead code elimination.
18477
18478 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18479
18480         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18481
18482 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18485         to fix the test 165, will investigate deeper.
18486
18487 2002-10-04  Martin Baulig  <martin@gnome.org>
18488
18489         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18490         finally blocks actually work.
18491         (Try.Resolve): We don't need to create a sibling for `finally' if
18492         there is no finally block.
18493
18494 2002-10-04  Martin Baulig  <martin@gnome.org>
18495
18496         * class.cs (Constructor.Define): The default accessibility for a
18497         non-default constructor is private, not public.
18498
18499 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * class.cs (Constructor): Make AllowedModifiers public, add
18502         EXTERN.
18503
18504         * cs-parser.jay: Perform the modifiers test here, as the
18505         constructor for the Constructor class usually receives a zero
18506         because of the way we create it (first we create, later we
18507         customize, and we were never checking the modifiers).
18508
18509         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18510         is a version of LookupTypeReflection that includes the type-name
18511         cache.  This can be used as a fast path for functions that know
18512         the fully qualified name and are only calling into *.GetType() to
18513         obtain a composed type.
18514
18515         This is also used by TypeManager.LookupType during its type
18516         composition.
18517
18518         (LookupType): We now also track the real type name, as sometimes
18519         we can get a quey for the real type name from things like
18520         ComposedCast.  This fixes bug 31422.
18521
18522         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18523         complete type fullname, it does not have to go through the type
18524         resolution system to obtain the composed version of the type (for
18525         obtaining arrays or pointers).
18526
18527         (Conditional.Emit): Use the EmitBoolExpression to
18528         generate nicer code, as requested by Paolo.
18529
18530         (ArrayCreation.CheckIndices): Use the patch from
18531         hwang_rob@yahoo.ca to validate the array initializers. 
18532
18533 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
18534
18535         * class.cs (ConstructorInitializer.Emit): simplify code by using
18536         Invocation.EmitCall, and at the same time, fix the bugs in calling
18537         parent constructors that took variable arguments. 
18538
18539         * ecore.cs (Expression.ConvertNumericExplicit,
18540         Expression.ImplicitNumericConversion): Remove the code that
18541         manually wrapped decimal (InternalTypeConstructor call is now gone
18542         as well).
18543
18544         * expression.cs (Cast.TryReduce): Also handle decimal types when
18545         trying to perform a constant fold on the type.
18546
18547         * typemanager.cs (IsUnmanagedtype): Partially implemented.
18548
18549         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18550         that only turned off an error report, and did nothing else. 
18551
18552 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * driver.cs: Handle and ignore /fullpaths
18555
18556 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
18557
18558         * expression.cs (Binary.ResolveOperator): Catch the case where
18559         DoNumericPromotions returns true, 
18560
18561         (Binary.DoNumericPromotions): Simplify the code, and the tests.
18562
18563 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
18564
18565         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18566         report error 70.
18567
18568 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
18569
18570         * ecore.cs (ConvertNumericExplicit): It is not enough that the
18571         conversion exists, but it is also required that the conversion be
18572         performed.  This manifested in "(Type64Enum) 2".  
18573
18574         * class.cs (TypeManager.AddMethod): The fix is not to change
18575         AddEnum, because that one was using a fully qualified name (every
18576         DeclSpace derivative does), but to change the AddMethod routine
18577         that was using an un-namespaced name.  This now correctly reports
18578         the duplicated name.
18579
18580         Revert patch until I can properly fix it.  The issue
18581         is that we have a shared Type space across all namespaces
18582         currently, which is wrong.
18583
18584         Options include making the Namespace a DeclSpace, and merge
18585         current_namespace/current_container in the parser.
18586
18587 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * cs-parser.jay: Improve error reporting when we get a different
18590         kind of expression in local_variable_type and
18591         local_variable_pointer_type. 
18592
18593         Propagate this to avoid missleading errors being reported.
18594
18595         * ecore.cs (ImplicitReferenceConversion): treat
18596         TypeManager.value_type as a target just like object_type.   As
18597         code like this:
18598
18599         ValueType v = 1;
18600
18601         Is valid, and needs to result in the int 1 being boxed before it
18602         is assigned to the value type v.
18603
18604         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18605         to validate the enumeration name.
18606
18607         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18608         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
18609         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18610
18611         * ecore.cs (TryImplicitIntConversion): When doing an
18612         implicit-enumeration-conversion, check if the type is 64-bits and
18613         perform a conversion before passing to EnumConstant.
18614
18615 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
18616
18617         * decl.cs (Error_AmbiguousTypeReference); New routine used to
18618         report ambiguous type references.  Unlike the MS version, we
18619         report what the ambiguity is.   Innovation at work ;-)
18620
18621         (DeclSpace.FindType): Require a location argument to
18622         display when we display an ambiguous error.
18623
18624         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18625
18626         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18627
18628         * expression.cs (EmitDynamicInitializers): Apply patch from
18629         hwang_rob@yahoo.ca that fixes the order in which we emit our
18630         initializers. 
18631
18632 2002-09-21  Martin Baulig  <martin@gnome.org>
18633
18634         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18635         delegate takes no arguments.
18636
18637 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18640         from integers.
18641
18642         * expression.cs: Extract the underlying type.
18643
18644         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18645
18646         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18647
18648 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * class.cs (TypeContainer.DefineType): We can not use the nice
18651         PackingSize with the size set to 1 DefineType method, because it
18652         will not allow us to define the interfaces that the struct
18653         implements.
18654
18655         This completes the fixing of bug 27287
18656
18657         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18658         means also structs.  This fixes part of the problem. 
18659         (Expresion.ImplicitReferenceConversionExists): ditto.
18660
18661         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18662         error if there were no errors reported during the type lookup
18663         process, to avoid duplicates or redundant errors.  Without this
18664         you would get an ambiguous errors plus a type not found.  We have
18665         beaten the user enough with the first error.  
18666
18667         (DeclSparce.FindType): Emit a warning if we have an ambiguous
18668         reference. 
18669
18670         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18671         during the resolution process, stop the lookup, this avoids
18672         repeated error reports (same error twice).
18673
18674         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18675
18676         * typemanager.cs (LookupType): Redo the type lookup code to match
18677         the needs of System.Reflection.  
18678
18679         The issue is that System.Reflection requires references to nested
18680         types to begin with a "+" sign instead of a dot.  So toplevel
18681         types look like: "NameSpace.TopLevelClass", and nested ones look
18682         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18683         levels. 
18684
18685 2002-09-19  Martin Baulig  <martin@gnome.org>
18686
18687         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18688         says that a method always returns or always throws an exception,
18689         don't report the CS0161.
18690
18691         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18692         set `Returns = new_returns'.
18693
18694 2002-09-19  Martin Baulig  <martin@gnome.org>
18695
18696         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18697         to an enum constant, check for a CS0176.
18698
18699 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
18700
18701         * class.cs (TypeContainer.CheckPairedOperators): Now we check
18702         for operators that must be in pairs and report errors.
18703
18704         * ecore.cs (SimpleName.DoResolveType): During the initial type
18705         resolution process, when we define types recursively, we must
18706         check first for types in our current scope before we perform
18707         lookups in the enclosing scopes.
18708
18709         * expression.cs (MakeByteBlob): Handle Decimal blobs.
18710
18711         (Invocation.VerifyArgumentsCompat): Call
18712         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18713         I thought we were supposed to always call this, but there are a
18714         few places in the code where we dont do it.
18715
18716 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
18717
18718         * driver.cs: Add support in -linkres and -resource to specify the
18719         name of the identifier.
18720
18721 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18722
18723         * ecore.cs (StandardConversionExists): Sync with the conversion
18724         code: allow anything-* to void* conversions.
18725
18726         (FindMostSpecificSource): Use an Expression argument
18727         instead of a Type, because we might be handed over a Literal which
18728         gets a few more implicit conversions that plain types do not.  So
18729         this information was being lost.
18730
18731         Also, we drop the temporary type-holder expression when not
18732         required.
18733
18734 2002-09-17  Martin Baulig  <martin@gnome.org>
18735
18736         * class.cs (PropertyBase.CheckBase): Don't check the base class if
18737         this is an explicit interface implementation.
18738
18739 2002-09-17  Martin Baulig  <martin@gnome.org>
18740
18741         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18742         different `IndexerName' attributes.
18743
18744         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18745         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18746         virtual CommonResolve().
18747
18748 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18749
18750         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18751         and convert that to the UnderlyingType.
18752
18753         * statement.cs (Foreach.Resolve): Indexers are just like variables
18754         or PropertyAccesses.
18755
18756         * cs-tokenizer.cs (consume_string): Track line numbers and columns
18757         inside quoted strings, we were not doing this before.
18758
18759 2002-09-16  Martin Baulig  <martin@gnome.org>
18760
18761         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
18762         resolve it.  This is needed for the definite assignment check of the
18763         instance expression, fixes bug #29846.
18764         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
18765
18766 2002-09-16  Nick Drochak  <ndrochak@gol.com>
18767
18768         * parameter.cs: Fix compile error.  Cannot reference static member
18769         from an instance object.  Is this an mcs bug?
18770
18771 2002-09-14  Martin Baulig  <martin@gnome.org>
18772
18773         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
18774         multiple times.  Fixes bug #30295, added test-166.cs.
18775
18776 2002-09-14  Martin Baulig  <martin@gnome.org>
18777
18778         * statement.cs (Block.Emit): Don't emit unreachable code.
18779         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
18780         `break' statements.
18781         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
18782
18783 2002-09-14  Martin Baulig  <martin@gnome.org>
18784
18785         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
18786         is set.
18787
18788 2002-09-14  Martin Baulig  <martin@gnome.org>
18789
18790         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
18791         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
18792         be false on the ms runtime.
18793
18794 2002-09-13  Martin Baulig  <martin@gnome.org>
18795
18796         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
18797         the CS0038 error message.
18798
18799 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
18802         constant inside, return it.
18803
18804 2002-09-12  Martin Baulig  <martin@gnome.org>
18805
18806         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
18807         implicit conversion can be done between enum types.
18808
18809         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
18810         check whether an implicit conversion to the current enum's UnderlyingType
18811         exists and report an error if not.
18812
18813         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
18814         without debugging support.
18815
18816         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18817         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
18818
18819 2002-09-12  Martin Baulig  <martin@gnome.org>
18820
18821         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18822
18823         * ecore.cs (IMemberExpr.DeclaringType): New property.
18824         (SimpleName.SimpleNameResolve): Check whether we're accessing a
18825         nonstatic member of an outer type (CS0038).
18826
18827 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
18828
18829         * driver.cs: Activate the using-error detector at warning level
18830         4 (at least for MS-compatible APIs).
18831
18832         * namespace.cs (VerifyUsing): Small buglett fix.
18833
18834         * pending.cs (PendingImplementation): pass the container pointer. 
18835
18836         * interface.cs (GetMethods): Allow for recursive definition.  Long
18837         term, I would like to move every type to support recursive
18838         definitions, not the current ordering mechanism that we have right
18839         now.
18840
18841         The situation is this: Attributes are handled before interfaces,
18842         so we can apply attributes to interfaces.  But some attributes
18843         implement interfaces, we will now handle the simple cases
18844         (recursive definitions will just get an error).  
18845
18846         * parameter.cs: Only invalidate types at the end if we fail to
18847         lookup all types.  
18848
18849 2002-09-09  Martin Baulig  <martin@gnome.org>
18850
18851         * ecore.cs (PropertyExpr.Emit): Also check for
18852         TypeManager.system_int_array_get_length so this'll also work when
18853         compiling corlib.  Fixes #30003.
18854
18855 2002-09-09  Martin Baulig  <martin@gnome.org>
18856
18857         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18858         and throw an exception if we can't get the type's size.  Fixed #30040,
18859         added test-165.cs.
18860
18861 2002-09-09  Martin Baulig  <martin@gnome.org>
18862
18863         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18864
18865         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18866         context.  Fixes bug #30027.
18867
18868         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18869         virtual functions.  Fixes bug #30043, added test-164.cs.
18870
18871 2002-09-08  Ravi Pratap  <ravi@ximian.com>
18872
18873         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18874
18875 2002-09-08  Nick Drochak  <ndrochak@gol.com>
18876
18877         * driver.cs: Use an object to get the windows codepage since it's not a
18878         static property.
18879
18880 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * statement.cs (For.Emit): for infinite loops (test == null)
18883         return whether there is a break inside, not always "true".
18884
18885         * namespace.cs (UsingEntry): New struct to hold the name of the
18886         using definition, the location where it is defined, and whether it
18887         has been used in a successful type lookup.
18888
18889         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18890         strings.
18891
18892         * decl.cs: ditto.
18893
18894 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18895
18896         * attribute.cs : Fix incorrect code which relied on catching
18897         a NullReferenceException to detect a null being passed in
18898         where an object was expected.
18899
18900 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
18901
18902         * statement.cs (Try): flag the catch variable as assigned
18903
18904         * expression.cs (Cast): Simplified by using ResolveType instead of
18905         manually resolving.
18906
18907         * statement.cs (Catch): Fix bug by using ResolveType.
18908
18909 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18910
18911         * expression.cs (BetterConversion): Special case for when we have
18912         a NullLiteral as the argument and we have to choose between string
18913         and object types - we choose string the way csc does.
18914
18915         * attribute.cs (Attribute.Resolve): Catch the
18916         NullReferenceException and report error #182 since the Mono
18917         runtime no more has the bug and having this exception raised means
18918         we tried to select a constructor which takes an object and is
18919         passed a null.
18920
18921 2002-09-05  Ravi Pratap  <ravi@ximian.com>
18922
18923         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18924         message (1502, 1503) when we can't locate a method after overload
18925         resolution. This is much more informative and closes the bug
18926         Miguel reported.
18927
18928         * interface.cs (PopulateMethod): Return if there are no argument
18929         types. Fixes a NullReferenceException bug.
18930
18931         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18932         expressions too. Previously we were checking only in one place for
18933         positional arguments leaving out named arguments.
18934
18935         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18936         type to the enum type is not allowed. Remove code corresponding to
18937         that.
18938
18939         (ConvertNumericExplicit): Allow explicit conversions from
18940         the underlying type to enum type. This precisely follows the spec
18941         and closes a bug filed by Gonzalo.
18942
18943 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18944
18945         * compiler.csproj:
18946         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18947
18948 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
18949
18950         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18951         it was important that we stored the right value after the
18952         reduction in `converted'.
18953
18954 2002-09-04  Martin Baulig  <martin@gnome.org>
18955
18956         * location.cs (Location.SymbolDocument): Use full pathnames for the
18957         source files.
18958
18959 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18962         of the expression resolve mechanism, because that will catch the
18963         SimpleName error failures.
18964
18965         (Conditional): If we can not resolve the
18966         expression, return, do not crash.
18967
18968 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18969
18970         * cs-tokenizer.cs:
18971         (location): display token name instead of its number.
18972
18973 2002-08-28  Martin Baulig  <martin@gnome.org>
18974
18975         * expression.cs (Binary.ResolveOperator): Don't silently return
18976         but return an error if an operator cannot be applied between two
18977         enum types.
18978
18979 2002-08-28  Martin Baulig  <martin@gnome.org>
18980
18981         * class.cs (Constructor.Define): Set the permission attributes
18982         correctly instead of making all constructors public.
18983
18984 2002-08-28  Martin Baulig  <martin@gnome.org>
18985
18986         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18987         for private members before reporting a CS0103; if we find anything,
18988         it's a CS0122.
18989
18990 2002-08-28  Martin Baulig  <martin@gnome.org>
18991
18992         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18993         to check whether `closure_start_type == closure_invocation_type',
18994         we also need to check whether `m.DeclaringType == closure_invocation_type'
18995         before bypassing the permission checks.  We might be accessing
18996         protected/private members from the base class.
18997         (TypeManager.RealMemberLookup): Only set private_ok if private
18998         members were requested via BindingFlags.NonPublic.
18999
19000         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19001
19002         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19003         MethodGroupExpr.IsExplicitImpl if appropriate.
19004         (Invocation.DoResolve): Don't report the CS0120 for explicit
19005         interface implementations.
19006
19007 2002-08-27  Martin Baulig  <martin@gnome.org>
19008
19009         * expression.cs (Invocation.DoResolve): If this is a static
19010         method and we don't have an InstanceExpression, we must report
19011         a CS0120.
19012
19013 2002-08-25  Martin Baulig  <martin@gnome.org>
19014
19015         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19016         `==' between a valuetype and an object.
19017
19018 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19019
19020         * ecore.cs (TypeExpr): Provide a ToString method.
19021
19022 2002-08-24  Martin Baulig  <martin@gnome.org>
19023
19024         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19025         now called proggie.dbg and it's a binary file.
19026
19027 2002-08-23  Martin Baulig  <martin@gnome.org>
19028
19029         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19030
19031 2002-08-23  Martin Baulig  <martin@gnome.org>
19032
19033         * struct.cs (MyStructInfo.ctor): Make this work with empty
19034         structs; it's not allowed to use foreach() on null.
19035
19036 2002-08-23  Martin Baulig  <martin@gnome.org>
19037
19038         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19039         writer the full pathname of the generated assembly.
19040
19041 2002-08-23  Martin Baulig  <martin@gnome.org>
19042
19043         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19044         A `finally' block never returns or breaks; improved handling of
19045         unreachable code.
19046
19047 2002-08-23  Martin Baulig  <martin@gnome.org>
19048
19049         * statement.cs (Throw.Resolve): Allow `throw null'.
19050
19051 2002-08-23  Martin Baulig  <martin@gnome.org>
19052
19053         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19054         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19055         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19056         MemberLookup would return a wrong event if this is an explicit
19057         interface implementation and the class has an event with the same
19058         name.
19059
19060 2002-08-23  Martin Baulig  <martin@gnome.org>
19061
19062         * statement.cs (Block.AddChildVariableNames): New public method.
19063         (Block.AddChildVariableName): Likewise.
19064         (Block.IsVariableNameUsedInChildBlock): Likewise.
19065         (Block.AddVariable): Check whether a variable name has already
19066         been used in a child block.
19067
19068         * cs-parser.jay (declare_local_variables): Mark all variable names
19069         from the current block as being used in a child block in the
19070         implicit block.
19071
19072 2002-08-23  Martin Baulig  <martin@gnome.org>
19073
19074         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19075         find the symbol writer.
19076
19077         * driver.cs: csc also allows the arguments to /define being
19078         separated by commas, not only by semicolons.
19079
19080 2002-08-23  Martin Baulig  <martin@gnome.org>
19081
19082         * interface.cs (Interface.GetMembers): Added static check for events.
19083
19084 2002-08-15  Martin Baulig  <martin@gnome.org>
19085
19086         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19087         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19088
19089         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19090         why the MethodData.EmitDestructor() change was necessary.
19091
19092 2002-08-20  Martin Baulig  <martin@gnome.org>
19093
19094         * class.cs (TypeContainer.FindMembers): Added static check for events.
19095
19096         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19097
19098         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19099         use Type.GetEvents(), not Type.FindMembers().
19100
19101 2002-08-20  Martin Baulig  <martin@gnome.org>
19102
19103         * decl.cs (MemberCache): Added a special method cache which will
19104         be used for method-only searched.  This ensures that a method
19105         search will return a MethodInfo with the correct ReflectedType for
19106         inherited methods.      
19107
19108 2002-08-20  Martin Baulig  <martin@gnome.org>
19109
19110         * decl.cs (DeclSpace.FindMembers): Made this public.
19111
19112 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19113
19114         * delegate.cs: fixed build on windows.
19115         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19116
19117 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19118
19119         * ecore.cs (StandardConversionExists): Return a false
19120         if we are trying to convert the void type to anything else
19121         since that is not allowed.
19122
19123         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19124         we flag error 70 in the event an event is trying to be accessed
19125         directly from outside the declaring type.
19126
19127 2002-08-20  Martin Baulig  <martin@gnome.org>
19128
19129         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19130         MemberCache from typemanager.cs to decl.cs.
19131
19132 2002-08-19  Martin Baulig  <martin@gnome.org>
19133
19134         * class.cs (TypeContainer): Implement IMemberContainer.
19135         (TypeContainer.DefineMembers): Create the MemberCache.
19136         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19137         return public members if BindingFlags.Public was given, check
19138         whether members are static.
19139
19140 2002-08-16  Martin Baulig  <martin@gnome.org>
19141
19142         * decl.cs (DeclSpace.Define): Splitted this in Define and
19143         DefineMembers.  DefineMembers is called first and initializes the
19144         MemberCache.
19145
19146         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19147         DefineMembers() on all our DeclSpaces.
19148
19149         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19150         but call DefineMembers() on all nested interfaces.  We call their
19151         Define() in our new Define() function.
19152
19153         * interface.cs (Interface): Implement IMemberContainer.
19154         (Interface.Define): Moved all code except the attribute stuf to
19155         DefineMembers().
19156         (Interface.DefineMembers): Initialize the member cache.
19157
19158         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19159         need this anymore since we can use MemberCache.FindMembers directly.
19160
19161 2002-08-19  Martin Baulig  <martin@gnome.org>
19162
19163         * typemanager.cs (MemberCache): When creating the cache for an
19164         interface type, add all inherited members.
19165         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19166         to `out bool used_cache' and documented it.
19167         (TypeManager.MemberLookup): If we already used the cache in the first
19168         iteration, we don't need to do the interfaces check.
19169
19170 2002-08-19  Martin Baulig  <martin@gnome.org>
19171
19172         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19173         here from IMemberFinder and don't implement this interface anymore.
19174         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19175
19176         * typemanager.cs (IMemberFinder): This interface is now only used by
19177         classes which actually support the member cache.
19178         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19179         since we only put DeclSpaces into this Hashtable.
19180         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19181         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19182
19183 2002-08-16  Martin Baulig  <martin@gnome.org>
19184
19185         * typemanager.cs (ICachingMemberFinder): Removed.
19186         (IMemberFinder.MemberCache): New property.
19187         (TypeManager.FindMembers): Merged this with RealFindMembers().
19188         This function will never be called from TypeManager.MemberLookup()
19189         so we can't use the cache here, just the IMemberFinder.
19190         (TypeManager.MemberLookup_FindMembers): Check whether the
19191         IMemberFinder has a MemberCache and call the cache's FindMembers
19192         function.
19193         (MemberCache): Rewrote larger parts of this yet another time and
19194         cleaned it up a bit.
19195
19196 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19197
19198         * driver.cs (LoadArgs): Support quoting.
19199
19200         (Usage): Show the CSC-like command line arguments.
19201
19202         Improved a few error messages.
19203
19204 2002-08-15  Martin Baulig  <martin@gnome.org>
19205
19206         * typemanager.cs (IMemberContainer.Type): New property.
19207         (IMemberContainer.IsInterface): New property.
19208
19209         The following changes are conditional to BROKEN_RUNTIME, which is
19210         defined at the top of the file.
19211
19212         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19213         class'es members, but add all members from TypeHandle.ObjectType
19214         if we're an interface.
19215         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19216         is the current type.
19217         (MemberCache.CacheEntry.Container): Removed this field.
19218         (TypeHandle.GetMembers): Include inherited members.
19219
19220 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19221
19222         * typemanager.cs: fixed compilation and added a comment on a field that
19223         is never used.
19224
19225 2002-08-15  Martin Baulig  <martin@gnome.org>
19226
19227         * class.cs (ConstructorInitializer.Resolve): In the
19228         Expression.MemberLookup call, use the queried_type as
19229         invocation_type.
19230
19231         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19232         declared' attribute, it's always true.
19233         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19234         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19235         temporary wrapper for FindMembers which tells MemberLookup whether
19236         members from the base classes are included in the return value.
19237         This will go away soon.
19238         (TypeManager.MemberLookup): Use this temporary hack here; once the
19239         new MemberCache is completed, we don't need to do the DeclaredOnly
19240         looping here anymore since the MemberCache will take care of this.
19241         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19242         (MemberCache): When creating the MemberCache for a class, get
19243         members from the current class and all its base classes.
19244         (MemberCache.CacheEntry.Container): New field.  This is a
19245         temporary hack until the Mono runtime is fixed to distinguish
19246         between ReflectedType and DeclaringType.  It allows us to use MCS
19247         with both the MS runtime and the unfixed Mono runtime without
19248         problems and without accecting performance.
19249         (MemberCache.SearchMembers): The DeclaredOnly looping from
19250         TypeManager.MemberLookup is now done here.      
19251
19252 2002-08-14  Martin Baulig  <martin@gnome.org>
19253
19254         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19255         Type.GetFields on dynamic types but get the fields from the
19256         corresponding TypeContainer.
19257         (MyStructInfo.GetStructInfo): Added check for enum types.
19258
19259         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19260         (MemberList.SyncRoot): Implemented.
19261         (TypeManager.FilterWithClosure): No need to check permissions if
19262         closure_start_type == closure_invocation_type, don't crash if
19263         closure_invocation_type is null.
19264
19265 2002-08-13  Martin Baulig  <martin@gnome.org>
19266
19267         Rewrote TypeContainer.FindMembers to use a member cache.  This
19268         gives us a speed increase of about 35% for the self-hosting MCS
19269         build and of about 15-20% for the class libs (both on GNU/Linux).
19270
19271         * report.cs (Timer): New class to get enhanced profiling.  This
19272         whole class is "TIMER" conditional since it remarkably slows down
19273         compilation speed.
19274
19275         * class.cs (MemberList): New class.  This is an IList wrapper
19276         which we're now using instead of passing MemberInfo[]'s around to
19277         avoid copying this array unnecessarily.
19278         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19279         (ICachingMemberFinder, IMemberContainer): New interface.
19280         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19281         has already been checked, otherwise use it for the name comparision.
19282         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19283         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19284         if possible.  Returns a MemberList, not a MemberInfo [].
19285         (TypeHandle): New class, implements IMemberContainer.  We create
19286         one instance of this class per type, it contains a MemberCache
19287         which is used to do the member lookups.
19288         (MemberCache): New class.  Each instance of this class contains
19289         all members of a type and a name-based hash table.
19290         (MemberCache.FindMembers): This is our new member lookup
19291         function.  First, it looks up all members of the requested name in
19292         the hash table.  Then, it walks this list and sorts out all
19293         applicable members and returns them.
19294
19295 2002-08-13  Martin Baulig  <martin@gnome.org>
19296
19297         In addition to a nice code cleanup, this gives us a performance
19298         increase of about 1.4% on GNU/Linux - not much, but it's already
19299         half a second for the self-hosting MCS compilation.
19300
19301         * typemanager.cs (IMemberFinder): New interface.  It is used by
19302         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19303         Enum, Delegate or Interface.
19304         (TypeManager.finder_to_member_finder): New PtrHashtable.
19305         (TypeManager.finder_to_container): Removed.
19306         (TypeManager.finder_to_delegate): Removed.
19307         (TypeManager.finder_to_interface): Removed.
19308         (TypeManager.finder_to_enum): Removed.
19309
19310         * interface.cs (Interface): Implement IMemberFinder.
19311
19312         * delegate.cs (Delegate): Implement IMemberFinder.
19313
19314         * enum.cs (Enum): Implement IMemberFinder.
19315
19316         * class.cs (TypeContainer): Implement IMemberFinder.
19317
19318 2002-08-12  Martin Baulig  <martin@gnome.org>
19319
19320         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19321
19322 2002-08-12  Martin Baulig  <martin@gnome.org>
19323
19324         * ecore.cs (ITypeExpression): New interface for expressions which
19325         resolve to a type.
19326         (TypeExpression): Renamed to TypeLookupExpression.
19327         (Expression.DoResolve): If we're doing a types-only lookup, the
19328         expression must implement the ITypeExpression interface and we
19329         call DoResolveType() on it.
19330         (SimpleName): Implement the new ITypeExpression interface.
19331         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19332         hack, the situation that we're only looking up types can't happen
19333         anymore when this method is called.  Moved the type lookup code to
19334         DoResolveType() and call it.
19335         (SimpleName.DoResolveType): This ITypeExpression interface method
19336         is now doing the types-only lookup.
19337         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19338         (ResolveFlags): Added MaskExprClass.
19339
19340         * expression.cs (MemberAccess): Implement the ITypeExpression
19341         interface.
19342         (MemberAccess.DoResolve): Added support for a types-only lookup
19343         when we're called via ITypeExpression.DoResolveType().
19344         (ComposedCast): Implement the ITypeExpression interface.
19345
19346         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19347         Expression.Resolve() with ResolveFlags.Type instead.
19348
19349 2002-08-12  Martin Baulig  <martin@gnome.org>
19350
19351         * interface.cs (Interface.Define): Apply attributes.
19352
19353         * attribute.cs (Attribute.ApplyAttributes): Added support for
19354         interface attributes.
19355
19356 2002-08-11  Martin Baulig  <martin@gnome.org>
19357
19358         * statement.cs (Block.Emit): Only check the "this" variable if we
19359         do not always throw an exception.
19360
19361         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19362         whether the property has a set accessor.
19363
19364 2002-08-11  Martin Baulig  <martin@gnome.org>
19365
19366         Added control flow analysis support for structs.
19367
19368         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19369         with control flow analysis turned off.
19370         (IVariable): New interface.
19371         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19372         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19373         (FieldExpr.DoResolve): Resolve the instance expression with flow
19374         analysis turned off and do the definite assignment check after the
19375         resolving when we know what the expression will resolve to.
19376
19377         * expression.cs (LocalVariableReference, ParameterReference):
19378         Implement the new IVariable interface, only call the flow analysis
19379         code if ec.DoFlowAnalysis is true.
19380         (This): Added constructor which takes a Block argument.  Implement
19381         the new IVariable interface.
19382         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19383         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19384         This does the definite assignment checks for struct members.
19385
19386         * class.cs (Constructor.Emit): If this is a non-static `struct'
19387         constructor which doesn't have any initializer, call
19388         Block.AddThisVariable() to tell the flow analysis code that all
19389         struct elements must be initialized before control returns from
19390         the constructor.
19391
19392         * statement.cs (MyStructInfo): New public class.
19393         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19394         argument to this indexer.  If non-zero, check an individual struct
19395         member, not the whole struct.
19396         (FlowBranching.CheckOutParameters): Check struct members.
19397         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19398         overloaded versions of these methods which take an additional
19399         `int field_idx' argument to check struct members.
19400         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19401         overloaded versions of these methods which take an additional
19402         `string field_name' argument to check struct member.s
19403         (VariableInfo): Implement the IVariable interface.
19404         (VariableInfo.StructInfo): New public property.  Returns the
19405         MyStructInfo instance of the variable if it's a struct or null.
19406         (Block.AddThisVariable): New public method.  This is called from
19407         Constructor.Emit() for non-static `struct' constructor which do
19408         not have any initializer.  It creates a special variable for the
19409         "this" instance variable which will be checked by the flow
19410         analysis code to ensure that all of the struct's fields are
19411         initialized before control returns from the constructor.
19412         (UsageVector): Added support for struct members.  If a
19413         variable/parameter is a struct with N members, we reserve a slot
19414         in the usage vector for each member.  A struct is considered fully
19415         initialized if either the struct itself (slot 0) or all its
19416         members are initialized.
19417
19418 2002-08-08  Martin Baulig  <martin@gnome.org>
19419
19420         * driver.cs (Driver.MainDriver): Only report an error CS5001
19421         if there were no compilation errors.
19422
19423         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19424         `UnsafeContext' property to determine whether the parent is in
19425         unsafe context rather than checking the parent's ModFlags:
19426         classes nested in an unsafe class are unsafe as well.
19427
19428 2002-08-08  Martin Baulig  <martin@gnome.org>
19429
19430         * statement.cs (UsageVector.MergeChildren): Distinguish between
19431         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19432         we return.  Added test17() and test18() to test-154.cs.
19433
19434 2002-08-08  Martin Baulig  <martin@gnome.org>
19435
19436         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19437         Family access, make sure the invoking type isn't a subclass of the
19438         queried type (that'd be a CS1540).
19439
19440         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19441         this method which takes an additional `Type invocation_type'.
19442
19443         * expression.cs (BaseAccess.DoResolve): Use the base type as
19444         invocation and query type.
19445         (MemberAccess.DoResolve): If the lookup failed and we're about to
19446         report a CS0122, try a lookup with the ec.ContainerType - if this
19447         succeeds, we must report a CS1540.
19448
19449 2002-08-08  Martin Baulig  <martin@gnome.org>
19450
19451         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19452         (MethodGroupExpr): Implement the IMemberExpr interface.
19453
19454         * expression (MemberAccess.ResolveMemberAccess): No need to have
19455         any special code for MethodGroupExprs anymore, they're now
19456         IMemberExprs.   
19457
19458 2002-08-08  Martin Baulig  <martin@gnome.org>
19459
19460         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19461         Family, FamANDAssem and FamORAssem permissions.
19462         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19463
19464 2002-08-08  Martin Baulig  <martin@gnome.org>
19465
19466         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19467         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19468         or loop block.
19469
19470 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19471
19472         * driver.cs: implemented /resource option to embed managed resources.
19473
19474 2002-08-07  Martin Baulig  <martin@gnome.org>
19475
19476         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19477         (FieldBase.HasFieldInitializer): New public property.
19478         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19479         returns the field initializer and makes sure it is only resolved once.
19480         (TypeContainer.EmitFieldInitializers): Call
19481         FieldBase.GetInitializerExpression to get the initializer, this ensures
19482         that it isn't resolved multiple times.
19483
19484         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19485         the resolving process (SimpleName/MemberLookup) that we're currently
19486         emitting a field initializer (which must not access any instance members,
19487         this is an error CS0236).
19488
19489         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19490         argument, if the `IsFieldInitializer' flag is set, we must report and
19491         error CS0236 and not an error CS0120.   
19492
19493 2002-08-07  Martin Baulig  <martin@gnome.org>
19494
19495         * ecore.cs (IMemberExpr): New public interface.
19496         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19497         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19498         if the expression is an IMemberExpr.
19499
19500         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19501         to be null, implicitly default to `this' if we're non-static in
19502         this case.  Simplified the code a lot by using the new IMemberExpr
19503         interface.  Also fixed bug #28176 here.
19504
19505 2002-08-06  Martin Baulig  <martin@gnome.org>
19506
19507         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19508         ParameterReferences during semantic analysis so that we can do a
19509         type-only search when resolving Cast, TypeOf and SizeOf.
19510         (block): Pass the `current_local_parameters' to the Block's
19511         constructor.
19512
19513         * class.cs (ConstructorInitializer): Added `Parameters parameters'
19514         argument to the constructor.
19515         (ConstructorInitializer.Resolve): Create a temporary implicit
19516         block with the parameters.
19517
19518         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19519         references here if we aren't doing a type-only search.
19520
19521         * statement.cs (Block): Added constructor which takes a
19522         `Parameters parameters' argument.
19523         (Block.Parameters): New public property.
19524
19525         * support.cs (InternalParameters.Parameters): Renamed `parameters'
19526         to `Parameters' and made it public readonly.
19527
19528 2002-08-06  Martin Baulig  <martin@gnome.org>
19529
19530         * ecore.cs (Expression.Warning): Made this public as well.
19531
19532         * report.cs (Report.Debug): Print the contents of collections.
19533
19534 2002-08-06  Martin Baulig  <martin@gnome.org>
19535
19536         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
19537         used to tell Resolve() which kinds of expressions it may return.
19538         (Expression.Resolve): Added overloaded version of this method which
19539         takes a `ResolveFlags flags' argument.  This can be used to tell
19540         Resolve() which kinds of expressions it may return.  Reports a
19541         CS0118 on error.
19542         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19543         ResolveFlags.SimpleName.
19544         (Expression.Error118): Added overloaded version of this method which
19545         takes a `ResolveFlags flags' argument.  It uses the flags to determine
19546         which kinds of expressions are allowed.
19547
19548         * expression.cs (Argument.ResolveMethodGroup): New public method.
19549         Resolves an argument, but allows a MethodGroup to be returned.
19550         This is used when invoking a delegate.
19551
19552         * TODO: Updated a bit.
19553
19554 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19555
19556         Fixed compilation with csc.
19557
19558         * ecore.cs: Expression.Error made public. Is this correct? Should
19559         Warning be made public too?
19560
19561         * expression.cs: use ea.Location instead of ea.loc.
19562         [FIXME:  Filed as bug #28607: MCS must report these errors.]
19563
19564 2002-08-06  Martin Baulig  <martin@gnome.org>
19565
19566         * ecore.cs (Expression.loc): Moved the location here instead of
19567         duplicating it in all derived classes.
19568         (Expression.Location): New public property.
19569         (Expression.Error, Expression.Warning): Made them non-static and
19570         removed the location argument.
19571         (Expression.Warning): Added overloaded version which takes an
19572         `int level' argument.
19573         (Expression.Error118): Make this non-static and removed the
19574         expression and location arguments.
19575         (TypeExpr): Added location argument to the constructor.
19576
19577         * expression.cs (StaticCallExpr): Added location argument to
19578         the constructor.
19579         (Indirection, PointerArithmetic): Likewise.
19580         (CheckedExpr, UnCheckedExpr): Likewise.
19581         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19582         (StringPtr): Likewise.
19583
19584
19585 2002-08-05  Martin Baulig  <martin@gnome.org>
19586
19587         * expression.cs (BaseAccess.DoResolve): Actually report errors.
19588
19589         * assign.cs (Assign.DoResolve): Check whether the source
19590         expression is a value or variable.
19591
19592         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19593         while resolving the corresponding blocks.
19594
19595         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19596         an error, don't silently return null.
19597
19598         * statement.cs (Block.AddVariable): Do the error reporting here
19599         and distinguish between CS0128 and CS0136.
19600         (Block.DoResolve): Report all unused labels (warning CS0164).
19601         (LabeledStatement): Pass the location to the constructor.
19602         (LabeledStatement.HasBeenReferenced): New property.
19603         (LabeledStatement.Resolve): Set it to true here.
19604
19605         * statement.cs (Return.Emit): Return success even after reporting
19606         a type mismatch error (CS0126 or CS0127), this is what csc does and
19607         it avoids confusing the users with any consecutive errors.
19608
19609 2002-08-05  Martin Baulig  <martin@gnome.org>
19610
19611         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19612
19613         * const.cs (Const.LookupConstantValue): Catch circular definitions.
19614
19615         * expression.cs (MemberAccess.DoResolve): Silently return if an
19616         error has already been reported.
19617
19618         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19619         error has already been reported.
19620
19621 2002-08-05  Martin Baulig  <martin@gnome.org>
19622
19623         * statement.cs (UsageVector): Only initialize the `parameters'
19624         vector if we actually have any "out" parameters.
19625
19626 2002-08-05  Martin Baulig  <martin@gnome.org>
19627
19628         * expression.cs (Binary.ResolveOperator): When combining delegates,
19629         they must have the same type.
19630
19631 2002-08-05  Martin Baulig  <martin@gnome.org>
19632
19633         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19634         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19635         work with the ms runtime and we also don't need it: if we're a
19636         PropertyBuilder and not in the `indexer_arguments' hash, then we
19637         are a property and not an indexer.
19638
19639         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19640         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19641         since the latter one doesn't work with the ms runtime.
19642
19643 2002-08-03  Martin Baulig  <martin@gnome.org>
19644
19645         Fixed bugs #27998 and #22735.
19646
19647         * class.cs (Method.IsOperator): New public field.
19648         (Method.CheckBase): Report CS0111 if there's already a method
19649         with the same parameters in the current class.  Report CS0508 when
19650         attempting to change the return type of an inherited method.
19651         (MethodData.Emit): Report CS0179 if a method doesn't have a body
19652         and it's not marked abstract or extern.
19653         (PropertyBase): New abstract base class for Property and Indexer.
19654         (PropertyBase.CheckBase): Moved here from Property and made it work
19655         for indexers.
19656         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19657         the same so we can reuse it there.
19658         (Property, Indexer): Derive from PropertyBase.
19659         (MethodSignature.inheritable_property_signature_filter): New delegate
19660         to find properties and indexers.
19661
19662         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19663         argument and improved error reporting.
19664
19665         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19666         EmptyReadOnlyParameters and made it a property.
19667
19668         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19669         version of this method which takes a `PropertyInfo indexer'.
19670         (TypeManager.RegisterIndexer): New method.
19671
19672         * class.cs: Added myself as author of this file :-)
19673
19674 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19675
19676         * class.cs: fixed compilation on windoze.
19677
19678 2002-08-03  Martin Baulig  <martin@gnome.org>
19679
19680         * interface.cs (Interface.GetInterfaceBases): Check whether all
19681         base interfaces are at least as accessible than the current one.
19682
19683         * class.cs (TypeContainer.GetClassBases): Check whether base types
19684         are at least as accessible than the current type.
19685         (TypeContainer.AsAccessible): Implemented and made non-static.
19686         (MemberBase.CheckParameters): Report errors if the accessibility
19687         checks fail.
19688
19689         * delegate.cs (Delegate.Delegate): The default visibility is
19690         internal for top-level types and private for nested types.
19691         (Delegate.Define): Report errors if the accessibility checks fail.
19692
19693         * enum.cs (Enum.Enum): The default visibility is internal for
19694         top-level types and private for nested types.
19695         (Enum.DefineType): Compute the correct visibility.
19696
19697         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19698         function which takes a `bool is_toplevel' instead of a TypeContainer.
19699
19700         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19701         builtin type.
19702
19703 2002-08-02  Martin Baulig  <martin@gnome.org>
19704
19705         * expression.cs (LocalVariableReferenc): Added constructor which
19706         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19707         (LocalVariableReference.IsReadOnly): New property.
19708         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19709         variable is readonly, use our own readonly flag to do this; you can
19710         use the new constructor to get a writable reference to a read-only
19711         variable.
19712
19713         * cs-parser.jay (foreach_statement, using_statement): Get a writable
19714         reference to the local variable.
19715
19716 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
19717
19718         * rootcontext.cs (ResolveCore): Also include System.Exception
19719
19720         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19721         we reach an EmptyStatement.
19722
19723         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19724         is also fine.
19725
19726         * expression.cs (Binary.ResolveOperator): Check error result in
19727         two places.
19728
19729         use brtrue/brfalse directly and avoid compares to null.
19730
19731 2002-08-02  Martin Baulig  <martin@gnome.org>
19732
19733         * class.cs (TypeContainer.Define): Define all nested interfaces here.
19734         Fixes bug #28407, added test-155.cs.
19735
19736 2002-08-01  Martin Baulig  <martin@gnome.org>
19737
19738         * class.cs (Event.EmitDefaultMethod): Make this work with static
19739         events.  Fixes #28311, added verify-3.cs.
19740
19741 2002-08-01  Martin Baulig  <martin@gnome.org>
19742
19743         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19744         `is_disposable' fields.
19745         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19746         `hm.is_disposable' if we're using the collection pattern.
19747         (Foreach.EmitCollectionForeach): Use the correct type for the
19748         enumerator's local variable, only emit the try/finally block if
19749         necessary (fixes #27713).
19750
19751 2002-08-01  Martin Baulig  <martin@gnome.org>
19752
19753         * ecore.cs (Expression.report118): Renamed to Error118 and made
19754         it public static.
19755
19756         * statement.cs (Throw.Resolve): Check whether the expression is of
19757         the correct type (CS0118) and whether the type derives from
19758         System.Exception (CS0155).
19759         (Catch.Resolve): New method.  Do the type lookup here and check
19760         whether it derives from System.Exception (CS0155).
19761         (Catch.CatchType, Catch.IsGeneral): New public properties.
19762
19763         * typemanager.cs (TypeManager.exception_type): Added.
19764
19765 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
19766
19767         * driver.cs: Updated About function.
19768
19769 2002-07-31  Martin Baulig  <martin@gnome.org>
19770
19771         Implemented Control Flow Analysis.
19772
19773         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
19774         (EmitContext.CurrentBranching): Added.
19775         (EmitContext.StartFlowBranching): Added.
19776         (EmitContext.EndFlowBranching): Added.
19777         (EmitContext.KillFlowBranching): Added.
19778         (EmitContext.IsVariableAssigned): Added.
19779         (EmitContext.SetVariableAssigned): Added.
19780         (EmitContext.IsParameterAssigned): Added.
19781         (EmitContext.SetParameterAssigned): Added.
19782         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
19783         Added control flow analysis stuff here.
19784
19785         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
19786         resolve the expression as lvalue.
19787         (LocalVariableReference.DoResolve): Check whether the variable has
19788         already been assigned.
19789         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
19790         the parameter as assigned here.
19791         (ParameterReference.DoResolve): Check whether the parameter has already
19792         been assigned.
19793         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
19794         expression as lvalue.
19795
19796         * statement.cs (FlowBranching): New class for the flow analysis code.
19797         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
19798         (LabeledStatement.IsDefined): New public property.
19799         (LabeledStatement.AddUsageVector): New public method to tell flow
19800         analyis that the label may be reached via a forward jump.
19801         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
19802         flow analysis.
19803         (VariableInfo.Number): New public field.  This is used by flow analysis
19804         to number all locals of a block.
19805         (Block.CountVariables): New public property.  This is the number of
19806         local variables in this block (including the locals from all parent
19807         blocks).
19808         (Block.EmitMeta): Number all the variables.
19809
19810         * statement.cs: Added flow analysis support to all classes.
19811
19812 2002-07-31  Martin Baulig  <martin@gnome.org>
19813
19814         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19815         To get debugging messages, compile mcs with /define:MCS_DEBUG and
19816         then use this argument.
19817
19818         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19819
19820         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19821         use this to specify /define options.
19822
19823 2002-07-29  Martin Baulig  <martin@gnome.org>
19824
19825         * statement.cs (Fixed): Moved all code that does variable lookups
19826         and resolvings from Emit to Resolve.
19827
19828         * statement.cs (For): Moved all code that does variable lookups
19829         and resolvings from Emit to Resolve.
19830
19831         * statement.cs (Using): Moved all code that does variable lookups
19832         and resolvings from Emit to Resolve.
19833
19834 2002-07-29  Martin Baulig  <martin@gnome.org>
19835
19836         * attribute.cs (Attribute.Resolve): Explicitly catch a
19837         System.NullReferenceException when creating the
19838         CustromAttributeBuilder and report a different warning message.
19839
19840 2002-07-29  Martin Baulig  <martin@gnome.org>
19841
19842         * support.cs (ParameterData.ParameterName): Added method to
19843         get the name of a parameter.
19844
19845         * typemanager.cs (TypeManager.IsValueType): New public method.
19846
19847 2002-07-29  Martin Baulig  <martin@gnome.org>
19848
19849         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
19850         is a flag which specifies that it's either ref or out.
19851         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19852         the out parameter to `out Parameter.Modifier mod', also set the
19853         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19854
19855         * support.cs (InternalParameters.ParameterModifier): Distinguish
19856         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19857         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19858
19859         * expression.cs (Argument.GetParameterModifier): Distinguish
19860         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19861         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19862
19863 2002-07-29  Martin Baulig  <martin@gnome.org>
19864
19865         * expression.cs (ParameterReference.ParameterReference): Added
19866         `Location loc' argument to the constructor.
19867
19868         * cs-parser.jay: Pass location to ParameterReference.
19869
19870 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * statement.cs (Try): Initialize the location.
19873
19874         * cs-parser.jay: pass location to Try.
19875
19876         * expression.cs (Unary.Reduce): Change the prototype to return
19877         whether a constant fold could be performed or not.  The result is
19878         returned in an out parameters.  In the case of Indirection and
19879         AddressOf, we want to perform the full tests.
19880
19881 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * statement.cs (Statement.Emit): Flag dead code.
19884
19885 2002-07-27  Andrew Birkett  <andy@nobugs.org>
19886
19887         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19888
19889 2002-07-27  Martin Baulig  <martin@gnome.org>
19890
19891         * class.cs (MethodData.Define): Put back call to
19892         TypeManager.AddMethod(), accidentally commented this out.
19893
19894         * report.cs (Debug): New public method to print debugging information,
19895         this is `[Conditional ("DEBUG")]'.
19896
19897 2002-07-26  Martin Baulig  <martin@gnome.org>
19898
19899         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19900         (switch_statement): Push the current_block to the switch_stack and
19901         pop it again when we're done with the switch.
19902         (switch_section): The new block is a child of the current_block.
19903         Fixes bug #24007, added test-152.cs.
19904
19905 2002-07-27  Martin Baulig  <martin@gnome.org>
19906
19907         * expression.cs (Invocation.EmitArguments): When calling a varargs
19908         function with only its fixed arguments, we need to pass an empty
19909         array.
19910
19911 2002-07-27  Martin Baulig  <martin@gnome.org>
19912
19913         Mono 0.13 has been released.
19914
19915 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * driver.cs: Rename --resource to --linkres, because that is what
19918         we do currently, we dont support --resource yet.
19919
19920         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19921
19922 2002-07-25  Martin Baulig  <martin@gnome.org>
19923
19924         * class.cs (MethodData): New public class.  This is a `method builder'
19925         class for a method or one accessor of a Property/Indexer/Event.
19926         (MethodData.GetMethodFlags): Moved here from MemberBase.
19927         (MethodData.ApplyAttributes): Likewise.
19928         (MethodData.ApplyObsoleteAttribute): Likewise.
19929         (MethodData.ApplyConditionalAttribute): Likewise.
19930         (MethodData.ApplyDllImportAttribute): Likewise.
19931         (MethodData.CheckAbstractAndExternal): Likewise.
19932         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19933         (MethodData.Emit): Formerly known as Method.Emit().
19934         (MemberBase): Moved everything which was specific to a single
19935         accessor/method to MethodData.
19936         (Method): Create a new MethodData and call Define() and Emit() on it.
19937         (Property, Indexer, Event): Create a new MethodData objects for each
19938         accessor and call Define() and Emit() on them.
19939
19940 2002-07-25  Martin Baulig  <martin@gnome.org>
19941
19942         Made MethodCore derive from MemberBase to reuse the code from there.
19943         MemberBase now also checks for attributes.
19944
19945         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19946         (MemberBase.GetMethodFlags): Moved here from class Method and marked
19947         as virtual.
19948         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19949         `CallingConventions cc' and `Attributes opt_attrs' arguments.
19950         (MemberBase.ApplyAttributes): New virtual method; applies the
19951         attributes to a method or accessor.
19952         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19953         (MemberBase.ApplyConditionalAttribute): Likewise.
19954         (MemberBase.ApplyDllImportAttribute): Likewise.
19955         (MemberBase.CheckAbstractAndExternal): Likewise.
19956         (MethodCore.ParameterTypes): This is now a property instead of a
19957         method, it's initialized from DoDefineParameters().
19958         (MethodCore.ParameterInfo): Removed the set accessor.
19959         (MethodCore.DoDefineParameters): New protected virtual method to
19960         initialize ParameterTypes and ParameterInfo.
19961         (Method.GetReturnType): We can now simply return the MemberType.
19962         (Method.GetMethodFlags): Override the MemberBase version and add
19963         the conditional flags.
19964         (Method.CheckBase): Moved some code from Define() here, call
19965         DoDefineParameters() here.
19966         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19967         here to avoid some larger code duplication.
19968         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19969         ensure that abstract and external accessors don't declare a body.
19970
19971         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19972         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19973         lookup in the attribute's parent classes, so we need to abort as soon
19974         as we found the first match.
19975         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19976         the attribute has no arguments.
19977
19978         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19979         of a Method.
19980
19981 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19982
19983         * cs-parser.jay: reverted previous patch.
19984
19985 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19986
19987         * cs-parser.jay: fixed bug #22119.
19988
19989 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19990
19991         * attribute.cs: fixed compilation. The error was:
19992         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
19993         be assigned to before control leaves the current method."
19994         [FIXME:  Filed as bug #28186: MCS must report this error.]
19995
19996 2002-07-25  Martin Baulig  <martin@gnome.org>
19997
19998         * attribute.cs (Attribute.Conditional_GetConditionName): New static
19999         method to pull the condition name ouf of a Conditional attribute.
20000         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20001         the obsolete message and error flag out of an Obsolete attribute.
20002
20003         * class.cs (Method.GetMethodFlags): New public method to get the
20004         TypeManager.MethodFlags for this method.
20005         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20006         private methods.
20007         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20008         if we're overriding a virtual function, set the new private variable
20009         `parent_method'; call the new TypeManager.AddMethod().
20010
20011         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20012         the MethodBuilder and the Method in a PtrHashtable.
20013         (TypeManager.builder_to_method): Added for this purpose.
20014         (TypeManager.MethodFlags): Added IsObsoleteError.
20015         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20016         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20017         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20018         the message from the attribute.
20019
20020 2002-07-24  Martin Baulig  <martin@gnome.org>
20021
20022         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20023         preprocessor directives, ensure that the argument to #define/#undef is
20024         exactly one identifier and that it's actually an identifier.
20025
20026         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20027         did not work ....
20028
20029 2002-07-24  Martin Baulig  <martin@gnome.org>
20030
20031         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20032         initialize it to TypeManager.object_type in the constructor.
20033         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20034         of the `hm.get_current' method if we're using the collection pattern.
20035         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20036         for the explicit conversion to make it work when we're using the collection
20037         pattern and the `Current' property has a different return type than `object'.
20038         Fixes #27713.
20039
20040 2002-07-24  Martin Baulig  <martin@gnome.org>
20041
20042         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20043         does not match, but don't report any errors.  This method is called in
20044         order for all methods in a MethodGroupExpr until a matching method is
20045         found, so we don't want to bail out if the first method doesn't match.
20046         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20047         matches, report the 123.  Fixes #28070.
20048
20049 2002-07-24  Martin Baulig  <martin@gnome.org>
20050
20051         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20052         TypeManager.TypeToCoreType() to the top of the method so the
20053         following equality checks will work.  Fixes #28107.
20054
20055 2002-07-24  Martin Baulig  <martin@gnome.org>
20056
20057         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20058         operand is of type uint, and the other operand is of type sbyte,
20059         short or int, the operands are converted to type long." -
20060         Actually do what this comment already told us.  Fixes bug #28106,
20061         added test-150.cs.
20062
20063 2002-07-24  Martin Baulig  <martin@gnome.org>
20064
20065         * class.cs (MethodBase): New abstract class.  This is now a base
20066         class for Property, Indexer and Event to avoid some code duplication
20067         in their Define() and DefineMethods() methods.
20068         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20069         generic methods for Define() and DefineMethods().
20070         (FieldBase): Derive from MemberBase, not MemberCore.
20071         (Property): Derive from MemberBase, not MemberCore.
20072         (Property.DefineMethod): Moved all the code from this method to the
20073         new MethodBase.DefineAccessor(), just call it with appropriate
20074         argumetnts.
20075         (Property.Define): Call the new Property.DoDefine(), this does some
20076         sanity checks and we don't need to duplicate the code everywhere.
20077         (Event): Derive from MemberBase, not MemberCore.
20078         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20079         accessors, this will also make them work with interface events.
20080         (Indexer): Derive from MemberBase, not MemberCore.
20081         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20082         (Indexer.Define): Use the new MethodBase functions.
20083
20084         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20085         argument to the constructor.
20086         (Interface.FindMembers): Added support for interface events.
20087         (Interface.PopluateEvent): Implemented.
20088
20089         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20090
20091 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20092
20093         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20094         but this is required to check for a method name being the same as
20095         the containing class.  
20096
20097         Handle this now.
20098
20099 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20100
20101         * interface.cs: initialize variable.
20102
20103 2002-07-23  Martin Baulig  <martin@gnome.org>
20104
20105         Implemented the IndexerName attribute in interfaces.
20106
20107         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20108         name if this is an explicit interface implementation.
20109         (Indexer.InterfaceIndexerName): New public variable.  If we're
20110         implementing an interface indexer, this is the IndexerName in that
20111         interface.  Otherwise, it's the IndexerName.
20112         (Indexer.DefineMethod): If we're implementing interface indexer,
20113         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20114         and Pending.ImplementIndexer methods.
20115         (Indexer.Define): Also define the PropertyBuilder if we're
20116         implementing an interface indexer and this is neither an explicit
20117         interface implementation nor do the IndexerName match the one in
20118         the interface.
20119
20120         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20121         If a method is defined here, then we always need to create a proxy
20122         for it.  This is used when implementing interface indexers.
20123         (Pending.IsInterfaceIndexer): New public method.
20124         (Pending.ImplementIndexer): New public method.
20125         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20126         This is used when implementing interface indexers to define a proxy
20127         if necessary.
20128         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20129         define a proxy if necessary.
20130
20131         * interface.cs (Interface.IndexerName): New public variable.
20132         (Interface.PopulateIndexer): Set the IndexerName.
20133         (Interface.DefineIndexers): New private method.  Populate all the
20134         indexers and make sure their IndexerNames match.
20135
20136         * typemanager.cs (IndexerPropertyName): Added support for interface
20137         indexers.
20138
20139 2002-07-22  Martin Baulig  <martin@gnome.org>
20140
20141         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20142         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20143         ret if HasReturnLabel.
20144         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20145         variables.
20146
20147         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20148         and set the ec.LoopBeginTryCatchLevel.
20149         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20150         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20151         the current ec.TryCatchLevel, the branch goes out of an exception
20152         block.  In this case, we need to use Leave and not Br.
20153
20154 2002-07-22  Martin Baulig  <martin@gnome.org>
20155
20156         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20157         block unless the block does not always return or it is contained in
20158         another try { ... } catch { ... } block.  Fixes bug #26506.
20159         Added verify-1.cs to the test suite.
20160
20161 2002-07-22  Martin Baulig  <martin@gnome.org>
20162
20163         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20164         then we do not always return.  Fixes bug #24985.
20165
20166 2002-07-22  Martin Baulig  <martin@gnome.org>
20167
20168         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20169         lookup on a per-class level; ie. walk up the class hierarchy until we
20170         found at least one applicable method, then choose the best among them.
20171         Fixes bug #24463 and test-29.cs.
20172
20173 2002-07-22  Martin Baulig  <martin@gnome.org>
20174
20175         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20176         return types of the methods.  The return type is not part of the
20177         signature and we must not check it to make the `new' modifier work.
20178         Fixes bug #27999, also added test-147.cs.
20179         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20180
20181         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20182         on the method's return type.
20183
20184 2002-07-21  Martin Baulig  <martin@gnome.org>
20185
20186         * assign.cs: Make this work if the rightmost source is a constant and
20187         we need to do an implicit type conversion.  Also adding a few more tests
20188         to test-38.cs which should have caught this.
20189
20190         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20191         target in the makefile for this.  The makefile.gnu is primarily intended
20192         for end-users who don't want to debug the compiler.
20193
20194 2002-07-21  Martin Baulig  <martin@gnome.org>
20195
20196         * assign.cs: Improved the Assign class so it can now handle embedded
20197         assignments (X = Y = Z = something).  As a side-effect this'll now also
20198         consume less local variables.  test-38.cs now passes with MCS, added
20199         a few new test cases to that test.
20200
20201 2002-07-20  Martin Baulig  <martin@gnome.org>
20202
20203         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20204         instructions.  Fixes bug #27977, also added test-146.cs.
20205
20206 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20207
20208         * cs-tokenizer.cs: fixed getHex ().
20209
20210 2002-07-19  Martin Baulig  <martin@gnome.org>
20211
20212         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20213         not Type.GetType() to lookup the array type.  This is needed when
20214         we're constructing an array of a user-defined type.
20215         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20216         single-dimensional arrays, but also for single-dimensial arrays of
20217         type decimal.
20218
20219 2002-07-19  Martin Baulig  <martin@gnome.org>
20220
20221         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20222         this function is called, it's not allowed to share LocalBuilders
20223         among ILGenerators.
20224
20225 2002-07-19  Martin Baulig  <martin@gnome.org>
20226
20227         * expression.cs (Argument.Resolve): Report an error 118 when trying
20228         to pass a type as argument.
20229
20230 2002-07-18  Martin Baulig  <martin@gnome.org>
20231
20232         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20233         Conv_R_Un for the signed `long' type.
20234
20235 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20236
20237         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20238         `expr' for the temporary result, as that will fail if we do
20239         multiple resolves on the same expression.
20240
20241 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20242
20243         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20244         ec.TypeContainer for looking up aliases. 
20245
20246         * class.cs (TypeContainer): Remove LookupAlias from here.
20247
20248         * decl.cs (DeclSpace); Move here.
20249
20250 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * class.cs (FindMembers): Only call filter if the constructor
20253         bulider is not null.
20254
20255         Also handle delegates in `NestedTypes' now.  Now we will perform
20256         type lookups using the standard resolution process.  This also
20257         fixes a bug.
20258
20259         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20260         This uses Expressions (the limited kind that can be parsed by the
20261         tree) instead of strings.
20262
20263         * expression.cs (ComposedCast.ToString): Implement, used to flag
20264         errors since now we have to render expressions.
20265
20266         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20267         FormArrayType. 
20268
20269         * ecore.cs (SimpleName.ToString): ditto.
20270
20271         * cs-parser.jay: Instead of using strings to assemble types, use
20272         Expressions to assemble the type (using SimpleName, ComposedCast,
20273         MemberAccess).  This should fix the type lookups in declarations,
20274         because we were using a different code path for this.
20275
20276         * statement.cs (Block.Resolve): Continue processing statements
20277         even when there is an error.
20278
20279 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20280
20281         * class.cs (Event.Define): Also remove the `remove' method from
20282         the list of pending items.
20283
20284         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20285         generate more compact code. 
20286
20287 2002-07-17  Martin Baulig  <martin@gnome.org>
20288
20289         * const.cs (Const.LookupConstantValue): Add support for constant
20290         `unchecked' and `checked' expressions.
20291         Also adding test case test-140.cs for this.
20292
20293 2002-07-17  Martin Baulig  <martin@gnome.org>
20294
20295         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20296         check whether mi.ReturnType implements the IEnumerator interface; the
20297         `==' and the IsAssignableFrom() will fail in this situation.
20298
20299 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20300
20301         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20302         here too.
20303
20304 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20305
20306         * expression.cs: fixed bug #27811.
20307
20308 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20309
20310         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20311         Molaro: when we are a ref, the value already contains a pointer
20312         value, do not take the address of it.
20313
20314 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20315         * removed mb-parser.jay and mb-tokenizer.cs
20316
20317 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20318
20319         * expression.cs: check against the building corlib void type.
20320
20321 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20322
20323         * ecore.cs: fix for valuetype static readonly fields: when 
20324         initializing them, we need their address, not the address of a copy.
20325
20326 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20327
20328         * typemanager.cs: register also enum_type in corlib.
20329
20330 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20331
20332         * class.cs: allow calling this (but not base) initializers in structs.
20333
20334 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20335
20336         * ecore.cs: make sure we compare against the building base types
20337         in GetTypeSize ().
20338
20339 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20340
20341         * typemanager.cs: fix TypeToCoreType() to handle void and object
20342         (corlib gets no more typerefs after this change).
20343
20344 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20345
20346         * expression.cs (ArrayCreation.EmitArrayArguments): use
20347         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20348
20349         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20350         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20351         array indexes, the runtime actually forbids them.
20352
20353         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20354         for array arguments here.
20355
20356         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20357         instead of the default for ValueTypes.
20358
20359         (New.DoEmit): Use IsValueType instead of
20360         IsSubclassOf (value_type)
20361         (New.DoResolve): ditto.
20362         (Invocation.EmitCall): ditto.
20363
20364         * assign.cs (Assign): ditto.
20365
20366         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20367         Statements *are* currently doing part of their resolution during
20368         Emit.  
20369
20370         Expressions do always resolve during resolve, but statements are
20371         only required to propagate resolution to their children.
20372
20373 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20376
20377         (LoadAssembly): Do not add the dll if it is already specified
20378
20379         (MainDriver): Add the System directory to the link path at the end,
20380         after all the other -L arguments. 
20381
20382         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20383         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20384         ldelem.u1) and using the opposite for sbytes.
20385
20386         This fixes Digger, and we can finally run it.
20387
20388         * driver.cs (UnixParseOption): Move the option parsing here.  
20389         (CSCParseOption): Implement CSC-like parsing of options.
20390
20391         We now support both modes of operation, the old Unix way, and the
20392         new CSC-like way.  This should help those who wanted to make cross
20393         platform makefiles.
20394
20395         The only thing broken is that /r:, /reference: and /lib: are not
20396         implemented, because I want to make those have the same semantics
20397         as the CSC compiler has, and kill once and for all the confussion
20398         around this.   Will be doing this tomorrow.
20399
20400         * statement.cs (Unsafe.Resolve): The state is checked during
20401         resolve, not emit, so we have to set the flags for IsUnsfe here.
20402
20403 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20404
20405         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20406         not catch the Error_ObjectRefRequired in SimpleName (as it is
20407         possible to have a class/instance variable name that later gets
20408         deambiguated), we have to check this here.      
20409
20410 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20411
20412         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20413         make static and put into Expression.
20414
20415         (Event.Define): Register the private field of the event with the 
20416         TypeManager so that GetFieldFromEvent can get at it.
20417
20418         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20419         keep track of the private field associated with an event which
20420         has no accessors.
20421
20422         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20423         private field.
20424
20425         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20426
20427 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * expression.cs (Binary.EmitBranchable): this routine emits the
20430         Binary expression in a branchable context.  This basically means:
20431         we need to branch somewhere, not just get the value on the stack.
20432
20433         This works together with Statement.EmitBoolExpression.
20434
20435         * statement.cs (Statement.EmitBoolExpression): Use
20436         EmitBranchable. 
20437
20438 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * statement.cs (For): Reduce the number of jumps in loops.
20441
20442         (For): Implement loop inversion for the For statement.
20443
20444         (Break): We can be breaking out of a Try/Catch controlled section
20445         (foreach might have an implicit try/catch clause), so we need to
20446         use Leave instead of Br.
20447
20448         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20449         now).  If the instace expression supports IMemoryLocation, we use
20450         the AddressOf method from the IMemoryLocation to extract the
20451         address instead of emitting the instance.
20452
20453         This showed up with `This', as we were emitting the instance
20454         always (Emit) instead of the Address of This.  Particularly
20455         interesting when This is a value type, as we dont want the Emit
20456         effect (which was to load the object).
20457
20458 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20459
20460         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20461
20462         * statement.cs (Checked): Set the CheckedState during the resolve
20463         process too, as the ConvCast operations track the checked state on
20464         the resolve process, and not emit.
20465
20466         * cs-parser.jay (namespace_member_declaration): Flag that we have
20467         found a declaration when we do.  This is used to flag error 1529
20468
20469         * driver.cs: Report ok when we display the help only.
20470
20471 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20472
20473         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20474
20475 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * cs-tokenizer.cs (define): We also have to track locally the
20478         defines.  AllDefines is just used for the Conditional Attribute,
20479         but we also need the local defines for the current source code. 
20480
20481 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20482
20483         * statement.cs (While, For, Do): These loops can exit through a
20484         Break statement, use this information to tell whether the
20485         statement is the last piece of code.
20486
20487         (Break): Flag that we break.
20488
20489         * codegen.cs (EmitContexts): New `Breaks' state variable.
20490
20491 2002-07-03  Martin Baulig  <martin@gnome.org>
20492
20493         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20494         modifiers in method declarations in structs.  Otherwise, you won't
20495         be able to override things like Object.Equals().
20496
20497 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * class.cs (Method, Property, Indexer): Do not allow the public
20500         modifier to be used in explicit interface implementations.
20501
20502         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20503         override modifiers in method declarations in structs
20504
20505 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20506
20507         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20508         integer or real overflow, report an error
20509
20510 2002-07-02  Martin Baulig  <martin@gnome.org>
20511
20512         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20513         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20514         to tell the runtime about our newly created System.Object and
20515         System.ValueType types.
20516
20517 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20518
20519         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20520         struct instead of Ldarg/Starg.
20521
20522 2002-07-02  Martin Baulig  <martin@gnome.org>
20523
20524         * expression.cs (Indirection.Indirection): Call
20525         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20526
20527 2002-07-02  Martin Baulig  <martin@gnome.org>
20528
20529         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20530         ValueType, call TypeManager.TypeToCoreType() on it.
20531         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20532         the OpCodes.Newarr argument.
20533
20534 2002-07-02  Martin Baulig  <martin@gnome.org>
20535
20536         * expression.cs (Invocation.EmitCall): When compiling corlib,
20537         replace all calls to the system's System.Array type to calls to
20538         the newly created one.
20539
20540         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20541         System.Array methods.
20542         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20543         from the system's System.Array type which must be replaced.
20544
20545 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20546
20547         * typemanager.cs: load unverifiable_code_ctor so we can build
20548         corlib using the correct type. Avoid using GetTypeCode() with
20549         TypeBuilders.
20550         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20551         TypeManager.object_type to allow building corlib.
20552
20553 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20554
20555         * ecore.cs: handle System.Enum separately in LoadFromPtr().
20556
20557 2002-07-01  Martin Baulig  <martin@gnome.org>
20558
20559         * class.cs: Make the last change actually work, we need to check
20560         whether `ifaces != null' to avoid a crash.
20561
20562 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20563
20564         * class.cs: when we build structs without fields that implement
20565         interfaces, we need to add the interfaces separately, since there is
20566         no API to both set the size and add the interfaces at type creation
20567         time.
20568
20569 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20570
20571         * expression.cs: the dimension arguments to the array constructors
20572         need to be converted if they are a long.
20573
20574 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20575
20576         * class.cs: don't emit ldarg.0 if there is no parent constructor
20577         (fixes showstopper for corlib).
20578
20579 2002-06-29  Martin Baulig  <martin@gnome.org>
20580
20581         MCS now compiles corlib on GNU/Linux :-)
20582
20583         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20584         ie. check for MethodImplOptions.InternalCall.
20585
20586         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20587         and TypeManager.attribute_type are null, so we must explicitly check
20588         whether parent is not null to find out whether it's an attribute type.
20589         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20590         and SetBuilder, not only if the property is neither abstract nor external.
20591         This is necessary to set the MethodImplOptions on the accessor methods.
20592         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20593         SetBuilder, see Property.Emit().
20594
20595         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20596         populate "System.Object", "System.ValueType" and "System.Attribute" since
20597         they've already been populated from BootCorlib_PopulateCoreTypes().
20598
20599 2002-06-29  Martin Baulig  <martin@gnome.org>
20600
20601         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20602         is the NullLiteral, we also need to make sure that target_type is not
20603         an enum type.   
20604
20605 2002-06-29  Martin Baulig  <martin@gnome.org>
20606
20607         * rootcontext.cs (RootContext.ResolveCore): We must initialize
20608         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20609         before calling BootstrapCorlib_ResolveDelegate ().
20610
20611 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20612
20613         * statement.cs: fixed build-breaker. All tests passed ok.
20614
20615 2002-06-27  Martin Baulig  <martin@gnome.org>
20616
20617         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20618         for System.Decimal when compiling corlib.
20619
20620 2002-06-27  Martin Baulig  <martin@gnome.org>
20621
20622         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20623         switch blocks which contain nothing but a default clause.
20624
20625 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
20626
20627        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20628
20629 2002-06-27  Martin Baulig  <martin@gnome.org>
20630
20631         * ecore.cs (PropertyExpr.PropertyExpr): Call
20632         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20633
20634         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20635         is already a TypeBuilder.
20636
20637 2002-06-27  Martin Baulig  <martin@gnome.org>
20638
20639         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20640         `target_type == TypeManager.array_type', not IsAssignableFrom() in
20641         the "from an array-type to System.Array" case.  This makes it work
20642         when compiling corlib.
20643
20644 2002-06-27  Martin Baulig  <martin@gnome.org>
20645
20646         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20647         non-static PropertyExpr, set its InstanceExpression.  This makes
20648         the `ICollection.Count' property work in System/Array.cs.
20649
20650 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
20651
20652         * driver.cs: Made error handling more consistent.  Errors now
20653         tracked by Report class, so many methods which used to return int
20654         now return void.  Main() now prints success/failure and 
20655         errors/warnings message.
20656
20657         Renamed '--probe' compiler argument to '--expect-error'.  Removed
20658         the magic number return values (123 and 124).  Now, if the
20659         expected error occurs, the compiler exits with success (exit value
20660         0).  If the compilation completes without seeing that particular
20661         error, the compiler exits with failure (exit value 1).  The
20662         makefile in mcs/errors has been changed to handle the new behaviour.
20663
20664         * report.cs: Made 'expected error' number a property and renamed
20665         it from 'Probe' to 'ExpectedError'.
20666
20667         * genericparser.cs: Removed error handling support, since it is
20668         now all done by Report class.
20669
20670         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20671         class, so parse() no longer returns an int.
20672
20673         * namespace.cs: Use Report.Error instead of GenericParser.error
20674
20675 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
20676
20677         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20678         TypeContainer.AddOperator): At the front of the list put the
20679         explicit implementations, so they get resolved/defined first. 
20680
20681 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20684         interface type is implemented by this TypeContainer.  Used during
20685         explicit interface implementation.
20686
20687         (Property.Define, Indexer.Define, Method.Define): Validate that
20688         the given interface in the explicit implementation is one of the
20689         base classes for the containing type.
20690
20691         Also if we are explicitly implementing an interface, but there is
20692         no match in the pending implementation table, report an error.
20693
20694         (Property.Define): Only define the property if we are
20695         not explicitly implementing a property from an interface.  Use the
20696         correct name also for those properties (the same CSC uses,
20697         although that is really not needed).
20698
20699         (Property.Emit): Do not emit attributes for explicitly implemented
20700         properties, as there is no TypeBuilder.
20701
20702         (Indexer.Emit): ditto.
20703
20704         Hiding then means that we do not really *implement* a pending
20705         implementation, which makes code fail.
20706
20707 2002-06-22  Martin Baulig  <martin@gnome.org>
20708
20709         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20710         the return value of Object.GetType().  [FIXME: we need to do this whenever
20711         we get a type back from the reflection library].
20712
20713 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20714
20715         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20716
20717 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
20718
20719         * attribute.cs: Return null if we can not look up the type.
20720
20721         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20722         the interface types found.
20723
20724         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20725         interface types found.
20726
20727         * typemanager.cs (GetInterfaces): Make this routine returns alll
20728         the interfaces and work around the lame differences between
20729         System.Type and System.Reflection.Emit.TypeBuilder in the results
20730         result for GetInterfaces.
20731
20732         (ExpandInterfaces): Given an array of interface types, expand and
20733         eliminate repeated ocurrences of an interface.  This expands in
20734         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20735         be IA, IB, IC.
20736
20737 2002-06-21  Martin Baulig  <martin@gnome.org>
20738
20739         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20740         on System.Enum.
20741
20742 2002-06-21  Martin Baulig  <martin@gnome.org>
20743
20744         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
20745         and called with one of the core types, return the corresponding typebuilder for
20746         that type.
20747
20748         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20749         element type.
20750
20751 2002-06-21  Martin Baulig  <martin@gnome.org>
20752
20753         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20754         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20755         (Expression.ConvertReferenceExplicit): Likewise.
20756
20757         * expression.cs (ElementAccess.DoResolve): Likewise.
20758         (ElementAccess.DoResolveLValue): Likewise.
20759
20760 2002-06-10  Martin Baulig  <martin@gnome.org>
20761
20762         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
20763         add the "value" parameter to the parameter list.
20764
20765         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
20766         to our caller.
20767
20768 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
20771         the argument to an int, uint, long or ulong, per the spec.  Also
20772         catch negative constants in array creation.
20773
20774 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
20775
20776         * class.cs: do not allow the same interface to appear twice in
20777         the definition list.
20778
20779 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
20780
20781         * ecore.cs: don't use ldlen with System.Array.
20782
20783 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
20784
20785         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
20786
20787 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
20788
20789         * modifiers.cs: produce correct field attributes for protected
20790         internal. Easy fix so miguel can work on ther harder stuff:-)
20791
20792 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
20793
20794         * pending.cs: New file.  Move the code from class.cs here.
20795         Support clearning the pending flag for all methods (when not doing
20796         explicit interface implementation).
20797
20798 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
20799
20800         * rootcontext.cs: added a couple more types needed to bootstrap.
20801
20802 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
20803
20804         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
20805         constructor in the type, instead of any constructor in the type
20806         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
20807         a bug in the Mono runtime when applying the params attribute). 
20808
20809 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
20810         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
20811
20812 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
20813
20814         * expression.cs (Unary.ResolveOperator): Use TypeManager
20815         to resolve the type.
20816
20817 2002-06-13  Ravi Pratap  <ravi@ximian.com>
20818
20819         * cs-parser.jay (enum_member_declaration): Pass in the attributes
20820         attached.
20821
20822         * enum.cs (AddEnumMember): Add support to store the attributes associated 
20823         with each member too.
20824
20825         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20826         field builders too - this takes care of the enum member case.
20827
20828 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
20829
20830         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20831         address-of operator on both value types and pointers.
20832
20833 2002-06-10  Martin Baulig  <martin@gnome.org>
20834
20835         * interface.cs (Interface.PopulateIndexer): Add the indexer's
20836         PropertyBuilder to the `property_builders' list.
20837
20838         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20839         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20840         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
20841         find any indexers which are inherited from an interface.
20842
20843 2002-06-09  Martin Baulig  <martin@gnome.org>
20844
20845         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20846         the same type as the constant if necessary.  There's also a test-130.cs
20847         for this.
20848
20849         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20850
20851         * typemanager.cs (TypeManager.ChangeType): Previously known as
20852         Enum.ChangeEnumType().
20853
20854 2002-06-09  Martin Baulig  <martin@gnome.org>
20855
20856         * expression.cs (Cast.TryReduce): Added support for consts.
20857
20858 2002-06-08  Ravi Pratap  <ravi@ximian.com>
20859
20860         * class.cs (Accessor): Hold attributes information so we can pass
20861         it along.
20862
20863         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20864         Modify to pass in attributes attached to the methods.
20865
20866         (add_accessor_declaration, remove_accessor_declaration): Ditto.
20867
20868         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20869         to handle the Accessor kind :-)
20870
20871         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20872
20873 2002-06-08  Martin Baulig  <martin@gnome.org>
20874
20875         * expression.cs (Unary.TryReduceNegative): Added support for
20876         ULongConstants.
20877
20878 2002-06-08  Martin Baulig  <martin@gnome.org>
20879
20880         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20881         name can't be found in the `defined_names' - the caller will do a
20882         MemberLookup in this case and thus find methods in System.Enum
20883         such as Enum.IsDefined().
20884
20885 2002-06-08  Martin Baulig  <martin@gnome.org>
20886
20887         * enum.cs (Enum.ChangeEnumType): This is a custom version of
20888         Convert.ChangeType() which works with TypeBuilder created types.
20889         (Enum.LookupEnumValue, Enum.Define): Use it here.
20890
20891         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20892         `TypeBuilder.BaseType != null' check.
20893         (TypeContainer.FindMembers): Only lookup parent members if we
20894         actually have a parent.
20895         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20896         (ConstructorInitializer.Resolve): Likewise.
20897
20898         * interface.cs (Interface.FindMembers): Added
20899         `TypeBuilder.BaseType != null' check.
20900
20901         * rootcontext.cs (RootContext.ResolveCore): Added
20902         "System.Runtime.CompilerServices.IndexerNameAttribute" to
20903         classes_second_stage.
20904
20905         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20906         debug_type and trace_type when compiling with --nostdlib.       
20907
20908 2002-06-07  Martin Baulig  <martin@gnome.org>
20909
20910         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20911         (AddField): Set it to true when adding a non-static field.
20912         (DefineType): Use `have_nonstatic_fields' to find out whether we
20913         have non-static fields, not `Fields != null'.
20914
20915 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20918         dereferencing a null on the static-field code path)
20919
20920 2002-05-30  Martin Baulig  <martin@gnome.org>
20921
20922         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20923         to take command line arguments.  Use reflection to call the new
20924         custom `Initialize' function on the symbol writer and pass it the
20925         command line arguments.
20926
20927         * driver.cs (--debug-args): New command line argument to pass command
20928         line arguments to the symbol writer.
20929
20930 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
20931
20932         * assign.cs (DoResolve): Forgot to do the implicit conversion to
20933         the target type for indexers and properties.  Thanks to Joe for
20934         catching this.
20935
20936 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
20937
20938         * typemanager.cs (MethodFlags): returns the method flags
20939         (Obsolete/ShouldIgnore) that control warning emission and whether
20940         the invocation should be made, or ignored. 
20941
20942         * expression.cs (Invocation.Emit): Remove previous hack, we should
20943         not do this on matching a base type, we should do this based on an attribute
20944
20945         Only emit calls to System.Diagnostics.Debug and
20946         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20947         on the command line.
20948
20949         * rootcontext.cs: Global settings for tracing and debugging.
20950
20951         * cs-tokenizer.cs (define): New utility function to track
20952         defines.   Set the global settings for TRACE and DEBUG if found.
20953
20954 2002-05-25  Ravi Pratap  <ravi@ximian.com>
20955
20956         * interface.cs (Populate*): Pass in the TypeContainer as well as
20957         the DeclSpace as parameters so that we can create EmitContexts and
20958         then use that to apply attributes etc.
20959
20960         (PopulateMethod, PopulateEvent, PopulateProperty)
20961         (PopulateIndexer): Apply attributes everywhere.
20962
20963         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20964         etc.
20965
20966         (ApplyAttributes): Update accordingly.
20967
20968         We now apply interface attributes for all members too.
20969
20970 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * class.cs (Indexer.Define); Correctly check if we are explicit
20973         implementation (instead of checking the Name for a ".", we
20974         directly look up if the InterfaceType was specified).
20975
20976         Delay the creation of the PropertyBuilder.
20977
20978         Only create the PropertyBuilder if we are not an explicit
20979         interface implementation.   This means that explicit interface
20980         implementation members do not participate in regular function
20981         lookups, and hence fixes another major ambiguity problem in
20982         overload resolution (that was the visible effect).
20983
20984         (DefineMethod): Return whether we are doing an interface
20985         implementation. 
20986
20987         * typemanager.cs: Temporary hack until we get attributes in
20988         interfaces (Ravi is working on that) and we get IndexerName
20989         support in interfaces.
20990
20991         * interface.cs: Register the indexers as properties.
20992
20993         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20994         warning, I have verified that this is a bug in the .NET runtime
20995         (JavaScript suffers of the same problem).
20996
20997         * typemanager.cs (MemberLookup): When looking up members for
20998         interfaces, the parent of an interface is the implicit
20999         System.Object (so we succeed in searches of Object methods in an
21000         interface method invocation.  Example:  IEnumerable x;  x.ToString
21001         ()) 
21002
21003 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21004
21005         * class.cs (Event): Events should also register if they do
21006         implement the methods that an interface requires.
21007
21008         * typemanager.cs (MemberLookup); use the new GetInterfaces
21009         method. 
21010
21011         (GetInterfaces): The code used to lookup interfaces for a type is
21012         used in more than one place, factor it here. 
21013
21014         * driver.cs: Track the errors at the bottom of the file, we kept
21015         on going.
21016
21017         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21018         instance if the method we are calling is static!
21019
21020 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21021
21022         * attribute.cs (ApplyAttributes): Make this function filter out
21023         the IndexerName attribute (as that attribute in reality is never
21024         applied) and return the string constant for the IndexerName
21025         attribute. 
21026
21027         * class.cs (TypeContainer.Emit): Validate that all the indexers
21028         have the same IndexerName attribute, and if so, set the
21029         DefaultName attribute on the class. 
21030
21031         * typemanager.cs: The return value might contain other stuff (not
21032         only methods).  For instance, consider a method with an "Item"
21033         property and an Item method.
21034
21035         * class.cs: If there is a problem with the parameter types,
21036         return. 
21037
21038 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21039
21040         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21041         looks at user defined conversion after making a call to 
21042         StandardConversionExists - we need this for overload resolution.
21043
21044         * expression.cs : Update accordingly the various method calls.
21045
21046         This fixes 2 bugs filed against implicit user defined conversions 
21047
21048 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21049
21050         * statement.cs: Track the result of the assignment.
21051
21052 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21053
21054         * expression.cs (MemberAccess): Improved error reporting for
21055         inaccessible members.
21056
21057 2002-05-22  Martin Baulig  <martin@gnome.org>
21058
21059         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21060         itself with debugging support.
21061
21062 2002-05-22  Martin Baulig  <martin@gnome.org>
21063
21064         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21065         Removed, this isn't needed anymore.
21066
21067 2002-05-20  Martin Baulig  <martin@gnome.org>
21068
21069         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21070         be underlying type for an enum.
21071
21072 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21075         that splits out the loading of just the core types.
21076
21077         * rootcontext.cs (ResolveCore): Split the struct resolution in
21078         two, so we can load the enumeration underlying types before any
21079         enums are used.
21080
21081         * expression.cs (Is): Bandaid until we fix properly Switch (see
21082         bug #24985 for details).
21083
21084         * typemanager.cs (ImplementsInterface): The hashtable will contain
21085         a null if there are no interfaces implemented.
21086
21087 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21088
21089         * cs-parser.jay (indexer_declarator): It is fine to have array
21090         parameters
21091
21092 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21093
21094         * typemanager.cs: (RegisterBuilder): New function used to register
21095         TypeBuilders that implement interfaces.  Since
21096         TypeBuilder.GetInterfaces (as usual) does not work with lame
21097         Reflection.Emit. 
21098         (AddUserType): register interfaces.
21099
21100         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21101         dealing with TypeBuilder.  Also, arrays are showing up as
21102         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21103         methods can not be invoked on them!
21104
21105         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21106         (ImplicitReferenceConversionExists): Split out from
21107         StandardConversionExists. 
21108
21109         * expression.cs (As): We were only implementing one of the three
21110         cases for the as operator.  We now implement them all.
21111         (Is): Implement the various other cases for Is as well.
21112
21113         * typemanager.cs (CACHE): New define used to control if we want or
21114         not the FindMembers cache.  Seems to have a negative impact on
21115         performance currently
21116
21117         (MemberLookup): Nested types have full acess to
21118         enclosing type members
21119
21120         Remove code that coped with instance/static returns for events, we
21121         now catch this in RealFindMembers.
21122
21123         (RealFindMembers): only perform static lookup if the instance
21124         lookup did not return a type or an event.  
21125
21126 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21127
21128         * assign.cs (CompoundAssign): We pass more semantic information
21129         now to Compound Assignments than we did before: now we have all
21130         the information at hand, and now we resolve the target *before* we
21131         do the expression expansion, which allows the "CacheValue" method
21132         to have the effect we intended (before, a [x] += 1 would generate
21133         two differen ArrayAccess expressions from the ElementAccess,
21134         during the resolution process).
21135
21136         (CompoundAssign.DoResolve): Resolve target and original_source here.
21137
21138 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21139
21140         * expression.cs (ArrayAccess): dropped debugging information. 
21141
21142         * typemanager.cs: Small bug fix: I was always returning i_members,
21143         instead of one of i_members or s_members (depending on which had
21144         the content).
21145
21146         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21147         method is invoked before any code generation takes place, and it
21148         is a mechanism to inform that the expression will be invoked more
21149         than once, and that the method should use temporary values to
21150         avoid having side effects
21151
21152         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21153
21154         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21155         implementation.
21156
21157         * expression.cs (Indirection, ArrayAccess): Add support for
21158         CacheTemporaries in these two bad boys. 
21159
21160         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21161         ldobj or ldind_ref.  
21162         (StoreFromPtr): Handle stobj as well.
21163
21164         * expression.cs (UnaryMutator): Share more code.
21165
21166         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21167         down: I was not tracking the Filter function as well, which
21168         was affecting the results of the cache.
21169
21170 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21171
21172         * attribute.cs: Remove the hack to handle the CharSet property on
21173         StructLayouts. 
21174
21175 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21176
21177         * attribute.cs (DoResolve): More uglyness, we now only try to
21178         resolve the attribute partially, to extract the CharSet
21179         information (only if we are a StructLayout attribute).  Otherwise 
21180
21181         (GetExtraTypeInfo): Add some code to conditionally kill in the
21182         future this.   I am more and more convinced that the .NET
21183         framework has special code to handle the attribute setting on
21184         certain elements.
21185
21186         * expression.cs (IsParamsMethodApplicable): Revert my previous
21187         foreach change here, it was wrong.
21188
21189 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21190
21191         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21192         (pp_expr): do not abort on unknown input, just return.
21193         (eval): abort if there are pending chars.
21194
21195         * attribute.cs (Attribute.Resolve): Positional parameters are
21196         optional.  Deal with that case.
21197
21198         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21199         the Ansi/Unicode/Auto information for the type.
21200
21201         (TypeContainer.DefineType): instantiate the EmitContext here, as
21202         we will be using it during the type definition (to resolve
21203         attributes) and during the emit phase.
21204
21205         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21206         to pull type information out of the attributes
21207
21208         (Attribute.Resolve): track the constructor builder, and allow for
21209         multiple invocations (structs and classes will use this).
21210
21211         * ecore.cs (MemberLookupFinal): new version with all the
21212         parameters customizable.
21213
21214         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21215         constructors.  Return if the result value is null (as the error
21216         would have been flagged already by MemberLookupFinal)
21217
21218         Do not allow instances of abstract classes or interfaces to be
21219         created.
21220
21221         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21222         We have to compare the assembly property here when dealing with
21223         FamANDAssem and Assembly access modifiers, because we might be
21224         creating an assembly from *modules* (that means that we are not
21225         getting TypeBuilders for types defined in other modules that are
21226         part of this assembly).
21227
21228         (Method.Emit): If the method is marked abstract and has a body,
21229         emit an error. 
21230
21231         (TypeContainer.DefineMembers): If both the defined member and the
21232         parent name match are methods, then do not emit any warnings: let
21233         the Method.Define routine take care of flagging warnings.  But if
21234         there is a mismatch (method overrides something else, or method is
21235         overriwritten by something, then emit warning).
21236
21237         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21238         set to null, this means `do not check for the return type on the
21239         signature'. 
21240
21241         (Method.Define): set the return type for the method signature to
21242         null, so that we get methods with the same name and parameters and
21243         different return types.  This is used to flag warning 114 (you are
21244         hiding a method, and you probably want to use the new/override
21245         keywords instead).
21246
21247         * typemanager.cs (MemberLookup): Implemented proper access
21248         control, closing a long standing set of bug reports.  The problem
21249         was that the Framework only has two bits: Public and NonPublic,
21250         and NonPublic includes private and protected methods, but we need
21251         to enforce the FamANDAssem, FamOrAssem and Family. 
21252
21253 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21254
21255         * statement.cs (GotoCase): Return true: Ammounts to giving up
21256         knowledge on whether we return or not, and letting the other case
21257         be responsible for it.
21258
21259 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * driver.cs: Do not load directories for each file processed, only
21262         do it if there is a pattern.
21263
21264         * ecore.cs: Report readonly assigns here as well, as we might have
21265         been resolved only by MemberAccess.
21266
21267         (SimpleName.SimpleNameResolve): Also be useful for LValue
21268         resolution.   We need this to propagate assign to local readonly variables
21269
21270         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21271         do not want to reuse potential criteria memory.
21272
21273         * class.cs (MyEventBuilder): Set reflected_type;
21274
21275         * ecore.cs (Constantify): Added support for constifying bools.
21276
21277         (RootContext.LookupType): Added a cache for values looked up in
21278         the declaration space.
21279
21280         * typemanager.cs (FindMembers): Now is a front-end to
21281         RealFindMembers, and provides a two-level hashtable-based cache to
21282         the request.  
21283
21284         15% performance improvement: from 22.5 to 19.2 seconds.
21285
21286         * expression.cs (IsParamsMethodApplicable): use foreach.
21287         (Invocation.DoResolve): ditto.
21288         (New.DoResolve): ditto.
21289         (ArrayCreation.DoResolve): ditto.
21290
21291         * ecore.cs (FindMostEncompassingType): use foreach.
21292
21293         * delegate.cs (NewDelegate.DoResolve): Use foreach
21294
21295         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21296         (RemoveMethods): use foreach.
21297
21298         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21299         nested foreach statements instead of for, and also break out of
21300         the inner loop once a match is found.
21301
21302         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21303
21304 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21305
21306         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21307         we actually unwrap the expression to allow for extra information
21308         to be extracted. 
21309
21310         * expression.cs: Use Shr_Un on unsigned operations. 
21311
21312 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21313
21314         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21315         applicable operators was not being considered correctly. This closes
21316         the bug Miguel reported.
21317
21318 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21319
21320         * attribute.cs: check that the type derives from System.Attribute
21321         and report the correct error in that case (moved the duplicate code to
21322         its own method, too).
21323
21324 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21325
21326         * attribute.cs: lookup attribute type name as the spec says: first the
21327         bare attribute name and then name + "Attribute" (nant compiles with
21328         mcs after this fix).
21329
21330 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21333         Because of the way we parse things, we should try to see if a
21334         UIntConstant can fit in an integer.
21335
21336 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21337
21338         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21339         when we are in an explicit context.
21340
21341         (ConvertReferenceExplicit): When converting from Iface type S to Class
21342         T make sure the rules are implemented as an OR.
21343
21344         * parameter.cs (ParameterType): Make it a property for now although the
21345         purpose really isn't anything immediate.
21346
21347         * expression.cs (Is*Applicable): Do better checking on the parameter type
21348         of a ref/out parameter. The ones from the system assemblies are already 
21349         marked with the correct type so we don't need to do any correction.
21350
21351         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21352         the object type is standard too so include that.
21353
21354 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21355
21356         * ecore.cs (StandardConversionExists): Augment with missing code:
21357         deal with IntConstant, LongConstants and Enumerations.
21358
21359         * assign.cs: Report the error, instead of failing silently
21360
21361         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21362         typecontainer that they are declared, because the
21363         typecontainer/namespace will have the list of using clauses that
21364         need to be applied.
21365
21366         Assembly Attributes were escaping the normal registration
21367         mechanism. 
21368
21369         (EmitCode): Apply attributes within an EmitContext that represents
21370         the container they were declared on.
21371
21372         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21373
21374 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21375
21376         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21377         Revamp completely - make much cleaner as we now operate only
21378         on a set of Types.
21379
21380         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21381         to implement the logic detailed in the spec more correctly.
21382
21383         (UserDefinedConversion): Update accordingly.
21384
21385 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21386
21387         * statement.cs: Return flow analysis information up.
21388
21389         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21390         and the default.
21391
21392         (token): Do not consume an extra character before calling
21393         decimal_digits.
21394
21395 2002-05-06  Piers Haken <piersh@friskit.com>
21396
21397         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21398
21399 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21402         EmitContext during the instance constructor initializer
21403         resolution, to stop access to instance variables.
21404
21405         This is mandated by the spec, last paragraph of the `constructor
21406         initializers' section. 
21407
21408 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21409
21410         * cs-parser.jay, class.cs (Accessor): new class used to represent
21411         an accessor (get or set).  In the past we used `null' to represent
21412         a missing accessor.  But this is ambiguous because there was no
21413         way to tell in abstract indexers/properties if one of them was
21414         specified.
21415
21416         Now there is a way of addressing that.
21417
21418         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21419         instead of FindMembers.
21420
21421         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21422         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21423
21424         * attribute.cs: Treat indexers and properties as the same in terms
21425         of applying attributes
21426
21427         * ecore.cs (FindMostEncompassedType): Use statically initialized
21428         EmptyExpressions()s like we do elsewhere to avoid creating useless
21429         objects (and we take this out of the tight loop).
21430
21431         (GetConversionOperators): Move the code to extract the actual
21432         operators to a separate routine to clean things up.
21433
21434 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21435
21436         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21437         events are always registered FieldBuilders.
21438
21439         * class.cs (FieldBase): New class shared by Fields 
21440
21441         * delegate.cs: If we are a toplevel delegate, use our full name.
21442         If we are a nested delegate, then only use our tail name.
21443
21444 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21445
21446         * expression.cs (IsApplicable): Ensure that we add the "&" to
21447         ref/out types before comparing it with the type of the argument.
21448
21449         (IsParamsMethodApplicable): Ditto.
21450
21451         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21452         silly me ;-)
21453
21454         * delegate.cs : Handle the case when we have more than one applicable
21455         method. Flag an error only when we finish checking all.
21456
21457 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21458
21459         * expression.cs: Add support for boolean static initializers.
21460
21461 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21462
21463         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21464
21465         * parameter.cs (ComputeParameterTypes,
21466         ComputeAndDefineParameterTypes): Better error handling: now we
21467         clear the `types' cache if we fail during any of the type lookups.
21468         We also return the status code correctly to our caller
21469
21470         * delegate.cs: If we fail to define a delegate, abort the extra
21471         steps. 
21472
21473         * expression.cs (Binary.ResolveOperator): for
21474         operator==(object,object) and operator !=(object, object) we also
21475         have to verify that there is an implicit conversion from one to
21476         the other.
21477
21478         (ArrayAccess.DoResolve): Array Access can operate on
21479         non-variables. 
21480
21481 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21482
21483         * assign.cs (CompoundAssign): A new class used as a "flag" that
21484         the assignment actually is happening as part of a compound
21485         assignment operator.
21486
21487         During compound assignment, a few new rules exist to enable things
21488         like:
21489
21490         byte b |= 1 + 2
21491
21492         From the spec:
21493
21494         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21495         to the type of x) if y is implicitly convertible to the type of x,
21496         and the operator is a builtin operator and the return type of the
21497         operator is explicitly convertible to the type of x. 
21498
21499         * rootcontext.cs: Reset warning level to 2.  4 catches various
21500         "interesting" features in mcs, we must clean this up at some
21501         point, but currently am trying to kill other bugs ;-)
21502
21503         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21504         in container classes as well.  
21505
21506         * expression.cs (Binary.ResolveOperator): Handle string case
21507         before anything else (as operator overloading does emit an error
21508         before doing anything else).
21509
21510         This code could go away when we move to a table driven model, but
21511         i could not come up with a good plan last night.
21512
21513 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
21514
21515         * typemanager.cs (CSharpName): reimplementation using regex.
21516         * class.cs: added null check for fields in Emit
21517         * rootcontext.cs: set warninglevel to 4
21518
21519 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
21520
21521         * typemanager.cs (CSharpName): reimplemented with Lupus
21522         suggestion.
21523
21524 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
21525
21526         * statement.cs (If): correclty implement Resolve, because we were
21527         not catching sem errors in there.  The same process is needed
21528         everywhere else. 
21529         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21530
21531
21532         (Statement.Warning_DeadCodeFound): Factorize code.
21533         (While): Report dead code here too.
21534
21535         (Statement): Added Resolve virtual method to allow
21536         for resolution split from the emit code.
21537
21538 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21539
21540         * statement.cs (EmitBoolExpression): No longer try to resolve the
21541         expression here.    
21542         (MakeBoolean): New utility function that resolve, implicitly
21543         converts to boolean and tags the expression. 
21544
21545
21546         (If, Do): Implement dead code elimination.
21547         (While): Implement loop inversion
21548
21549         (Do, While, For, If): Resolve the expression prior to calling our
21550         code generation.
21551
21552 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
21553
21554         * class.cs:
21555           - added method Report28 (warning: program has more than one entry point)
21556           - added method IsEntryPoint, implements paragraph 10.1 of the spec
21557           - modified method Method.Define, the part at the end of the method
21558
21559         * rootcontext.cs: added static public Location EntryPointLocation;
21560           
21561         * ../errors/cs0028.cs : Add test case for the above warning.              
21562
21563         * typemanager.cs:
21564           - modified method CSharpName to allow arrays of primitive type to
21565             be printed nicely (e.g. instead of System.Int32[][] it now prints
21566             int[][])
21567           - added method CSharpSignature: returns the signature of a method
21568             in string format to be used in reporting errors, warnings, etc.
21569
21570         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21571         with String.Empty.
21572
21573 2002-04-26  Ravi Pratap  <ravi@ximian.com>
21574
21575         * delegate.cs (Define): Fix extremely silly bug where I was
21576         setting the type of the 'object' parameter of the BeginInvoke
21577         method to System.IAsyncResult instead of System.Object ;-)
21578
21579 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21580
21581         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21582         here. 
21583
21584         (Constructor.Emit): return if we fail to initialize the
21585         constructor.  Another door closed!  
21586
21587         * expression.cs (New.DoResolve): Improve error message (from -6 to
21588         1501).  Use DeclaredOnly lookup to find the exact constructor.
21589
21590         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21591         loop.  This is useful.
21592
21593         * cs-parser.jay: Adjust the default parameters so that destructors
21594         have the proper signature.
21595
21596 2002-04-26  Martin Baulig  <martin@gnome.org>
21597
21598         * driver.cs (LoadAssembly): If `assembly' contains any characters
21599         which are only valid in path names and not in assembly names
21600         (currently slash, backslash and point), use Assembly.LoadFrom ()
21601         instead of Assembly.Load () on the `assembly' (before iteration
21602         over the link_paths).
21603
21604 2002-04-26  Martin Baulig  <martin@gnome.org>
21605
21606         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21607
21608 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
21609
21610         * class.cs (Property): use the new typemanager.MemberLookup
21611
21612         (TypeContainer.MemberLookup): Implement using the
21613         TypeManager.MemberLookup now. 
21614
21615         * typemanager.cs: Make MemberLookup a function of the TypeManager,
21616         and return MemberInfos, so that these can be used without an
21617         EmitContext (what we had before).
21618
21619 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * expression.cs: Fix the case where the argument to params if the
21622         type of the params.  I omitted handling this before.   Fixed
21623
21624 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21625
21626         * driver.cs: Call BootCorlib_PopulateCoreType
21627
21628         * class.cs (Property.CheckBase): Check for properties only, not
21629         for all members. 
21630
21631         * interface.cs: Temporary hack: try/catch around the
21632         CustomAttributeBuilder, because I am getting an exception that I
21633         do not understand.
21634
21635         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21636         types whose definitions are required to be there (attributes are
21637         defined before standard types).
21638
21639         Compute definitions as we boot the various types, as they are used
21640         immediately (value_type class will need object_type, but if we do
21641         not initialize object_type, we will pass a null, which will let
21642         the runtime pick the System.Object from the existing corlib, which
21643         is not what we want).
21644
21645 2002-04-22  Patrik Torstensson <totte@labs2.com>
21646
21647         * cs-tokenizer.cs: fixed a number of trim() issues.
21648
21649 2002-04-22  Ravi Pratap  <ravi@ximian.com>
21650
21651         * expression.cs (Argument.Type): Ensure that we return the correct
21652         type when we have out or ref parameters [in which case we 
21653         append a "&"].
21654
21655 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21656
21657         * class.cs (Property, Indexer): Allow extern modifier in there. 
21658
21659         * typemanager.cs (InitBaseTypes): Initializes object_type and
21660         value_type, since those will be used early on during the bootstrap
21661         process to compile corlib.
21662
21663         (InitCoreTypes): Move code from here to InitBaseTypes.
21664
21665 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
21666
21667         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21668         single-dimension arrays as using the ldlen opcode.  
21669
21670         Daniel Lewis discovered this optimization.  
21671
21672         * typemanager.cs: Add signature for System.Array::get_Length
21673
21674 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21675
21676         * statement.cs: report the error when the foreach does not apply to an
21677         array nor a collection.
21678
21679 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
21680
21681         * expression.cs: Add implicit conversions to the operator ~.
21682
21683         * constant.cs (DecimalConstant.Emit): Emit decimal value.
21684
21685         * typemanager.cs: Locate the decimal constructor.
21686
21687 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21688
21689         * attribute.cs: use the new property of TypeOf.
21690         * expression.cs: added 'get' property around typearg.
21691
21692         These changes fix a build breaker reported by NickD. Is this the
21693         correct way to fix?  If not, please, revert my changes and make it
21694         work :-).
21695
21696 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
21697
21698         * attribute.cs: Add support for typeof in attribute invocations.
21699         I am not sure that this is right though.
21700
21701 2002-04-14  Duncan Mak  <duncan@ximian.com>
21702
21703         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21704         Binary.Operator.Division case.
21705
21706 2002-04-13  Ravi Pratap  <ravi@ximian.com>
21707
21708         * class.cs (DefineType): Ensure that we do a proper check on
21709         attribute types and also register it with the TypeManager.
21710
21711         (TypeContainer.Targets): The default for attribute types is
21712         AttributeTargets.All.
21713
21714         * attribute.cs (ApplyAttributes): Registering the attribute type
21715         is done elsewhere, not when we discover we have a Usage attribute.
21716
21717 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21718
21719         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21720         and get rid of is_delegate parameter.
21721
21722         * everywhere : update.
21723
21724 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21725
21726         * cs-parser.jay (compilation_unit): Revamp completely to use
21727         some new ideas that I got from Rhys' grammar to solve the problems
21728         with assembly level attributes.
21729
21730         (outer_declaration): New grammar production.
21731
21732         (attribute_sections): Add.
21733
21734         (opt_attributes): Base on attribute_sections
21735
21736         (namespace_declaration): Allow opt_attributes to tackle the case
21737         when we have assembly level attributes - we are clever in this
21738         regard now ;-)
21739
21740         * attribute.cs (ApplyAttributes): Do not worry about assembly 
21741         attributes in the non-global context.
21742
21743         * rootcontext.cs (AddGlobalAttributes): Go back to using this
21744         instead of SetGlobalAttributes.
21745
21746         * class.cs, rootcontext.cs : Ensure we define and generate 
21747         attribute types before anything else.
21748
21749         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21750         and flag the new error -20 for the case when the attribute type
21751         does not have valid targets specified. csc does not catch this.
21752
21753         * ../errors/errors.txt : update for error # -20
21754
21755 2002-04-11  Ravi Pratap  <ravi@ximian.com>
21756
21757         * support.cs (InternalParameters.ParameterModifier): Do some null
21758         checking and return sane values.
21759
21760         * class.cs (Method.Define): If we are a PInvoke method, ensure
21761         that we are static and extern. Report error # 601
21762
21763         * ../errors/cs0601.cs : Add test case for the above error.
21764
21765 2002-04-07  Ravi Pratap  <ravi@ximian.com>
21766
21767         * rootcontext.cs (attribute_types): We need to keep type of
21768         all attribute types separately and emit code for them first.
21769
21770         (RegisterAttribute) : Implement.
21771
21772         * class.cs (DefineType): Check if the current Type is a custom
21773         attribute type and register it accordingly.
21774
21775         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
21776         adding the first attribute twice and rename to
21777
21778         (SetGlobalAttributes): this.
21779
21780         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
21781         lookups.
21782
21783         * attribute.cs (ApplyAttributes): Take an additional argument telling us
21784         if we are processing global arguments. Hmm, I am unsure of this.
21785
21786 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21787
21788         * expression.cs: added static array of strings to avoid calling
21789         Enum.ToString () for Operator in Binary. Significant recover of
21790         performance.
21791
21792 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * class.cs (FindMembers): Allow the Builders of the various
21795         members to be null.  If they are skip them.  This only happens
21796         during the PInvoke declaration.
21797
21798 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
21799
21800         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
21801         failure, so we do not keep going afterwards.
21802
21803         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
21804         wanted to pass `false' as the `is_delegate' argument.  If this is
21805         the case, why not use delegate_type == null to mean `is_delegate =
21806         false' and anything else as is_delegate = true.
21807
21808 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
21809
21810         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
21811         code for the section, not the beginning of the tests.
21812
21813 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
21814
21815         * cfold.cs: Handle operator + (Enum x, Underlying x) 
21816
21817         * expression.cs (Binary): same.  Warn about errors where we have
21818         Enum/Enum in operator + as well.
21819
21820 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
21821
21822         * statement.cs:
21823                 - added support for switch(bool)
21824                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21825                 - add TableSwitchEmit() to handle table-based switch statements
21826
21827 2002-04-05  Ravi Pratap  <ravi@ximian.com>
21828
21829         * expression.cs (Invocation.OverloadResolve): Factor out code which
21830         does parameter compatibility checking with arguments so that we can 
21831         re-use the code even from Delegate.VerifyApplicability
21832
21833         (VerifyArgumentsCompat): Move above code here.
21834
21835         * delegate.cs (VerifyApplicability): Get rid of duplicate code
21836         and instead make a call to the above method.
21837
21838 2002-03-31  Ravi Pratap  <ravi@ximian.com>
21839
21840         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21841         We use it to keep track of classes which are attribute types.
21842
21843 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
21844
21845         * delegate.cs (Delegate.Define): Correctly define the types in the
21846         presence of fixed and array parameters.
21847
21848         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21849         doing FindMembers.
21850
21851         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21852         include NonPublic after the first iteration.
21853
21854         * class.cs (Indexer.CheckBase): Only check if both parents are
21855         non-null. 
21856
21857         * cs-parser.jay (accessor_body): If empty, set to null.
21858
21859         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21860         same code path here to resolve constants names that we did have in
21861         MemberAccess.DoResolve.  There is too much code duplicated here.
21862
21863 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21866
21867         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21868         to MakeUnionSet.
21869
21870         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21871         tokens, numbers and strings.
21872
21873         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21874         parenthesis.
21875
21876         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21877         asyncronous parameters and the regular parameters.  
21878
21879         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21880         specify the target directory.
21881
21882         * expression.cs: (This.DoResolve): Simplify
21883         (As.Emit): Optimize, do not generate IsInst if the expression is
21884         always of the given type.
21885
21886         (Is.DoResolve): Bug fix, we were reporting both always/never for
21887         the is expression.
21888
21889         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21890         creating too many unnecessary arrays.
21891
21892 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
21893
21894         * class.cs (EmitFieldInitializer): Use Assign expression to assign
21895         fields instead of rolling our own initializer.   Takes care of all
21896         implicit conversions, and drops unnecessary static checks/argument.
21897
21898 2002-03-31  Dick Porter  <dick@ximian.com>
21899
21900         * driver.cs: use the GetDirectories() return values properly, and
21901         use "/" as path separator.
21902
21903 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * expression.cs (Unary): Optimize - - expr into expr.
21906         (Binary): Optimize a + (-b) into a -b.
21907
21908         * codegen.cs (CodeGen): Made all methods static.
21909
21910 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
21911
21912         * rootcontext.cs: 
21913
21914         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21915         TypeBuilder property.
21916
21917         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21918         instead. 
21919
21920         * tree.cs: Removed the various RecordXXXX, and replaced with a
21921         single RecordDecl.  Removed all the accessor methods, and just
21922         left a single access point Type 
21923
21924         * enum.cs: Rename DefineEnum to DefineType.
21925
21926         * decl.cs: New abstract method `DefineType' used to unify the
21927         Defines for Enumerations, Interfaces, TypeContainers and
21928         Delegates.
21929
21930         (FindType): Moved LookupInterfaceOrClass here.  Moved the
21931         LookupBaseClasses method that used to live in class.cs and
21932         interface.cs here, and renamed to FindType.
21933
21934         * delegate.cs: Implement DefineType.  Take advantage of the
21935         refactored pattern for locating the parent builder without taking
21936         the parent_builder argument (which we know does not work if we are
21937         nested, and triggering a toplevel definition).
21938
21939 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21942         accessibility of a member has changed during override and report
21943         an error if so.
21944
21945         * class.cs (Method.Define, Property.Define): Only complain on
21946         overrides if the method is private, any other accessibility is
21947         fine (and since we just checked the permission is the same, we are
21948         good to go).
21949
21950         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21951         and elif are processed always.  The other pre-processing
21952         directives are only processed if we are "taking" the path
21953
21954 2002-03-29  Martin Baulig  <martin@gnome.org>
21955
21956         * class.cs (Method.Emit): Only emit symbolic debugging info if the
21957         current location is not Null.
21958
21959         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21960         a separate method so we can profile it.
21961
21962         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21963         `span.Seconds' are just seconds, but no minutes or hours.
21964         (MainDriver): Profile the CodeGen.SaveSymbols calls.
21965
21966 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21967
21968         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21969         Remove the gratuitous set of Final:
21970
21971                                 // If an interface implementation, then we can set Final.
21972                                 if (((flags & MethodAttributes.Abstract) == 0) &&
21973                                     implementing.DeclaringType.IsInterface)
21974                                         flags |= MethodAttributes.Final;
21975
21976         I do not know what I was smoking when I used that.
21977
21978
21979         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21980         step into fixing the name resolution issues for delegates and
21981         unifying the toplevel name resolution.
21982
21983 2002-03-28  Martin Baulig  <martin@gnome.org>
21984
21985         * class.cs (Method.Emit): If we have a symbol writer, call its
21986         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21987         tell it about the current method.
21988
21989         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21990         writer that we're going to emit the first byte of IL code for a new
21991         statement (a new source line).
21992         (EmitContext.EmitTopBlock): If we have a symbol writer, call
21993         EmitContext.Mark() before emitting any code.
21994
21995         * location.cs (SymbolDocument): Return null when we're Null.
21996
21997         * statement.cs (Statement): Moved the `Location loc' variable here.
21998         (Statement.EmitBoolExpression): If we have a symbol writer, call
21999         ec.Mark() before emitting any code to tell it that we're at the
22000         beginning of a new statement.
22001         (StatementExpression): Added `Location' argument to the constructor.
22002         (Block): Added public readonly variable `StartLocation' and public
22003         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22004         (Block): Added constructor which takes a start and end location.
22005         (Block.SetEndLocation): New method. This sets the end location.
22006         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22007         local variables we create.
22008         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22009         each statement and do also mark the begin and end of the block.
22010
22011         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22012         tell it the current lexer.Location, use Location.Null for the end of the
22013         block.
22014         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22015         current block, set its end location using SetEndLocation().
22016         (statement_expression): StatementExpression constructor now takes the
22017         lexer.Location as additional argument.
22018         (for_statement, declare_local_variables): Likewise.
22019         (declare_local_variables): When creating a new implicit block, use the
22020         new Block constructor and pass it the lexer.Location.
22021
22022 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22023
22024         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22025         members also on the parent interfaces recursively.
22026
22027 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22028
22029         * report.cs: Use new formats, since Gonzalo finished the missing
22030         bits. 
22031
22032         * expression.cs (Binary.ResolveOperator): added missing operator|
22033         operator& and operator^ for bool/bool.
22034
22035         * cs-parser.jay: CheckDef now takes a Location argument that is
22036         used to report errors more precisly (instead of reporting the end
22037         of a definition, we try to track something which is a lot closer
22038         to the source of the problem).
22039
22040         * cs-tokenizer.cs: Track global token use, so we can properly flag
22041         the use of #define/#undef after the first token has been seen.
22042
22043         Also, rename the reportXXXX to Error_DescriptiveName
22044
22045         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22046         TypeContainer, so that Enum and Interface can use this too.
22047
22048         * class.cs (TypeContainer.LookupInterfaceOrClass,
22049         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22050         `builder' argument.  Typically this was used to pass the parent
22051         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22052         the definition).  
22053
22054         The problem is that a nested class could trigger the definition of
22055         a toplevel class, and the builder would be obviously wrong in that
22056         case. 
22057
22058         So we drop this argument, and we compute dynamically the
22059         TypeBuilder/ModuleBuilder (the correct information was available
22060         to us anyways from DeclSpace.Parent)
22061
22062         * interface.cs (Interface.DefineInterface): Drop builder
22063         parameter cleanup like class.cs
22064
22065         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22066         like class.cs
22067
22068         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22069         values. 
22070
22071         (Try.Emit): Propagate the returns value from the statement.
22072
22073         (Return.Emit): Even if we are leavning 
22074
22075         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22076
22077         * modifiers.cs: Fix the computation of MethodAttributes flags.
22078
22079 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22080
22081         * driver.cs: allow compilation of files that start with '/'.
22082         Add a default case when checking the argument of --target.
22083
22084 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22085
22086         * interface.cs: Implement the same search algorithm for types in
22087         the interface code.
22088
22089         * delegate.cs: Do not allow multiple definition.
22090
22091         * Recovered ChangeLog that got accidentally amputated
22092
22093         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22094
22095         * rootcontext.cs: Load manually enum to allow core classes to
22096         contain enumerations.
22097
22098         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22099         Update to new static methods in TypeManager.
22100
22101         * typemanager.cs (GetMethod, GetConstructor): Use our
22102         implementation of FindMembers to find the members, since during
22103         corlib compilation, the types are TypeBuilders and GetMethod and
22104         GetConstructor do not work.
22105
22106         Make all methods in TypeManager static.
22107
22108         (InitCodeHelpers): Split the functionality from
22109         the InitCodeTypes function.
22110
22111         * driver.cs: Call InitCodeHelpers after we have populated the
22112         types. 
22113
22114         * cs-parser.jay (delegate_declaration): we did not used to compute
22115         the delegate name correctly for void delegates.
22116
22117 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22118
22119         * rootcontext.cs (RootContext): Init the interface_resolve_order
22120         and type_container_resolve_order always.
22121
22122         (ResolveCore, BootstrapCorlib_ResolveClass,
22123         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22124         compiler when compiling with --nostdlib
22125
22126         * class.cs (TypeContainer.DefineType): Check that our parent is
22127         not null.  This test is most important when we are bootstraping
22128         the core types.
22129
22130         * codegen.cs: Split out the symbol writing code.
22131
22132 2002-03-25  Martin Baulig  <martin@gnome.org>
22133
22134         * driver.cs (-g): Made -g an alias for --debug.
22135
22136 2002-03-24  Martin Baulig  <martin@gnome.org>
22137
22138         * codegen.cs (SymbolWriter): New public variable. Returns the
22139         current symbol writer.
22140         (CodeGen): Added `bool want_debugging_support' argument to the
22141          constructor. If true, tell the ModuleBuild that we want debugging
22142         support and ask it for the ISymbolWriter.
22143         (Save): If we have a symbol writer, call it's Close() method after
22144         saving the assembly.
22145
22146         * driver.c (--debug): New command line argument to create a
22147         debugger information file.
22148
22149         * location.cs (SymbolDocument): New public property. Returns an
22150         ISymbolDocumentWriter object for the current source file or null
22151         if we don't have a symbol writer.
22152
22153 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22154
22155         * driver.cs (LoadAssembly): Correctly return when all the paths
22156         have been tried and not before.
22157
22158         * statement.cs (Switch.Emit): return the actual coverage for this
22159         statement (returns/not-returns)
22160
22161         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22162         switch of the statement if we are the last switch section.  That
22163         kills two problems: try/catch problems (we used to emit an empty
22164         nop at the end) and switch statements where all branches would
22165         return. 
22166
22167 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22168
22169         * driver.cs: Add default assemblies (the equivalent to the
22170         Microsoft CSC.RSP file)
22171
22172         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22173         also update tokens_seen and set it to false.
22174
22175         * driver.cs: Implement --recurse for Mike.
22176
22177         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22178         correctly splitting out the paths.
22179
22180 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22181
22182         * interface.cs (Interface.PopulateProperty): Instead of using
22183         `parent' as the declaration space for the set parameters, use
22184         `this' 
22185
22186         * support.cs (InternalParameters): InternalParameters constructor
22187         takes a DeclSpace instead of a TypeContainer.
22188
22189         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22190         types are being initialized, load the address of it before calling
22191         the function.  
22192
22193         (New): Provide a mechanism to disable the generation of local
22194         value type temporaries when the caller will be providing us with
22195         an address to store it.
22196
22197         (ArrayCreation.EmitDynamicInitializers): Use it.
22198
22199 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22200
22201         * expression.cs (Invocation.EmitArguments): Only probe for array
22202         property if there is more than one argument.  Sorry about that.
22203
22204         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22205         empty param arrays.
22206
22207         * class.cs (Method.LabelParameters): Fix incorrect code path that
22208         prevented the `ParamArrayAttribute' from being applied to the
22209         params attribute.
22210
22211 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22212
22213         * support.cs (ReflectionParameters): Correctly compute whether the
22214         last argument is a params array.  Fixes the problem with
22215         string.Split ('a')
22216
22217         * typemanager.cs: Make the assemblies array always be non-null
22218         (empty, but non-null)
22219
22220         * tree.cs (RecordDecl): New function that abstracts the recording
22221         of names.  This reports error 101, and provides a pointer to the
22222         previous declaration.  Fixes a crash in the compiler.
22223
22224         * cs-parser.jay (constructor_declaration): Update to new grammar,
22225         and provide a constructor_body that can be empty.
22226
22227 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22228
22229         * driver.cs: Add support for --resources.
22230
22231         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22232         Make all types for the various array helper methods be integer.
22233
22234         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22235         CheckState to ConvCast.
22236
22237         (ConvCast): Now it takes a `checked' state argument, to avoid
22238         depending on the emit context for the conversion, and just using
22239         the resolve time setting.
22240
22241         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22242         instead of Invocation.EmitArguments.  We do not emit the original
22243         arguments, instead we emit those which have been converted to
22244         unsigned int expressions.
22245
22246         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22247
22248         * codegen.cs: ditto.
22249
22250         * expression.cs (LocalVariableReference): Drop the use of the
22251         Store function that depended on the variable index.
22252
22253         * statement.cs (VariableInfo): Drop the `Idx' property from this
22254         class, as this is not taking into account the indexes for
22255         temporaries tat we generate during the execution, getting the
22256         indexes wrong.
22257
22258         * class.cs: First emit class initializers, then call the parent
22259         constructor. 
22260
22261         * expression.cs (Binary): Fix opcode emision.
22262         (UnaryMutator.EmitCode): Support checked code generation
22263
22264         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22265         matches for events for both the Static and Instance scans,
22266         pointing to the same element.   Fix that.
22267
22268 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22269
22270         * rootcontext.cs (ResolveTree): Always set the
22271         interface_resolve_order, because nested interfaces will be calling
22272         into us.
22273
22274         * class.cs (GetInterfaceOrClass): Track the same resolution
22275         process used by TypeManager.LookupType.  This fixes the nested
22276         type lookups in class declarations (separate path from
22277         LookupType). 
22278
22279         (TypeContainer.DefineType): Also define nested interfaces.
22280         (TypeContainer.RegisterOrder): New public function used to
22281         register the order in which child interfaces need to be closed.
22282
22283         Nested interfaces need to be closed after their parents have been
22284         created. 
22285
22286         * interface.cs (InterfaceAttr): Put all the logic for computing
22287         the interface attribute here. 
22288
22289         (DefineInterface): Register our interface order with the
22290         RootContext or with the TypeContainer depending on the case.
22291
22292 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * cs-parser.jay: rework foreach statement to work with the new
22295         changes to the policy on SimpleNames.
22296
22297         * report.cs: support Stacktrace on warnings as well.
22298
22299         * makefile: drop --unsafe and /unsafe from the compile.
22300
22301 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22302
22303         * ecore.cs (StandardConversionExists): Modify to take an Expression
22304         as the first parameter. Ensure we do null -> reference type conversion
22305         checking.
22306
22307         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22308         temporary Expression objects.
22309
22310 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22311
22312         * interface.cs: workaround bug in method overloading resolution
22313         (there is already a bugzilla bug for it).
22314
22315 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22316
22317         We could also solve this problem by having a separate path for
22318         performing type lookups, instead of DoResolve, we could have a
22319         ResolveType entry point, and only participating pieces of the
22320         production (simplename, deref, array) would implement this. 
22321
22322         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22323         signal SimpleName to only resolve type names and not attempt to
22324         resolve anything else.
22325
22326         * expression.cs (Cast): Set the flag.
22327
22328         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22329
22330         * class.cs: Only report 108 if there is no `new' modifier.
22331
22332         * cs-parser.jay: rework foreach statement to work with the new
22333         changes to the policy on SimpleNames.
22334
22335         * report.cs: support Stacktrace on warnings as well.
22336
22337         * makefile: drop --unsafe and /unsafe from the compile.
22338
22339 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22340
22341         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22342         lookups here, instead of doing that at parse time.  This means
22343         that our grammar will not introduce `LocalVariableReferences' as
22344         expressions at this point.  That solves the problem of code like
22345         this:
22346
22347         class X {
22348            static void Main ()
22349            { int X = 1;
22350             { X x = null }}}
22351
22352         This is only half the fix.  The full fix requires parameters to
22353         also be handled in this way.
22354
22355         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22356         makes the use more obvious of the DeclSpace.  The
22357         ec.TypeContainer.TypeBuilder is now only used to pull the
22358         TypeBuilder for it.
22359
22360         My theory is that I can get rid of the TypeBuilder completely from
22361         the EmitContext, and have typecasts where it is used (from
22362         DeclSpace to where it matters).  
22363
22364         The only pending problem is that the code that implements Aliases
22365         is on TypeContainer, and probably should go in DeclSpace.
22366
22367         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22368         lookups here, instead of doing that at parse time.  This means
22369         that our grammar will not introduce `LocalVariableReferences' as
22370         expressions at this point.  That solves the problem of code like
22371         this:
22372
22373         class X {
22374            static void Main ()
22375            { int X = 1;
22376             { X x = null }}}
22377
22378         This is only half the fix.  The full fix requires parameters to
22379         also be handled in this way.
22380
22381         * class.cs (Property.DefineMethod): When implementing an interface
22382         method, set newslot, when implementing an abstract method, do not
22383         set the flag (before we tried never setting it, or always setting
22384         it, which is the difference).
22385         (Indexer.DefineMethod): same.
22386         (Method.DefineMethod): same.
22387
22388         * ecore.cs: Only set the status used flag if we get back a Field.
22389
22390         * attribute.cs: Temporary hack, so Paolo can keep working.
22391
22392 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22393
22394         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22395         the unmanaged type in the case we have a MarshalAs attribute.
22396
22397         (Resolve): Handle the case when we are parsing the special MarshalAs
22398         attribute [we need to store the unmanaged type to use later]
22399
22400         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22401         MarshalAs Attribute.
22402
22403         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22404         on parameters and accordingly set the marshalling info.
22405
22406 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22407
22408         * class.cs: Optimizing slightly by removing redundant code after
22409         we switched to the `NoTypes' return value.
22410         (Property.DefineMethod): use NoTypes here too.
22411
22412         This fixes the bug I introduced in my last batch of changes.
22413
22414 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22415
22416         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22417
22418         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22419         Enums since those are types too. 
22420
22421         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22422
22423         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22424         thanks to a call during the lookup process.
22425
22426 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22427
22428         * statement.cs (Foreach): Lots of work to accomodate a particular
22429         kind of foreach statement that I had not kept in mind.  It is
22430         possible to have foreachs on classes that provide a GetEnumerator
22431         method that return objects that implement the "pattern" for using
22432         a foreach, there is no need to support GetEnumerator
22433         specifically. 
22434
22435         This is needed to compile nant.
22436
22437         * decl.cs: Only report 114 if the member is not `Finalize' and if
22438         the warning level is at least 2.
22439
22440         * class.cs: Moved the compare function from Method to
22441         MethodSignature. 
22442
22443         (MethodSignature.InheritableMemberSignatureCompare): Add new
22444         filter function that is used to extract inheritable methods from a
22445         class. 
22446
22447         (Method.Define): Use the new `inheritable_method_signature_filter'
22448         delegate
22449
22450         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22451         command. 
22452
22453 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22454
22455         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22456
22457         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22458
22459         * expression.cs: Pass location information to
22460         ConvertImplicitStandard. 
22461
22462         * class.cs: Added debugging code to track return values from
22463         interfaces. 
22464
22465 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * expression.cs (Is.DoResolve): If either side of the `is' is an
22468         interface, do not flag the warning.
22469
22470         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22471         for interfaces
22472
22473         * report.cs: Allow for --fatal to be used with --probe.
22474
22475         * typemanager.cs (NoTypes): Move the definition for the empty Type
22476         array here. 
22477
22478         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22479         properties. 
22480         (TypeContainer.DefineProxy): New function used to proxy to parent
22481         implementations when implementing interfaces.
22482         (TypeContainer.ParentImplements): used to lookup if our parent
22483         implements a public function that is required by an interface.
22484         (TypeContainer.VerifyPendingMethods): Hook this up.
22485
22486         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22487         `modules' and `assemblies' arraylists into arrays.  We only grow
22488         these are the very early start up of the program, so this improves
22489         the speedof LookupType (nicely measured).
22490
22491         * expression.cs (MakeByteBlob): Replaced unsafe code with
22492         BitConverter, as suggested by Paolo.
22493
22494         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22495         folding of string concatenation, but if either side is a string,
22496         and the other is not, then return null, and let the runtime use
22497         the concatenation on the string plus the object (using
22498         `Object.ToString'). 
22499
22500 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22501
22502         Constant Folding has been implemented now.
22503
22504         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22505         the error instead on types that are not supported in one's
22506         complement. 
22507
22508         * constant.cs (Constant and all children): New set of functions to
22509         perform implict and explicit conversions.
22510
22511         * ecore.cs (EnumConstant): Implement the new functions to perform
22512         conversion by proxying to the child expression.
22513
22514         * codegen.cs: (ConstantCheckState): Constant evaluation has its
22515         own separate setting that can not be turned off from the command
22516         line using --unchecked or --checked and is only controlled using
22517         the checked/unchecked statements and expressions.  This setting is
22518         used by the constant folder to flag errors.
22519
22520         * expression.cs (CheckedExpr, UncheckedExpr): Set the
22521         ConstantCheckState as well.   
22522
22523         During Resolve, they also have to flag the state, because the
22524         constant folder runs completely in the Resolve phase.
22525
22526         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22527         well.
22528
22529 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * cfold.cs: New file, this file contains the constant folder.
22532
22533         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22534         argument to track whether we are using the resulting address to
22535         load or store a value and provide better error messages. 
22536
22537         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22538         new AddressOf arguments.
22539
22540         * statement.cs (Foreach.EmitCollectionForeach): Update
22541
22542         * expression.cs (Argument.Emit): Call AddressOf with proper
22543         arguments to track usage.
22544
22545         (New.DoEmit): Call AddressOf with new arguments.
22546
22547         (Unary.Emit): Adjust AddressOf call.
22548
22549 2002-03-01  Ravi Pratap  <ravi@ximian.com>
22550
22551         * cs-parser.jay (member_access): Change the case for pre-defined types
22552         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
22553         this suggestion.
22554
22555         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22556         a method body.
22557
22558         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22559         essentially like methods and apply attributes like MethodImplOptions to them too.
22560
22561         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22562         not being null.
22563
22564         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22565         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22566         is the DeclSpace.
22567
22568         * Update code everywhere accordingly.
22569
22570         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22571
22572         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22573
22574 2002-02-28  Ravi Pratap  <ravi@ximian.com>
22575
22576         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22577         try performing lookups against those instead of jumping straight into using
22578         the 'using' clauses.
22579
22580         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22581
22582         (LookupType): Perform lookups in implicit parents too.
22583
22584         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22585         sequence as RootContext.LookupType. 
22586
22587         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
22588         the various cases of namespace lookups into this method.
22589
22590 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22591
22592         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22593         in positional arguments)
22594
22595         * class.cs (Operator): Update the AllowedModifiers to contain
22596         extern. 
22597
22598         * cs-parser.jay: Update operator declaration to allow for the
22599         operator body to be empty.
22600
22601         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22602         values. 
22603
22604 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
22605
22606         * class.cs (Method.Emit): Label parameters.
22607
22608         * driver.cs: Return 1 or 0 as the program exit code.
22609
22610 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
22611
22612         * expression.cs: Special case the `null' object when trying to
22613         auto-compute the type, as anything can be explicitly converted to
22614         that. 
22615
22616         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22617         spotting this Paolo.
22618
22619         (Expression.ImplicitNumericConversion): Perform comparissions of
22620         the type using the underlying type in the case of an enumeration
22621         rather than using the enumeration type for the compare.
22622
22623         Cope with the underlying == type case, which is not possible to
22624         catch before. 
22625
22626         (Expression.ConvertNumericExplicit): Perform comparissions of
22627         the type using the underlying type in the case of an enumeration
22628         rather than using the enumeration type for the compare.
22629
22630         * driver.cs: If the user does not supply an extension, assume .exe
22631
22632         * cs-parser.jay (if_statement): Rewrote so that we can track the
22633         location for the if statement.
22634
22635         * expression.cs (Binary.ConstantFold): Only concat strings when
22636         the operation is "+", not everything ;-)
22637
22638         * statement.cs (Statement.EmitBoolExpression): Take a location
22639         argument. 
22640         (If, While, Do): Track location.
22641
22642         * expression.cs (Binary.ResolveOperator): In the object + string
22643         case, I was missing a call to ConvertImplicit
22644
22645 2002-02-25  Ravi Pratap  <ravi@ximian.com>
22646
22647         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22648         Location arguments. Ensure we use RootContext.LookupType to do our work
22649         and not try to do a direct Type.GetType and ModuleBuilder.GetType
22650
22651         * interface.cs (PopulateMethod): Handle the type of the parameter being
22652         null gracefully.
22653
22654         * expression.cs (Invocation.BetterFunction): Handle the case when we 
22655         have a params method with no fixed arguments and a call is made with no
22656         arguments.
22657
22658 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
22659
22660         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22661         the verbatim-string-literal
22662
22663         * support.cs (InternalParameters.ParameterModifier): handle null
22664         fixed parameters.
22665         (InternalParameters.ParameterType): ditto.
22666
22667         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22668         duplicating the name of the variable parameter.
22669         (GetParameterByName): Fix bug where we were not looking up array
22670         paramters if they were the only present (thanks Paolo!).
22671         (GetParameterInfo): We only have an empty set of types if both
22672         fixed and array are set to null.
22673         (GetParameterInfo-idx): Handle FixedParameter == null
22674
22675         * cs-parser.jay: Handle the case where there is no catch
22676         statements (missing null test).
22677
22678 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
22679
22680         * driver.cs (MainDriver): Be conservative on our command line
22681         handling.
22682
22683         Catch DirectoryNotFoundException when calling GetFiles.
22684
22685         (SplitPathAndPattern): Used to split the input specification into
22686         a path and a pattern that we can feed to Directory.GetFiles.
22687
22688 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
22689
22690         * statement.cs (Fixed): Implement the last case of the Fixed
22691         statement (string handling).
22692
22693         * expression.cs (StringPtr): New class used to return a char * to
22694         a string;  Used by the Fixed statement.
22695
22696         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
22697
22698         * expression.cs (Binary.ResolveOperator): Remove redundant
22699         MemberLookup pn parent type.
22700         Optimize union call, we do not need a union if the types are the same.
22701         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22702         type.
22703
22704         Specialize the use of MemberLookup everywhere, instead of using
22705         the default settings. 
22706
22707         (StackAlloc): Implement stackalloc keyword.
22708
22709         * cs-parser.jay: Add rule to parse stackalloc.
22710
22711         * driver.cs: Handle /h, /help, /?
22712
22713         * expression.cs (MakeByteBlob): Removed the hacks we had in place
22714         before we supported unsafe code.
22715
22716         * makefile: add --unsafe to the self compilation of mcs.
22717
22718 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
22719
22720         * expression.cs (PointerArithmetic): New class that is used to
22721         perform pointer arithmetic.
22722         (Binary.Resolve): Handle pointer arithmetic
22723         Handle pointer comparission.
22724         (ArrayPtr): Utility expression class that is used to take the
22725         address of an array.
22726
22727         (ElementAccess): Implement array access for pointers
22728
22729         * statement.cs (Fixed): Implement fixed statement for arrays, we
22730         are missing one more case before we are done.
22731
22732         * expression.cs (Indirection): Implement EmitAssign and set the
22733         ExprClass to Variable.  This allows pointer dereferences to be
22734         treated as variables, and to have values assigned to them.
22735
22736         * ecore.cs (Expression.StoreFromPtr): New utility function to
22737         store values dereferencing.
22738
22739 2002-02-20  Ravi Pratap  <ravi@ximian.com>
22740
22741         * expression.cs (Binary.ResolveOperator): Ensure that we are
22742         not trying to operate on a void type - this fixes the reported
22743         bug.
22744
22745         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22746         the parent implementation is sealed.
22747
22748         * ../errors/cs0239.cs : Add.
22749
22750         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22751
22752         * typemanager.cs (unverifiable_code_type): Corresponds to 
22753         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22754         which have unsafe code in them.
22755
22756         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
22757         unsafe context.
22758
22759 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
22760
22761         * cs-tokenizer.cs: Add support for @"litreal strings"
22762
22763         Make tokenizer accept pre-processor directives
22764         on any column (remove the old C-like limitation). 
22765
22766         * rootcontext.cs (EmitCode): Emit any global attributes.
22767         (AddGlobalAttributes): Used to keep track of assembly attributes. 
22768
22769         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
22770
22771         * cs-parser.jay: Add support for global attributes.  
22772
22773 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
22774
22775         * expression.cs (Indirection): New helper class.  Unary will
22776         create Indirection classes to be able to implement the
22777         IMemoryLocation interface on it.
22778
22779 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
22780
22781         * cs-parser.jay (fixed_statement): reference the right statement.
22782
22783         * statement.cs (Fixed.Emit): Finish implementing the fixed
22784         statement for the &x case.
22785
22786 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
22787
22788         * class.cs (Property.Define, Method.Define): Remove newslot when
22789         `implementing'.  
22790
22791         * modifiers.cs: My use of NewSlot when `Abstract' was set was
22792         wrong.  NewSlot should only be used if the `new' keyword is present.
22793
22794         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
22795         locating our system dir.  Sorry about this.
22796
22797 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
22798
22799         * driver.cs (GetSystemDir): Compute correctly the location of our
22800         system assemblies.  I was using the compiler directory instead of
22801         the library directory.
22802
22803 2002-02-13  Ravi Pratap  <ravi@ximian.com>
22804
22805         * expression.cs (BetterFunction): Put back in what Miguel commented out
22806         since it is the correct fix. The problem is elsewhere ;-)
22807
22808         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
22809         parameters of the parms method are themselves compatible or not !
22810
22811         (StandardConversionExists): Fix very dangerous bug where we were forgetting
22812         to check that a class implements an interface before saying that an implicit
22813         conversion was allowed. Use ImplementsInterface to do the checking.
22814
22815 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
22816
22817         * class.cs (Method.Define): Track whether we are an explicit
22818         implementation or not.  And only call DefineMethodOverride if we
22819         are an explicit implementation.
22820
22821         (Property.DefineMethod): Ditto.
22822
22823 2002-02-11  Ravi Pratap  <ravi@ximian.com>
22824
22825         * expression.cs (BetterFunction): Catch hideous bug which was
22826          preventing us from detecting ambiguous calls due to implicit casts i.e
22827         cs0121.
22828
22829 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
22830
22831         * support.cs (Pair): Remove un-needed method.  I figured why I was
22832         getting the error in cs-parser.jay, the variable in a foreach loop
22833         is readonly, and the compiler does not really treat this as a variable.
22834
22835         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
22836         instead of EQUALS in grammar.  
22837
22838         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22839
22840         * expression.cs (Unary.DoResolve): Check whether the argument is
22841         managed or not.
22842
22843 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
22844
22845         * support.cs: Api for Pair to set a value.  Despite the fact that
22846         the variables are public the MS C# compiler refuses to compile
22847         code that accesses the field if the variable is part of a foreach
22848         statement. 
22849
22850         * statement.cs (Fixed): Begin implementation of the fixed
22851         statement.
22852
22853         (Block.AddVariable): Return the VariableInfo on success and null
22854         on failure instead of true/false. 
22855
22856         * cs-parser.jay (foreach): Catch errors on variables already
22857         defined (we were ignoring this value before) and properly unwind
22858         the block hierarchy
22859
22860         (fixed_statement): grammar for the fixed statement.
22861
22862 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
22863
22864         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22865         pointer types to be incretemented.
22866
22867         (SizeOf): Implement.
22868
22869         * cs-parser.jay (pointer_member_access): Implement
22870         expr->IDENTIFIER production.
22871
22872         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22873         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22874         on safe contexts.
22875
22876         (Unary): Implement indirection.
22877
22878         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22879         use in non-unsafe context).
22880
22881         (SimpleName.DoResolve): Check for pointers in field access on safe
22882         contexts. 
22883
22884         (Expression.LoadFromPtr): Factor the load-indirect code in this
22885         function.  This was duplicated in UnboxCast and ParameterReference
22886
22887 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
22888
22889         * expression.cs (ComposedCast): report an error if a pointer cast
22890         is used in a safe region.
22891
22892         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22893         pointer type casts in unsafe context.
22894
22895         * codegen.cs (EmitContext): Set up IsUnsafe.
22896
22897         * cs-parser.jay (non_expression_type): Add productions for pointer
22898         casts. 
22899
22900         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22901         code.  We should not use force into static mode if the method is
22902         not virtual.  Fixes bug in MIS
22903
22904         * statement.cs (Do.Emit, While.Emit, For.Emit,
22905         Statement.EmitBoolExpression): Add support to Do and While to
22906         propagate infinite loop as `I do return' semantics.
22907
22908         Improve the For case to also test for boolean constants.
22909
22910         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22911         to the list of attributes we can add.
22912
22913         Remove `EmitContext' argument.
22914
22915         * class.cs (Method.Define): Apply parameter attributes.
22916         (Constructor.Define): Apply parameter attributes.
22917         (MethodCore.LabelParameters): Move here the core of labeling
22918         parameters. 
22919
22920         * support.cs (ReflectionParameters.ParameterModifier,
22921         InternalParameters.ParameterModifier): Use IsByRef on the type and
22922         only return the OUT bit for these parameters instead of in/out/ref
22923         flags.
22924
22925         This is because I miss-understood things.  The ParameterInfo.IsIn
22926         and IsOut represent whether the parameter has the [In] and [Out]
22927         attributes set.  
22928
22929 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
22930
22931         * ecore.cs (FieldExpr.Emit): Release temporaries.
22932
22933         * assign.cs (LocalTemporary.Release): new function.
22934
22935         * codegen.cs (EmitContext.GetTemporaryStorage,
22936         EmitContext.FreeTemporaryStorage): Rework the way we deal with
22937         temporary storage.  Now we can "put back" localbuilders when we
22938         are done with them
22939
22940 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
22941
22942         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22943         need to make a copy of the variable to generate verifiable code.
22944
22945 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
22946
22947         * driver.cs: Compute dynamically the system directory.
22948
22949         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22950         Slower, but more generally useful.  Used by the abstract
22951         registering implementation. 
22952
22953         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22954         the rules for the special rule on Type/instances.  First check if
22955         we have the same name, and if so, try that special static path
22956         rather than the instance path.
22957
22958 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
22959
22960         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22961         for, while and if.
22962
22963         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22964         Enum, ValueType, Delegate or Array for non-corlib compiles.
22965
22966         * cs-tokenizer.cs: Catch long identifiers (645)
22967
22968         * typemanager.cs (IndexerPropetyName): Ravi never tested this
22969         piece of code.
22970
22971         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22972         fix, we were returning too early, so we were not registering
22973         pending methods from abstract classes.
22974
22975         Do not register pending methods if the class is abstract.
22976
22977         * expression.cs (Conditional.DoResolve): Report circular implicit
22978         conversions when we neecd to compute it for conditional
22979         expressions. 
22980
22981         (Is.DoResolve): If the expression is always of the provided type,
22982         flag warning 183.  If the expression can not ever be of the
22983         provided type flag warning 184.
22984
22985         * class.cs: Catch 169 as well.
22986
22987         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22988         read. 
22989
22990 2002-01-18  Nick Drochak  <ndrochak@gol.com>
22991
22992         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
22993
22994 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * interface.cs: (PopulateMethod): Check for pointers being defined
22997         only if the unsafe context is active.
22998         (PopulateProperty): ditto.
22999         (PopulateIndexer): ditto.
23000
23001         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23002         specified.  If pointers are present, make sure that they are
23003         present in an unsafe context.
23004         (Constructor, Constructor.Define): ditto.
23005         (Field, Field.Define): ditto.
23006         (Property, Property.Define): ditto.
23007         (Event, Event.Define): ditto.
23008
23009         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23010         hashtable if there are classes or structs defined.
23011
23012         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23013         code, as the constant resolution moved.
23014
23015         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23016         the metadata, so we can flag error 133. 
23017
23018         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23019         pointer is being declared in an unsafe context.
23020
23021 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23022
23023         * modifiers.cs (Modifiers.Check): Require a Location argument.
23024         Report error 227 for Unsafe use.
23025
23026         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23027
23028         * statement.cs (For.Emit): If the test is null, then report that
23029         we do `return', as we wont reach anything afterwards.
23030
23031         (Switch.SwitchGoverningType): Track the expression that matched
23032         the conversion.
23033
23034         * driver.cs: Allow negative numbers as an error code to flag.
23035
23036         * cs-parser.jay: Handle 1551.
23037
23038         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23039
23040 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23041
23042         * cs-parser.jay: Report 1518 (type declaration can only contain
23043         class, struct, interface, enum or delegate)
23044
23045         (switch_label): Report 1523 (keywords `case' or `default' must
23046         preced code)
23047
23048         (opt_switch_sections): Report 1522 (empty switch)
23049
23050         * driver.cs: Report 1515 (response file specified multiple times)
23051         Report 1516 (Source file specified multiple times).
23052
23053         * expression.cs (Argument.Resolve): Signal 1510
23054
23055         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23056         access not allowed in static code)
23057
23058 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23059
23060         * typemanager.cs (IsPointerType): Utility method which we are going
23061         to need a lot.
23062
23063         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23064         the object type, so we take care of that.
23065
23066         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23067
23068         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23069         added to non-params parameters :-)
23070
23071         * typemanager.cs (CSharpName): Include 'void' type too. 
23072
23073         (void_ptr_type): Include in the set of core types.
23074
23075         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23076         duplicating code.
23077
23078         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23079         an unsafe context.
23080
23081         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23082         completely forgotten about it.
23083
23084 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23085
23086         * cs-parser.jay (pointer_type): Add. This begins our implementation
23087         of parsing rules for unsafe code.
23088
23089         (unsafe_statement): Implement.
23090
23091         (embedded_statement): Modify to include the above.
23092
23093         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23094
23095         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23096         if the current context is an unsafe one.
23097
23098         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23099         are handled differently, we need separate rules for them.
23100
23101         (local_variable_declaration): Update to use local_variable_pointer_type
23102         to allow variable declarations of unmanaged pointer types.
23103
23104         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23105         in unsafe contexts.
23106
23107         * ../errors/cs0214.cs : Add.
23108
23109 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23110
23111         * makefile: remove 'response' file when cleaning.
23112
23113 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23114
23115         * cs-parser.jay: Report 1524.
23116
23117 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23118
23119         * typemanager.cs (RegisterMethod): drop checking if we have
23120         registered this from here
23121
23122 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23123
23124         * class.cs (Method.EmitDestructor): Implement calling our base
23125         destructor. 
23126
23127         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23128         value of InFinally.
23129
23130         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23131         this routine and will wrap the call in a try/catch block.  Deal
23132         with the case.
23133
23134 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23135
23136         * ecore.cs (Expression.MemberLookup): instead of taking a
23137         parameter `same_type' that was used to tell whether we could
23138         access private members we compute our containing type from the
23139         EmitContext.
23140
23141         (FieldExpr): Added partial support for volatile fields.  This does
23142         not work for volatile fields exposed from assemblies, as I can not
23143         figure out how to extract the modreq from it.
23144
23145         Updated all the source files to use this.
23146
23147         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23148         because it is referenced by MemberLookup very often. 
23149
23150 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23151
23152         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23153         TypeBuilder.GetCustomAttributes to retrieve what we need.
23154
23155         Get rid of redundant default_member_attr_type as this is the same as
23156         default_member_type which already exists.
23157
23158         * interface.cs, attribute.cs : Update accordingly.
23159
23160 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23161
23162         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23163         work for TYpeBuilders though.  Ravi, can you please fix this?
23164
23165         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23166
23167         * expression.cs (Argument.Emit): Handle the case of ref objects
23168         being passed to ref functions;  
23169
23170         (ParameterReference.EmitLoad): Loads the content of the pointer
23171         without dereferencing.
23172
23173 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23174
23175         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23176
23177 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23178
23179         * class.cs (Indexer.DefineMethod): Incorporate the interface
23180         type in the name of the method if we are doing explicit interface
23181         implementation.
23182
23183         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23184
23185         (BetterConversion): Fix extremely trivial bug where we were referring to
23186         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23187         again !
23188
23189         * ../errors/bug16.cs : Add although we have fixed it.
23190
23191 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23192
23193         * expression.cs (BaseIndexer): Begin implementation.
23194
23195         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23196
23197         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23198         production directly to remove a shift/reduce, and implement
23199         explicit interface implementation.
23200
23201         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23202         after a floating point suffix.
23203
23204         * expression.cs (DoNumericPromotions): Improved the conversion for
23205         uint/uint.  If we have a constant, we avoid doing a typecast to a
23206         larger type.
23207
23208         * class.cs (Indexer): Implement explicit interface implementation
23209         for indexers.
23210
23211 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23212
23213         * class.cs: make the default instance constructor public and hidebysig.
23214
23215 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23216
23217         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23218         so we can call it from elsewhere.
23219
23220         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23221         we emit it internally if the class has a defined indexer; otherwise the user
23222         emits it by decorating the class definition with the DefaultMemberAttribute.
23223
23224         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23225         attribute is not used on a type which defines an indexer.
23226
23227         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23228         character when we skip whitespace.
23229
23230         * ../errors/cs0646.cs : Add.
23231
23232 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23233
23234         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23235         again. 
23236
23237         * makefile: Add practical target `mcs3.exe' which builds the third
23238         generation compiler. 
23239
23240         * expression.cs (New): Fix structures constructor calling.
23241
23242         * class.cs (Property, Method, Indexer): Emit Final flag on the
23243         method if we are an interface implementation and we are not
23244         abstract. 
23245
23246         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23247         whether this property is referencing a `base' method.
23248
23249         * expression.cs (Invocation.EmitCall): take an extra argument:
23250         is_base, this is used to determine whether the `call' or
23251         `callvirt' opcode should be used.
23252
23253
23254         * delegate.cs: update EmitCall.
23255
23256         * class.cs (Method.Define): Set NewSlot for the cases where we are
23257         not implementing an interface method.
23258
23259         (Property.Define): ditto.
23260
23261 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23264         'r'.  Allows mcs to parse itself fully.
23265
23266 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23267
23268         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23269         of the number of initializers that require the InitializeArray method.
23270
23271         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23272         update the above field where necessary.
23273
23274         (MakeByteBlob): Update accordingly.
23275
23276         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23277         greater than 2.
23278
23279         (EmitDynamicInitializers): Update in accordance with the new optimization.
23280
23281         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23282         same OpCode applies.
23283
23284         * cs-parser.jay : Fix some glaring errors I introduced.
23285
23286 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23287
23288         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23289         so that we can check for name clashes there too.
23290
23291         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23292         for interface indexers.
23293
23294         * interfaces.cs (Define): Emit the default member attribute.
23295
23296         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23297         variable was being referred to while setting the value ;-)
23298
23299 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23300
23301         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23302         byte-by-byte information when we know the data is zero.
23303
23304         Make the block always a multiple of 4, because
23305         DefineInitializedData has a bug.
23306
23307         * assign.cs: Fix, we should assign from the temporary, not from
23308         the source. 
23309
23310         * expression.cs (MakeByteBlob): Fix my incorrect code.
23311
23312 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23313
23314         * typemanager.cs (EnumToUnderlying): This function is used to get
23315         the underlying type from an enumeration, because it does not
23316         always work. 
23317
23318         * constant.cs: Use the I4_S form for values between -128 and 127.
23319
23320         * statement.cs (Block.LookupLabel): Looks up a label.
23321         (Block): Drop support for labeled blocks.
23322
23323         (LabeledStatement): New kind of statement that represents a label
23324         only.
23325
23326         (Goto): Finally implement this bad boy.
23327
23328         * cs-parser.jay: Update to reflect new mechanism to implement
23329         labels.
23330
23331 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23332
23333         * codegen.cs (EmitContext.This): a codegen property that keeps the
23334         a single instance of this instead of creating many different this
23335         instances. 
23336
23337         * delegate.cs (Delegate.DoResolve): Update to use the property;
23338
23339         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23340
23341         * expression.cs (BaseAccess.DoResolve): Ditto.
23342
23343 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23344
23345         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23346         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23347
23348         (InitCoreTypes): Update accordingly.
23349
23350         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23351         so we can quickly store the state.
23352
23353         (ApplyAttributes): Set the correct implementation flags
23354         for InternalCall methods.
23355
23356 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23357
23358         * expression.cs (EmitCall): if a method is not virtual, then do
23359         not use callvirt on it.
23360
23361         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23362         user defined stuff) requires the use of stobj, which takes an
23363         address on the stack instead of an array and an index.  So emit
23364         the Ldelema operation for it.
23365
23366         (EmitStoreOpcode): Use stobj for valuetypes.
23367
23368         (UnaryMutator.EmitCode): Use the right 1 value depending on
23369         whether we are dealing with int64/uint64, float or doubles.
23370
23371         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23372         constructors that I implemented last night.
23373
23374         (Constructor.IsDefault): Fix to work properly for static
23375         constructors.
23376
23377         * cs-parser.jay (CheckDef): report method signature errors.
23378         Update error number 103 to be 132.
23379
23380         * decl.cs: New AdditionResult enumeration value: MethodExists.
23381         Although we do this check for methods later on in the semantic
23382         analysis, catching repeated default constructors is so easy that
23383         we catch these here. 
23384
23385         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23386         promotions code.
23387
23388         (ParameterReference.EmitAssign, Emit): handle
23389         bools as bytes.
23390
23391         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23392         (ArrayAccess.EmitStoreOpcode): ditto.
23393
23394         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23395
23396         * expression.cs (MakeByteBlob): Complete all the missing types
23397         (uint, short, ushort, byte, sbyte)
23398
23399         * class.cs: Only init instance field initializers on instance
23400         constructors. 
23401
23402         Rename `constructors' to instance_constructors. 
23403
23404         (TypeContainer.AddConstructor): Only add constructors to the list
23405         if it is not static.
23406
23407         Make sure that we handle default_static_constructor independently
23408         everywhere where we handle instance_constructors
23409
23410 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23411
23412         * class.cs: Do not lookup or create a base initializer for a
23413         static constructor.
23414
23415         (ConstructorInitializer.Resolve): use the proper type to lookup
23416         for constructors.
23417
23418         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23419
23420         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23421         in DeclSpace. 
23422
23423         * decl.cs: CloseType is now an virtual method, the default
23424         implementation just closes this type.
23425
23426 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23427
23428         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23429         to PreserveSig by default. Also emit HideBySig on such methods.
23430
23431         Basically, set the defaults to standard values.
23432
23433         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23434         argument, if candidate is better, it can't be worse than the best !
23435
23436         (Invocation): Re-write bits to differentiate between methods being
23437         applicable in their expanded form and their normal form - for params
23438         methods of course.
23439
23440         Get rid of use_standard everywhere as only standard conversions are allowed
23441         in overload resolution. 
23442
23443         More spec conformance.
23444
23445 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23446
23447         * driver.cs: Add --timestamp, to see where the compiler spends
23448         most of its time.
23449
23450         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23451         `this' in static code.
23452
23453         (SimpleName.DoResolve): Implement in terms of a helper function
23454         that allows static-references to be passed upstream to
23455         MemberAccess.
23456
23457         (Expression.ResolveWithSimpleName): Resolve specially simple
23458         names when called by MemberAccess to implement the special
23459         semantics. 
23460
23461         (Expression.ImplicitReferenceConversion): Handle conversions from
23462         Null to reference types before others, as Null's type is
23463         System.Object. 
23464
23465         * expression.cs (Invocation.EmitCall): Handle the special case of
23466         calling methods declared on a reference type from a ValueType
23467         (Base classes System.Object and System.Enum)
23468
23469         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23470         the left hand side is a TypeExpr, not on every enumeration. 
23471
23472         (Binary.Resolve): If types are reference types, then do a cast to
23473         object on operators != and == of both arguments.
23474
23475         * typemanager.cs (FindMembers): Extract instance and static
23476         members if requested.
23477
23478         * interface.cs (PopulateProperty): Use void_type instead of null
23479         as the return type for the setter method.
23480
23481         (PopulateIndexer): ditto.
23482
23483 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23484
23485         * support.cs (ReflectionParameters): Fix minor bug where we
23486         were examining the wrong parameter for the ParamArray attribute.
23487
23488         Cope with requests for the type of the parameter at position
23489         greater than the params parameter's. We now return the element
23490         type of the params array as that makes more sense.
23491
23492         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23493         accordingly as we no longer have to extract the element type
23494         ourselves.
23495
23496         (Invocation.OverloadResolve): Update.
23497
23498 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23499
23500         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23501         against IEnumerator, test whether the return value is a descendant
23502         of the IEnumerator interface.
23503
23504         * class.cs (Indexer.Define): Use an auxiliary method to implement
23505         the other bits of the method definition.  Begin support for
23506         explicit interface implementation.
23507
23508         (Property.DefineMethod): Use TypeManager.void_type instead of null
23509         for an empty return value.
23510
23511 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
23512
23513         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23514         dealing with a FieldExpr which is composed of a FieldBuilder, in
23515         the code path we did extract the constant, but we should have
23516         obtained the underlying value to be able to cast it (otherwise we
23517         end up in an infinite loop, this is what Ravi was running into).
23518
23519         (ArrayCreation.UpdateIndices): Arrays might be empty.
23520
23521         (MemberAccess.ResolveMemberAccess): Add support for section
23522         14.5.4.1 that deals with the special case of E.I when E is a type
23523         and something else, that I can be a reference to a static member.
23524
23525         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23526         handle a particular array type to create byte blobs, it is just
23527         something we dont generate byteblobs for.
23528
23529         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23530         arguments. 
23531
23532         * location.cs (Push): remove the key from the hashtable that we
23533         are about to add.   This happens for empty files.
23534
23535         * driver.cs: Dispose files after we have parsed them.
23536
23537         (tokenize): new function that only runs the tokenizer on its
23538         input, for speed testing.
23539
23540 2001-12-26  Ravi Pratap  <ravi@ximian.com>
23541
23542         * class.cs (Event.Define): Define the private field only if there
23543         are no accessors defined.
23544
23545         * expression.cs (ResolveMemberAccess): If there is no associated
23546         field with the event, that means we have an event defined with its
23547         own accessors and we should flag error cs0070 since transforming
23548         ourselves into a field is not valid in that case.
23549
23550         * ecore.cs (SimpleName.DoResolve): Same as above.
23551
23552         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23553         and charset to sane values.
23554
23555 2001-12-25  Ravi Pratap  <ravi@ximian.com>
23556
23557         * assign.cs (DoResolve): Perform check on events only if they 
23558         are being accessed outside the declaring type.
23559
23560         * cs-parser.jay (event_declarations): Update rules to correctly
23561         set the type of the implicit parameter etc.
23562
23563         (add_accessor, remove_accessor): Set current local parameters.
23564
23565         * expression.cs (Binary): For delegate addition and subtraction,
23566         cast the return value from the method into the appropriate delegate
23567         type.
23568
23569 2001-12-24  Ravi Pratap  <ravi@ximian.com>
23570
23571         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23572         of these as the workaround is unnecessary.
23573
23574         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23575         delegate data - none of that is needed at all.
23576
23577         Re-write bits to extract the instance expression and the delegate method
23578         correctly.
23579
23580         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
23581         on delegates too.
23582
23583         * attribute.cs (ApplyAttributes): New method to take care of common tasks
23584         of attaching attributes instead of duplicating code everywhere.
23585
23586         * everywhere : Update code to do attribute emission using the above method.
23587
23588 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23589
23590         * expression.cs (IsParamsMethodApplicable): if there are not
23591         parameters, return immediately.
23592
23593         * ecore.cs: The 0 literal can be implicity converted to an enum
23594         type. 
23595
23596         (SimpleName.DoResolve): First lookup the type, then lookup the
23597         members. 
23598
23599         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23600         want to get its address.  If the InstanceExpression is not
23601         addressable, store the result in a temporary variable, then get
23602         the address of it.
23603
23604         * codegen.cs: Only display 219 errors on warning level or above. 
23605
23606         * expression.cs (ArrayAccess): Make it implement the
23607         IMemoryLocation interface.
23608
23609         (Binary.DoResolve): handle the operator == (object a, object b)
23610         and operator != (object a, object b) without incurring into a
23611         BoxedCast (because 5 != o should never be performed).
23612
23613         Handle binary enumerator operators.
23614
23615         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23616         value type, otherwise use Ldelem_ref.
23617
23618         Use precomputed names;
23619
23620         (AddressOf): Implement address of
23621
23622         * cs-parser.jay (labeled_statement): Fix recursive block
23623         addition by reworking the production.
23624
23625         * expression.cs (New.DoEmit): New has a special case:
23626                 
23627                  If we are dealing with a ValueType, we have a few
23628                  situations to deal with:
23629                 
23630                     * The target of New is a ValueType variable, that is
23631                       easy, we just pass this as the variable reference
23632                 
23633                     * The target of New is being passed as an argument,
23634                       to a boxing operation or a function that takes a
23635                       ValueType.
23636                 
23637                       In this case, we need to create a temporary variable
23638                       that is the argument of New.
23639
23640
23641 2001-12-23  Ravi Pratap  <ravi@ximian.com>
23642
23643         * rootcontext.cs (LookupType): Check that current_type is not null before
23644         going about looking at nested types.
23645
23646         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23647         not implement the IAssignMethod interface any more.
23648
23649         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23650         where we tranform them into FieldExprs if they are being resolved from within
23651         the declaring type.
23652
23653         * ecore.cs (SimpleName.DoResolve): Do the same here.
23654
23655         * assign.cs (DoResolve, Emit): Clean up code considerably. 
23656
23657         * ../errors/bug10.cs : Add.
23658
23659         * ../errors/cs0070.cs : Add.
23660
23661         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23662
23663         * assign.cs : Get rid of EventIsLocal everywhere.
23664
23665 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23666
23667         * ecore.cs (ConvertIntLiteral): finished the implementation.
23668
23669         * statement.cs (SwitchLabel): Convert the value we are using as a
23670         key before looking up the table.
23671
23672 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23673
23674         * codegen.cs (EmitTopBlock): Require a Location argument now.
23675
23676         * cs-parser.jay (constructor_declarator): We need to setup
23677         current_local_parameters before we parse the
23678         opt_constructor_initializer, to allow the variables to be bound
23679         to the constructor arguments.
23680
23681         * rootcontext.cs (LookupType): First lookup nested classes in our
23682         class and our parents before we go looking outside our class.
23683
23684         * expression.cs (ConstantFold): Extract/debox the values at the
23685         beginnning. 
23686
23687         * rootcontext.cs (EmitCode): Resolve the constants first before we
23688         resolve the types.  This is not really needed, but it helps debugging.
23689
23690         * statement.cs: report location.
23691
23692         * cs-parser.jay: pass location to throw statement.
23693
23694         * driver.cs: Small bug fix.
23695
23696         * report.cs: Updated format to be 4-zero filled digits.
23697
23698 2001-12-22  Ravi Pratap  <ravi@ximian.com>
23699
23700         * expression.cs (CheckIndices): Fix minor bug where the wrong
23701         variable was being referred to ;-)
23702
23703         (DoEmit): Do not call EmitStaticInitializers when the 
23704         underlying type is System.Object.
23705
23706 2001-12-21  Ravi Pratap  <ravi@ximian.com>
23707
23708         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23709         and do the usual workaround for SRE.
23710
23711         * class.cs (MyEventBuilder.EventType): New member to get at the type
23712         of the event, quickly.
23713
23714         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23715
23716         * assign.cs (Assign.DoResolve): Handle the case when the target
23717         is an EventExpr and perform the necessary checks.
23718
23719         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23720         interface.
23721
23722         (SimpleName.MemberStaticCheck): Include check for EventExpr.
23723
23724         (EventExpr): Set the type in the constructor itself since we 
23725         are meant to be born fully resolved.
23726
23727         (EventExpr.Define): Revert code I wrote earlier.
23728                 
23729         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23730         instance expression is null. The instance expression is a This in that case
23731         or a null, depending on whether it is a static method or not.
23732
23733         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23734         refers to more than one method.
23735
23736         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23737         and accordingly flag errors.
23738
23739 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23740
23741         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23742
23743 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23744
23745         * location.cs (ToString): Provide useful rutine.
23746
23747 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23748
23749         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23750         objects, return the actual integral boxed.
23751
23752         * statement.cs (SwitchLabel): define an ILLabel for each
23753         SwitchLabel. 
23754
23755         (Switch.CheckSwitch): If the value is a Literal, extract
23756         the underlying literal.
23757
23758         Also in the unused hashtable we had, add the SwitchLabel so we can
23759         quickly look this value up.
23760
23761         * constant.cs: Implement a bunch of new constants.  Rewrite
23762         Literal based on this.  Made changes everywhere to adapt to this.
23763
23764         * expression.cs (Expression.MakeByteBlob): Optimize routine by
23765         dereferencing array only once, and also copes with enumrations.
23766
23767         bytes are two bytes wide, not one.
23768
23769         (Cast): Perform constant conversions.
23770
23771         * ecore.cs (TryImplicitIntConversion): Return literals instead of
23772         wrappers to the literals here.
23773
23774         * expression.cs (DoNumericPromotions): long literals can converted
23775         to ulong implicity (this is taken care of elsewhere, but I was
23776         missing this spot).
23777
23778         * ecore.cs (Expression.Literalize): Make the return type Literal,
23779         to improve type checking.
23780
23781         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
23782
23783 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
23784
23785         * literal.cs: Revert code from ravi that checked the bounds.  The
23786         bounds are sane by the definition of the type itself. 
23787
23788         * typemanager.cs: Fix implementation of ImplementsInterface.  We
23789         need to actually look up in our parent hierarchy for interfaces
23790         implemented. 
23791
23792         * const.cs: Use the underlying type for enumerations
23793
23794         * delegate.cs: Compute the basename for the delegate creation,
23795         that should fix the delegate test case, and restore the correct
23796         Type Lookup semantics in rootcontext
23797
23798         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
23799         referencing a nested type with the Reflection API is using the "+"
23800         sign. 
23801
23802         * cs-parser.jay: Do not require EOF token at the end.
23803
23804 2001-12-20  Ravi Pratap  <ravi@ximian.com>
23805
23806         * rootcontext.cs (LookupType): Concatenate type names with
23807         a '.' instead of a '+' The test suite passes again.
23808
23809         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
23810         field of the enumeration.
23811
23812         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
23813         the case when the member is an EventExpr.
23814
23815         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23816         static has an associated instance expression.
23817
23818         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23819
23820         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23821
23822         * class.cs (Event.Define): Register event and perform appropriate checks
23823         for error #111.
23824
23825         We define the Add and Remove methods even if the use provides none because
23826         in that case, we provide default implementations ourselves.
23827
23828         Define a private field of the type of the event. This is done by the CSC compiler
23829         and we should be doing it too ;-)
23830
23831         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23832         More methods we use in code we generate.
23833
23834         (multicast_delegate_type, delegate_type): Two separate types since the distinction
23835         is important.
23836
23837         (InitCoreTypes): Update accordingly for the above.
23838
23839         * class.cs (Event.Emit): Generate code for default accessors that we provide
23840
23841         (EmitDefaultMethod): Do the job in the above.
23842
23843         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
23844         appropriate place.
23845
23846 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
23847
23848         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23849         builders even if we were missing one.
23850
23851         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23852         pass the Basename as our class name instead of the Name.  The
23853         basename will be correctly composed for us.
23854
23855         * parameter.cs (Paramters): Now takes a Location argument.
23856
23857         * decl.cs (DeclSpace.LookupType): Removed convenience function and
23858         make all the code call directly LookupType in RootContext and take
23859         this chance to pass the Location information everywhere.
23860
23861         * Everywhere: pass Location information.
23862
23863 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
23864
23865         * class.cs (Constructor.Define): Updated way of detecting the
23866         length of the parameters.
23867
23868         (TypeContainer.DefineType): Use basename as the type name for
23869         nested types.
23870
23871         (TypeContainer.Define): Do not recursively define types here, as
23872         definition is taken care in order by the RootContext.
23873
23874         * tree.cs: Keep track of namespaces in a per-file basis.
23875
23876         * parameter.cs (Parameter.ComputeSignature): Update to use
23877         DeclSpace. 
23878
23879         (Parameters.GetSignature): ditto.
23880
23881         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23882         instead of a TypeContainer.
23883
23884         (Interface.SemanticAnalysis): Use `this' instead of our parent to
23885         resolve names.  Because we need to be resolve in our context, not
23886         our parents.
23887
23888         * driver.cs: Implement response files.
23889
23890         * class.cs (TypeContainer.DefineType): If we are defined, do not
23891         redefine ourselves.
23892
23893         (Event.Emit): Emit the code for add/remove handlers.
23894         (Event.Define): Save the MethodBuilders for add/remove.
23895
23896         * typemanager.cs: Use pair here too.
23897
23898         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23899         DictionaryEntry requires the first argument to be non-null.  
23900
23901         (enum_declaration): Compute full name for registering the
23902         enumeration.
23903
23904         (delegate_declaration): Instead of using
23905         formal_parameter_list, use opt_formal_parameter_list as the list
23906         can be empty.
23907
23908         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23909         (EventParsing): New property that controls whether `add' and
23910         `remove' are returned as tokens or identifiers (for events);
23911
23912 2001-12-19  Ravi Pratap  <ravi@ximian.com>
23913
23914         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23915         use MyEventBuilder only and let it wrap the real builder for us.
23916
23917         (MyEventBuilder): Revamp constructor etc.
23918
23919         Implement all operations that we perform on EventBuilder in precisely the same
23920         way here too.
23921
23922         (FindMembers): Update to use the EventBuilder member.
23923
23924         (Event.Emit): Update accordingly.
23925
23926 2001-12-18  Ravi Pratap  <ravi@ximian.com>
23927
23928         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23929         by calling the appropriate methods.
23930
23931         (GetCustomAttributes): Make stubs as they cannot possibly do anything
23932         useful.
23933
23934         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23935
23936 2001-12-17  Ravi Pratap  <ravi@ximian.com>
23937
23938         * delegate.cs (Delegate.Populate): Check that the return type
23939         and various parameters types are indeed accessible.
23940
23941         * class.cs (Constructor.Define): Same here.
23942
23943         (Field.Define): Ditto.
23944
23945         (Event.Define): Ditto.
23946
23947         (Operator.Define): Check that the underlying Method defined itself
23948         correctly - so it's MethodBuilder should not be null.
23949
23950         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23951         expression happens to be null.
23952
23953         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23954         members but as of now we don't seem to be able to do anything really useful with it.
23955
23956         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23957         not the EventBuilder.
23958
23959 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
23960
23961         * cs-tokenizer.cs: Add support for defines.
23962         Add support for #if, #elif, #else, #endif
23963
23964         (eval_var): evaluates a variable.
23965         (eval): stubbed for evaluating functions.
23966
23967         * cs-parser.jay: Pass the defines information
23968
23969         * driver.cs: Add --define command line option.
23970
23971         * decl.cs: Move MemberCore here.
23972
23973         Make it the base class for DeclSpace.  This allows us to catch and
23974         report 108 and 109 for everything now.
23975
23976         * class.cs (TypeContainer.Define): Extract all the members
23977         before populating and emit the warning 108 (new keyword required
23978         to override) instead of having each member implement this.
23979
23980         (MemberCore.Define): New abstract method, we will be using this in
23981         the warning reporting engine in Populate.
23982
23983         (Operator.Define): Adjust to new MemberCore protocol. 
23984
23985         * const.cs (Const): This does not derive from Expression, it is a
23986         temporary object we use to create fields, it is a MemberCore. 
23987
23988         * class.cs (Method.Define): Allow the entry point to be in a
23989         specific class.
23990
23991         * driver.cs: Rewrite the argument handler to clean it up a bit.
23992
23993         * rootcontext.cs: Made it just an auxiliary namespace feature by
23994         making everything static.
23995
23996         * driver.cs: Adapt code to use RootContext type name instead of
23997         instance variable.
23998
23999         * delegate.cs: Remove RootContext argument.
24000
24001         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24002         argument. 
24003
24004         * class.cs (Event.Define): The lookup can fail.
24005
24006         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24007
24008         * expression.cs: Resolve the this instance before invoking the code.
24009
24010 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24011
24012         * cs-parser.jay: Add a production in element_access that allows
24013         the thing to become a "type" reference.  This way we can parse
24014         things like "(string [])" as a type.
24015
24016         Note that this still does not handle the more complex rules of
24017         casts. 
24018
24019
24020         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24021
24022         * ecore.cs: (CopyNewMethods): new utility function used to
24023         assemble the list of methods from running FindMembers.
24024
24025         (MemberLookup): Rework FindMembers so that 
24026
24027 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24028
24029         * class.cs (TypeContainer): Remove Delegates who fail to be
24030         defined.
24031
24032         * delegate.cs (Populate): Verify that we dont get null return
24033         values.   TODO: Check for AsAccessible.
24034
24035         * cs-parser.jay: Use basename to emit error 574 (destructor should
24036         have the same name as container class), not the full name.
24037
24038         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24039         possible representation.  
24040
24041         Also implements integer type suffixes U and L.
24042
24043 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24044
24045         * expression.cs (ArrayCreation.DoResolve): We need to do the
24046         argument resolution *always*.
24047
24048         * decl.cs: Make this hold the namespace.  Hold the root context as
24049         well.
24050         (LookupType): Move here.
24051
24052         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24053
24054         * location.cs (Row, Name): Fixed the code, it was always returning
24055         references to the first file.
24056
24057         * interface.cs: Register properties defined through interfaces.
24058
24059         * driver.cs: Add support for globbing on the command line
24060
24061         * class.cs (Field): Make it derive from MemberCore as well.
24062         (Event): ditto.
24063
24064 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24065
24066         * class.cs (Event::Define): Check that the type of the event is a delegate
24067         type else flag error #66.
24068
24069         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24070         same.
24071
24072         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24073         values of EntryPoint, CharSet etc etc.
24074
24075         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24076
24077         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24078         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24079         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24080         which needs this to do its work.
24081
24082         * ../errors/cs0066.cs : Add.
24083
24084 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24085
24086         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24087         helper functions.
24088
24089         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24090         clears out the parameters field.
24091         (MemberSignatureCompare): Cleanup
24092
24093         (MemberCore): New base class used to share code between MethodCore
24094         and Property.
24095
24096         (RegisterRequiredImplementations) BindingFlags.Public requires
24097         either BindingFlags.Instace or Static.  Use instance here.
24098
24099         (Property): Refactored code to cope better with the full spec.
24100
24101         * parameter.cs (GetParameterInfo): Return an empty array instead
24102         of null on error.
24103
24104         * class.cs (Property): Abstract or extern properties have no bodies.
24105
24106         * parameter.cs (GetParameterInfo): return a zero-sized array.
24107
24108         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24109         method modifier validation to the typecontainer so we can reuse
24110         this on properties.
24111
24112         (MethodCore.ParameterTypes): return an empty sized array of types.
24113
24114         (Property.Define): Test property modifier validity.
24115
24116         Add tests for sealed/override too.
24117
24118         (Method.Emit): abstract or extern methods have no bodies.
24119
24120 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24121
24122         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24123         thing.
24124
24125         (Method::Define, ::Emit): Modify accordingly.
24126
24127         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24128
24129         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24130
24131         * makefile: Pass in /unsafe.
24132
24133 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24134
24135         * class.cs (MakeKey): Kill routine.
24136
24137         * class.cs (TypeContainer.Define): Correctly define explicit
24138         method implementations (they require the full interface name plus
24139         the method name).
24140
24141         * typemanager.cs: Deply the PtrHashtable here and stop using the
24142         lame keys.  Things work so much better.
24143
24144         This of course broke everyone who depended on `RegisterMethod' to
24145         do the `test for existance' test.  This has to be done elsewhere.
24146
24147         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24148         the object stupid Equals method (because, that like fails all over
24149         the place).  We still do not use it.
24150
24151         * class.cs (TypeContainer.SetRequiredInterface,
24152         TypeContainer.RequireMethods): Killed these two routines and moved
24153         all the functionality to RegisterRequiredImplementations.
24154
24155         (TypeContainer.RegisterRequiredImplementations): This routine now
24156         registers all the implementations required in an array for the
24157         interfaces and abstract methods.  We use an array of structures
24158         which can be computed ahead of time to reduce memory usage and we
24159         also assume that lookups are cheap as most classes will not
24160         implement too many interfaces.
24161
24162         We also avoid creating too many MethodSignatures.
24163
24164         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24165         clear the "pending" bit if we find that there are problems with
24166         the declaration.
24167
24168         (TypeContainer.VerifyPendingMethods): Update to report errors of
24169         methods that look like implementations but are not.
24170
24171         (TypeContainer.Define): Add support for explicit interface method
24172         implementation. 
24173
24174 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24175
24176         * typemanager.cs: Keep track of the parameters here instead of
24177         being a feature of the TypeContainer.
24178
24179         * class.cs: Drop the registration of parameters here, as
24180         InterfaceMethods are also interface declarations.
24181
24182         * delegate.cs: Register methods with the TypeManager not only with
24183         the TypeContainer.  This code was buggy.
24184
24185         * interface.cs: Full registation here.
24186
24187 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24188
24189         * expression.cs: Remove reducer for binary expressions, it can not
24190         be done this way.
24191
24192         * const.cs: Put here the code that used to go into constant.cs
24193
24194         * constant.cs: Put here the code for constants, this is a new base
24195         class for Literals.
24196
24197         * literal.cs: Make Literal derive from Constant.
24198
24199 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24200
24201         * statement.cs (Return.Emit): Report error 157 if the user
24202         attempts to return from a finally block.
24203
24204         (Return.Emit): Instead of emitting a return, jump to the end of
24205         the function.
24206
24207         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24208         LocalBuilder to store the result of the function.  ReturnLabel is
24209         the target where we jump.
24210
24211
24212 2001-12-09  Radek Doulik  <rodo@ximian.com>
24213
24214         * cs-parser.jay: remember alias in current namespace
24215
24216         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24217         namespaces
24218
24219         * class.cs (LookupAlias): lookup alias in my_namespace
24220
24221         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24222         aliases hashtable
24223         (LookupAlias): lookup alias in this and if needed in parent
24224         namespaces
24225
24226 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24227
24228         * support.cs: 
24229
24230         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24231         making things static.  I need this to avoid passing the
24232         TypeContainer when calling ParameterType.
24233
24234         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24235         that did string manipulation to compute the type and then call
24236         GetType.  Use Parameter.ParameterType instead.
24237
24238         * cs-tokenizer.cs: Consume the suffix for floating values.
24239
24240         * expression.cs (ParameterReference): figure out whether this is a
24241         reference parameter or not.  Kill an extra variable by computing
24242         the arg_idx during emission.
24243
24244         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24245         function that returns whether a parameter is an out/ref value or not.
24246
24247         (Parameter.ParameterType): The type of the parameter (base,
24248         without ref/out applied).
24249
24250         (Parameter.Resolve): Perform resolution here.
24251         (Parameter.ExternalType): The full type (with ref/out applied).
24252
24253         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24254         support for expressions on the using statement.
24255
24256 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24257
24258         * statement.cs (Using.EmitLocalVariableDecls): Split the
24259         localvariable handling of the using statement.
24260
24261         (Block.EmitMeta): Keep track of variable count across blocks.  We
24262         were reusing slots on separate branches of blocks.
24263
24264         (Try.Emit): Emit the general code block, we were not emitting it. 
24265
24266         Check the type of the declaration to be an IDisposable or
24267         something that can be implicity converted to it. 
24268
24269         Emit conversions if required.
24270
24271         * ecore.cs (EmptyExpression): New utility class.
24272         (Expression.ImplicitConversionExists): New utility function.
24273
24274 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24275
24276         * statement.cs (Using): Implement.
24277
24278         * expression.cs (LocalVariableReference): Support read only variables.
24279
24280         * statement.cs: Remove the explicit emit for the Leave opcode.
24281         (VariableInfo): Add a readonly field.
24282
24283 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24284
24285         * ecore.cs (ConvCast): new class used to encapsulate the various
24286         explicit integer conversions that works in both checked and
24287         unchecked contexts.
24288
24289         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24290         properly generate the overflow opcodes.
24291
24292 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * statement.cs: The correct type for the EmptyExpression is the
24295         element_type, not the variable type.  Ravi pointed this out.
24296
24297 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24298
24299         * class.cs (Method::Define): Handle PInvoke methods specially
24300         by using DefinePInvokeMethod instead of the usual one.
24301
24302         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24303         above to do the task of extracting information and defining the method.
24304
24305 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24306
24307         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24308         of the condition for string type.
24309
24310         (Emit): Move that here. 
24311
24312         (ArrayCreation::CheckIndices): Keep string literals in their expression
24313         form.
24314
24315         (EmitDynamicInitializers): Handle strings appropriately.
24316
24317 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24318
24319         * codegen.cs (EmitContext): Replace multiple variables with a
24320         single pointer to the current Switch statement.
24321
24322         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24323         EmitContext.
24324
24325 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24326
24327         * statement.cs 
24328
24329         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24330         default'.
24331
24332         (Foreach.Emit): Foreach on arrays was not setting
24333         up the loop variables (for break/continue).
24334
24335         (GotoCase): Semi-implented.
24336
24337 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24338
24339         * attribute.cs (CheckAttribute): Handle system attributes by using
24340         Attribute.GetAttributes to examine information we need.
24341
24342         (GetValidPlaces): Same here.
24343
24344         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24345
24346         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24347
24348         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24349
24350         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24351
24352         (Method::Emit): Handle the case when we are a PInvoke method.
24353
24354 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24355
24356         * expression.cs: Use ResolveWithSimpleName on compound names.
24357
24358 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24359
24360         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24361         before trying to reduce it.
24362
24363         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24364
24365         * constant.cs (LookupConstantValue): Implement.
24366
24367         (EmitConstant): Use the above in emitting the constant.
24368
24369         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24370         that are user-defined by doing a LookupConstantValue on them.
24371
24372         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24373         too, like above.
24374
24375 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24376
24377         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24378
24379         (BaseAccess.DoResolve): Implement.
24380
24381         (MemberAccess.DoResolve): Split this routine into a
24382         ResolveMemberAccess routine that can be used independently
24383
24384 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24385
24386         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24387         As that share bits of the implementation.  Is returns a boolean,
24388         while As returns the Type that is being probed.
24389
24390 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24391
24392         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24393         instead of a Literal - much easier.
24394
24395         (EnumInTransit): Remove - utterly useless :-)
24396
24397         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24398
24399         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24400
24401         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24402         chain when we have no associated expression.
24403
24404 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24405
24406         * constant.cs (Define): Use Location while reporting the errror.
24407
24408         Also emit a warning when 'new' is used and there is no inherited
24409         member to hide.
24410
24411         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24412         populated.
24413
24414         (LookupEnumValue): Implement to lookup an enum member's value and define it
24415         if necessary.
24416
24417         (Populate): Re-write accordingly to use the above routine.
24418
24419 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24420
24421         * expression.cs (This): Fix prototype for DoResolveLValue to
24422         override the base class DoResolveLValue.
24423
24424         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24425         declarations) 
24426
24427         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24428         (we need to load the address of the field here).  This fixes
24429         test-22. 
24430
24431         (FieldExpr.DoResolveLValue): Call the DoResolve
24432         function to initialize the Instance expression.
24433
24434         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24435         correctly the GetEnumerator operation on a value type.
24436
24437         * cs-parser.jay: Add more simple parsing error catches.
24438
24439         * statement.cs (Switch): Add support for string switches.
24440         Handle null specially.
24441
24442         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24443
24444 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24445
24446         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24447
24448         (declare_local_constant): New helper function.
24449
24450         * statement.cs (AddConstant): Keep a separate record of constants
24451
24452         (IsConstant): Implement to determine if a variable is a constant.
24453
24454         (GetConstantExpression): Implement.
24455
24456         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24457
24458         * statement.cs (IsVariableDefined): Re-write.
24459
24460 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24461
24462         * class.cs (TypeContainer::FindMembers): Look for constants
24463         in the case when we are looking for MemberTypes.Field
24464
24465         * expression.cs (MemberAccess::DoResolve): Check that in the
24466         case we are a FieldExpr and a Literal, we are not being accessed
24467         by an instance reference.
24468
24469         * cs-parser.jay (local_constant_declaration): Implement.
24470
24471         (declaration_statement): Implement for constant declarations.
24472
24473 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24474
24475         * statement.cs (Switch): Catch double defaults.
24476
24477         (Switch): More work on the switch() statement
24478         implementation.  It works for integral values now, need to finish
24479         string support.
24480
24481
24482 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24483
24484         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24485         integer literals into other integer literals.  To be used by
24486         switch. 
24487
24488 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24489
24490         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24491         some memory.
24492
24493         (EmitDynamicInitializers): Cope with the above since we extract data
24494         directly from ArrayData now.
24495
24496         (ExpectInitializers): Keep track of whether initializers are mandatory
24497         or not.
24498
24499         (Bounds): Make it a hashtable to prevent the same dimension being 
24500         recorded for every element in that dimension.
24501
24502         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24503         from being found.
24504
24505         Also fix bug which was causing the indices to be emitted in the reverse
24506         order.
24507
24508 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24509
24510         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24511         unfinished.  They do not work, because the underlying code is
24512         sloppy.
24513
24514 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24515
24516         * cs-parser.jay: Remove bogus fixme.
24517
24518         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24519         on Switch statement.
24520
24521 2001-11-23  Ravi Pratap  <ravi@ximian.com>
24522
24523         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24524         the same. 
24525
24526         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24527         parameter. Apparently, any expression is allowed. 
24528
24529         (ValidateInitializers): Update accordingly.
24530
24531         (CheckIndices): Fix some tricky bugs thanks to recursion.
24532
24533         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
24534         I was being completely brain-dead.
24535
24536         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24537         and re-write acordingly.
24538
24539         (DelegateInvocation): Re-write accordingly.
24540
24541         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24542
24543         (MakeByteBlob): Handle types more correctly.
24544
24545         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24546         initialization from expressions but it is incomplete because I am a complete
24547         Dodo :-|
24548
24549 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24550
24551         * statement.cs (If.Emit): Fix a bug that generated incorrect code
24552         on If.  Basically, we have to return `true' (ie, we do return to
24553         our caller) only if both branches of the if return.
24554
24555         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24556         short-circuit operators, handle them as short circuit operators. 
24557
24558         (Cast.DoResolve): Resolve type.
24559         (Cast.Cast): Take an expression as the target type.
24560
24561         * cs-parser.jay (cast_expression): Remove old hack that only
24562         allowed a limited set of types to be handled.  Now we take a
24563         unary_expression and we resolve to a type during semantic
24564         analysis.
24565
24566         Use the grammar productions from Rhys to handle casts (this is
24567         not complete like Rhys syntax yet, we fail to handle that corner
24568         case that C# has regarding (-x), but we will get there.
24569
24570 2001-11-22  Ravi Pratap  <ravi@ximian.com>
24571
24572         * class.cs (EmitFieldInitializer): Take care of the case when we have a
24573         field which is an array type.
24574
24575         * cs-parser.jay (declare_local_variables): Support array initialization too.
24576
24577         * typemanager.cs (MakeKey): Implement.
24578
24579         (everywhere): Use the above appropriately.
24580
24581         * cs-parser.jay (for_statement): Update for array initialization while
24582         declaring variables.
24583
24584         * ecore.cs : The error message was correct, it's the variable's names that
24585         were misleading ;-) Make the code more readable.
24586
24587         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24588         the correct type etc.
24589
24590         (ConvertExplicit): Handle Enum types by examining the underlying type.
24591
24592 2001-11-21  Ravi Pratap  <ravi@ximian.com>
24593
24594         * parameter.cs (GetCallingConvention): Always return
24595         CallingConventions.Standard for now.
24596
24597 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24598
24599         * expression.cs (Binary.ResolveOperator): Update the values of `l'
24600         and `r' after calling DoNumericPromotions.
24601
24602         * ecore.cs: Fix error message (the types were in the wrong order).
24603
24604         * statement.cs (Foreach.ProbeCollectionType): Need to pass
24605         BindingFlags.Instance as well 
24606
24607         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24608         implicit int literal conversion in an empty cast so that we
24609         propagate the right type upstream.
24610
24611         (UnboxCast): new class used to unbox value types.
24612         (Expression.ConvertExplicit): Add explicit type conversions done
24613         by unboxing.
24614
24615         (Expression.ImplicitNumericConversion): Oops, forgot to test for
24616         the target type before applying the implicit LongLiterals to ULong
24617         literal cast.
24618
24619 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
24620
24621         * cs-parser.jay (for_statement): Reworked the way For works: now
24622         we declare manually any variables that are introduced in
24623         for_initializer to solve the problem of having out-of-band code
24624         emition (that is what got for broken).
24625
24626         (declaration_statement): Perform the actual variable declaration
24627         that used to be done in local_variable_declaration here.
24628
24629         (local_variable_declaration): Do not declare anything, just pass
24630         the information on a DictionaryEntry
24631
24632 2001-11-20  Ravi Pratap  <ravi@ximian.com>
24633
24634         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24635         re-write of the logic to now make it recursive.
24636
24637         (UpdateIndices): Re-write accordingly.
24638
24639         Store element data in a separate ArrayData list in the above methods.
24640
24641         (MakeByteBlob): Implement to dump the array data into a byte array.
24642
24643 2001-11-19  Ravi Pratap  <ravi@ximian.com>
24644
24645         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24646         into CheckIndices.
24647
24648         * constant.cs (Define): Implement.
24649
24650         (EmitConstant): Re-write fully.
24651
24652         Pass in location info.
24653
24654         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24655         respectively.
24656
24657         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24658         DictionaryEntry since we need location info too.
24659
24660         (constant_declaration): Update accordingly.
24661
24662         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24663         code into another method : UpdateIndices.
24664
24665 2001-11-18  Ravi Pratap  <ravi@ximian.com>
24666
24667         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24668         some type checking etc.
24669
24670 2001-11-17  Ravi Pratap  <ravi@ximian.com>
24671
24672         * expression.cs (ArrayCreation::ValidateInitializers): Implement
24673         bits to provide dimension info if the user skips doing that.
24674
24675         Update second constructor to store the rank correctly.
24676
24677 2001-11-16  Ravi Pratap  <ravi@ximian.com>
24678
24679         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24680         and try to implement.
24681
24682         * ../errors/cs0150.cs : Add.
24683
24684         * ../errors/cs0178.cs : Add.
24685
24686 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
24687
24688         * statement.cs: Implement foreach on multi-dimensional arrays. 
24689
24690         * parameter.cs (Parameters.GetParameterByName): Also lookup the
24691         name of the params argument.
24692
24693         * expression.cs: Use EmitStoreOpcode to get the right opcode while
24694         initializing the array.
24695
24696         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24697         we can use this elsewhere.
24698
24699         * statement.cs: Finish implementation of foreach for single
24700         dimension arrays.
24701
24702         * cs-parser.jay: Use an out-of-band stack to pass information
24703         around, I wonder why I need this.
24704
24705         foreach_block: Make the new foreach_block the current_block.
24706
24707         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24708         function used to return a static Parameters structure.  Used for
24709         empty parameters, as those are created very frequently.
24710
24711         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24712
24713 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24714
24715         * interface.cs : Default modifier is private, not public. The
24716         make verify test passes again.
24717
24718 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24719
24720         * support.cs (ReflectionParameters): Fix logic to determine
24721         whether the last parameter is a params one. Test 9 passes again.
24722
24723         * delegate.cs (Populate): Register the builders we define with
24724         RegisterParameterForBuilder. Test 19 passes again.
24725
24726         * cs-parser.jay (property_declaration): Reference $6 instead
24727         of $$ to get at the location.
24728
24729         (indexer_declaration): Similar stuff.
24730
24731         (attribute): Ditto.
24732
24733         * class.cs (Property): Register parameters for the Get and Set methods
24734         if they exist. Test 23 passes again.
24735
24736         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24737         call to EmitArguments as we are sure there aren't any params arguments. 
24738         Test 32 passes again.
24739
24740         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24741         IndexOutOfRangeException. 
24742
24743         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24744         Test 33 now passes again.
24745
24746 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
24747
24748         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24749         broke a bunch of things.  Will have to come up with a better way
24750         of tracking locations.
24751
24752         * statement.cs: Implemented foreach for single dimension arrays.
24753
24754 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24755
24756         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
24757         an error.  This removes the lookup from the critical path.
24758
24759         * cs-parser.jay: Removed use of temporary_loc, which is completely
24760         broken. 
24761
24762 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
24763
24764         * support.cs (ReflectionParameters.ParameterModifier): Report
24765         whether the argument is a PARAMS argument or not.
24766
24767         * class.cs: Set the attribute `ParamArrayAttribute' on the
24768         parameter argument.
24769
24770         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
24771         and cons_param_array_attribute (ConstructorInfo for
24772         ParamArrayAttribute)., 
24773
24774         * codegen.cs: Emit the return using the `Return' statement, that
24775         way we can report the error correctly for missing return values. 
24776
24777         * class.cs (Method.Emit): Clean up.
24778
24779         * expression.cs (Argument.Resolve): Take another argument: the
24780         location where this argument is used.  Notice that this is not
24781         part of the "Argument" class as to reduce the size of the
24782         structure (we know the approximate location anyways).
24783
24784         Test if the argument is a variable-reference, if not, then
24785         complain with a 206.
24786
24787         (Argument.Emit): Emit addresses of variables.
24788
24789         (Argument.FullDesc): Simplify.
24790
24791         (Invocation.DoResolve): Update for Argument.Resolve.
24792
24793         (ElementAccess.DoResolve): ditto.
24794
24795         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
24796         method should be virtual, as this method is always virtual.
24797
24798         (NewDelegate.DoResolve): Update for Argument.Resolve.
24799
24800         * class.cs (ConstructorInitializer.DoResolve): ditto.
24801
24802         * attribute.cs (Attribute.Resolve): ditto.
24803
24804 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
24805
24806         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
24807
24808         * expression.cs (ParameterReference): Drop IStackStorage and implement
24809         IAssignMethod instead. 
24810
24811         (LocalVariableReference): ditto.
24812
24813         * ecore.cs (FieldExpr): Drop IStackStorage and implement
24814         IAssignMethod instead. 
24815
24816 2001-11-13  Miguel de Icaza <miguel@ximian.com>
24817
24818         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24819         enumerations that are used in heavily used structures derive from
24820         byte in a laughable and pathetic attempt to reduce memory usage.
24821         This is the kind of pre-optimzations that you should not do at
24822         home without adult supervision.
24823
24824         * expression.cs (UnaryMutator): New class, used to handle ++ and
24825         -- separatedly from the other unary operators.  Cleans up the
24826         code, and kills the ExpressionStatement dependency in Unary.
24827
24828         (Unary): Removed `method' and `Arguments' from this class, making
24829         it smaller, and moving it all to SimpleCall, so I can reuse this
24830         code in other locations and avoid creating a lot of transient data
24831         strucutres when not required.
24832
24833         * cs-parser.jay: Adjust for new changes.
24834
24835 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
24836
24837         * enum.cs (Enum.Populate): If there is a failure during
24838         definition, return
24839
24840         * cs-parser.jay (opt_enum_base): we used to catch type errors
24841         here, but this is really incorrect.  The type error should be
24842         catched during semantic analysis.
24843
24844 2001-12-11  Ravi Pratap  <ravi@ximian.com>
24845
24846         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24847         current_local_parameters as expected since I, in my stupidity, had forgotten
24848         to do this :-)
24849
24850         * attribute.cs (GetValidPlaces): Fix stupid bug.
24851
24852         * class.cs (Method::Emit): Perform check on applicability of attributes.
24853
24854         (Constructor::Emit): Ditto.
24855
24856         (Field::Emit): Ditto.
24857
24858         (Field.Location): Store location information.
24859
24860         (Property, Event, Indexer, Operator): Ditto.
24861
24862         * cs-parser.jay (field_declaration): Pass in location for each field.
24863
24864         * ../errors/cs0592.cs : Add.
24865
24866 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24867
24868         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24869
24870         (InitCoreTypes): Update accordingly.
24871
24872         (RegisterAttrType, LookupAttr): Implement.
24873
24874         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24875         info about the same.
24876
24877         (Resolve): Update to populate the above as necessary.
24878
24879         (Error592): Helper.
24880
24881         (GetValidPlaces): Helper to the above.
24882
24883         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24884
24885         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24886
24887 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24888
24889         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24890
24891         * ../errors/cs0617.cs : Add.
24892
24893 2001-11-11  Ravi Pratap  <ravi@ximian.com>
24894
24895         * enum.cs (Emit): Rename to Populate to be more consistent with what
24896         we expect it to do and when exactly it is called.
24897
24898         * class.cs, rootcontext.cs : Update accordingly.
24899
24900         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24901         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24902
24903         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24904
24905         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24906         of a fieldinfo using the above, when dealing with a FieldBuilder.
24907
24908 2001-11-10  Ravi Pratap  <ravi@ximian.com>
24909
24910         * ../errors/cs0031.cs : Add.
24911
24912         * ../errors/cs1008.cs : Add.
24913
24914         * ../errrors/cs0543.cs : Add.
24915
24916         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24917         enum type.
24918
24919         (FindMembers): Implement.
24920
24921         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24922         enums and delegates too.
24923
24924         (enum_types): Rename to builder_to_enum.
24925
24926         (delegate_types): Rename to builder_to_delegate.
24927
24928         * delegate.cs (FindMembers): Implement.
24929
24930 2001-11-09  Ravi Pratap  <ravi@ximian.com>
24931
24932         * typemanager.cs (IsEnumType): Implement.
24933
24934         * enum.cs (Emit): Re-write parts to account for the underlying type
24935         better and perform checking etc.
24936
24937         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24938         of the underlying type.
24939
24940         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24941         value
24942
24943         * enum.cs (error31): Helper to report error #31.
24944
24945         * cs-parser.jay (enum_declaration): Store location of each member too.
24946
24947         * enum.cs (member_to_location): New hashtable. 
24948
24949         (AddEnumMember): Update location hashtable.
24950
24951         (Emit): Use the location of each member while reporting errors.
24952
24953 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24954
24955         * cs-parser.jay: A for_initializer if is a
24956         local_variable_declaration really ammount to have an implicit
24957         block with the variable declaration and no initializer for for.
24958
24959         * statement.cs (For.Emit): Cope with null initializers.
24960
24961         This fixes the infinite loop on for initializers.
24962
24963 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
24964
24965         * enum.cs: More cleanup.
24966
24967         * ecore.cs: Remove dead code.
24968
24969         * class.cs (Property.Emit): More simplification.
24970         (Event.Emit): ditto.
24971
24972         Reworked to have less levels of indentation.
24973
24974 2001-11-08  Ravi Pratap  <ravi@ximian.com>
24975
24976         * class.cs (Property): Emit attributes.
24977
24978         (Field): Ditto.
24979
24980         (Event): Ditto.
24981
24982         (Indexer): Ditto.
24983
24984         (Operator): Ditto.
24985
24986         * enum.cs (Emit): Ditto.
24987
24988         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24989         Enums too.
24990
24991         * class.cs (Field, Event, etc.): Move attribute generation into the
24992         Emit method everywhere.
24993
24994         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24995         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24996         as we had no way of defining nested enums !
24997
24998         * rootcontext.cs : Adjust code accordingly.
24999
25000         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25001
25002 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25003
25004         * expression.cs (EvalConstantExpression): Move into ecore.cs
25005
25006         * enum.cs (Enum): Rename some members and make them public and readonly
25007         according to our convention.
25008
25009         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25010         nothing else.
25011
25012         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25013
25014         (Enum::Emit): Write a simple version for now which doesn't try to compute
25015         expressions. I shall modify this to be more robust in just a while.
25016
25017         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25018
25019         (TypeContainer::CloseType): Create the Enum types too.
25020
25021         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25022
25023         * expression.cs (EvalConstantExpression): Get rid of completely.
25024
25025         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25026         user-defined values and other cases.
25027
25028         (IsValidEnumLiteral): Helper function.
25029
25030         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25031         out there in the case we had a literal FieldExpr.
25032
25033         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25034
25035         (Literalize): Revamp a bit to take two arguments.
25036
25037         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25038
25039 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25040
25041         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25042
25043         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25044
25045         (Resolve): Use the above to ensure we have proper initializers.
25046
25047 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25048
25049         * expression.cs (Expression::EvalConstantExpression): New method to 
25050         evaluate constant expressions.
25051
25052         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25053
25054 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25055
25056         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25057         in an array.
25058
25059         (Binary.ResolveOperator): Handle operator != (object a, object b)
25060         and operator == (object a, object b);
25061
25062         (Binary.DoNumericPromotions): Indicate whether the numeric
25063         promotion was possible.
25064
25065         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25066         Implement.  
25067
25068         Made the ArrayAccess implement interface IAssignMethod instead of
25069         IStackStore as the order in which arguments are passed reflects
25070         this.
25071
25072         * assign.cs: Instead of using expr.ExprClass to select the way of
25073         assinging, probe for the IStackStore/IAssignMethod interfaces.
25074
25075         * typemanager.cs: Load InitializeArray definition.
25076
25077         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25078         static data that can be used to initialize arrays. 
25079
25080 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25081
25082         * expression.cs: Handle operator== and operator!= for booleans.
25083
25084         (Conditioal.Reduce): Implement reducer for the ?: operator.
25085
25086         (Conditional.Resolve): Implement dead code elimination.
25087
25088         (Binary.Resolve): Catch string literals and return a new
25089         concatenated string.
25090
25091         (Unary.Reduce): Implement reduction of unary expressions.
25092
25093         * ecore.cs: Split out the expression core handling here.
25094
25095         (Expression.Reduce): New method used to perform constant folding
25096         and CSE.  This is needed to support constant-expressions. 
25097
25098         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25099         targets, and optimize for !x.
25100
25101 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25102
25103         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25104         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25105         set custom atttributes.
25106
25107         * literal.cs (Literal::GetValue): New abstract method to return the actual
25108         value of the literal, cast as an object.
25109
25110         (*Literal): Implement GetValue method.
25111
25112         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25113         expressions to the arraylist but objects of type Argument.
25114
25115         * class.cs (TypeContainer::Emit): Emit our attributes too.
25116
25117         (Method::Emit, Constructor::Emit): Ditto.
25118
25119         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25120         to be ignoring earlier.
25121
25122 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25123
25124         * attribute.cs (AttributeSection::Define): Implement to do the business
25125         of constructing a CustomAttributeBuilder.
25126
25127         (Attribute): New trivial class. Increases readability of code.  
25128
25129         * cs-parser.jay : Update accordingly.
25130
25131         (positional_argument_list, named_argument_list, named_argument): New rules
25132
25133         (attribute_arguments): Use the above so that we are more correct.
25134
25135 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25136
25137         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25138         to perform all checks for a method with a params parameter.
25139
25140         (Invocation::OverloadResolve): Update to use the above method and therefore
25141         cope correctly with params method invocations.
25142
25143         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25144         params too.
25145
25146         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25147         constructors in our parent too because we can't afford to miss out on 
25148         protected ones ;-)
25149
25150         * attribute.cs (AttributeSection): New name for the class Attribute
25151
25152         Other trivial changes to improve readability.
25153
25154         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25155         use the new class names.
25156
25157 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25158
25159         * class.cs (Method::Define): Complete definition for params types too
25160
25161         (Indexer::Define): Ditto.
25162
25163         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25164         Cope everywhere with a request for info about the array parameter.
25165
25166 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25167
25168         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25169
25170         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25171         local_variable_type to extract the string corresponding to the type.
25172
25173         (local_variable_type): Fixup the action to use the new helper method.
25174
25175         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25176         go.
25177
25178         * expression.cs : Clean out code which uses the above.
25179
25180 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25181
25182         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25183         and bale out if necessary by returning a false.
25184
25185         (RegisterProperty): Ditto.
25186
25187         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25188         and print out appropriate error messages.
25189
25190         * interface.cs (everywhere): Ditto.
25191
25192         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25193         location to constructor.
25194
25195         * class.cs (Property, Event, Indexer): Update accordingly.
25196
25197         * ../errors/cs111.cs : Added.
25198
25199         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25200         of a method, as laid down by the spec.
25201
25202         (Invocation::OverloadResolve): Use the above method.
25203
25204 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25205
25206         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25207         now take a TypeContainer and a Parameters object.
25208
25209         (ParameterData): Modify return type of ParameterModifier method to be 
25210         Parameter.Modifier and not a string.
25211
25212         (ReflectionParameters, InternalParameters): Update accordingly.
25213
25214         * expression.cs (Argument::GetParameterModifier): Same here.
25215
25216         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25217         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25218         symbol in it at all so maybe this is only for now.
25219
25220 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25221
25222         * support.cs (InternalParameters): Constructor now takes an extra argument 
25223         which is the actual Parameters class.
25224
25225         (ParameterDesc): Update to provide info on ref/out modifiers.
25226
25227         * class.cs (everywhere): Update call to InternalParameters to pass in
25228         the second argument too.
25229
25230         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25231         to return the modifier info [ref/out etc]
25232
25233         (InternalParameters, ReflectionParameters): Implement the above.
25234
25235         * expression.cs (Argument::ParameterModifier): Similar function to return
25236         info about the argument's modifiers.
25237
25238         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25239         too.
25240
25241         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25242         a new SetFormalParameters object which we pass to InternalParameters.
25243
25244 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25245
25246         * expression.cs (NewArray): Merge into the ArrayCreation class.
25247
25248 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25249
25250         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25251         NewUserdefinedArray into one as there wasn't much of a use in having
25252         two separate ones.
25253
25254         * expression.cs (Argument): Change field's name to ArgType from Type.
25255
25256         (Type): New readonly property which returns the proper type, taking into 
25257         account ref/out modifiers.
25258
25259         (everywhere): Adjust code accordingly for the above.
25260
25261         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25262         whether we are emitting for a ref or out parameter.
25263
25264         * expression.cs (Argument::Emit): Use the above field to set the state.
25265
25266         (LocalVariableReference::Emit): Update to honour the flag and emit the
25267         right stuff.
25268
25269         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25270
25271         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25272
25273         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25274
25275         (ReflectionParameters, InternalParameters): Implement the above method.
25276
25277         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25278         reporting errors.
25279
25280         (Invocation::FullMethodDesc): Ditto. 
25281
25282 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25283
25284         * cs-parser.jay: Add extra production for the second form of array
25285         creation. 
25286
25287         * expression.cs (ArrayCreation): Update to reflect the above
25288         change. 
25289
25290         * Small changes to prepare for Array initialization.
25291
25292 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25293
25294         * typemanager.cs (ImplementsInterface): interface might be null;
25295         Deal with this problem;
25296
25297         Also, we do store negative hits on the cache (null values), so use
25298         this instead of calling t.GetInterfaces on the type everytime.
25299
25300 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25301
25302         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25303
25304         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25305         split functionality out into different classes.
25306
25307         (New::FormArrayType): Move into NewBuiltinArray.
25308
25309         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25310         quite useless.
25311
25312         (NewBuiltinArray): New class to handle creation of built-in arrays.
25313
25314         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25315         account creation of one-dimensional arrays.
25316
25317         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25318
25319         (NewUserdefinedArray::DoResolve): Implement.
25320
25321         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25322
25323         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25324         we maintain inside the TypeManager. This is necessary to perform lookups on the
25325         module builder.
25326
25327         (LookupType): Update to perform GetType on the module builders too.     
25328
25329         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25330
25331         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25332
25333 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25334
25335         * expression.cs (New::DoResolve): Implement guts of array creation.
25336
25337         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25338
25339 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25340
25341         * expression.cs: Fix bug I introduced lsat night that broke
25342         Delegates. 
25343
25344         (Expression.Resolve): Report a 246 error (can not resolve name)
25345         if we find a SimpleName in the stream.
25346
25347         (Expression.ResolveLValue): Ditto.
25348
25349         (Expression.ResolveWithSimpleName): This function is a variant of
25350         ResolveName, this one allows SimpleNames to be returned without a
25351         warning.  The only consumer of SimpleNames is MemberAccess
25352
25353 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25354
25355         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25356         might arrive here.  I have my doubts that this is correct.
25357
25358         * statement.cs (Lock): Implement lock statement.
25359
25360         * cs-parser.jay: Small fixes to support `lock' and `using'
25361
25362         * cs-tokenizer.cs: Remove extra space
25363
25364         * driver.cs: New flag --checked, allows to turn on integer math
25365         checking. 
25366
25367         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25368         Threading.Monitor.Exit 
25369
25370 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25371
25372         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25373         Expression Class to be IndexerAccess.
25374
25375         Notice that Indexer::DoResolve sets the eclass to Value.
25376
25377 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25378
25379         * class.cs (TypeContainer::Emit): Emit code for indexers.
25380
25381         * assign.cs (IAssignMethod): New interface implemented by Indexers
25382         and Properties for handling assignment.
25383
25384         (Assign::Emit): Simplify and reuse code. 
25385
25386         * expression.cs (IndexerAccess, PropertyExpr): Implement
25387         IAssignMethod, clean up old code. 
25388
25389 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25390
25391         * typemanager.cs (ImplementsInterface): New method to determine if a type
25392         implements a given interface. Provides a nice cache too.
25393
25394         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25395         method.
25396
25397         (ConvertReferenceExplicit): Ditto.
25398
25399         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25400         various methods, with correct names etc.
25401
25402         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25403         Operator.UnaryNegation.
25404
25405         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25406         we have a unary plus or minus operator.
25407
25408         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25409         UnaryMinus.
25410
25411         * everywhere : update accordingly.
25412
25413         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25414         respectively.
25415
25416         * class.cs (Method::Define): For the case where we are implementing a method
25417         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25418         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25419
25420 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25421
25422         * interface.cs (FindMembers): Implement to work around S.R.E
25423         lameness.
25424
25425         * typemanager.cs (IsInterfaceType): Implement.
25426
25427         (FindMembers): Update to handle interface types too.
25428
25429         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25430         use IsAssignableFrom as that is not correct - it doesn't work.
25431
25432         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25433         and accordingly override EmitStatement.
25434
25435         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25436         using the correct logic :-)
25437
25438 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25439
25440         * ../errors/cs-11.cs : Add to demonstrate error -11 
25441
25442 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25443
25444         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25445         then pass this as a hint to ResolveLValue.
25446
25447         * expression.cs (FieldExpr): Add Location information
25448
25449         (FieldExpr::LValueResolve): Report assignment to readonly
25450         variable. 
25451
25452         (Expression::ExprClassFromMemberInfo): Pass location information.
25453
25454         (Expression::ResolveLValue): Add new method that resolves an
25455         LValue. 
25456
25457         (Expression::DoResolveLValue): Default invocation calls
25458         DoResolve. 
25459
25460         (Indexers): New class used to keep track of indexers in a given
25461         Type. 
25462
25463         (IStackStore): Renamed from LValue, as it did not really describe
25464         what this did.  Also ResolveLValue is gone from this interface and
25465         now is part of Expression.
25466
25467         (ElementAccess): Depending on the element access type
25468
25469         * typemanager.cs: Add `indexer_name_type' as a Core type
25470         (System.Runtime.CompilerServices.IndexerNameAttribute)
25471
25472         * statement.cs (Goto): Take a location.
25473
25474 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25475
25476         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25477         if two delegates are compatible.
25478
25479         (NewDelegate::DoResolve): Update to take care of the case when
25480         we instantiate a delegate from another delegate.
25481
25482         * typemanager.cs (FindMembers): Don't even try to look up members
25483         of Delegate types for now.
25484
25485 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25486
25487         * delegate.cs (NewDelegate): New class to take care of delegate
25488         instantiation.
25489
25490         * expression.cs (New): Split the delegate related code out into 
25491         the NewDelegate class.
25492
25493         * delegate.cs (DelegateInvocation): New class to handle delegate 
25494         invocation.
25495
25496         * expression.cs (Invocation): Split out delegate related code into
25497         the DelegateInvocation class.
25498
25499 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25500
25501         * expression.cs (New::DoResolve): Implement delegate creation fully
25502         and according to the spec.
25503
25504         (New::DoEmit): Update to handle delegates differently.
25505
25506         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25507         because of which we were printing out arguments in reverse order !
25508
25509         * delegate.cs (VerifyMethod): Implement to check if the given method
25510         matches the delegate.
25511
25512         (FullDelegateDesc): Implement.
25513
25514         (VerifyApplicability): Implement.
25515
25516         * expression.cs (Invocation::DoResolve): Update to accordingly handle
25517         delegate invocations too.
25518
25519         (Invocation::Emit): Ditto.
25520
25521         * ../errors/cs1593.cs : Added.
25522
25523         * ../errors/cs1594.cs : Added.
25524
25525         * delegate.cs (InstanceExpression, TargetMethod): New properties.
25526
25527 2001-10-16  Ravi Pratap  <ravi@ximian.com>
25528
25529         * typemanager.cs (intptr_type): Core type for System.IntPtr
25530
25531         (InitCoreTypes): Update for the same.
25532
25533         (iasyncresult_type, asynccallback_type): Ditto.
25534
25535         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25536         correct.
25537
25538         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25539         too.
25540
25541         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25542         the builders for the 4 members of a delegate type :-)
25543
25544         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25545         type.
25546
25547         * expression.cs (New::DoResolve): Implement guts for delegate creation.
25548
25549         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25550
25551 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
25552
25553         * statement.cs (Break::Emit): Implement.   
25554         (Continue::Emit): Implement.
25555
25556         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25557         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25558         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25559         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
25560         end loop
25561
25562         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25563         properties that track the label for the current loop (begin of the
25564         loop and end of the loop).
25565
25566 2001-10-15  Ravi Pratap  <ravi@ximian.com>
25567
25568         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25569         use of emitting anything at all.
25570
25571         * class.cs, rootcontext.cs : Get rid of calls to the same.
25572
25573         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25574
25575         (Populate): Define the constructor correctly and set the implementation
25576         attributes.
25577
25578         * typemanager.cs (delegate_types): New hashtable to hold delegates that
25579         have been defined.
25580
25581         (AddDelegateType): Implement.
25582
25583         (IsDelegateType): Implement helper method.
25584
25585         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25586
25587         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25588         and accordingly handle it.
25589
25590         * delegate.cs (Populate): Take TypeContainer argument.
25591         Implement bits to define the Invoke method. However, I still haven't figured out
25592         how to take care of the native int bit :-(
25593
25594         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
25595         Qualify the name of the delegate, not its return type !
25596
25597         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25598         conversion.
25599
25600         (StandardConversionExists): Checking for array types turns out to be recursive.
25601
25602         (ConvertReferenceExplicit): Implement array conversion.
25603
25604         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25605
25606 2001-10-12  Ravi Pratap  <ravi@ximian.com>
25607
25608         * cs-parser.jay (delegate_declaration): Store the fully qualified
25609         name as it is a type declaration.
25610
25611         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
25612         readonly.
25613
25614         (DefineDelegate): Renamed from Define. Does the same thing essentially,
25615         as TypeContainer::DefineType.
25616
25617         (Populate): Method in which all the definition of the various methods (Invoke)
25618         etc is done.
25619
25620         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25621         see.
25622
25623         (CloseDelegate): Finally creates the delegate.
25624
25625         * class.cs (TypeContainer::DefineType): Update to define delegates.
25626         (Populate, Emit and CloseType): Do the same thing here too.
25627
25628         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25629         delegates in all these operations.
25630
25631 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
25632
25633         * expression.cs: LocalTemporary: a new expression used to
25634         reference a temporary that has been created.
25635
25636         * assign.cs: Handle PropertyAccess back here, so that we can
25637         provide the proper semantic access to properties.
25638
25639         * expression.cs (Expression::ConvertReferenceExplicit): Implement
25640         a few more explicit conversions. 
25641
25642         * modifiers.cs: `NEW' modifier maps to HideBySig.
25643
25644         * expression.cs (PropertyExpr): Make this into an
25645         ExpressionStatement, and support the EmitStatement code path. 
25646
25647         Perform get/set error checking, clean up the interface.
25648
25649         * assign.cs: recognize PropertyExprs as targets, and if so, turn
25650         them into toplevel access objects.
25651
25652 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
25653
25654         * expression.cs: PropertyExpr::PropertyExpr: use work around the
25655         SRE.
25656
25657         * typemanager.cs: Keep track here of our PropertyBuilders again to
25658         work around lameness in SRE.
25659
25660 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
25661
25662         * expression.cs (LValue::LValueResolve): New method in the
25663         interface, used to perform a second resolution pass for LValues. 
25664
25665         (This::DoResolve): Catch the use of this in static methods.
25666
25667         (This::LValueResolve): Implement.
25668
25669         (This::Store): Remove warning, assigning to `this' in structures
25670         is 
25671
25672         (Invocation::Emit): Deal with invocation of
25673         methods on value types.  We need to pass the address to structure
25674         methods rather than the object itself.  (The equivalent code to
25675         emit "this" for structures leaves the entire structure on the
25676         stack instead of a pointer to it). 
25677
25678         (ParameterReference::DoResolve): Compute the real index for the
25679         argument based on whether the method takes or not a `this' pointer
25680         (ie, the method is static).
25681
25682         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25683         value types returned from functions when we need to invoke a
25684         method on the sturcture.
25685
25686
25687 2001-10-11  Ravi Pratap  <ravi@ximian.com>
25688
25689         * class.cs (TypeContainer::DefineType): Method to actually do the business of
25690         defining the type in the Modulebuilder or Typebuilder. This is to take
25691         care of nested types which need to be defined on the TypeBuilder using
25692         DefineNestedMethod.
25693
25694         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
25695         methods in RootContext, only ported to be part of TypeContainer.
25696
25697         (TypeContainer::GetInterfaceOrClass): Ditto.
25698
25699         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25700
25701         * interface.cs (Interface::DefineInterface): New method. Does exactly
25702         what RootContext.CreateInterface did earlier, only it takes care of nested types 
25703         too.
25704
25705         (Interface::GetInterfaces): Move from RootContext here and port.
25706
25707         (Interface::GetInterfaceByName): Same here.
25708
25709         * rootcontext.cs (ResolveTree): Re-write.
25710
25711         (PopulateTypes): Re-write.
25712
25713         * class.cs (TypeContainer::Populate): Populate nested types too.
25714         (TypeContainer::Emit): Emit nested members too.
25715
25716         * typemanager.cs (AddUserType): Do not make use of the FullName property,
25717         instead just use the name argument passed in as it is already fully
25718         qualified.
25719
25720         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25721         to TypeContainer mapping to see if a type is user-defined.
25722
25723         * class.cs (TypeContainer::CloseType): Implement. 
25724
25725         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25726         the default constructor.
25727
25728         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25729         twice.
25730
25731         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25732
25733         * interface.cs (CloseType): Create the type here.
25734
25735         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25736         the hierarchy.
25737
25738         Remove all the methods which are now in TypeContainer.
25739
25740 2001-10-10  Ravi Pratap  <ravi@ximian.com>
25741
25742         * delegate.cs (Define): Re-write bits to define the delegate
25743         correctly.
25744
25745 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
25746
25747         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25748
25749         * expression.cs (ImplicitReferenceConversion): handle null as well
25750         as a source to convert to any reference type.
25751
25752         * statement.cs (Return): Perform any implicit conversions to
25753         expected return type.  
25754
25755         Validate use of return statement.  
25756
25757         * codegen.cs (EmitContext): Pass the expected return type here.
25758
25759         * class.cs (Method, Constructor, Property): Pass expected return
25760         type to EmitContext.
25761
25762 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
25763
25764         * expression.cs: Make DoResolve take an EmitContext instead of a
25765         TypeContainer.
25766
25767         Replaced `l' and `location' for `loc', for consistency.
25768
25769         (Error, Warning): Remove unneeded Tc argument.
25770
25771         * assign.cs, literal.cs, constant.cs: Update to new calling
25772         convention. 
25773
25774         * codegen.cs: EmitContext now contains a flag indicating whether
25775         code is being generated in a static method or not.
25776
25777         * cs-parser.jay: DecomposeQI, new function that replaces the old
25778         QualifiedIdentifier.  Now we always decompose the assembled
25779         strings from qualified_identifier productions into a group of
25780         memberaccesses.
25781
25782 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
25783
25784         * rootcontext.cs: Deal with field-less struct types correctly now
25785         by passing the size option to Define Type.
25786
25787         * class.cs: Removed hack that created one static field. 
25788
25789 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
25790
25791         * statement.cs: Moved most of the code generation here. 
25792
25793 2001-10-09  Ravi Pratap  <ravi@ximian.com>
25794
25795         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
25796         seem very right.
25797
25798         (ElementAccess): Remove useless bits for now - keep checks as the spec
25799         says.
25800
25801 2001-10-08  Ravi Pratap  <ravi@ximian.com>
25802
25803         * expression.cs (ElementAccess::DoResolve): Remove my crap code
25804         and start performing checks according to the spec.
25805
25806 2001-10-07  Ravi Pratap  <ravi@ximian.com>
25807
25808         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
25809         rank_specifiers instead.
25810
25811         (rank_specifiers): Change the order in which the rank specifiers are stored
25812
25813         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
25814
25815         * expression.cs (ElementAccess): Implement the LValue interface too.
25816
25817 2001-10-06  Ravi Pratap  <ravi@ximian.com>
25818
25819         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25820         except that user defined conversions are not included.
25821
25822         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
25823         perform the conversion of the return type, if necessary.
25824
25825         (New::DoResolve): Check whether we are creating an array or an object
25826         and accordingly do the needful.
25827
25828         (New::Emit): Same here.
25829
25830         (New::DoResolve): Implement guts of array creation.
25831
25832         (New::FormLookupType): Helper function.
25833
25834 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
25835
25836         * codegen.cs: Removed most of the code generation here, and move the
25837         corresponding code generation bits to the statement classes. 
25838
25839         Added support for try/catch/finalize and throw.
25840
25841         * cs-parser.jay: Added support for try/catch/finalize.
25842
25843         * class.cs: Catch static methods having the flags override,
25844         virtual or abstract.
25845
25846         * expression.cs (UserCast): This user cast was not really doing
25847         what it was supposed to do.  Which is to be born in fully resolved
25848         state.  Parts of the resolution were being performed at Emit time! 
25849
25850         Fixed this code.
25851
25852 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25853
25854         * expression.cs: Implicity convert the result from UserCast.
25855
25856 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25857
25858         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25859         prevented it from working correctly. 
25860
25861         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25862         merely ConvertImplicit.
25863
25864 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25865
25866         * typemanager.cs: Make the LookupTypeContainer function static,
25867         and not per-instance.  
25868
25869         * class.cs: Make static FindMembers (the one that takes a Type
25870         argument). 
25871
25872         * codegen.cs: Add EmitForeach here.
25873
25874         * cs-parser.jay: Make foreach a toplevel object instead of the
25875         inline expansion, as we need to perform semantic analysis on it. 
25876
25877 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25878
25879         * expression.cs (Expression::ImplicitUserConversion): Rename to
25880         UserDefinedConversion.
25881
25882         (Expression::UserDefinedConversion): Take an extra argument specifying 
25883         whether we look for explicit user conversions too.
25884
25885         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25886
25887         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25888
25889         (ExplicitUserConversion): Make it a call to UserDefinedConversion
25890         with the appropriate arguments.
25891
25892         * cs-parser.jay (cast_expression): Record location too.
25893
25894         * expression.cs (Cast): Record location info.
25895
25896         (Expression::ConvertExplicit): Take location argument.
25897
25898         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25899         to determine if we are doing explicit conversions.
25900
25901         (UserCast::Emit): Update accordingly.
25902
25903         (Expression::ConvertExplicit): Report an error if everything fails.
25904
25905         * ../errors/cs0030.cs : Add.
25906
25907 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
25908
25909         * modifiers.cs: If the ABSTRACT keyword is present, also set the
25910         virtual and newslot bits. 
25911
25912         * class.cs (TypeContainer::RegisterRequiredImplementations):
25913         Record methods we need.
25914
25915         (TypeContainer::MakeKey): Helper function to make keys for
25916         MethodBases, since the Methodbase key is useless.
25917
25918         (TypeContainer::Populate): Call RegisterRequiredImplementations
25919         before defining the methods.   
25920
25921         Create a mapping for method_builders_to_methods ahead of time
25922         instead of inside a tight loop.
25923
25924         (::RequireMethods):  Accept an object as the data to set into the
25925         hashtable so we can report interface vs abstract method mismatch.
25926
25927 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25928
25929         * report.cs: Make all of it static.
25930
25931         * rootcontext.cs: Drop object_type and value_type computations, as
25932         we have those in the TypeManager anyways.
25933
25934         Drop report instance variable too, now it is a global.
25935
25936         * driver.cs: Use try/catch on command line handling.
25937
25938         Add --probe option to debug the error reporting system with a test
25939         suite. 
25940
25941         * report.cs: Add support for exiting program when a probe
25942         condition is reached.
25943
25944 2001-10-03  Ravi Pratap  <ravi@ximian.com>
25945
25946         * expression.cs (Binary::DoNumericPromotions): Fix the case when
25947         we do a forcible conversion regardless of type, to check if 
25948         ForceConversion returns a null.
25949
25950         (Binary::error19): Use location to report error.
25951
25952         (Unary::error23): Use location here too.
25953
25954         * ../errors/cs0019.cs : Check in.
25955
25956         * ../errors/cs0023.cs : Check in.
25957
25958         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25959         case of a non-null MethodInfo object with a length of 0 !
25960
25961         (Binary::ResolveOperator): Flag error if overload resolution fails to find
25962         an applicable member - according to the spec :-)
25963         Also fix logic to find members in base types.
25964
25965         (Unary::ResolveOperator): Same here.
25966
25967         (Unary::report23): Change name to error23 and make first argument a TypeContainer
25968         as I was getting thoroughly confused between this and error19 :-)
25969
25970         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25971         (::FindMostEncompassedType): Implement.
25972         (::FindMostEncompassingType): Implement.
25973         (::StandardConversionExists): Implement.
25974
25975         (UserImplicitCast): Re-vamp. We now need info about most specific
25976         source and target types so that we can do the necessary conversions.
25977
25978         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25979         mathematical union with no duplicates.
25980
25981 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25982
25983         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25984         in order from base classes to child classes, so that we can in
25985         child classes look up in our parent for method names and
25986         attributes (required for handling abstract, virtual, new, override
25987         constructs: we need to instrospect our base class, and if we dont
25988         populate the classes in order, the introspection might be
25989         incorrect.  For example, a method could query its parent before
25990         the parent has any methods and would determine that the parent has
25991         no abstract methods (while it could have had them)).
25992
25993         (RootContext::CreateType): Record the order in which we define the
25994         classes.
25995
25996 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
25997
25998         * class.cs (TypeContainer::Populate): Also method definitions can
25999         fail now, keep track of this.
26000
26001         (TypeContainer::FindMembers): Implement support for
26002         DeclaredOnly/noDeclaredOnly flag.
26003
26004         (Constructor::Emit) Return the ConstructorBuilder.
26005
26006         (Method::Emit) Return the MethodBuilder. 
26007         Check for abstract or virtual methods to be public.
26008
26009         * rootcontext.cs (RootContext::CreateType): Register all the
26010         abstract methods required for the class to be complete and the
26011         interface methods that must be implemented. 
26012
26013         * cs-parser.jay: Report error 501 (method requires body if it is
26014         not marked abstract or extern).
26015
26016         * expression.cs (TypeOf::Emit): Implement.
26017
26018         * typemanager.cs: runtime_handle_type, new global type.
26019
26020         * class.cs (Property::Emit): Generate code for properties.
26021
26022 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26023
26024         * expression.cs (Unary::ResolveOperator): Find operators on base type
26025         too - we now conform exactly to the spec.
26026
26027         (Binary::ResolveOperator): Same here.
26028
26029         * class.cs (Operator::Define): Fix minor quirk in the tests.
26030
26031         * ../errors/cs0215.cs : Added.
26032
26033         * ../errors/cs0556.cs : Added.
26034
26035         * ../errors/cs0555.cs : Added.
26036
26037 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26038
26039         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26040         single integer which is really efficient
26041
26042 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26043
26044         *  expression.cs (Expression::ImplicitUserConversion): Use location
26045         even in the case when we are examining True operators.
26046  
26047         * class.cs (Operator::Define): Perform extensive checks to conform
26048         with the rules for operator overloading in the spec.
26049
26050         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26051         some of the other conversions mentioned in the spec.
26052
26053         * typemanager.cs (array_type): New static member for the System.Array built-in
26054         type.
26055
26056         (cloneable_interface): For System.ICloneable interface.
26057
26058         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26059         we start resolving the tree and populating types.
26060
26061         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26062  
26063 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26064
26065         * expression.cs (Expression::ExprClassFromMemberInfo,
26066         Expression::Literalize): Create literal expressions from
26067         FieldInfos which are literals.
26068
26069         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26070         type casts, because they were wrong.  The test suite in tests
26071         caught these ones.
26072
26073         (ImplicitNumericConversion): ushort to ulong requires a widening
26074         cast. 
26075
26076         Int32 constant to long requires widening cast as well.
26077
26078         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26079         for integers because the type on the stack is not i4.
26080
26081 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26082
26083         * expression.cs (report118): require location argument. 
26084
26085         * parameter.cs: Do not dereference potential null value.
26086
26087         * class.cs: Catch methods that lack the `new' keyword when
26088         overriding a name.  Report warnings when `new' is used without
26089         anything being there to override.
26090
26091         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26092
26093         * class.cs: Only add constructor to hashtable if it is non-null
26094         (as now constructors can fail on define).
26095
26096         (TypeManager, Class, Struct): Take location arguments.
26097
26098         Catch field instance initialization in structs as errors.
26099
26100         accepting_filter: a new filter for FindMembers that is static so
26101         that we dont create an instance per invocation.
26102
26103         (Constructor::Define): Catch errors where a struct constructor is
26104         parameterless 
26105
26106         * cs-parser.jay: Pass location information for various new
26107         constructs. 
26108
26109         * delegate.cs (Delegate): take a location argument.
26110
26111         * driver.cs: Do not call EmitCode if there were problesm in the
26112         Definition of the types, as many Builders wont be there. 
26113
26114         * decl.cs (Decl::Decl): Require a location argument.
26115
26116         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26117         into integers, and find the most appropiate integer for it.
26118
26119         * literal.cs: Implement ULongLiteral.
26120
26121         * rootcontext.cs: Provide better information about the location of
26122         failure when CreateType fails.
26123
26124 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26125
26126         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26127         as well.
26128
26129         * expression.cs (Binary::CheckShiftArguments): Add missing type
26130         computation.
26131         (Binary::ResolveOperator): Add type to the logical and and logical
26132         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26133         before.
26134
26135         (Binary::DoNumericPromotions): In the case where either argument
26136         is ulong (and most signed types combined with ulong cause an
26137         error) perform implicit integer constant conversions as well.
26138
26139 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26140
26141         * expression.cs (UserImplicitCast): Method should always be
26142         non-null. 
26143         (Invocation::BetterConversion): Simplified test for IntLiteral.
26144
26145         (Expression::ImplicitNumericConversion): Split this routine out.
26146         Put the code that performs implicit constant integer conversions
26147         here. 
26148
26149         (Expression::Resolve): Become a wrapper around DoResolve so we can
26150         check eclass and type being set after resolve.
26151
26152         (Invocation::Badness): Remove this dead function
26153
26154         (Binary::ResolveOperator): Do not compute the expensive argumnets
26155         unless we have a union for it.
26156
26157         (Probe::Emit): Is needs to do an isinst and then
26158         compare against null.
26159
26160         (::CanConvert): Added Location argument.  If the Location argument
26161         is null (Location.Null), then we do not report errors.  This is
26162         used by the `probe' mechanism of the Explicit conversion.  We do
26163         not want to generate an error for something that the user
26164         explicitly requested to be casted.  But the pipeline for an
26165         explicit cast first tests for potential implicit casts.
26166
26167         So for now, if the Location is null, it means `Probe only' to
26168         avoid adding another argument.   Might have to revise this
26169         strategy later.
26170
26171         (ClassCast): New class used to type cast objects into arbitrary
26172         classes (used in Explicit Reference Conversions).
26173
26174         Implement `as' as well.
26175
26176         Reverted all the patches from Ravi below: they were broken:
26177
26178                 * The use of `level' as a mechanism to stop recursive
26179                   invocations is wrong.  That was there just to catch the
26180                   bug with a strack trace but not as a way of addressing
26181                   the problem.
26182
26183                   To fix the problem we have to *understand* what is going
26184                   on and the interactions and come up with a plan, not
26185                   just get things going.
26186
26187                 * The use of the type conversion cache that I proposed
26188                   last night had an open topic: How does this work across
26189                   protection domains.  A user defined conversion might not
26190                   be public in the location where we are applying the
26191                   conversion, a different conversion might be selected
26192                   (ie, private A->B (better) but public B->A (worse),
26193                   inside A, A->B applies, but outside it, B->A will
26194                   apply).
26195
26196                 * On top of that (ie, even if the above is solved),
26197                   conversions in a cache need to be abstract.  Ie, `To
26198                   convert from an Int to a Short use an OpcodeCast', not
26199                   `To convert from an Int to a Short use the OpcodeCast on
26200                   the variable 5' (which is what this patch was doing).
26201
26202 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26203
26204         * expression.cs (Invocation::ConversionExists): Re-write to use
26205         the conversion cache
26206
26207         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26208         cache all conversions done, not just user-defined ones.
26209
26210         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26211         to determine if a conversion exists instead of acutually trying to 
26212         perform the conversion. It's faster too.
26213
26214         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26215         and only then attempt the implicit conversion.
26216
26217 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26218
26219         * expression.cs (ConvertImplicit): Use a cache for conversions
26220         already found. Check level of recursion and bail out if necessary.
26221
26222 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26223
26224         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26225         Export standard methods that we expect for string operations.
26226
26227         * statement.cs (Block::UsageWarning): Track usage of variables and
26228         report the errors for not used variables.
26229
26230         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26231         operator. 
26232
26233 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26234
26235         * codegen.cs: remove unnneded code 
26236
26237         * expression.cs: Removed BuiltinTypeAccess class
26238
26239         Fix the order in which implicit conversions are
26240         done.  
26241
26242         The previous fixed dropped support for boxed conversions (adding a
26243         test to the test suite now)
26244
26245         (UserImplicitCast::CanConvert): Remove test for source being null,
26246         that code is broken.  We should not feed a null to begin with, if
26247         we do, then we should track the bug where the problem originates
26248         and not try to cover it up here.
26249
26250         Return a resolved expression of type UserImplicitCast on success
26251         rather than true/false.  Ravi: this is what I was talking about,
26252         the pattern is to use a static method as a "constructor" for
26253         objects. 
26254
26255         Also, do not create arguments until the very last minute,
26256         otherwise we always create the arguments even for lookups that
26257         will never be performed. 
26258
26259         (UserImplicitCast::Resolve): Eliminate, objects of type
26260         UserImplicitCast are born in a fully resolved state. 
26261
26262         * typemanager.cs (InitCoreTypes): Init also value_type
26263         (System.ValueType). 
26264
26265         * expression.cs (Cast::Resolve): First resolve the child expression.
26266
26267         (LValue): Add new method AddressOf to be used by
26268         the `&' operator.  
26269
26270         Change the argument of Store to take an EmitContext instead of an
26271         ILGenerator, because things like FieldExpr need to be able to call
26272         their children expression to generate the instance code. 
26273
26274         (Expression::Error, Expression::Warning): Sugar functions for
26275         reporting errors.
26276
26277         (Expression::MemberLookup): Accept a TypeContainer instead of a
26278         Report as the first argument.
26279
26280         (Expression::ResolvePrimary): Killed.  I still want to improve
26281         this as currently the code is just not right.
26282
26283         (Expression::ResolveMemberAccess): Simplify, but it is still
26284         wrong. 
26285
26286         (Unary::Resolve): Catch errors in AddressOf operators.
26287
26288         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26289         index to a byte for the short-version, or the compiler will choose
26290         the wrong Emit call, which generates the wrong data.
26291
26292         (ParameterReference::Emit, ::Store): same.
26293
26294         (FieldExpr::AddressOf): Implement.
26295
26296         * typemanager.cs: TypeManager: made public variable instead of
26297         property.
26298
26299         * driver.cs: document --fatal.
26300
26301         * report.cs (ErrorMessage, WarningMessage): new names for the old
26302         Error and Warning classes.
26303
26304         * cs-parser.jay (member_access): Turn built-in access to types
26305         into a normal simplename
26306
26307 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26308
26309         * expression.cs (Invocation::BetterConversion): Fix to cope
26310         with q being null, since this was introducing a bug.
26311
26312         * expression.cs (ConvertImplicit): Do built-in conversions first.
26313
26314 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26315
26316         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26317
26318 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26319
26320         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26321         I had introduced long ago (what's new ?).
26322
26323         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26324         the work of all the checking. 
26325         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26326         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26327
26328         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26329         that is the right way. 
26330
26331         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26332         overloading resolution. Use everywhere instead of cutting and pasting code.
26333
26334         (Binary::ResolveOperator): Use MakeUnionSet.
26335
26336         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26337         we have to convert to bool types. Not complete yet.
26338
26339 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26340
26341         * typemanager.cs (TypeManager::CSharpName): support ushort.
26342
26343         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26344         to provide an expression that performsn an implicit constant int
26345         conversion (section 6.1.6).
26346         (Expression::ConvertImplicitRequired): Reworked to include
26347         implicit constant expression conversions.
26348
26349         (Expression::ConvertNumericExplicit): Finished.
26350
26351         (Invocation::Emit): If InstanceExpression is null, then it means
26352         that we perform a call on this.
26353
26354 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26355
26356         * expression.cs (Unary::Emit): Remove some dead code.
26357         (Probe): Implement Resolve and Emit for `is'.
26358         (Expression::ConvertImplicitRequired): Attempt to do constant
26359         expression conversions here.  Maybe should be moved to
26360         ConvertImplicit, but I am not sure.
26361         (Expression::ImplicitLongConstantConversionPossible,
26362         Expression::ImplicitIntConstantConversionPossible): New functions
26363         that tell whether is it possible to apply an implicit constant
26364         expression conversion.
26365
26366         (ConvertNumericExplicit): Started work on explicit numeric
26367         conversions.
26368
26369         * cs-parser.jay: Update operator constants.
26370
26371         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26372         (Parameters::GetSignature): Hook up VerifyArgs here.
26373         (Parameters::VerifyArgs): Verifies that no two arguments have the
26374         same name. 
26375
26376         * class.cs (Operator): Update the operator names to reflect the
26377         ones that the spec expects (as we are just stringizing the
26378         operator names).
26379
26380         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26381         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26382         previous usage did only work for our methods.
26383         (Expression::ConvertImplicit): Handle decimal implicit numeric
26384         conversions as well.
26385         (Expression::InternalTypeConstructor): Used to invoke constructors
26386         on internal types for default promotions.
26387
26388         (Unary::Emit): Implement special handling for the pre/post
26389         increment/decrement for overloaded operators, as they need to have
26390         the same semantics as the other operators.
26391
26392         (Binary::ResolveOperator): ditto.
26393         (Invocation::ConversionExists): ditto.
26394         (UserImplicitCast::Resolve): ditto.
26395
26396 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26397
26398         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26399         operator, return after emitting body. Regression tests pass again !
26400
26401         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26402         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26403         (Invocation::OverloadResolve): Ditto.
26404         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26405
26406         * everywhere : update calls to the above methods accordingly.
26407
26408 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26409
26410         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26411
26412         * expression.cs (ExpressionStatement): New base class used for
26413         expressions that can appear in statements, so that we can provide
26414         an alternate path to generate expression that do not leave a value
26415         on the stack.
26416
26417         (Expression::Emit, and all the derivatives): We no longer return
26418         whether a value is left on the stack or not.  Every expression
26419         after being emitted leaves a single value on the stack.
26420
26421         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26422         facilties of ExpressionStatement if possible.
26423
26424         * cs-parser.jay: Update statement_expression.
26425
26426 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26427
26428         * driver.cs: Change the wording of message
26429
26430 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26431
26432         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26433         the type of the expression to the return type of the method if
26434         we have an overloaded operator match ! The regression tests pass again !
26435         (Unary::ResolveOperator): Ditto.
26436
26437         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26438         to find "op_Implicit", not "implicit" ;-)
26439         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26440         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26441
26442         * everywhere : Correct calls to the above accordingly.
26443
26444         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26445         (ConvertImplicit): Do user-defined conversion if it exists.
26446
26447 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26448
26449         * assign.cs: track location.
26450         (Resolve): Use implicit conversions on assignment.
26451
26452         * literal.cs: Oops.  Not good, Emit of short access values should
26453         pass (Bytes) or the wrong argument will be selected.
26454
26455         * expression.cs (Unary::Emit): Emit code for -expr.
26456
26457         (Unary::ResolveOperator): Handle `Substract' for non-constants
26458         (substract from zero from the non-constants).
26459         Deal with Doubles as well. 
26460
26461         (Expression::ConvertImplicitRequired): New routine that reports an
26462         error if no implicit conversion exists. 
26463
26464         (Invocation::OverloadResolve): Store the converted implicit
26465         expressions if we make them
26466
26467 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26468
26469         * class.cs (ConstructorInitializer): Take a Location argument.
26470         (ConstructorBaseInitializer): Same here.
26471         (ConstructorThisInitializer): Same here.
26472
26473         * cs-parser.jay : Update all calls accordingly.
26474
26475         * expression.cs (Unary, Binary, New): Take location argument.
26476         Update accordingly everywhere.
26477
26478         * cs-parser.jay : Update all calls to the above to take a location
26479         argument.
26480
26481         * class.cs : Ditto.
26482
26483 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26484
26485         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26486         (Invocation::BetterConversion): Same here
26487         (Invocation::ConversionExists): Ditto.
26488
26489         (Invocation::ConversionExists): Implement.
26490
26491 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26492
26493         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26494         Also take an additional TypeContainer argument.
26495
26496         * All over : Pass in TypeContainer as argument to OverloadResolve.
26497
26498         * typemanager.cs (CSharpName): Update to check for the string type and return
26499         that too.
26500
26501         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26502         a given method.
26503
26504 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26505
26506         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26507         (Invocation::BetterFunction): Implement.
26508         (Invocation::BetterConversion): Implement.
26509         (Invocation::ConversionExists): Skeleton, no implementation yet.
26510
26511         Okay, things work fine !
26512
26513 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
26514
26515         * typemanager.cs: declare and load enum_type, delegate_type and
26516         void_type. 
26517
26518         * expression.cs (Expression::Emit): Now emit returns a value that
26519         tells whether a value is left on the stack or not.  This strategy
26520         might be reveted tomorrow with a mechanism that would address
26521         multiple assignments.
26522         (Expression::report118): Utility routine to report mismatches on
26523         the ExprClass.
26524
26525         (Unary::Report23): Report impossible type/operator combination
26526         utility function.
26527
26528         (Unary::IsIncrementableNumber): Whether the type can be
26529         incremented or decremented with add.
26530         (Unary::ResolveOperator): Also allow enumerations to be bitwise
26531         complemented. 
26532         (Unary::ResolveOperator): Implement ++, !, ~,
26533
26534         (Invocation::Emit): Deal with new Emit convetion.
26535
26536         * All Expression derivatives: Updated their Emit method to return
26537         whether they leave values on the stack or not.
26538
26539         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26540         stack for expressions that are statements. 
26541
26542 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26543
26544         * expression.cs (LValue): New interface.  Must be implemented by
26545         LValue objects.
26546         (LocalVariableReference, ParameterReference, FieldExpr): Implement
26547         LValue interface.
26548
26549         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26550         interface for generating code, simplifies the code.
26551
26552 2001-09-20  Ravi Pratap  <ravi@ximian.com>
26553
26554         * expression.cs (everywhere): Comment out return statements in ::Resolve
26555         methods to avoid the warnings.
26556
26557 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26558
26559         * driver.cs (parse): Report error 2001 if we can not open the
26560         source file.
26561
26562         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26563         not resolve it.
26564
26565         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26566         object. 
26567
26568         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26569         otherwise nested blocks end up with the same index.
26570
26571         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26572
26573         * expression.cs:  Instead of having FIXMEs in the Resolve
26574         functions, throw exceptions so it is obvious that we are facing a
26575         bug. 
26576
26577         * cs-parser.jay (invocation_expression): Pass Location information.
26578
26579         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26580         Use a basename for those routines because .NET does not like paths
26581         on them. 
26582
26583         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26584         already defined.
26585
26586 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
26587
26588         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26589         are loading the correct data types (throws an exception if not).
26590         (TypeManager::InitCoreTypes): Use CoreLookupType
26591
26592         * expression.cs (Unary::ResolveOperator): return the child
26593         expression for expressions which are just +expr.
26594         (Unary::ResolveOperator): Return negative literals for -LITERAL
26595         expressions (otherwise they are Unary {Literal}).
26596         (Invocation::Badness): Take into account `Implicit constant
26597         expression conversions'.
26598
26599         * literal.cs (LongLiteral): Implement long literal class.
26600         (IntLiteral): export the `Value' of the intliteral. 
26601
26602 2001-09-19  Ravi Pratap  <ravi@ximian.com>
26603
26604         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26605
26606         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
26607         instead of 'Operator'
26608
26609         * expression.cs (Binary::ResolveOperator): Update accordingly.
26610         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26611         and 'Minus'
26612
26613         * cs-parser.jay (unary_expression): Update to use the new names.
26614
26615         * gen-treedump.cs (GetUnary): Same here.
26616
26617         * expression.cs (Unary::Resolve): Implement.
26618         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
26619         operators are found instead of making noise ;-)
26620         (Unary::ResolveOperator): New method to do precisely the same thing which
26621         Binary::ResolveOperator does for Binary expressions.
26622         (Unary.method, .Arguments): Add.
26623         (Unary::OperName): Implement.   
26624         (Unary::ForceConversion): Copy and Paste !
26625
26626         * class.cs (Operator::Define): Fix a small bug for the case when we have 
26627         a unary operator.
26628
26629         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26630         for the inbuilt operators. Only overloading works for now ;-)
26631
26632 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
26633
26634         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26635         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26636
26637         * expression.cs (This::Emit): Implement. 
26638         (This::Resolve): Implement.
26639         (TypeOf:Resolve): Implement.
26640         (Expression::ResolveSimpleName): Add an implicit this to instance
26641         field references. 
26642         (MemberAccess::Resolve): Deal with Parameters and Fields. 
26643         Bind instance variable to Field expressions.
26644         (FieldExpr::Instance): New field used to track the expression that
26645         represents the object instance.
26646         (FieldExpr::Resolve): Track potential errors from MemberLookup not
26647         binding 
26648         (FieldExpr::Emit): Implement.
26649
26650         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26651         the last instruction contains a return opcode to avoid generating
26652         the last `ret' instruction (this generates correct code, and it is
26653         nice to pass the peverify output).
26654
26655         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26656         initializer for static and instance variables.
26657         (Constructor::Emit): Allow initializer to be null in the case of
26658         static constructors.  Only emit initializer for instance
26659         constructors. 
26660
26661         (TypeContainer::FindMembers): Return a null array if there are no
26662         matches.
26663
26664         Also fix the code for the MemberTypes.Method branch, as it was not
26665         scanning that for operators (or tried to access null variables before).
26666
26667         * assign.cs (Assign::Emit): Handle instance and static fields. 
26668
26669         * TODO: Updated.
26670
26671         * driver.cs: Stop compilation if there are parse errors.
26672
26673         * cs-parser.jay (constructor_declaration): Provide default base
26674         initializer for non-static constructors.
26675         (constructor_declarator): Do not provide a default base
26676         initializers if none was specified.
26677         Catch the fact that constructors should not have parameters.
26678
26679         * class.cs: Do not emit parent class initializers for static
26680         constructors, that should be flagged as an error.
26681
26682 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26683
26684         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26685         Move back code into TypeContainer::Populate.
26686
26687 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26688
26689         * class.cs (TypeContainer::AddConstructor): Fix the check to
26690         compare against Name, not Basename. 
26691         (Operator::OpType): Change Plus and Minus to Add and Subtract.
26692
26693         * cs-parser.jay : Update accordingly.
26694
26695         * class.cs (TypeContainer::FindMembers): For the case where we are searching
26696         for methods, don't forget to look into the operators too.
26697         (RegisterMethodBuilder): Helper method to take care of this for
26698         methods, constructors and operators.
26699         (Operator::Define): Completely revamp.
26700         (Operator.OperatorMethod, MethodName): New fields.
26701         (TypeContainer::Populate): Move the registering of builders into
26702         RegisterMethodBuilder.
26703         (Operator::Emit): Re-write.
26704
26705         * expression.cs (Binary::Emit): Comment out code path to emit method
26706         invocation stuff for the case when we have a user defined operator. I am
26707         just not able to get it right !
26708
26709 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
26710
26711         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26712         argument. 
26713
26714         (Expression::MemberLookup): Provide a version that allows to
26715         specify the MemberTypes and BindingFlags. 
26716
26717         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26718         so it was not fetching variable information from outer blocks.
26719
26720         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26721         Beforefieldinit as it was buggy.
26722
26723         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26724         that Ravi put here.  
26725
26726         * class.cs (Constructor::Emit): Only emit if block is not null.
26727         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26728         deal with this by semantically definining it as if the user had
26729         done it.
26730
26731         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26732         constructors as we now "emit" them at a higher level.
26733
26734         (TypeContainer::DefineDefaultConstructor): Used to define the
26735         default constructors if none was provided.
26736
26737         (ConstructorInitializer): Add methods Resolve and Emit. 
26738
26739         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26740
26741 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26742
26743         * class.cs (TypeContainer::EmitDefaultConstructor): Register
26744         the default constructor builder with our hashtable for methodbuilders
26745         to methodcores.
26746
26747         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26748         and argument_count is 0 in which case we have a match.
26749         (Binary::ResolveOperator): More null checking and miscellaneous coding
26750         style cleanup.
26751
26752 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26753
26754         * rootcontext.cs (IsNameSpace): Compare against null.
26755
26756         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
26757
26758         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
26759         and Unary::Operator.
26760
26761         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
26762         accordingly.
26763
26764         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
26765         we have overloaded operators.
26766         (Binary::ResolveOperator): Implement the part which does the operator overload
26767         resolution.
26768
26769         * class.cs (Operator::Emit): Implement.
26770         (TypeContainer::Emit): Emit the operators we have too.
26771
26772         * expression.cs (Binary::Emit): Update to emit the appropriate code for
26773         the case when we have a user-defined operator.
26774
26775 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
26776
26777         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
26778
26779 2001-09-16  Ravi Pratap  <ravi@ximian.com>
26780
26781         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
26782         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
26783         (Constructor::Emit): Implement.
26784         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
26785         if we have no work to do. 
26786         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
26787         Emit method.
26788
26789         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
26790         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
26791
26792         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
26793         of parent.parent.
26794
26795 2001-09-15  Ravi Pratap  <ravi@ximian.com>
26796
26797         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
26798         in the source.
26799         (Tree::RecordNamespace): Method to do what the name says ;-)
26800         (Tree::Namespaces): Property to get at the namespaces hashtable.
26801
26802         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
26803         keep track.
26804
26805         * rootcontext.cs (IsNamespace): Fixed it :-)
26806
26807 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
26808
26809         * class.cs (TypeContainer::FindMembers): Add support for
26810         constructors. 
26811         (MethodCore): New class that encapsulates both the shared aspects
26812         of a Constructor and a Method.  
26813         (Method, Constructor): Factored pieces into MethodCore.
26814
26815         * driver.cs: Added --fatal which makes errors throw exceptions.
26816         Load System assembly as well as part of the standard library.
26817
26818         * report.cs: Allow throwing exceptions on errors for debugging.
26819
26820         * modifiers.cs: Do not use `parent', instead use the real type
26821         container to evaluate permission settings.
26822
26823         * class.cs: Put Ravi's patch back in.  He is right, and we will
26824         have to cope with the
26825
26826 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26827
26828         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26829         FamORAssem, not FamANDAssem.
26830
26831 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
26832
26833         * driver.cs: Added --parse option that only parses its input files
26834         and terminates.
26835
26836         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
26837         incorrect.  IsTopLevel is not used to tell whether an object is
26838         root_types or not (that can be achieved by testing this ==
26839         root_types).  But to see if this is a top-level *class* (not
26840         necessarly our "toplevel" container). 
26841
26842 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26843
26844         * enum.cs (Enum::Define): Modify to call the Lookup method on the
26845         parent instead of a direct call to GetType.
26846
26847 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26848
26849         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26850         Modifiers.TypeAttr. This should just be a call to that method.
26851
26852         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26853         object so that we can determine if we are top-level or not.
26854
26855         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
26856         TypeContainer too.
26857
26858         * enum.cs (Enum::Define): Ditto.
26859
26860         * modifiers.cs (FieldAttr): Re-write.
26861
26862         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26863         (TypeContainer::HaveStaticConstructor): New property to provide access
26864         to precisely that info.
26865
26866         * modifiers.cs (MethodAttr): Re-write.
26867         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26868
26869         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26870         of top-level types as claimed.
26871
26872 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26873
26874         * expression.cs (MemberLookup): Fruitless attempt to lookup
26875         constructors.  Maybe I need to emit default constructors?  That
26876         might be it (currently .NET emits this for me automatically).
26877         (Invocation::OverloadResolve): Cope with Arguments == null.
26878         (Invocation::EmitArguments): new function, shared by the new
26879         constructor and us.
26880         (Invocation::Emit): Handle static and instance methods.  Emit
26881         proper call instruction for virtual or non-virtual invocations.
26882         (New::Emit): Implement.
26883         (New::Resolve): Implement.
26884         (MemberAccess:Resolve): Implement.
26885         (MethodGroupExpr::InstanceExpression): used conforming to the spec
26886         to track instances.
26887         (FieldExpr::Resolve): Set type.
26888
26889         * support.cs: Handle empty arguments.
26890                 
26891         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26892         SimpleLookup): Auxiliary routines to help parse a qualifier
26893         identifier.  
26894
26895         Update qualifier_identifier rule.
26896
26897         * codegen.cs: Removed debugging messages.
26898
26899         * class.cs: Make this a global thing, this acts just as a "key" to
26900         objects that we might have around.
26901
26902         (Populate): Only initialize method_builders_to_methods once.
26903
26904         * expression.cs (PropertyExpr): Initialize type from the
26905         PropertyType. 
26906
26907         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26908         Resolve pattern.  Attempt to implicitly convert value to boolean.
26909         Emit code.
26910
26911         * expression.cs: Set the type for the int32/int32 argument case.
26912         (Binary::ResolveOperator): Set the return type to boolean for
26913         comparission operators
26914
26915         * typemanager.cs: Remove debugging print code.
26916
26917         (Invocation::Resolve): resolve type.
26918
26919         * class.cs: Allocate a MemberInfo of the correct size, as the code
26920         elsewhere depends on the test to reflect the correct contents.
26921
26922         (Method::) Keep track of parameters, due to System.Reflection holes
26923
26924         (TypeContainer::Populate): Keep track of MethodBuilders to Method
26925         mapping here.
26926
26927         (TypeContainer::FindMembers): Use ArrayList and then copy an array
26928         of the exact size and return that.
26929
26930         (Class::LookupMethodByBuilder): New function that maps
26931         MethodBuilders to its methods.  Required to locate the information
26932         on methods because System.Reflection bit us again.
26933
26934         * support.cs: New file, contains an interface ParameterData and
26935         two implementations: ReflectionParameters and InternalParameters
26936         used to access Parameter information.  We will need to grow this
26937         as required.
26938
26939         * expression.cs (Invocation::GetParameterData): implement a cache
26940         and a wrapper around the ParameterData creation for methods. 
26941         (Invocation::OverloadResolve): Use new code.
26942
26943 2001-09-13  Ravi Pratap  <ravi@ximian.com>
26944
26945         * class.cs (TypeContainer::EmitField): Remove and move into 
26946         (Field::Define): here and modify accordingly.
26947         (Field.FieldBuilder): New member.
26948         (TypeContainer::Populate): Update accordingly.
26949         (TypeContainer::FindMembers): Implement.
26950
26951 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26952
26953         * statement.cs: (VariableInfo::VariableType): New field to be
26954         initialized with the full type once it is resolved. 
26955
26956 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
26957
26958         * parameter.cs (GetParameterInfo): Use a type cache to compute
26959         things only once, and to reuse this information
26960
26961         * expression.cs (LocalVariableReference::Emit): Implement.
26962         (OpcodeCast::Emit): fix.
26963
26964         (ParameterReference::Resolve): Implement.
26965         (ParameterReference::Emit): Implement.
26966
26967         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26968         that are expressions need to stay as Expressions.
26969
26970         * typemanager.cs (CSharpName): Returns the C# name of a type if
26971         possible. 
26972
26973         * expression.cs (Expression::ConvertImplicit): New function that
26974         implements implicit type conversions.
26975
26976         (Expression::ImplicitReferenceConversion): Implements implicit
26977         reference conversions.
26978
26979         (EmptyCast): New type for transparent casts.
26980
26981         (OpcodeCast): New type for casts of types that are performed with
26982         a sequence of bytecodes.
26983
26984         (BoxedCast): New type used for casting value types into reference
26985         types.  Emits a box opcode.
26986
26987         (Binary::DoNumericPromotions): Implements numeric promotions of
26988         and computation of the Binary::Type.
26989
26990         (Binary::EmitBranchable): Optimization.
26991
26992         (Binary::Emit): Implement code emission for expressions.
26993
26994         * typemanager.cs (TypeManager): Added two new core types: sbyte
26995         and byte.
26996
26997 2001-09-12  Ravi Pratap  <ravi@ximian.com>
26998
26999         * class.cs (TypeContainer::FindMembers): Method which does exactly
27000         what Type.FindMembers does, only we don't have to use reflection. No
27001         implementation yet.
27002
27003         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27004         typecontainer objects as we need to get at them.
27005         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27006
27007         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27008         typecontainer object.
27009
27010         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27011         of just a Report object.
27012
27013 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27014
27015         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27016         "remove_"
27017         (TypeContainer::Populate): Now define the delegates of the type too.
27018         (TypeContainer.Delegates): Property to access the list of delegates defined
27019         in the type.
27020
27021         * delegates.cs (Delegate::Define): Implement partially.
27022
27023         * modifiers.cs (TypeAttr): Handle more flags.
27024
27025 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27026
27027         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27028         and not <=
27029         (Operator::Define): Re-write logic to get types by using the LookupType method
27030         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27031         (Indexer::Define): Ditto.
27032         (Event::Define): Ditto.
27033         (Property::Define): Ditto.
27034
27035 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27036
27037         * class.cs (TypeContainer::Populate): Now define operators too. 
27038         (TypeContainer.Operators): New property to access the list of operators
27039         in a type.
27040         (Operator.OperatorMethodBuilder): New member to hold the method builder
27041         for the operator we are defining.
27042         (Operator::Define): Implement.
27043
27044 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27045
27046         * class.cs (Event::Define): Make the prefixes of the accessor methods
27047         addOn_ and removeOn_ 
27048
27049         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27050         of the location being passed in too. Ideally, this should go later since all
27051         error reporting should be done through the Report object.
27052
27053         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27054         (Populate): Iterate thru the indexers we have and define them too.
27055         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27056         for the get and set accessors.
27057         (Indexer::Define): Implement.
27058
27059 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27060
27061         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27062         my previous implementation, did not work.
27063
27064         * typemanager.cs: Add a couple of missing types (the longs).
27065
27066         * literal.cs: Use TypeManager.bool_type instead of getting it.
27067
27068         * expression.cs (EventExpr): New kind of expressions.
27069         (Expressio::ExprClassFromMemberInfo): finish
27070
27071 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27072
27073         * assign.cs: Emit stores to static fields differently.
27074
27075 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27076
27077         * Merge in changes and adjust code to tackle conflicts. Backed out my
27078         code in Assign::Resolve ;-) 
27079
27080 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27081
27082         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27083         instead Report.Error and also pass in the location.
27084         (CSharpParser::Lexer): New readonly property to return the reference
27085         to the Tokenizer object.
27086         (declare_local_variables): Use Report.Error with location instead of plain 
27087         old error.
27088         (CheckDef): Ditto.
27089
27090         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27091         (Operator.CheckBinaryOperator): Ditto.
27092
27093         * cs-parser.jay (operator_declarator): Update accordingly.
27094
27095         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27096         (CheckBinaryOperator): Same here.
27097
27098         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27099         on the name without any prefixes of namespace names etc. This is because we
27100         already might have something already fully qualified like 
27101         'System.Console.WriteLine'
27102
27103         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27104
27105 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27106
27107         * cs-tokenizer.cs (location): Return a string which also contains
27108         the file name.
27109
27110         * expression.cs (ElementAccess): New class for expressions of the
27111         type 'element access.'
27112         (BaseAccess): New class for expressions of the type 'base access.'
27113         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27114         respectively.
27115
27116         * cs-parser.jay (element_access): Implement action.
27117         (base_access): Implement actions.
27118         (checked_expression, unchecked_expression): Implement.
27119
27120         * cs-parser.jay (local_variable_type): Correct and implement.
27121         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27122
27123         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27124
27125         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27126         name and the specifiers.
27127
27128         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27129
27130         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27131         making them all public ;-)
27132
27133         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27134         class anyways.
27135
27136 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27137
27138         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27139         PropertyExprs.
27140         (FieldExpr, PropertyExprs): New resolved expressions.
27141         (SimpleName::MemberStaticCheck): Perform static checks for access
27142         to non-static fields on static methods. Maybe this should be
27143         generalized for MemberAccesses. 
27144         (SimpleName::ResolveSimpleName): More work on simple name
27145         resolution. 
27146
27147         * cs-parser.jay (primary_expression/qualified_identifier): track
27148         the parameter index.
27149
27150         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27151         (EmitContext::EmitBoolExpression): Chain to expression generation
27152         instead of temporary hack.
27153         (::EmitStatementExpression): Put generic expression code generation.
27154
27155         * assign.cs (Assign::Emit): Implement variable assignments to
27156         local variables, parameters and fields.
27157
27158 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27159
27160         * statement.cs (Block::GetVariableInfo): New method, returns the
27161         VariableInfo for a variable name in a block.
27162         (Block::GetVariableType): Implement in terms of GetVariableInfo
27163
27164         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27165         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27166
27167 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27168
27169         * cs-parser.jay (operator_declaration): Continue on my quest : update
27170         to take attributes argument.
27171         (event_declaration): Ditto.
27172         (enum_declaration): Ditto.
27173         (indexer_declaration): Ditto.
27174
27175         * class.cs (Operator::Operator): Update constructor accordingly.
27176         (Event::Event): Ditto.
27177
27178         * delegate.cs (Delegate::Delegate): Same here.
27179
27180         * enum.cs (Enum::Enum): Same here.
27181
27182 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27183
27184         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27185
27186         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27187
27188         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27189         being passed around as an arraylist.
27190         (Attributes::AddAttribute): Method to add attribute sections.
27191
27192         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27193         (struct_declaration): Update accordingly.
27194         (constant_declaration): Update.
27195         (field_declaration): Update.
27196         (method_header): Update.
27197         (fixed_parameter): Update.
27198         (parameter_array): Ditto.
27199         (property_declaration): Ditto.
27200         (destructor_declaration): Ditto.
27201
27202         * class.cs (Struct::Struct): Update constructors accordingly.
27203         (Class::Class): Ditto.
27204         (Field::Field): Ditto.
27205         (Method::Method): Ditto.
27206         (Property::Property): Ditto.
27207         (TypeContainer::OptAttribute): update property's return type.
27208
27209         * interface.cs (Interface.opt_attributes): New member.
27210         (Interface::Interface): Update to take the extra Attributes argument.
27211
27212         * parameter.cs (Parameter::Parameter): Ditto.
27213
27214         * constant.cs (Constant::Constant): Ditto.
27215
27216         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27217         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27218         the attributes as a parameter.
27219         (InterfaceProperty): Update constructor call.
27220         (InterfaceEvent): Ditto.
27221         (InterfaceMethod): Ditto.
27222         (InterfaceIndexer): Ditto.
27223
27224         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27225         pass the attributes too.
27226         (interface_event_declaration): Ditto.
27227         (interface_property_declaration): Ditto.
27228         (interface_method_declaration): Ditto.
27229         (interface_declaration): Ditto.
27230
27231 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27232
27233         * class.cs (Method::Define): Track the "static Main" definition to
27234         create an entry point. 
27235
27236         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27237         EntryPoint if we find it. 
27238
27239         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27240         (EmitContext::ig): Make this variable public.
27241
27242         * driver.cs: Make the default output file be the first file name
27243         with the .exe extension.  
27244
27245         Detect empty compilations
27246
27247         Handle various kinds of output targets.  Handle --target and
27248         rename -t to --dumper.
27249
27250         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27251         methods inherited from Expression return now an Expression.  This
27252         will is used during the tree rewriting as we resolve them during
27253         semantic analysis.
27254
27255         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27256         the spec.  Missing entirely is the information about
27257         accessability of elements of it.
27258
27259         (Expression::ExprClassFromMemberInfo): New constructor for
27260         Expressions that creates a fully initialized Expression based on
27261         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27262         a Type.
27263
27264         (Invocation::Resolve): Begin implementing resolution of invocations.
27265
27266         * literal.cs (StringLiteral):  Implement Emit.
27267
27268 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27269
27270         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27271         member.
27272
27273 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27274
27275         * cs-parser.jay (attribute_arguments): Implement actions.
27276         (attribute): Fix bug in production. Implement action.
27277         (attribute_list): Implement.
27278         (attribute_target): Implement.
27279         (attribute_target_specifier, opt_target_specifier): Implement
27280         (CheckAttributeTarget): New method to check if the attribute target
27281         is valid.
27282         (attribute_section): Implement.
27283         (opt_attributes): Implement.
27284
27285         * attribute.cs : New file to handle attributes.
27286         (Attribute): Class to hold attribute info.
27287
27288         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27289         (attribute_section): Modify production to use 2 different rules to 
27290         achieve the same thing. 1 s/r conflict down !
27291         Clean out commented, useless, non-reducing dimension_separator rules.
27292
27293         * class.cs (TypeContainer.attributes): New member to hold list
27294         of attributes for a type.
27295         (Struct::Struct): Modify to take one more argument, the attribute list.
27296         (Class::Class): Ditto.
27297         (Field::Field): Ditto.
27298         (Method::Method): Ditto.
27299         (Property::Property): Ditto.
27300
27301         * cs-parser.jay (struct_declaration): Update constructor call to
27302         pass in the attributes too.
27303         (class_declaration): Ditto.
27304         (constant_declaration): Ditto.
27305         (field_declaration): Ditto.
27306         (method_header): Ditto.
27307         (fixed_parameter): Ditto.
27308         (parameter_array): Ditto.
27309         (property_declaration): Ditto.
27310
27311         * constant.cs (Constant::Constant): Update constructor similarly.
27312         Use System.Collections.
27313
27314         * parameter.cs (Parameter::Parameter): Update as above.
27315
27316 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27317
27318         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27319         (TypeContainer.delegates): New member to hold list of delegates.
27320
27321         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27322         this time as I seem to be on crack ;-)
27323
27324 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27325
27326         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27327         tell whether an identifier represents a namespace.
27328
27329         * expression.cs (NamespaceExpr): A namespace expression, used only
27330         temporarly during expression resolution.
27331         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27332         utility functions to resolve names on expressions.
27333
27334 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27335
27336         * codegen.cs: Add hook for StatementExpressions. 
27337
27338         * class.cs: Fix inverted test for static flag in methods.
27339
27340 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27341
27342         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27343         to make it coincide with MS' number.
27344         (Operator::CheckBinaryOperator): Ditto.
27345
27346         * ../errors/errors.txt : Remove error numbers added earlier.
27347
27348         * ../errors/cs1019.cs : Test case for error # 1019
27349
27350         * ../errros/cs1020.cs : Test case for error # 1020
27351
27352         * cs-parser.jay : Clean out commented cruft.
27353         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27354         used anywhere - non-reducing rule.
27355         (namespace_declarations): Non-reducing rule - comment out.
27356
27357         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27358         with TypeContainer::AddEnum.
27359
27360         * delegate.cs : New file for delegate handling classes.
27361         (Delegate): Class for declaring delegates.
27362
27363         * makefile : Update.
27364
27365         * cs-parser.jay (delegate_declaration): Implement.
27366
27367 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27368
27369         * class.cs (Event::Define): Implement.
27370         (Event.EventBuilder): New member.
27371
27372         * class.cs (TypeContainer::Populate): Update to define all enums and events
27373         we have.
27374         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27375         readonly fields for all these cases ?
27376
27377 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27378
27379         * class.cs (Property): Revamp to use the convention of making fields readonly.
27380         Accordingly modify code elsewhere.
27381
27382         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27383         the Define method of the Property class.
27384
27385         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27386         trivial bug.
27387         (TypeContainer::Populate): Update to define all the properties we have. Also
27388         define all enumerations.
27389
27390         * enum.cs (Define): Implement.
27391
27392 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27393
27394         * cs-parser.jay (overloadable_operator): The semantic value is an
27395         enum of the Operator class.
27396         (operator_declarator): Implement actions.
27397         (operator_declaration): Implement.
27398
27399         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27400         validity of definitions.
27401         (Operator::CheckBinaryOperator): Static method to check for binary operators
27402         (TypeContainer::AddOperator): New method to add an operator to a type.
27403
27404         * cs-parser.jay (indexer_declaration): Added line to actually call the
27405         AddIndexer method so it gets added ;-)
27406
27407         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27408         already taken care of by the MS compiler ?  
27409
27410 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27411
27412         * class.cs (Operator): New class for operator declarations.
27413         (Operator::OpType): Enum for the various operators.
27414
27415 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27416
27417         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27418         ostensibly handle this in semantic analysis.
27419
27420         * cs-parser.jay (general_catch_clause): Comment out
27421         (specific_catch_clauses, specific_catch_clause): Ditto.
27422         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27423         (catch_args, opt_catch_args): New productions.
27424         (catch_clause): Rewrite to use the new productions above
27425         (catch_clauses): Modify accordingly.
27426         (opt_catch_clauses): New production to use in try_statement
27427         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27428         and re-write the code in the actions to extract the specific and
27429         general catch clauses by being a little smart ;-)
27430
27431         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27432         Hooray, try and catch statements parse fine !
27433
27434 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27435
27436         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27437         string from the hashtable of variables.
27438
27439         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27440         I end up making that mistake ;-)
27441         (catch_clauses): Fixed gross error which made Key and Value of the 
27442         DictionaryEntry the same : $1 !!
27443
27444 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27445
27446         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27447
27448         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27449         when the add and remove accessors are specified. 
27450
27451 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27452
27453         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27454         information about indexer_declarator.
27455         (indexer_declarator): Implement actions.
27456         (parsing_indexer): New local boolean used to keep track of whether
27457         we are parsing indexers or properties. This is necessary because 
27458         implicit_parameters come into picture even for the get accessor in the 
27459         case of an indexer.
27460         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27461
27462         * class.cs (Indexer): New class for indexer declarations.
27463         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27464         (TypeContainer::indexers): New member to hold list of indexers for the
27465         type.
27466
27467 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27468
27469         * cs-parser.jay (add_accessor_declaration): Implement action.
27470         (remove_accessor_declaration): Implement action.
27471         (event_accessors_declaration): Implement
27472         (variable_declarators): swap statements for first rule - trivial.
27473
27474         * class.cs (Event): New class to hold information about event
27475         declarations.
27476         (TypeContainer::AddEvent): New method to add an event to a type
27477         (TypeContainer::events): New member to hold list of events.
27478
27479         * cs-parser.jay (event_declaration): Implement actions.
27480
27481 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27482
27483         * cs-parser.jay (dim_separators): Implement. Make it a string
27484         concatenating all the commas together, just as they appear.
27485         (opt_dim_separators): Modify accordingly
27486         (rank_specifiers): Update accordingly. Basically do the same
27487         thing - instead, collect the brackets here.
27488         (opt_rank_sepcifiers): Modify accordingly.
27489         (array_type): Modify to actually return the complete type string
27490         instead of ignoring the rank_specifiers.
27491         (expression_list): Implement to collect the expressions
27492         (variable_initializer): Implement. We make it a list of expressions
27493         essentially so that we can handle the array_initializer case neatly too.
27494         (variable_initializer_list): Implement.
27495         (array_initializer): Make it a list of variable_initializers
27496         (opt_array_initializer): Modify accordingly.
27497
27498         * expression.cs (New::NType): Add enumeration to help us
27499         keep track of whether we have an object/delegate creation
27500         or an array creation.
27501         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27502         members to hold data about array creation.
27503         (New:New): Modify to update NewType
27504         (New:New): New Overloaded contructor for the array creation
27505         case.
27506
27507         * cs-parser.jay (array_creation_expression): Implement to call
27508         the overloaded New constructor.
27509
27510 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27511
27512         * class.cs (TypeContainer::Constructors): Return member
27513         constructors instead of returning null.
27514
27515 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
27516
27517         * typemanager.cs (InitCoreTypes): Initialize the various core
27518         types after we have populated the type manager with the user
27519         defined types (this distinction will be important later while
27520         compiling corlib.dll)
27521
27522         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27523         on Expression Classification.  Now all expressions have a method
27524         `Resolve' and a method `Emit'.
27525
27526         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27527         generation from working.     Also add some temporary debugging
27528         code. 
27529
27530 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
27531
27532         * codegen.cs: Lots of code generation pieces.  This is only the
27533         beginning, will continue tomorrow with more touches of polish.  We
27534         handle the fundamentals of if, while, do, for, return.  Others are
27535         trickier and I need to start working on invocations soon.
27536
27537         * gen-treedump.cs: Bug fix, use s.Increment here instead of
27538         s.InitStatement. 
27539
27540         * codegen.cs (EmitContext): New struct, used during code
27541         emission to keep a context.   Most of the code generation will be
27542         here. 
27543
27544         * cs-parser.jay: Add embedded blocks to the list of statements of
27545         this block.  So code generation proceeds in a top down fashion.
27546
27547 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
27548
27549         * statement.cs: Add support for multiple child blocks.
27550
27551 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
27552
27553         * codegen.cs (EmitCode): New function, will emit the code for a
27554         Block of code given a TypeContainer and its ILGenerator. 
27555
27556         * statement.cs (Block): Standard public readonly optimization.
27557         (Block::Block constructors): Link children. 
27558         (Block::Child): Child Linker.
27559         (Block::EmitVariables): Emits IL variable declarations.
27560
27561         * class.cs: Drop support for MethodGroups here, delay until
27562         Semantic Analysis.
27563         (Method::): Applied the same simplification that I did before, and
27564         move from Properties to public readonly fields.
27565         (Method::ParameterTypes): Returns the parameter types for the
27566         function, and implements a cache that will be useful later when I
27567         do error checking and the semantic analysis on the methods is
27568         performed.
27569         (Constructor::GetCallingConvention): Renamed from CallingConvetion
27570         and made a method, optional argument tells whether this is a class
27571         or a structure to apply the `has-this' bit.
27572         (Method::GetCallingConvention): Implement, returns the calling
27573         convention. 
27574         (Method::Define): Defines the type, a second pass is performed
27575         later to populate the methods.
27576
27577         (Constructor::ParameterTypes): implement a cache similar to the
27578         one on Method::ParameterTypes, useful later when we do semantic
27579         analysis. 
27580
27581         (TypeContainer::EmitMethod):  New method.  Emits methods.
27582
27583         * expression.cs: Removed MethodGroup class from here.
27584
27585         * parameter.cs (Parameters::GetCallingConvention): new method.
27586
27587 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
27588
27589         * class.cs (TypeContainer::Populate): Drop RootContext from the
27590         argument. 
27591
27592         (Constructor::CallingConvention): Returns the calling convention.
27593         (Constructor::ParameterTypes): Returns the constructor parameter
27594         types. 
27595
27596         (TypeContainer::AddConstructor): Keep track of default constructor
27597         and the default static constructor.
27598
27599         (Constructor::) Another class that starts using `public readonly'
27600         instead of properties. 
27601
27602         (Constructor::IsDefault): Whether this is a default constructor. 
27603
27604         (Field::) use readonly public fields instead of properties also.
27605
27606         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27607         track of static constructors;  If none is used, turn on
27608         BeforeFieldInit in the TypeAttributes. 
27609
27610         * cs-parser.jay (opt_argument_list): now the return can be null
27611         for the cases where there are no arguments. 
27612
27613         (constructor_declarator): If there is no implicit `base' or
27614         `this', then invoke the default parent constructor. 
27615
27616         * modifiers.cs (MethodAttr): New static function maps a set of
27617         modifiers flags into a MethodAttributes enum
27618         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
27619         MethodAttr, TypeAttr to represent the various mappings where the
27620         modifiers are used.
27621         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
27622
27623 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
27624
27625         * parameter.cs (GetParameterInfo): Fix bug where there would be no
27626         method arguments.
27627
27628         * interface.cs (PopulateIndexer): Implemented the code generator
27629         for interface indexers.
27630
27631 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
27632
27633         * interface.cs (InterfaceMemberBase): Now we track the new status
27634         here.  
27635
27636         (PopulateProperty): Implement property population.  Woohoo!  Got
27637         Methods and Properties going today. 
27638
27639         Removed all the properties for interfaces, and replaced them with
27640         `public readonly' fields. 
27641
27642 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
27643
27644         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27645         initialize their hashtables/arraylists only when they are needed
27646         instead of doing this always.
27647
27648         * parameter.cs: Handle refs and out parameters.
27649
27650         * cs-parser.jay: Use an ArrayList to construct the arguments
27651         instead of the ParameterCollection, and then cast that to a
27652         Parameter[] array.
27653
27654         * parameter.cs: Drop the use of ParameterCollection and use
27655         instead arrays of Parameters.
27656
27657         (GetParameterInfo): Use the Type, not the Name when resolving
27658         types. 
27659
27660 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
27661
27662         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27663         and instead use public readonly fields.
27664
27665         * class.cs: Put back walking code for type containers.
27666
27667 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
27668
27669         * class.cs (MakeConstant): Code to define constants.
27670
27671         * rootcontext.cs (LookupType): New function.  Used to locate types 
27672
27673
27674 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
27675
27676         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
27677         this System.Reflection code is.  Kudos to Microsoft
27678
27679         * typemanager.cs: Implement a type cache and avoid loading all
27680         types at boot time.  Wrap in LookupType the internals.  This made
27681         the compiler so much faster.  Wow.  I rule!
27682
27683         * driver.cs: Make sure we always load mscorlib first (for
27684         debugging purposes, nothing really important).
27685
27686         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
27687         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
27688
27689         * rootcontext.cs: Lookup types on their namespace;  Lookup types
27690         on namespaces that have been imported using the `using' keyword.
27691
27692         * class.cs (TypeContainer::TypeAttr): Virtualize.
27693         (Class::TypeAttr): Return attributes suitable for this bad boy.
27694         (Struct::TypeAttr): ditto.
27695         Handle nested classes.
27696         (TypeContainer::) Remove all the type visiting code, it is now
27697         replaced with the rootcontext.cs code
27698
27699         * rootcontext.cs (GetClassBases): Added support for structs. 
27700
27701 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
27702
27703         * interface.cs, statement.cs, class.cs, parameter.cs,
27704         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27705         Drop use of TypeRefs, and use strings instead.
27706
27707 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
27708
27709         * rootcontext.cs: 
27710
27711         * class.cs (Struct::Struct): set the SEALED flags after
27712         checking the modifiers.
27713         (TypeContainer::TypeAttr): new property, returns the
27714         TypeAttributes for a class.  
27715
27716         * cs-parser.jay (type_list): Oops, list production was creating a
27717         new list of base types.
27718
27719         * rootcontext.cs (StdLib): New property.
27720         (GetInterfaceTypeByName): returns an interface by type name, and
27721         encapsulates error handling here.
27722         (GetInterfaces): simplified.
27723         (ResolveTree): Encapsulated all the tree resolution here.
27724         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27725         types. 
27726
27727         * driver.cs: Add support for --nostdlib, to avoid loading the
27728         default assemblies.
27729         (Main): Do not put tree resolution here. 
27730
27731         * rootcontext.cs: Beginning of the class resolution.
27732
27733 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
27734
27735         * rootcontext.cs: Provide better error reporting. 
27736
27737         * cs-parser.jay (interface_base): set our $$ to be interfaces.
27738
27739         * rootcontext.cs (CreateInterface): Handle the case where there
27740         are no parent interfaces.
27741
27742         (CloseTypes): Routine to flush types at the end.
27743         (CreateInterface): Track types.
27744         (GetInterfaces): Returns an array of Types from the list of
27745         defined interfaces.
27746
27747         * typemanager.c (AddUserType): Mechanism to track user types (puts
27748         the type on the global type hash, and allows us to close it at the
27749         end). 
27750
27751 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
27752
27753         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27754         RecordInterface instead.
27755
27756         * cs-parser.jay: Updated to reflect changes above.
27757
27758         * decl.cs (Definition): Keep track of the TypeBuilder type that
27759         represents this type here.  Not sure we will use it in the long
27760         run, but wont hurt for now.
27761
27762         * driver.cs: Smaller changes to accomodate the new code.
27763
27764         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
27765         when done. 
27766
27767         * rootcontext.cs (CreateInterface):  New method, used to create
27768         the System.TypeBuilder type for interfaces.
27769         (ResolveInterfaces): new entry point to resolve the interface
27770         hierarchy. 
27771         (CodeGen): Property, used to keep track of the code generator.
27772
27773 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
27774
27775         * cs-parser.jay: Add a second production for delegate_declaration
27776         with `VOID'.
27777
27778         (enum_body): Put an opt_comma here instead of putting it on
27779         enum_body or enum_member_declarations so we can handle trailing
27780         commas on enumeration members.  Gets rid of a shift/reduce.
27781
27782         (type_list): Need a COMMA in the middle.
27783
27784         (indexer_declaration): Tell tokenizer to recognize get/set
27785
27786         * Remove old targets.
27787
27788         * Re-add the parser target.
27789
27790 2001-07-13  Simon Cozens <simon@simon-cozens.org>
27791
27792         * cs-parser.jay: Add precendence rules for a number of operators
27793         ot reduce the number of shift/reduce conflicts in the grammar.
27794
27795 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
27796
27797         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
27798         and put it here.
27799
27800         Get rid of old crufty code.
27801
27802         * rootcontext.cs: Use this to keep track of the parsed
27803         representation and the defined types available to the program. 
27804
27805         * gen-treedump.cs: adjust for new convention.
27806
27807         * type.cs: Split out the type manager, and the assembly builder
27808         from here. 
27809
27810         * typemanager.cs: the type manager will live here now.
27811
27812         * cil-codegen.cs: And the code generator here. 
27813
27814 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
27815
27816         * makefile: Fixed up for easy making.
27817
27818 2001-07-13  Simon Cozens <simon@simon-cozens.org>
27819
27820         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27821         the 
27822
27823         (unary_expression): Expand pre_increment_expression and
27824         post_decrement_expression to reduce a shift/reduce.
27825
27826 2001-07-11  Simon Cozens
27827
27828         * cs-tokenizer.cs: Hex numbers should begin with a 0.
27829
27830         Improve allow_keyword_as_indent name.
27831
27832 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
27833
27834         * Adjustments for Beta2. 
27835
27836 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
27837
27838         * decl.cs: Added `Define' abstract method.
27839         (InTransit): new property, used to catch recursive definitions. 
27840
27841         * interface.cs: Implement `Define'. 
27842
27843         * modifiers.cs: Map Modifiers.constants to
27844         System.Reflection.TypeAttribute flags.
27845
27846         * class.cs: Keep track of types and user-defined types.
27847         (BuilderInit): New method for creating an assembly
27848         (ResolveType): New function to launch the resolution process, only
27849         used by interfaces for now.
27850
27851         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27852         that are inserted into the name space. 
27853
27854 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
27855
27856         * ARGH.  I have screwed up my tree so many times due to the use of
27857         rsync rather than using CVS.  Going to fix this at once. 
27858
27859         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
27860         load types.
27861
27862 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
27863
27864         * Experiment successful: Use System.Type rather that our own
27865         version of Type.  
27866
27867 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
27868
27869         * cs-parser.jay: Removed nsAliases from here.
27870
27871         Use new namespaces, handle `using XXX;' 
27872
27873         * namespace.cs: Reimplemented namespace handling, use a recursive
27874         definition of the class.  Now we can keep track of using clauses
27875         and catch invalid using clauses.
27876
27877 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
27878
27879         * gen-treedump.cs: Adapted for all the renaming.
27880
27881         * expression.cs (Expression): this class now has a Type property
27882         which returns an expression Type.
27883
27884         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27885         `Type', as this has a different meaning now in the base
27886
27887 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
27888
27889         * interface.cs, class.cs: Removed from all the sources the
27890         references to signature computation, as we can not do method
27891         signature computation during the parsing time, as we are not
27892         trying to solve at that point distinguishing:
27893
27894         class X {
27895                 void a (Blah x) {}
27896                 void a (NS.Blah x) {}
27897         }
27898
27899         Which depending on the context might be valid or not, as we do not
27900         know if Blah is the same thing as NS.Blah at that point.
27901
27902         * Redid everything so the code uses TypeRefs now instead of
27903         Types.  TypeRefs are just temporary type placeholders, that need
27904         to be resolved.  They initially have a pointer to a string and the
27905         current scope in which they are used.  This is used later by the
27906         compiler to resolve the reference to an actual Type. 
27907
27908         * DeclSpace is no longer a CIR.Type, and neither are
27909         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
27910         are all DeclSpaces, but no Types. 
27911
27912         * type.cs (TypeRefManager): This implements the TypeRef manager,
27913         which keeps track of all the types that need to be resolved after
27914         the parsing has finished. 
27915
27916 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
27917
27918         * ARGH.  We are going to have to store `foreach' as a class rather
27919         than resolving it, as we need to verify error 1579 after name
27920         resolution.   *OR* we could keep a flag that says `This request to
27921         IEnumerator comes from a foreach statement' which we can then use
27922         to generate the error.
27923
27924 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
27925
27926         * class.cs (TypeContainer.AddMethod): we now add methods to the
27927         MethodGroup instead of the method hashtable.  
27928
27929         * expression.cs: Add MethodGroup abstraction, which gets us one
27930         step closer to the specification in the way we handle method
27931         declarations.  
27932
27933         * cs-parser.jay (primary_expression): qualified_identifier now
27934         tried to match up an identifier to a local variable reference or
27935         to a parameter reference.
27936
27937         current_local_parameters is now a parser global variable that
27938         points to the current parameters for the block, used during name
27939         lookup.
27940
27941         (property_declaration): Now creates an implicit `value' argument to
27942         the set accessor.
27943
27944 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
27945
27946         * parameter.cs: Do not use `param' arguments as part of the
27947         signature, per the spec.
27948
27949 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
27950
27951         * decl.cs: Base class for classes, structs and interfaces.  This
27952         is the "Declaration Space" 
27953
27954         * cs-parser.jay: Use CheckDef for checking declaration errors
27955         instead of having one on each function.
27956
27957         * class.cs: Factor out some code for handling error handling in
27958         accordance to the "Declarations" section in the "Basic Concepts"
27959         chapter in the ECMA C# spec.
27960
27961         * interface.cs: Make all interface member classes derive from
27962         InterfaceMemberBase.
27963
27964 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
27965
27966         * Many things: all interfaces are parsed and generated in
27967         gen-treedump.  Support for member variables, constructors,
27968         destructors, properties, constants is there.
27969
27970         Beginning of the IL backend, but very little done, just there for
27971         testing purposes. 
27972
27973 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
27974
27975         * cs-parser.jay: Fix labeled statement.
27976
27977         * cs-tokenizer.cs (escape): Escape " and ' always.
27978         ref_line, ref_name: keep track of the line/filename as instructed
27979         by #line by the compiler.
27980         Parse #line.
27981
27982 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
27983
27984         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27985         to match the values in System.CodeDOM.
27986
27987         Divid renamed to Divide.
27988
27989         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27990         statements. 
27991         (Statements.set): remove.
27992
27993         * System.CodeDOM/CodeCatchClause.cs: always have a valid
27994         statements. 
27995
27996         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27997         falseStatements always have valid values. 
27998
27999         * cs-parser.jay: Use System.CodeDOM now.
28000